-
-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ts-node eval public for node REPL consumption #1121
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ffe2428
Add createReplEval function
MarcManiez 6c3ecbf
Add a test
MarcManiez c064d71
Fix a couple of typos
MarcManiez b6eca72
Actually test the evaluator
MarcManiez ada5afd
Try removing spec
MarcManiez 9ab7eca
Use service creation pattern
MarcManiez 58354c3
Move REPL code to its own file
MarcManiez 6d8a66f
Merge remote-tracking branch 'origin/master' into public-eval
cspotcode 02c174a
- Reorder repl.ts declarations to match the original order from bin.ts
cspotcode 95375d5
Expand ReplService API; use new API in bin.ts, which further decouple…
cspotcode 7acec12
Add brief, internal docs for REPL API
cspotcode b2f13e3
Add support for DI of alternative stdio streams into REPL
cspotcode d539f40
export REPL from index.ts
cspotcode 4164a37
remove unnecessary export
cspotcode 9b834b0
Add test for new REPL API
cspotcode 495475e
API surface, naming, docs tweaks
cspotcode 80f67ed
tweak identifiers
cspotcode d610300
Merge remote-tracking branch 'origin/master' into public-eval
cspotcode 354cb10
fix name
cspotcode 7f1a7a2
Tweak repl API test to match REPL CLI test, allowing it to pass on Wi…
cspotcode 5267c0b
Merge remote-tracking branch 'origin/master' into public-eval
cspotcode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a newcomer, I experienced some confusion seeing the
replService
juxtaposed with theservice
. I noticed that theRegister
type applies to the service and that naming discrepancy was also a head-scratcher for me. With some digging, I kind of see what they represent.Nothing immediately applicable, but just sharing some thoughts, as I recall y'all considering what might make the repo easier on newbies!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't like the name of
Register
. IMO it should beService
so that if you doimport {Service} from 'ts-node';
then it's intuitive. I'm guessing theRegister
name made more sense in the past. We can rename it toService
and export by the legacyRegister
name for backwards-compatibility.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question:
Given that our
create()
function returns aRegister
, which I'd like to rename toService
, does it make sense to renamecreateReplService()
tocreateRepl()
for consistency?create(): Service
,createRepl(): ReplService
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that would make a lot more sense! I might even rename the
ReplService
type toTsRepl
, orTsNodeRepl
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking it's best to avoid putting
TsNode
into the names of exports, to match TypeScript and node's APIs. For example:import {Duplex} from 'streams';
(it's called Duplex, not DuplexStream)import {LanguageService} from 'typescript';
It's named LanguageService instead of TsLanguageService, and lots of usages I've seen do a wildcard import to add thets
prefix:import * as ts from 'typescript'; ts.LanguageService