Skip to content
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

Add scope to CLI and tsconfig options; un-deprecate TS_NODE_SCOPE #1346

Closed
1 task done
cspotcode opened this issue May 26, 2021 · 0 comments · Fixed by #1367
Closed
1 task done

Add scope to CLI and tsconfig options; un-deprecate TS_NODE_SCOPE #1346

cspotcode opened this issue May 26, 2021 · 0 comments · Fixed by #1367
Milestone

Comments

@cspotcode
Copy link
Collaborator

cspotcode commented May 26, 2021

Add --scope to the CLI and add scope as an option which can be specified in tsconfig.json
Un-deprecate TS_NODE_SCOPE
Update docs
Update ts-node --help output
Update: also added TS_NODE_SCOPE_DIR and --scope-dir / tsconfig scopeDir in #1367

  • double-check my old issues about scope to ensure there are no reasons against adding it to tsconfig.json

Motivating use-case

Based on conversation starting here:
#693 (comment)

  • The user has a monorepos, ./packages/a/node_modules/b symlinks to ./packages/b
  • running tests and scripts in ./packages/a
  • allowJS is enabled
  • code in a imports b, which resolves to ./packages/b/dist/index.js
  • The user does not want ts-node to compile anything in b; only in a
    • philosophically, each package in the monorepo is a separate entity with its own build scripts
    • One package should not make assumptions about its ability to transpile the source of another
  • rootDir is ./packages/a/src but ts-node is running unit-tests in ./packages/a/unit-tests
    • This can be addressed by overriding rootDir for ts-node
@cspotcode cspotcode added this to the 10.x.x milestone May 26, 2021
@cspotcode cspotcode changed the title Add scope to CLI and tsconfig options Add scope to CLI and tsconfig options; un-deprecate TS_NODE_SCOPE May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant