chore(deps): update dependency ts-node to v10
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| ts-node (source) | ^8.10.1 -> ^10.4.0 |
Release Notes
TypeStrong/ts-node
v10.4.0
Added
- Adds support for targets "es2020" and "es2021" to swc transpiler (#1521)
- Adds automatic target downgrade when using older versions of swc (#1521)
- If tsconfig specifies es2020, but your version of swc only supports up to es2019, ts-node will automatically switch to es2019 instead of throwing an error
Changed
Fixed
https://github.com/TypeStrong/ts-node/milestone/8
v10.3.1
Fixed
- Add version check to use new loader hooks API for node >=16.12.0 (#1522) @shrujalshah28
https://github.com/TypeStrong/ts-node/milestone/7
v10.3.0
Questions about this release? Ask in the official discussion thread: #1507
Added
- Declare types for node builtin modules within REPL so you do not need to import them (#1424, #1500)
- Node REPL exposes builtin modules as globals; typechecker now understands this
- Typechecking should no longer raise errors when using builtins without first importing
- For example:
util.promisify(setTimeout)(1000)orfs.readFileSync('example.txt')
- Add
createEsmHooks()function to create ESM loader hooks (API docs) (#1439) @nonara- Can be used to compose our loader hooks with another loader or additional logic
-
register()accepts a ts-nodeService(API docs) (#1474)-
register(options)is still supported; no breaking changes
-
- Add support for Node.js's new loader hooks API (#1372, #1457, #1007) @jonaskello
- Node.js has changed their loader hooks API
- ts-node is compatible with all node versions, detects your node version and exposes the correct hooks API
- Node's new API currently only available in node v17 nightly builds
- Node will eventually backport the changes to node 16, and may also be backport to 14 and 12
- Add
--emitto--helpoutput (#1400, #1484) @markbradley27
Changed
- When ts-node is registered and other libraries
require('source-map-support'), they will be redirected to@cspotcode/source-map-support- See complete description in Fixed section below
Fixed
- Fix #1440, #1441, #1438, #1495: Incorrect stack traces when third-party libraries use
source-map-supportinstead of@cspotcode/source-map-support(#1440, #1441, #1438, #1495, cspotcode/node-source-map-support#23, #1496, #1497) @ejose19- When ts-node is registered and other libraries
require('source-map-support'), they will be redirected to@cspotcode/source-map-support - ts-node uses
@cspotcode/source-map-supportfor the fixes and enhancements listed here:@cspotcode/source-map-supportchangelog - To ensure correct stack traces, all libraries must share a compatible sourcemap support implementation
- When ts-node is registered and other libraries
- Fix #1363: REPL may erroneously combine previous input with next input, eval both as a single statement (#1363, #1480) @TheUnlocked
- For example, entering
100on first line and* 2on second line would erronously be interpreted as100 * 2 - REPL now ensures both lines are separate statements, both when typechecking and when evaluating
- For example, entering
- Fix #1488: Node may log "circular dependency" warning when using
allowJs(#1488, #1489) - Fix #1301: Filter empty strings from
TS_NODE_IGNOREandTS_NODE_IGNORE_DIAGNOSTICS; treat empty environment variable as empty array (#1301, #1483) @ValeriaVG-
TS_NODE_IGNORE= ts-node ./example.tswill disable default ignore rules; will compile files in./node_modules
-
Docs
- Update VSCode debug configuration (Docs) (#1466)
- Update ESM-related messaging to clarify that experimental status is due to Node.js, not ts-node (#1455)
- Refer to ts-node consistently (#1481) @animafps
https://github.com/TypeStrong/ts-node/milestone/5
v10.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.
https://github.com/TypeStrong/ts-node/milestone/6
v10.2.0
Questions about this release? Ask in the official discussion thread: #1423
Added
- Adds top-level await support to REPL (#1383, #245) @ejose19
- Setting
"pretty": falsedisables pretty formatting of diagnostics even when stdout is a TTY (#1418, #1420) @elevatebart- Applies to ts-node's
prettyoption, not to be confused with TypeScript'sprettyoption
- Applies to ts-node's
- Ignores diagnostics which are annoying in an interactive REPL (#1396, #1120, #729, #850, #469)
- For example, when you input
const foo = 1in the REPL,foois unused. We ignore the resulting diagnosticfoo 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
- For example, when you input
- 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
- Enables SWC transpiler to be used alongside
- Fix #1403: source-map-support breaks rendering of node errors (#1405, #1403)
- Fix #1410: rendering of async stack frames should include
asyncannotations (#1405, #1410) - Fix #1411: wrong order of process 'exit' event and logging unhandled exception (#1405, #1411)
- Fix #1419: Should not throw
require.resolveerror when@types/nodepeerDependency is missing (#1419, #1422)
https://github.com/TypeStrong/ts-node/milestone/2
v10.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"andtsconfig.json"module" - akin to
.cjsand.mjsextensions, but for.tsand.tsxfiles - thanks to @jayaddison for help on test coverage
- Useful when a configuration file, for example
- Implement
"extends"support for"ts-node"options intsconfig.json(#1328, #1356)-
"ts-node": {}options will be parsed from extended tsconfigs - allows sharing and deduplicating ts-node configuration
-
- Un-deprecate
scopeandscopeDir; add both to CLI andtsconfig.jsonoptions; un-deprecateTS_NODE_SCOPEenv var; addTS_NODE_SCOPE_DIRenv 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--showConfigoutput 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,moduleand sub-fields ofmodule,exports, and builtin module aliasesfs, etc
- Fix #1343: Set swc option
keepClassNamestotrue(#1344) - Fix: #1387: REPL outputs 'use strict' after first empty line of input (#1388) @ejose19
Docs
https://github.com/TypeStrong/ts-node/milestone/3
v10.0.0
Questions about this release? Ask in the official discussion thread: #1337
Breaking changes are prefixed with [BREAKING]
Added
- Adds
--show-configto 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
swcintegration and new--transpileroption to use third-party transpilers for a massive speed boost on large codebases (docs) (#779, #1160) - Add
scopeDirAPI option (docs) (#1155) - Add
projectSearchDirAPI option (docs) (#1155) - Add
--cwd-modeandts-node-cwdto resolve config file relative to cwd, not entrypoint script (#1155)
Changed
-
[BREAKING] Make
--script-modedefault 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, becausets-nodewill respect the script's localtsconfig.json - Use
--cwd-modeorts-node-cwdif you need legacy behavior
-
[BREAKING]
ignorerules evaluate relative totsconfig.jsondirectory, otherwisecwd(#1155) - [BREAKING] Remove support for node 10. Minimum supported version is node 12 (#1312)
- Rename
--dirto--cwd; renameTS_NODE_DIRtoTS_NODE_CWD(#1155)-
--dirandTS_NODE_DIRare deprecated but still parsed for backwards-compatibility -
--direffectively changed the working directory ofts-node; renaming makes this behavior more obvious
-
Deprecated
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
- Removed
Fixed
-
[BREAKING] Fix #1229 and #1235: always throw
ERR_REQUIRE_ESMwhen attempting to execute ESM as CJS, even when not using--loader ts-node/esm(#1232)- This aligns our behavior with vanilla
node
- This aligns our behavior with vanilla
-
[BREAKING] Fix #1225:
compileris loaded relative totsconfig.jsoninstead 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 ./indexmay execute the wrong file extension because tsconfig search poisons therequire.resolvecache (#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
- add troubleshooting tip for syntax errors (#1201) @jedwards1211
- Clarify handling of tsx/jsx file extensions (#1179) @NaridaL
- Added
CONTRIBUTING.mdto document the codebase and our development workflow
https://github.com/TypeStrong/ts-node/milestone/1
v9.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
v9.1.0
Added
- Expose ts-node REPL via the API (#1121) @MarcManiez
- Allow
--typeCheckflag to override--transpileOnlyflag specified intsconfig.json(#1142)
Changed
- Rename interface
RegistertoService. It is still aliased asRegisterfor 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-resolutionas an alias of--experimental-specifier-resolutionfor node 12 compatibility (#1122) @nguyensomniac
Docs
- Fix description of
ts-node-devin README (#1131) @iamandrewluca - Update
transformersdescription to clarify incompatibility withtranspileOnly(#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
Breaking changes are labelled [BREAKING] below.
Added
- Throw
ERR_REQUIRE_ESMwhen a file isrequire()d which should be loaded as ESM (#1031) - Re-add
"exports"declaration to package.json in backwards-compatible way, enablingnode --loader ts-node/esmwithout file extension (#1028) - Allow specifying
"require"option via tsconfig (#925) - REPL respects node's
NODE_NO_READLINEenvironment variable (#1090) - Add a transpile-only entrypoint for ESM loader:
node --loader ts-node/esm/transpile-only(#1102) @concision
Changed
- [BREAKING] Drops support for node versions < 10 (#1036)
Fixed
- [BREAKING] Re-add
realpath, which should fix workflows that use symlinks, such aspnpm, Lerna workspaces, or other mono-repo configurations (#970) - Compile files within
node_moduleswhen--skip-ignoreor--ignoreoptions are configured to allow it (#970) - Fix #884 by not adding all referenced files to
getSourceFileNames/rootNames(#999) - Fix #996: bump
projectVersionevery timegetSourceFileNameschanges, avoiding accidentally outdated typechecking (#998) - Fix #1051: pass transformers object to
ts.transpileModule(#1054) @thetutlage - Fix #1060: use source maps for stack traces in ESM modules (#1087)
- Fix #1072: Respect
--experimental-specifier-resolutioncoming fromNODE_OPTIONSin ESM loader (#1085) @evg656e - Fix #1098: ESM loader should skip
.cjs,.mjs, and any unexpected file extensions (#1103) @concision
Docs
- Better explain how to compile imports, either CommonJS or using experimental ESM loader. Resolves #1075 (#1086)
Misc
- Fix, re-enable, and add various tests (#1044, #1088, #1108, #1110, #1109, #1115, #1043, #999)
v8.10.2
Fixed
Fixes #1037: source maps broken on Windows. (#1038)
Misc
Fix failing tests on node 6 (#1035)
Push coverage from Github Actions; remove TravisCI (#1034)
Run tests e2e against an npm pack && npm installed ts-node (#1032)
Run CI tests on Windows (#1041)
Run CI only once per commit on pull requests and master (#1042)
Configuration
📅 Schedule: "on the 1st through 7th day of the month" in timezone America/Los_Angeles.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by WhiteSource Renovate. View repository job log here.
Codecov Report
Merging #382 (003c97a) into master (73f4129) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #382 +/- ##
=======================================
Coverage 85.91% 85.91%
=======================================
Files 14 14
Lines 653 653
Branches 175 175
=======================================
Hits 561 561
Misses 92 92
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 73f4129...003c97a. Read the comment docs.