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.
See changesets and README for full details. Closes #84.
skuba node
runs a TypeScript file; it's like a one-offskuba start
. Unlike start, it gives you a REPL when you omit the command line entry point rather than falling back to the entry point inpackage.json
.This PR also adds some secret sauce to automatically register the
src
module alias when you're running underskuba node
orskuba start
. This means that you only need a runtime module alias resolver likeimport skuba-dive/register
at the top of production entry points; local scripts can be run with little fanfare using the skuba commands.Notes:
I considered calling the command
skuba exec
, but that sounds a bit awkward when it supports opening a REPL.You may be wondering why don't we just use
tsconfig-paths
.This is tempting but I'm not convinced that we should depend on reading configuration out of
tsconfig.json
at runtime. This can be confusing given TypeScript is generally considered a compile-time concern, and our own templates only keeplib
andnode_modules
in the runtime Docker image.Diving into this has uncovered that the
@babel/node
REPL is pretty unusable with modern JavaScript/TypeScript. See the README for more.