-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thank fuck I finally seem to have a repl working
https://nodejs.org/api/repl.html#repl TypeStrong/ts-node#1007 some real jank around ESM vs CommonJS - we seem to have to use .js file extensions in src/repl.ts ;; let's check if we CAN use .js everywhere in our .ts files at least that would be consistent.
- Loading branch information
Showing
3 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as repl from 'node:repl' | ||
import * as E from './entry.js' | ||
import { Value } from '@sinclair/typebox/value' | ||
|
||
const replServer = repl.start('> ') | ||
replServer.context.E = E | ||
replServer.context.Value = Value | ||
|
||
|
||
// import repl from "repl"; | ||
// import ts from "typescript"; | ||
// import * as tsnode from "ts-node"; | ||
|
||
// // Create a ts-node replService | ||
// const replService: tsnode.ReplService = tsnode.createRepl() | ||
// const service = tsnode.create({ ...replService.evalAwarePartialHost }) | ||
// service.ts = ts; | ||
// replService.setService(service) | ||
|
||
// // create a node-repl server | ||
// const replServer = repl.start({ | ||
// prompt: "→º ", | ||
// ignoreUndefined: true, | ||
// eval: replService.nodeEval, | ||
// }); | ||
|
||
// // setup environment | ||
// replServer.setupHistory(".log", () => {}) |