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

Upgrade ts-node: 9.0.0 → 10.2.1 (major) #301

Open
wants to merge 1 commit into
base: dependency-updates
Choose a base branch
from

Conversation

depfu[bot]
Copy link

@depfu depfu bot commented Sep 5, 2021

Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ ts-node (9.0.0 → 10.2.1) · Repo

Release Notes

10.2.1

Fixed

  • Fixes #1426: Do not import typescript outside of configuration/project loading (#1433, #1426) @Songkeys
    • We take care to load your project's version of typescript, falling back to a globally-installed version if necessary.
    • 10.2.0 introduced a bug where we did not do this consistently, causing global or npx installations of ts-node to attempt loading typescript relative to themselves, not your project.
    • This failed if typescript was not globally installed or npx did not install peer dependencies.

v10.2.0...v10.2.1
https://github.com/TypeStrong/ts-node/milestone/6

10.2.0

Questions about this release? Ask in the official discussion thread: #1423

Added

  • Adds top-level await support to REPL (#1383, #245) @ejose19
    • can be disabled with --no-experimental-repl-await, experimentalReplAwait, or TS_NODE_EXPERIMENTAL_REPL_AWAIT (CLI docs, API docs)
  • Setting "pretty": false disables pretty formatting of diagnostics even when stdout is a TTY (#1418, #1420) @elevatebart
    • Applies to ts-node's pretty option, not to be confused with TypeScript's pretty option
  • Ignores diagnostics which are annoying in an interactive REPL (#1396, #1120, #729, #850, #469)
    • For example, when you input const foo = 1 in the REPL, foo is unused. We ignore the resulting diagnostic foo is declared but its value is never read
    • Diagnostics are only ignored in the REPL
    • Diagnostics for non-REPL files imported by the REPL will still be shown
  • Logged stack traces are colorized to match vanilla node's behavior (#1412, #1405)

Fixed

  • Fix #1397: SWC transpiler should emit ECMAScript imports and exports when configuration dictates (#1409, #1397)
    • Enables SWC transpiler to be used alongside --loader
  • Fix #1403: source-map-support breaks rendering of node errors (#1405, #1403)
  • Fix #1410: rendering of async stack frames should include async annotations (#1405, #1410)
  • Fix #1411: wrong order of process 'exit' event and logging unhandled exception (#1405, #1411)
  • Fix #1419: Should not throw require.resolve error when @types/node peerDependency is missing (#1419, #1422)

v10.1.0...v10.2.0
https://github.com/TypeStrong/ts-node/milestone/2

10.1.0

Questions about this release? Ask in the official discussion thread: #1390

Added

  • Add "moduleType" option to override module type -- CommonJS or ECMAScript -- on select files. (docs) (#1342, #1371, #1376)
    • Useful when a configuration file, for example webpack.config.ts, must execute as CommonJS but the rest of the project is ESM
    • selectively overrides package.json "type" and tsconfig.json "module"
    • akin to .cjs and .mjs extensions, but for .ts and .tsx files
    • thanks to @jayaddison for help on test coverage
  • Implement "extends" support for "ts-node" options in tsconfig.json (#1328, #1356)
    • "ts-node": {} options will be parsed from extended tsconfigs
    • allows sharing and deduplicating ts-node configuration
  • Un-deprecate scope and scopeDir; add both to CLI and tsconfig.json options; un-deprecate TS_NODE_SCOPE env var; add TS_NODE_SCOPE_DIR env var (docs) (#1346, #1367)

Changed

  • Improve error messages thrown by native ESM loader hooks (#1357, #1373) @tars0x9752
    • messages more closely match node; are more descriptive
  • Emit "ts-node" object at the top of --showConfig output instead of the bottom (#1355)

Fixed

  • Fix #1282: Set correct globals in [stdin], [eval], and <repl> contexts (#1333)
    • More closely align ts-node's behavior with vanilla node
    • Affects the interactive REPL, piping to stdin, and ts-node -e
    • Matches node's behavior for globals __filename, __dirname, module and sub-fields of module, exports, and builtin module aliases fs, etc
  • Fix #1343: Set swc option keepClassNames to true (#1344)
  • Fix: #1387: REPL outputs 'use strict' after first empty line of input (#1388) @ejose19

Docs

  • Update ESM docs to say that env vars are supported with node --loader ts-node/esm (docs) (#1379)

v10.0.0...v10.1.0
https://github.com/TypeStrong/ts-node/milestone/3

10.0.0

Questions about this release? Ask in the official discussion thread: #1337

Breaking changes are prefixed with [BREAKING]

Added

  • Adds --show-config to log the resolved configuration (docs) (#1100, #1243)
  • Bundle and re-export @tsconfig/node* configurations for convenience (docs) (#1202, #1236, #1313)
  • Default to appropriate @tsconfig/node* configuration based on node and typescript versions (docs) (#1202, #1236, #1313)
  • Automatically reference @types/node; use globally-installed @types/node if not locally installed (#1240, #1257)
  • Add swc integration and new --transpiler option to use third-party transpilers for a massive speed boost on large codebases (docs) (#779, #1160)
  • Add scopeDir API option (docs) (#1155)
  • Add projectSearchDir API option (docs) (#1155)
  • Add --cwd-mode and ts-node-cwd to resolve config file relative to cwd, not entrypoint script (#1155)

Changed

  • [BREAKING] Make --script-mode default behavior; resolve tsconfig relative to entrypoint script instead of cwd (#949, #1197, #1155)
    • In most cases this change will have no noticeable effect
    • Primarily benefits portable shell scripts on your $PATH, because ts-node will respect the script's local tsconfig.json
    • Use --cwd-mode or ts-node-cwd if you need legacy behavior
  • [BREAKING] ignore rules evaluate relative to tsconfig.json directory, otherwise cwd (#1155)
  • [BREAKING] Remove support for node 10. Minimum supported version is node 12 (#1312)
  • Rename --dir to --cwd; rename TS_NODE_DIR to TS_NODE_CWD (#1155)
    • --dir and TS_NODE_DIR are deprecated but still parsed for backwards-compatibility
    • --dir effectively changed the working directory of ts-node; renaming makes this behavior more obvious

Deprecated

  • Deprecate TS_NODE_SCOPE (#1155)
  • Deprecate --dir and TS_NODE_DIR (#1155)

Removed

  • [BREAKING] Internal APIs removed from type declarations (#1242)
    • Removed DEFAULTS, normalizeSlashes, parse, split
    • No features were removed
    • This will only affect consumers of ts-node's programmatic API

Fixed

  • [BREAKING] Fix #1229 and #1235: always throw ERR_REQUIRE_ESM when attempting to execute ESM as CJS, even when not using --loader ts-node/esm (#1232)
    • This aligns our behavior with vanilla node
  • [BREAKING] Fix #1225: compiler is loaded relative to tsconfig.json instead of entrypoint script (#1155)
    • In most cases this change will have no noticable effect
  • Fix #1217: REPL not always using passed stdout and stderr (#1224)
  • Fix #1220: ts-node ./index may execute the wrong file extension because tsconfig search poisons the require.resolve cache (#1155)
  • Fix #1322: Sourcemaps fail for filenames with spaces or other characters which are percent-encoded in URLs (#1160, #1330)
  • Fix #1331: Resolution of node builtin modules in ESM loader fails on node >=12.20.0, <13 (#1332)

Docs

  • New documentation website: https://typestrong.org/ts-node
    • README is generated to match the website
    • Added page explaining CommonJS vs ESM
    • Added page with Performance advice
    • Added Troubleshooting page
    • Organized and added to "Recipes" section with third-party tool integrations
    • Added TypeDoc-generated API docs
    • Work was spread across multiple tickets: #1207, #1213, #1221, #1228, #1244, #1250, #1294, #1295, #1296, #1297
    • Thanks to these contributors for PRs which improved our documentation
  • Added CONTRIBUTING.md to document the codebase and our development workflow

v9.1.1...v10.0.0
https://github.com/TypeStrong/ts-node/milestone/1

9.1.1

No code changes. We re-packed and republished v9.1.1, because the v9.1.0 package was broken due to an npm v7 bug.

Fixes

  • Published tarball had extra slashes in the paths of dist files. #1172

9.1.0

Added

  • Expose ts-node REPL via the API (#1121) (MarcManiez)
  • Allow --typeCheck flag to override --transpileOnly flag specified in tsconfig.json (#1142)

Changed

  • Rename interface Register to Service. It is still aliased as Register for backwards compatibility (#1158)
  • Update code copied from node's ESM resolver to be the latest from node 15, to keep our ESM resolver's behavior as close as possible to vanilla node (#1167)

Fixed

  • ESM resolver will preserve search portion of URL, used for cache busting (#1165) @frandiox
  • Fix ESM resolution of builtin modules on node >=14.13.1 (#1136)
  • Recognize --es-module-specifier-resolution as an alias of --experimental-specifier-resolution for node 12 compatibility (#1122) @nguyensomniac

Docs

  • Fix description of ts-node-dev in README (#1131) @iamandrewluca
  • Update transformers description to clarify incompatibility with transpileOnly (#1123)

Misc

  • Changes to test matrix: Test against node 15; drop node 13 tests; remove 12.16 in favor of latest 12.x.x (#1138, #1148)
  • Improve codecov rules to remove misleading test failures (#1159)

v9.0.0...v9.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants