TypeStrong/ts-node
### [`v10.7.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.7.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.6.0...v10.7.0)
Questions about this release? Ask in the official discussion thread: [#1680](https://togithub.com/TypeStrong/ts-node/issues/1680)
**Added**
- Adds `--esm` flag, option, and `ts-node-esm` binary ([#1258](https://togithub.com/TypeStrong/ts-node/issues/1258), [#1655](https://togithub.com/TypeStrong/ts-node/issues/1655))
- Enables full `esm` support; no need for `--loader` nor `NODE_OPTIONS`
- Use shebang `#!/usr/bin/env ts-node-esm`, run `ts-node --esm`, or add to your tsconfig.json: `"ts-node": {"esm": true}`
**Changed**
- Unflag ESM json modules on node >=17.5.0 ([#1661](https://togithub.com/TypeStrong/ts-node/issues/1661), [#1665](https://togithub.com/TypeStrong/ts-node/issues/1665)) [@Jamesernator](https://togithub.com/Jamesernator)
- no longer requires `--experimental-json-modules`
- Lazy-load dependencies to improve startup responsiveness. ([#1676](https://togithub.com/TypeStrong/ts-node/issues/1676))
**Fixed**
- Fixed bug where "compiler", "transpiler", and swc backend would not resolve relative to the tsconfig.json that declared them ([#1662](https://togithub.com/TypeStrong/ts-node/issues/1662), [#1655](https://togithub.com/TypeStrong/ts-node/issues/1655))
- Enables reusable tsconfig.json shared via node module to include necessary dependencies
https://github.com/TypeStrong/ts-node/milestone/11
### [`v10.6.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.6.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.5.0...v10.6.0)
Questions about this release? Ask in the official discussion thread: [#1666](https://togithub.com/TypeStrong/ts-node/issues/1666)
**Added**
- Adds workaround for extensionless entrypoints with ESM loader ([#1649](https://togithub.com/TypeStrong/ts-node/issues/1649), [#1654](https://togithub.com/TypeStrong/ts-node/issues/1654))
- You can now combine tools such as `mocha` with `--loader ts-node/esm`, where previously node would throw `[ERR_UNKNOWN_FILE_EXTENSION]`
- node has a bug where combining `--loader` with an extensionless entrypoint causes this error [nodejs/node#33226](https://togithub.com/nodejs/node/issues/33226)
- Some tools, for example `mocha`, have an extensionless entrypoint. ([source](https://togithub.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/package.json#L37), [source](https://togithub.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/bin/mocha))
- Combining `NODE_OPTIONS=--loader ts-node/esm` with these tools causes this error. [mochajs/mocha#4645](https://togithub.com/mochajs/mocha/issues/4645)
- node intends to fix this bug in a future release: [nodejs/node#41711](https://togithub.com/nodejs/node/issues/41711)
- In the interim, we have implemented a workaround in ts-node.
- Adds support for target "ES2022" in `moduleTypes` overrides ([#1650](https://togithub.com/TypeStrong/ts-node/issues/1650))
**Fixed**
- Fixed bug where `--swc` and other third-party transpilers did not respect `moduleTypes` overrides ([#1651](https://togithub.com/TypeStrong/ts-node/issues/1651), [#1652](https://togithub.com/TypeStrong/ts-node/issues/1652), [#1660](https://togithub.com/TypeStrong/ts-node/issues/1660))
- Fixed bug where node flags were not preserved correctly in `process.execArgv` ([#1657](https://togithub.com/TypeStrong/ts-node/issues/1657), [#1658](https://togithub.com/TypeStrong/ts-node/issues/1658))
- This affected `child_process.fork()`, since it uses `process.execArgv` to create a similar child runtime.
- With this fix, `child_process.fork()` will preserve both node flags and `ts-node` hooks.
- Fixed compatibility TypeScript 4.7's API changes ([#1647](https://togithub.com/TypeStrong/ts-node/issues/1647), [#1648](https://togithub.com/TypeStrong/ts-node/issues/1648))
https://github.com/TypeStrong/ts-node/milestone/9
### [`v10.5.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.5.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.4.0...v10.5.0)
Questions about this release? Ask in the official discussion thread: [#1634](https://togithub.com/TypeStrong/ts-node/issues/1634)
**Added**
- Eliminate "Emit Skipped" errors ([#693](https://togithub.com/TypeStrong/ts-node/issues/693), [#1345](https://togithub.com/TypeStrong/ts-node/issues/1345), [#1629](https://togithub.com/TypeStrong/ts-node/issues/1629))
- Avoids all "Emit Skipped" errors by performing a fallback `transpileOnly`-style transformation.
- Does not affect typechecking. Type errors are still detected and thrown.
- Fallback has the same limitations as `isolatedModules`. This will only affect rare cases such as using `const enums` with `preserveConstEnums` disabled.
- Fixes [#693](https://togithub.com/TypeStrong/ts-node/issues/693)
- Graduate swc transpiler out of experimental; add `swc: true` convenience option ([docs](https://typestrong.org/ts-node/docs/transpilers)) ([#1487](https://togithub.com/TypeStrong/ts-node/issues/1487), [#1536](https://togithub.com/TypeStrong/ts-node/issues/1536), [#1613](https://togithub.com/TypeStrong/ts-node/issues/1613), [#1627](https://togithub.com/TypeStrong/ts-node/issues/1627))
- `"swc": true` or `--swc` will use swc for faster execution
- This feature is no longer marked "experimental." Thank you to everyone who filed bugs!
- swc transpiler attempts to load `@swc/core` or `@swc/wasm` dependencies from your project before falling-back to global installations ([#1613](https://togithub.com/TypeStrong/ts-node/issues/1613), [#1627](https://togithub.com/TypeStrong/ts-node/issues/1627))
- global fallback only occurs when using a global installation of ts-node
- Add support for TypeScript's `traceResolution` output ([docs](https://www.typescriptlang.org/tsconfig/#traceResolution)) ([#1128](https://togithub.com/TypeStrong/ts-node/issues/1128), [#1491](https://togithub.com/TypeStrong/ts-node/issues/1491)) [@TheUnlocked](https://togithub.com/TheUnlocked)
- Support import assertions in ESM loader ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#import-assertions)) ([#1557](https://togithub.com/TypeStrong/ts-node/issues/1557), [#1558](https://togithub.com/TypeStrong/ts-node/issues/1558), [#1559](https://togithub.com/TypeStrong/ts-node/issues/1559), [#1573](https://togithub.com/TypeStrong/ts-node/issues/1573)) [@Pokute](https://togithub.com/Pokute), [@geigerzaehler](https://togithub.com/geigerzaehler)
- Allows importing JSON files from ESM with the requisite flag ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#json-modules))
- `ts-node -vvv` also logs absolute paths to `ts-node` and `typescript`, to make it more obvious when you're accidentally using globally-installed versions ([#1323](https://togithub.com/TypeStrong/ts-node/issues/1323), [#1620](https://togithub.com/TypeStrong/ts-node/issues/1620))
- Add swc target "es2022" ([#1535](https://togithub.com/TypeStrong/ts-node/issues/1535), [#1540](https://togithub.com/TypeStrong/ts-node/issues/1540))
- When you have target es2022 in tsconfig, will use swc's es2022 target
**Changed**
- Initialize TypeScript compiler before starting REPL prompt ([#1498](https://togithub.com/TypeStrong/ts-node/issues/1498)) [@TheUnlocked](https://togithub.com/TheUnlocked)
- Improves responsiveness for first line of REPL input
- Use `v8-compile-cache-lib` to load typescript
- improves startup time ([#1339](https://togithub.com/TypeStrong/ts-node/issues/1339), [#1603](https://togithub.com/TypeStrong/ts-node/issues/1603))
- Support both `--camelCase` and `--hyphen-case` for all CLI flags; update documentation to use `--camelCase` ([#1598](https://togithub.com/TypeStrong/ts-node/issues/1598), [#1599](https://togithub.com/TypeStrong/ts-node/issues/1599))
- Not a breaking change; CLI continues to accept both forms
- Make `TSError` `diagnosticText` property non-enumerable to prevent it from being logged below the stack ([#1632](https://togithub.com/TypeStrong/ts-node/issues/1632))
**Fixed**
- Fix [#1538](https://togithub.com/TypeStrong/ts-node/issues/1538): REPL inputs fail to transpile via swc ([#1538](https://togithub.com/TypeStrong/ts-node/issues/1538), [#1541](https://togithub.com/TypeStrong/ts-node/issues/1541), [#1602](https://togithub.com/TypeStrong/ts-node/issues/1602))
- Fix [#1478](https://togithub.com/TypeStrong/ts-node/issues/1478): REPL erroneously logged `undefined` for all inputs after the first when using swc transpiler ([#1478](https://togithub.com/TypeStrong/ts-node/issues/1478), [#1580](https://togithub.com/TypeStrong/ts-node/issues/1580), [#1602](https://togithub.com/TypeStrong/ts-node/issues/1602))
- Fix [#1389](https://togithub.com/TypeStrong/ts-node/issues/1389): In `--showConfig` output, emit accurate `moduleTypes` paths resolved relative to the `tsconfig.json` which declared them ([#1389](https://togithub.com/TypeStrong/ts-node/issues/1389), [#1619](https://togithub.com/TypeStrong/ts-node/issues/1619))
- Fix: Remove indentation from `ts-node --help` output ([#1597](https://togithub.com/TypeStrong/ts-node/issues/1597), [#1600](https://togithub.com/TypeStrong/ts-node/issues/1600))
- Fix [#1425](https://togithub.com/TypeStrong/ts-node/issues/1425): Merged definitions correctly into `tsconfig.schemastore-schema.json` ([#1425](https://togithub.com/TypeStrong/ts-node/issues/1425), [#1618](https://togithub.com/TypeStrong/ts-node/issues/1618))
- Fix: Allow disabling `"use strict"` emit in SWC transpiler ([#1531](https://togithub.com/TypeStrong/ts-node/issues/1531), [#1537](https://togithub.com/TypeStrong/ts-node/issues/1537))
- Fix: Add missing `ERR_UNKNOWN_FILE_EXTENSION` constructor; was throwing `ERR_UNKNOWN_FILE_EXTENSION is not a constructor` ([#1562](https://togithub.com/TypeStrong/ts-node/issues/1562)) [@bluelovers](https://togithub.com/bluelovers)
- Fix [#1565](https://togithub.com/TypeStrong/ts-node/issues/1565): entrypoint resolution failed on node v12.0.x and v12.1.x ([#1565](https://togithub.com/TypeStrong/ts-node/issues/1565), [#1566](https://togithub.com/TypeStrong/ts-node/issues/1566)) [@davidmurdoch](https://togithub.com/davidmurdoch)
#### Docs
- Explain `env -S` flag for shebangs ([docs](https://typestrong.org/ts-node/docs/usage#shebang)) ([#1448](https://togithub.com/TypeStrong/ts-node/issues/1448), [#1545](https://togithub.com/TypeStrong/ts-node/issues/1545)) [@sheeit](https://togithub.com/sheeit), [@chee](https://togithub.com/chee)
- Suggest `skipIgnore` when you want to compile files in node_modules ([docs](https://typestrong.org/ts-node/docs/how-it-works)) ([#1553](https://togithub.com/TypeStrong/ts-node/issues/1553)) [@webstrand](https://togithub.com/webstrand)
- Fix typo in `moduleTypes` on options page ([docs](https://typestrong.org/ts-node/docs/options)) ([#1630](https://togithub.com/TypeStrong/ts-node/issues/1630), [#1633](https://togithub.com/TypeStrong/ts-node/issues/1633))
#### Misc
- Adds experimental `experimentalResolverFeatures` option, but it does not do anything yet ([#1514](https://togithub.com/TypeStrong/ts-node/issues/1514), [#1614](https://togithub.com/TypeStrong/ts-node/issues/1614))
https://github.com/TypeStrong/ts-node/milestone/4
### [`v10.4.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.4.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.3.1...v10.4.0)
**Added**
- Adds support for targets "es2020" and "es2021" to swc transpiler ([#1521](https://togithub.com/TypeStrong/ts-node/issues/1521))
- Adds automatic target downgrade when using older versions of swc ([#1521](https://togithub.com/TypeStrong/ts-node/issues/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**
- Improves types and API docs for `creatEsmHooks` ([API docs](https://typestrong.org/ts-node/api/index.html#createEsmHooks)) ([#1506](https://togithub.com/TypeStrong/ts-node/issues/1506), [#1529](https://togithub.com/TypeStrong/ts-node/issues/1529))
**Fixed**
- Fix [#1526](https://togithub.com/TypeStrong/ts-node/issues/1526): data URL handling in new ESM loader hooks API ([#1526](https://togithub.com/TypeStrong/ts-node/issues/1526), [#1529](https://togithub.com/TypeStrong/ts-node/issues/1529))
https://github.com/TypeStrong/ts-node/milestone/8
### [`v10.3.1`](https://togithub.com/TypeStrong/ts-node/releases/v10.3.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.3.0...v10.3.1)
**Fixed**
- Add version check to use new loader hooks API for node >=16.12.0 ([#1522](https://togithub.com/TypeStrong/ts-node/issues/1522)) [@shrujalshah28](https://togithub.com/shrujalshah28)
https://github.com/TypeStrong/ts-node/milestone/7
### [`v10.3.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.3.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.2.1...v10.3.0)
Questions about this release? Ask in the official discussion thread: [#1507](https://togithub.com/TypeStrong/ts-node/issues/1507)
**Added**
- Declare types for node builtin modules within REPL so you do not need to import them ([#1424](https://togithub.com/TypeStrong/ts-node/issues/1424), [#1500](https://togithub.com/TypeStrong/ts-node/issues/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)` or `fs.readFileSync('example.txt')`
- Add `createEsmHooks()` function to create ESM loader hooks ([API docs](https://typestrong.org/ts-node/api/index.html#createEsmHooks)) ([#1439](https://togithub.com/TypeStrong/ts-node/issues/1439)) [@nonara](https://togithub.com/nonara)
- Can be used to compose our loader hooks with another loader or additional logic
- `register()` accepts a ts-node `Service` ([API docs](https://typestrong.org/ts-node/api/index.html#register)) ([#1474](https://togithub.com/TypeStrong/ts-node/issues/1474))
- `register(options)` is still supported; no breaking changes
- Add support for Node.js's new loader hooks API ([#1372](https://togithub.com/TypeStrong/ts-node/issues/1372), [#1457](https://togithub.com/TypeStrong/ts-node/issues/1457), [#1007](https://togithub.com/TypeStrong/ts-node/issues/1007)) [@jonaskello](https://togithub.com/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 `--emit` to `--help` output ([#1400](https://togithub.com/TypeStrong/ts-node/issues/1400), [#1484](https://togithub.com/TypeStrong/ts-node/issues/1484)) [@markbradley27](https://togithub.com/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](https://togithub.com/TypeStrong/ts-node/issues/1440), [#1441](https://togithub.com/TypeStrong/ts-node/issues/1441), [#1438](https://togithub.com/TypeStrong/ts-node/issues/1438), [#1495](https://togithub.com/TypeStrong/ts-node/issues/1495): Incorrect stack traces when third-party libraries use `source-map-support` instead of `@cspotcode/source-map-support` ([#1440](https://togithub.com/TypeStrong/ts-node/issues/1440), [#1441](https://togithub.com/TypeStrong/ts-node/issues/1441), [#1438](https://togithub.com/TypeStrong/ts-node/issues/1438), [#1495](https://togithub.com/TypeStrong/ts-node/issues/1495), [cspotcode/node-source-map-support#23](https://togithub.com/cspotcode/node-source-map-support/issues/23), [#1496](https://togithub.com/TypeStrong/ts-node/issues/1496), [#1497](https://togithub.com/TypeStrong/ts-node/issues/1497)) [@ejose19](https://togithub.com/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-support` for the fixes and enhancements listed here: [`@cspotcode/source-map-support` changelog](https://togithub.com/cspotcode/node-source-map-support/issues/24)
- To ensure correct stack traces, all libraries must share a compatible sourcemap support implementation
- Fix [#1363](https://togithub.com/TypeStrong/ts-node/issues/1363): REPL may erroneously combine previous input with next input, eval both as a single statement ([#1363](https://togithub.com/TypeStrong/ts-node/issues/1363), [#1480](https://togithub.com/TypeStrong/ts-node/issues/1480)) [@TheUnlocked](https://togithub.com/TheUnlocked)
- For example, entering `100` on first line and `* 2` on second line would erronously be interpreted as `100 * 2`
- REPL now ensures both lines are separate statements, both when typechecking and when evaluating
- Fix [#1488](https://togithub.com/TypeStrong/ts-node/issues/1488): Node may log "circular dependency" warning when using `allowJs` ([#1488](https://togithub.com/TypeStrong/ts-node/issues/1488), [#1489](https://togithub.com/TypeStrong/ts-node/issues/1489))
- Fix [#1301](https://togithub.com/TypeStrong/ts-node/issues/1301): Filter empty strings from `TS_NODE_IGNORE` and `TS_NODE_IGNORE_DIAGNOSTICS`; treat empty environment variable as empty array ([#1301](https://togithub.com/TypeStrong/ts-node/issues/1301), [#1483](https://togithub.com/TypeStrong/ts-node/issues/1483)) [@ValeriaVG](https://togithub.com/ValeriaVG)
- `TS_NODE_IGNORE= ts-node ./example.ts` will disable default ignore rules; will compile files in `./node_modules`
**Docs**
- Update VSCode debug configuration ([Docs](https://typestrong.org/ts-node/docs/recipes/visual-studio-code)) ([#1466](https://togithub.com/TypeStrong/ts-node/issues/1466))
- Update ESM-related messaging to clarify that experimental status is due to Node.js, not ts-node ([#1455](https://togithub.com/TypeStrong/ts-node/issues/1455))
- Refer to ts-node consistently ([#1481](https://togithub.com/TypeStrong/ts-node/issues/1481)) [@animafps](https://togithub.com/animafps)
https://github.com/TypeStrong/ts-node/milestone/5
### [`v10.2.1`](https://togithub.com/TypeStrong/ts-node/releases/v10.2.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.2.0...v10.2.1)
**Fixed**
- Fixes [#1426](https://togithub.com/TypeStrong/ts-node/issues/1426): Do not import typescript outside of configuration/project loading ([#1433](https://togithub.com/TypeStrong/ts-node/issues/1433), [#1426](https://togithub.com/TypeStrong/ts-node/issues/1426)) [@Songkeys](https://togithub.com/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`](https://togithub.com/TypeStrong/ts-node/releases/v10.2.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.1.0...v10.2.0)
Questions about this release? Ask in the official discussion thread: [#1423](https://togithub.com/TypeStrong/ts-node/issues/1423)
**Added**
- Adds top-level await support to REPL ([#1383](https://togithub.com/TypeStrong/ts-node/issues/1383), [#245](https://togithub.com/TypeStrong/ts-node/issues/245)) [@ejose19](https://togithub.com/ejose19)
- can be disabled with `--no-experimental-repl-await`, `experimentalReplAwait`, or `TS_NODE_EXPERIMENTAL_REPL_AWAIT` ([CLI docs](https://typestrong.org/ts-node/docs/options), [API docs](https://typestrong.org/ts-node/api/interfaces/CreateOptions.html#experimentalReplAwait))
- Setting `"pretty": false` disables pretty formatting of diagnostics even when stdout is a TTY ([#1418](https://togithub.com/TypeStrong/ts-node/issues/1418), [#1420](https://togithub.com/TypeStrong/ts-node/issues/1420)) [@elevatebart](https://togithub.com/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](https://togithub.com/TypeStrong/ts-node/issues/1396), [#1120](https://togithub.com/TypeStrong/ts-node/issues/1120), [#729](https://togithub.com/TypeStrong/ts-node/issues/729), [#850](https://togithub.com/TypeStrong/ts-node/issues/850), [#469](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1412), [#1405](https://togithub.com/TypeStrong/ts-node/issues/1405))
**Fixed**
- Fix [#1397](https://togithub.com/TypeStrong/ts-node/issues/1397): SWC transpiler should emit ECMAScript imports and exports when configuration dictates ([#1409](https://togithub.com/TypeStrong/ts-node/issues/1409), [#1397](https://togithub.com/TypeStrong/ts-node/issues/1397))
- Enables SWC transpiler to be used alongside `--loader`
- Fix [#1403](https://togithub.com/TypeStrong/ts-node/issues/1403): source-map-support breaks rendering of node errors ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1403](https://togithub.com/TypeStrong/ts-node/issues/1403))
- Fix [#1410](https://togithub.com/TypeStrong/ts-node/issues/1410): rendering of async stack frames should include `async` annotations ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1410](https://togithub.com/TypeStrong/ts-node/issues/1410))
- Fix [#1411](https://togithub.com/TypeStrong/ts-node/issues/1411): wrong order of process 'exit' event and logging unhandled exception ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1411](https://togithub.com/TypeStrong/ts-node/issues/1411))
- Fix [#1419](https://togithub.com/TypeStrong/ts-node/issues/1419): Should not throw `require.resolve` error when `@types/node` peerDependency is missing ([#1419](https://togithub.com/TypeStrong/ts-node/issues/1419), [#1422](https://togithub.com/TypeStrong/ts-node/issues/1422))
https://github.com/TypeStrong/ts-node/milestone/2
### [`v10.1.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.1.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.0.0...v10.1.0)
Questions about this release? Ask in the official discussion thread: [#1390](https://togithub.com/TypeStrong/ts-node/issues/1390)
**Added**
- Add `"moduleType"` option to override module type -- CommonJS or ECMAScript -- on select files. ([docs](https://typestrong.org/ts-node/docs/module-type-overrides)) ([#1342](https://togithub.com/TypeStrong/ts-node/issues/1342), [#1371](https://togithub.com/TypeStrong/ts-node/issues/1371), [#1376](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/jayaddison) for help on test coverage
- Implement `"extends"` support for `"ts-node"` options in `tsconfig.json` ([#1328](https://togithub.com/TypeStrong/ts-node/issues/1328), [#1356](https://togithub.com/TypeStrong/ts-node/issues/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](https://typestrong.org/ts-node/docs/options)) ([#1346](https://togithub.com/TypeStrong/ts-node/issues/1346), [#1367](https://togithub.com/TypeStrong/ts-node/issues/1367))
**Changed**
- Improve error messages thrown by native ESM loader hooks ([#1357](https://togithub.com/TypeStrong/ts-node/issues/1357), [#1373](https://togithub.com/TypeStrong/ts-node/issues/1373)) [@tars0x9752](https://togithub.com/tars0x9752)
- messages more closely match node; are more descriptive
- Emit `"ts-node"` object at the top of `--showConfig` output instead of the bottom ([#1355](https://togithub.com/TypeStrong/ts-node/issues/1355))
**Fixed**
- Fix [#1282](https://togithub.com/TypeStrong/ts-node/issues/1282): Set correct globals in `[stdin]`, `[eval]`, and `` contexts ([#1333](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1343): Set swc option `keepClassNames` to `true` ([#1344](https://togithub.com/TypeStrong/ts-node/issues/1344))
- Fix: [#1387](https://togithub.com/TypeStrong/ts-node/issues/1387): REPL outputs 'use strict' after first empty line of input ([#1388](https://togithub.com/TypeStrong/ts-node/issues/1388)) [@ejose19](https://togithub.com/ejose19)
**Docs**
- Update ESM docs to say that env vars *are* supported with `node --loader ts-node/esm` ([docs](https://togithub.com/TypeStrong/ts-node/issues/1007)) ([#1379](https://togithub.com/TypeStrong/ts-node/issues/1379))
https://github.com/TypeStrong/ts-node/milestone/3
### [`v10.0.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.0.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v9.1.1...v10.0.0)
Questions about this release? Ask in the official discussion thread: [#1337](https://togithub.com/TypeStrong/ts-node/issues/1337)
*Breaking changes are prefixed with **\[BREAKING]***
**Added**
- Adds `--show-config` to log the resolved configuration ([docs](https://typestrong.org/ts-node/docs/troubleshooting#understanding-configuration)) ([#1100](https://togithub.com/TypeStrong/ts-node/issues/1100), [#1243](https://togithub.com/TypeStrong/ts-node/issues/1243))
- Bundle and re-export [@tsconfig/node](https://togithub.com/tsconfig/node)\* configurations for convenience ([docs](https://typestrong.org/ts-node/docs/configuration#tsconfigbases)) ([#1202](https://togithub.com/TypeStrong/ts-node/issues/1202), [#1236](https://togithub.com/TypeStrong/ts-node/issues/1236), [#1313](https://togithub.com/TypeStrong/ts-node/issues/1313))
- Default to appropriate [@tsconfig/node](https://togithub.com/tsconfig/node)\* configuration based on node and typescript versions ([docs](https://typestrong.org/ts-node/docs/configuration#default-config)) ([#1202](https://togithub.com/TypeStrong/ts-node/issues/1202), [#1236](https://togithub.com/TypeStrong/ts-node/issues/1236), [#1313](https://togithub.com/TypeStrong/ts-node/issues/1313))
- Automatically reference [@types/node](https://togithub.com/types/node); use globally-installed [@types/node](https://togithub.com/types/node) if not locally installed ([#1240](https://togithub.com/TypeStrong/ts-node/issues/1240), [#1257](https://togithub.com/TypeStrong/ts-node/issues/1257))
- Add `swc` integration and new `--transpiler` option to use third-party transpilers for a massive speed boost on large codebases ([docs](https://typestrong.org/ts-node/docs/transpilers)) ([#779](https://togithub.com/TypeStrong/ts-node/issues/779), [#1160](https://togithub.com/TypeStrong/ts-node/issues/1160))
- Add `scopeDir` API option ([docs](https://typestrong.org/ts-node/api/interfaces/RegisterOptions.html#scopeDir)) ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
- Add `projectSearchDir` API option ([docs](https://typestrong.org/ts-node/api/interfaces/RegisterOptions.html#projectSearchDir)) ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
- Add `--cwd-mode` and `ts-node-cwd` to resolve config file relative to cwd, not entrypoint script ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
**Changed**
- **\[BREAKING]** Make `--script-mode` default behavior; resolve tsconfig relative to entrypoint script instead of cwd ([#949](https://togithub.com/TypeStrong/ts-node/issues/949), [#1197](https://togithub.com/TypeStrong/ts-node/issues/1197), [#1155](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1155))
- **\[BREAKING]** Remove support for node 10. Minimum supported version is node 12 ([#1312](https://togithub.com/TypeStrong/ts-node/issues/1312))
- Rename `--dir` to `--cwd`; rename `TS_NODE_DIR` to `TS_NODE_CWD` ([#1155](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1155))
- Deprecate `--dir` and `TS_NODE_DIR` ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
**Removed**
- **\[BREAKING]** Internal APIs removed from type declarations ([#1242](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1229) and [#1235](https://togithub.com/TypeStrong/ts-node/issues/1235): always throw `ERR_REQUIRE_ESM` when attempting to execute ESM as CJS, even when not using `--loader ts-node/esm` ([#1232](https://togithub.com/TypeStrong/ts-node/issues/1232))
- This aligns our behavior with vanilla `node`
- **\[BREAKING]** Fix [#1225](https://togithub.com/TypeStrong/ts-node/issues/1225): `compiler` is loaded relative to `tsconfig.json` instead of entrypoint script ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
- In most cases this change will have no noticable effect
- Fix [#1217](https://togithub.com/TypeStrong/ts-node/issues/1217): REPL not always using passed stdout and stderr ([#1224](https://togithub.com/TypeStrong/ts-node/issues/1224))
- Fix [#1220](https://togithub.com/TypeStrong/ts-node/issues/1220): `ts-node ./index` may execute the wrong file extension because tsconfig search poisons the `require.resolve` cache ([#1155](https://togithub.com/TypeStrong/ts-node/issues/1155))
- Fix [#1322](https://togithub.com/TypeStrong/ts-node/issues/1322): Sourcemaps fail for filenames with spaces or other characters which are percent-encoded in URLs ([#1160](https://togithub.com/TypeStrong/ts-node/issues/1160), [#1330](https://togithub.com/TypeStrong/ts-node/issues/1330))
- Fix [#1331](https://togithub.com/TypeStrong/ts-node/issues/1331): Resolution of node builtin modules in ESM loader fails on node >=12.20.0, <13 ([#1332](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1207), [#1213](https://togithub.com/TypeStrong/ts-node/issues/1213), [#1221](https://togithub.com/TypeStrong/ts-node/issues/1221), [#1228](https://togithub.com/TypeStrong/ts-node/issues/1228), [#1244](https://togithub.com/TypeStrong/ts-node/issues/1244), [#1250](https://togithub.com/TypeStrong/ts-node/issues/1250), [#1294](https://togithub.com/TypeStrong/ts-node/issues/1294), [#1295](https://togithub.com/TypeStrong/ts-node/issues/1295), [#1296](https://togithub.com/TypeStrong/ts-node/issues/1296), [#1297](https://togithub.com/TypeStrong/ts-node/issues/1297)
- Thanks to these contributors for PRs which improved our documentation
- add troubleshooting tip for syntax errors ([#1201](https://togithub.com/TypeStrong/ts-node/issues/1201)) [@jedwards1211](https://togithub.com/jedwards1211)
- Clarify handling of tsx/jsx file extensions ([#1179](https://togithub.com/TypeStrong/ts-node/issues/1179)) [@NaridaL](https://togithub.com/NaridaL)
- Added `CONTRIBUTING.md` to document the codebase and our development workflow
https://github.com/TypeStrong/ts-node/milestone/1
### [`v9.1.1`](https://togithub.com/TypeStrong/ts-node/releases/v9.1.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v9.1.0...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](https://togithub.com/TypeStrong/ts-node/issues/1172)
### [`v9.1.0`](https://togithub.com/TypeStrong/ts-node/releases/v9.1.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v9.0.0...v9.1.0)
**Added**
- Expose ts-node REPL via the API ([#1121](https://togithub.com/TypeStrong/ts-node/issues/1121)) [@MarcManiez](https://togithub.com/MarcManiez)
- Allow `--typeCheck` flag to override `--transpileOnly` flag specified in `tsconfig.json` ([#1142](https://togithub.com/TypeStrong/ts-node/issues/1142))
**Changed**
- Rename interface `Register` to `Service`. It is still aliased as `Register` for backwards compatibility ([#1158](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1167))
**Fixed**
- ESM resolver will preserve search portion of URL, used for cache busting ([#1165](https://togithub.com/TypeStrong/ts-node/issues/1165)) [@frandiox](https://togithub.com/frandiox)
- Fix ESM resolution of builtin modules on node >=14.13.1 ([#1136](https://togithub.com/TypeStrong/ts-node/issues/1136))
- Recognize `--es-module-specifier-resolution` as an alias of `--experimental-specifier-resolution` for node 12 compatibility ([#1122](https://togithub.com/TypeStrong/ts-node/issues/1122)) [@nguyensomniac](https://togithub.com/nguyensomniac)
**Docs**
- Fix description of `ts-node-dev` in README ([#1131](https://togithub.com/TypeStrong/ts-node/issues/1131)) [@iamandrewluca](https://togithub.com/iamandrewluca)
- Update `transformers` description to clarify incompatibility with `transpileOnly` ([#1123](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1138), [#1148](https://togithub.com/TypeStrong/ts-node/issues/1148))
- Improve codecov rules to remove misleading test failures ([#1159](https://togithub.com/TypeStrong/ts-node/issues/1159))
### [`v9.0.0`](https://togithub.com/TypeStrong/ts-node/releases/v9.0.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.10.2...v9.0.0)
*Breaking changes are labelled \[BREAKING] below.*
**Added**
- Throw `ERR_REQUIRE_ESM` when a file is `require()`d which should be loaded as ESM ([#1031](https://togithub.com/TypeStrong/ts-node/issues/1031))
- Re-add `"exports"` declaration to package.json in backwards-compatible way, enabling `node --loader ts-node/esm` without file extension ([#1028](https://togithub.com/TypeStrong/ts-node/issues/1028))
- Allow specifying `"require"` option via tsconfig ([#925](https://togithub.com/TypeStrong/ts-node/issues/925))
- REPL respects node's `NODE_NO_READLINE` environment variable ([#1090](https://togithub.com/TypeStrong/ts-node/issues/1090))
- Add a transpile-only entrypoint for ESM loader: `node --loader ts-node/esm/transpile-only` ([#1102](https://togithub.com/TypeStrong/ts-node/issues/1102)) [@concision](https://togithub.com/concision)
**Changed**
- \[BREAKING] Drops support for node versions < 10 ([#1036](https://togithub.com/TypeStrong/ts-node/issues/1036))
**Fixed**
- \[BREAKING] Re-add `realpath`, which should fix workflows that use symlinks, such as `pnpm`, Lerna workspaces, or other mono-repo configurations ([#970](https://togithub.com/TypeStrong/ts-node/issues/970))
- Compile files within `node_modules` when `--skip-ignore` or `--ignore` options are configured to allow it ([#970](https://togithub.com/TypeStrong/ts-node/issues/970))
- Fix [#884](https://togithub.com/TypeStrong/ts-node/issues/884) by not adding all referenced files to `getSourceFileNames`/`rootNames` ([#999](https://togithub.com/TypeStrong/ts-node/issues/999))
- Fix [#996](https://togithub.com/TypeStrong/ts-node/issues/996): bump `projectVersion` every time `getSourceFileNames` changes, avoiding accidentally outdated typechecking ([#998](https://togithub.com/TypeStrong/ts-node/issues/998))
- Fix [#1051](https://togithub.com/TypeStrong/ts-node/issues/1051): pass transformers object to `ts.transpileModule` ([#1054](https://togithub.com/TypeStrong/ts-node/issues/1054)) [@thetutlage](https://togithub.com/thetutlage)
- Fix [#1060](https://togithub.com/TypeStrong/ts-node/issues/1060): use source maps for stack traces in ESM modules ([#1087](https://togithub.com/TypeStrong/ts-node/issues/1087))
- Fix [#1072](https://togithub.com/TypeStrong/ts-node/issues/1072): Respect `--experimental-specifier-resolution` coming from `NODE_OPTIONS` in ESM loader ([#1085](https://togithub.com/TypeStrong/ts-node/issues/1085)) [@evg656e](https://togithub.com/evg656e)
- Fix [#1098](https://togithub.com/TypeStrong/ts-node/issues/1098): ESM loader should skip `.cjs`, `.mjs`, and any unexpected file extensions ([#1103](https://togithub.com/TypeStrong/ts-node/issues/1103)) [@concision](https://togithub.com/concision)
**Docs**
- Better explain how to compile imports, either CommonJS or using experimental ESM loader. Resolves [#1075](https://togithub.com/TypeStrong/ts-node/issues/1075) ([#1086](https://togithub.com/TypeStrong/ts-node/issues/1086))
**Misc**
- Fix, re-enable, and add various tests ([#1044](https://togithub.com/TypeStrong/ts-node/issues/1044), [#1088](https://togithub.com/TypeStrong/ts-node/issues/1088), [#1108](https://togithub.com/TypeStrong/ts-node/issues/1108), [#1110](https://togithub.com/TypeStrong/ts-node/issues/1110), [#1109](https://togithub.com/TypeStrong/ts-node/issues/1109), [#1115](https://togithub.com/TypeStrong/ts-node/issues/1115), [#1043](https://togithub.com/TypeStrong/ts-node/issues/1043), [#999](https://togithub.com/TypeStrong/ts-node/issues/999))
### [`v8.10.2`](https://togithub.com/TypeStrong/ts-node/releases/v8.10.2)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.10.1...v8.10.2)
**Fixed**
Fixes [#1037](https://togithub.com/TypeStrong/ts-node/issues/1037): source maps broken on Windows. ([#1038](https://togithub.com/TypeStrong/ts-node/issues/1038))
**Misc**
Fix failing tests on node 6 ([#1035](https://togithub.com/TypeStrong/ts-node/issues/1035))
Push coverage from Github Actions; remove TravisCI ([#1034](https://togithub.com/TypeStrong/ts-node/issues/1034))
Run tests e2e against an `npm pack && npm install`ed ts-node ([#1032](https://togithub.com/TypeStrong/ts-node/issues/1032))
Run CI tests on Windows ([#1041](https://togithub.com/TypeStrong/ts-node/issues/1041))
Run CI only once per commit on pull requests and master ([#1042](https://togithub.com/TypeStrong/ts-node/issues/1042))
### [`v8.10.1`](https://togithub.com/TypeStrong/ts-node/releases/v8.10.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.10.0...v8.10.1)
**Fix**
Fixes [#1026](https://togithub.com/TypeStrong/ts-node/issues/1026): revert the addition of package.json "exports" because it blocked `require()`s that used to work, for example `require('ts-node/register')` ([#1027](https://togithub.com/TypeStrong/ts-node/issues/1027))
### [`v8.10.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.10.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.9.1...v8.10.0)
**Added**
Experimental support for native ECMAScript modules in node >=13 ([#1007](https://togithub.com/TypeStrong/ts-node/issues/1007), [#1010](https://togithub.com/TypeStrong/ts-node/issues/1010))
### [`v8.9.1`](https://togithub.com/TypeStrong/ts-node/releases/v8.9.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.9.0...v8.9.1)
**Fixed**
Fix `--interactive` / `-i` flag so it forces REPL even when stdin is not a TTY ([#1019](https://togithub.com/TypeStrong/ts-node/issues/1019))
### [`v8.9.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.9.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.8.2...v8.9.0)
**Fixed**
Fix failing tests caused by recent changes to [@types/node](https://togithub.com/types/node) ([#1016](https://togithub.com/TypeStrong/ts-node/issues/1016))
Fix [#945](https://togithub.com/TypeStrong/ts-node/issues/945): Bump source-map-support dependency to include upstream fix for worker threads error handling ([#1015](https://togithub.com/TypeStrong/ts-node/issues/1015)) [@addaleax](https://togithub.com/addaleax)
Fix [#1004](https://togithub.com/TypeStrong/ts-node/issues/1004): in `--scriptMode`, resolve config file relative to realpath of entrypoint script ([#1009](https://togithub.com/TypeStrong/ts-node/issues/1009))
Normalized filenames in cache to fix performance issues on Windows ([#997](https://togithub.com/TypeStrong/ts-node/issues/997)) [@sylc](https://togithub.com/sylc)
**Added**
Add timestamps to debug logging ([#994](https://togithub.com/TypeStrong/ts-node/issues/994)) [@sylc](https://togithub.com/sylc)
**Docs**
Improve coverage of the README ([#1000](https://togithub.com/TypeStrong/ts-node/issues/1000)) [@KasparEtter](https://togithub.com/KasparEtter)
Change order of install commands in README ([#993](https://togithub.com/TypeStrong/ts-node/issues/993)) [@jacobdcastro](https://togithub.com/jacobdcastro)
Mention `ts-node -vv` flag in issue template ([#1001](https://togithub.com/TypeStrong/ts-node/issues/1001))
Run GHActions tests on pull requests ([#1017](https://togithub.com/TypeStrong/ts-node/issues/1017))
### [`v8.8.2`](https://togithub.com/TypeStrong/ts-node/releases/v8.8.2)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.8.1...v8.8.2)
**Fixed**
- Avoid pushing to `rootFileNames` with version
### [`v8.8.1`](https://togithub.com/TypeStrong/ts-node/releases/v8.8.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.8.0...v8.8.1)
**Fixed**
- Fix `--files` support [`be2c899`](https://togithub.com/TypeStrong/ts-node/commit/be2c899)
### [`v8.8.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.8.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.7.0...v8.8.0)
**Added**
- Add `sanitize=true` to README for SVGs to work on NPM
**Fixed**
- Simplify `projectVersion++` by incrementing on each file change
- List all files for `getScriptFileNames` ([#985](https://togithub.com/TypeStrong/ts-node/issues/985)) - revisits the change in https://github.com/TypeStrong/ts-node/issues/884
### [`v8.7.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.7.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.6.2...v8.7.0)
**Fixed**
- Remove buggy caching of `ts.sys.readDirectory` ([#969](https://togithub.com/TypeStrong/ts-node/issues/969))
- Fix REPL ASI handling when user input starts with `-` ([#944](https://togithub.com/TypeStrong/ts-node/issues/944))
**Added**
- Implement `LanguageServiceHost::getProjectVersion` to workaround [microsoft/TypeScript#36748](https://togithub.com/microsoft/TypeScript/issues/36748) ([#906](https://togithub.com/TypeStrong/ts-node/issues/906)
- Add `ts-node-transpile-only` binary ([#939](https://togithub.com/TypeStrong/ts-node/issues/939)) [@G-Rath](https://togithub.com/G-Rath)
**Changed**
- Deprecate `ts-script` in favor of `ts-node-script` ([#948](https://togithub.com/TypeStrong/ts-node/issues/948)) [@G-Rath](https://togithub.com/G-Rath)
**Docs**
- Fix bash syntax error in README ([#943](https://togithub.com/TypeStrong/ts-node/issues/943)) [@abraj](https://togithub.com/abraj)
- Add Github issue templates ([#959](https://togithub.com/TypeStrong/ts-node/issues/959), [#965](https://togithub.com/TypeStrong/ts-node/issues/965), [#947](https://togithub.com/TypeStrong/ts-node/issues/947))
- Add IntelliJ debug instructions to README ([#958](https://togithub.com/TypeStrong/ts-node/issues/958))
- Add mocha 7 usage example to README ([#961](https://togithub.com/TypeStrong/ts-node/issues/961))
### [`v8.6.2`](https://togithub.com/TypeStrong/ts-node/releases/v8.6.2)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.6.1...v8.6.2)
**Fixed**
- Downgrade `yn` due to node engine ([#942](https://togithub.com/TypeStrong/ts-node/issues/942))
### [`v8.6.1`](https://togithub.com/TypeStrong/ts-node/releases/v8.6.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.6.0...v8.6.1)
**Fixed**
- Fix the resolution order of `TS_NODE_COMPILER_OPTIONS` - closes https://github.com/TypeStrong/ts-node/issues/938
### [`v8.6.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.6.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.5.4...v8.6.0)
**Fixed**
- Remove normalize slashes from config file loading for Windows
**Added**
- Configure using `tsconfig.json` ([#921](https://togithub.com/TypeStrong/ts-node/issues/921)) [@cspotcode](https://togithub.com/cspotcode) 🎉
- Allow `dir` to be configurable
- Add `--build` flag for emitting compiled TypeScript (under `--compiler-host` mode)
- Incremental compiler support ([#895](https://togithub.com/TypeStrong/ts-node/issues/895))
### [`v8.5.4`](https://togithub.com/TypeStrong/ts-node/releases/v8.5.4)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.5.3...v8.5.4)
- Fix relative `node_modules` ignore [`266eaa5`](https://togithub.com/TypeStrong/ts-node/commit/266eaa5)
### [`v8.5.3`](https://togithub.com/TypeStrong/ts-node/releases/v8.5.3)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.5.2...v8.5.3)
**Fixed**
- Pass correct diagnostics list in transpile mode ([#917](https://togithub.com/TypeStrong/ts-node/issues/917)) [`907e3e1`](https://togithub.com/TypeStrong/ts-node/commit/907e3e1)
- Make `--ignore` relative [`ea6e1da`](https://togithub.com/TypeStrong/ts-node/commit/ea6e1da)
### [`v8.5.2`](https://togithub.com/TypeStrong/ts-node/releases/v8.5.2)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.5.0...v8.5.2)
**Fixed**
- Revert `--require` module loading change
### [`v8.5.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.5.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.4.1...v8.5.0)
**Added**
- Expose `ts-script` for relative `tsconfig.json` files from ``
- Support `--interactive` CLI option
- Expose registered `ts-node` instance information on `process`
- Allow dynamic `enable` of registered `ts-node` instances
- Allow `--dir` to be configurable from CLI
- Add `--scope` flag for directory scoped compilation of TypeScript
- REPL history on node 11+
- Expose `create` function for programmatic compiler usage
**Fixed**
- Repeated RegExps in REPL will now compile
### [`v8.4.1`](https://togithub.com/TypeStrong/ts-node/releases/v8.4.1)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.4.0...v8.4.1)
**Fixed**
- Revert "List all files in memory cache improves perf 1.4x" [`87a6e2c`](https://togithub.com/TypeStrong/ts-node/commit/87a6e2c)
### [`v8.4.0`](https://togithub.com/TypeStrong/ts-node/releases/v8.4.0)
[Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v8.3.0...v8.4.0)
**Added**
- Introduce transformers program support ([#879](https://togithub.com/TypeStrong/ts-node/issues/879)) [`12ff53d`](https://togithub.com/TypeStrong/ts-node/commit/12ff53d)
**Fixed**
- Fix prefer TS exts via env variables ([#867](https://togithub.com/TypeStrong/ts-node/issues/867)) [`b01b629`](https://togithub.com/TypeStrong/ts-node/commit/b01b629)
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 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 contains the following updates:
^8.0.0
->^10.0.0
Release Notes
TypeStrong/ts-node
### [`v10.7.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.7.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.6.0...v10.7.0) Questions about this release? Ask in the official discussion thread: [#1680](https://togithub.com/TypeStrong/ts-node/issues/1680) **Added** - Adds `--esm` flag, option, and `ts-node-esm` binary ([#1258](https://togithub.com/TypeStrong/ts-node/issues/1258), [#1655](https://togithub.com/TypeStrong/ts-node/issues/1655)) - Enables full `esm` support; no need for `--loader` nor `NODE_OPTIONS` - Use shebang `#!/usr/bin/env ts-node-esm`, run `ts-node --esm`, or add to your tsconfig.json: `"ts-node": {"esm": true}` **Changed** - Unflag ESM json modules on node >=17.5.0 ([#1661](https://togithub.com/TypeStrong/ts-node/issues/1661), [#1665](https://togithub.com/TypeStrong/ts-node/issues/1665)) [@Jamesernator](https://togithub.com/Jamesernator) - no longer requires `--experimental-json-modules` - Lazy-load dependencies to improve startup responsiveness. ([#1676](https://togithub.com/TypeStrong/ts-node/issues/1676)) **Fixed** - Fixed bug where "compiler", "transpiler", and swc backend would not resolve relative to the tsconfig.json that declared them ([#1662](https://togithub.com/TypeStrong/ts-node/issues/1662), [#1655](https://togithub.com/TypeStrong/ts-node/issues/1655)) - Enables reusable tsconfig.json shared via node module to include necessary dependencies https://github.com/TypeStrong/ts-node/milestone/11 ### [`v10.6.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.6.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.5.0...v10.6.0) Questions about this release? Ask in the official discussion thread: [#1666](https://togithub.com/TypeStrong/ts-node/issues/1666) **Added** - Adds workaround for extensionless entrypoints with ESM loader ([#1649](https://togithub.com/TypeStrong/ts-node/issues/1649), [#1654](https://togithub.com/TypeStrong/ts-node/issues/1654)) - You can now combine tools such as `mocha` with `--loader ts-node/esm`, where previously node would throw `[ERR_UNKNOWN_FILE_EXTENSION]` - node has a bug where combining `--loader` with an extensionless entrypoint causes this error [nodejs/node#33226](https://togithub.com/nodejs/node/issues/33226) - Some tools, for example `mocha`, have an extensionless entrypoint. ([source](https://togithub.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/package.json#L37), [source](https://togithub.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/bin/mocha)) - Combining `NODE_OPTIONS=--loader ts-node/esm` with these tools causes this error. [mochajs/mocha#4645](https://togithub.com/mochajs/mocha/issues/4645) - node intends to fix this bug in a future release: [nodejs/node#41711](https://togithub.com/nodejs/node/issues/41711) - In the interim, we have implemented a workaround in ts-node. - Adds support for target "ES2022" in `moduleTypes` overrides ([#1650](https://togithub.com/TypeStrong/ts-node/issues/1650)) **Fixed** - Fixed bug where `--swc` and other third-party transpilers did not respect `moduleTypes` overrides ([#1651](https://togithub.com/TypeStrong/ts-node/issues/1651), [#1652](https://togithub.com/TypeStrong/ts-node/issues/1652), [#1660](https://togithub.com/TypeStrong/ts-node/issues/1660)) - Fixed bug where node flags were not preserved correctly in `process.execArgv` ([#1657](https://togithub.com/TypeStrong/ts-node/issues/1657), [#1658](https://togithub.com/TypeStrong/ts-node/issues/1658)) - This affected `child_process.fork()`, since it uses `process.execArgv` to create a similar child runtime. - With this fix, `child_process.fork()` will preserve both node flags and `ts-node` hooks. - Fixed compatibility TypeScript 4.7's API changes ([#1647](https://togithub.com/TypeStrong/ts-node/issues/1647), [#1648](https://togithub.com/TypeStrong/ts-node/issues/1648)) https://github.com/TypeStrong/ts-node/milestone/9 ### [`v10.5.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.5.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.4.0...v10.5.0) Questions about this release? Ask in the official discussion thread: [#1634](https://togithub.com/TypeStrong/ts-node/issues/1634) **Added** - Eliminate "Emit Skipped" errors ([#693](https://togithub.com/TypeStrong/ts-node/issues/693), [#1345](https://togithub.com/TypeStrong/ts-node/issues/1345), [#1629](https://togithub.com/TypeStrong/ts-node/issues/1629)) - Avoids all "Emit Skipped" errors by performing a fallback `transpileOnly`-style transformation. - Does not affect typechecking. Type errors are still detected and thrown. - Fallback has the same limitations as `isolatedModules`. This will only affect rare cases such as using `const enums` with `preserveConstEnums` disabled. - Fixes [#693](https://togithub.com/TypeStrong/ts-node/issues/693) - Graduate swc transpiler out of experimental; add `swc: true` convenience option ([docs](https://typestrong.org/ts-node/docs/transpilers)) ([#1487](https://togithub.com/TypeStrong/ts-node/issues/1487), [#1536](https://togithub.com/TypeStrong/ts-node/issues/1536), [#1613](https://togithub.com/TypeStrong/ts-node/issues/1613), [#1627](https://togithub.com/TypeStrong/ts-node/issues/1627)) - `"swc": true` or `--swc` will use swc for faster execution - This feature is no longer marked "experimental." Thank you to everyone who filed bugs! - swc transpiler attempts to load `@swc/core` or `@swc/wasm` dependencies from your project before falling-back to global installations ([#1613](https://togithub.com/TypeStrong/ts-node/issues/1613), [#1627](https://togithub.com/TypeStrong/ts-node/issues/1627)) - global fallback only occurs when using a global installation of ts-node - Add support for TypeScript's `traceResolution` output ([docs](https://www.typescriptlang.org/tsconfig/#traceResolution)) ([#1128](https://togithub.com/TypeStrong/ts-node/issues/1128), [#1491](https://togithub.com/TypeStrong/ts-node/issues/1491)) [@TheUnlocked](https://togithub.com/TheUnlocked) - Support import assertions in ESM loader ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#import-assertions)) ([#1557](https://togithub.com/TypeStrong/ts-node/issues/1557), [#1558](https://togithub.com/TypeStrong/ts-node/issues/1558), [#1559](https://togithub.com/TypeStrong/ts-node/issues/1559), [#1573](https://togithub.com/TypeStrong/ts-node/issues/1573)) [@Pokute](https://togithub.com/Pokute), [@geigerzaehler](https://togithub.com/geigerzaehler) - Allows importing JSON files from ESM with the requisite flag ([docs](https://nodejs.org/dist/latest-v17.x/docs/api/esm.html#json-modules)) - `ts-node -vvv` also logs absolute paths to `ts-node` and `typescript`, to make it more obvious when you're accidentally using globally-installed versions ([#1323](https://togithub.com/TypeStrong/ts-node/issues/1323), [#1620](https://togithub.com/TypeStrong/ts-node/issues/1620)) - Add swc target "es2022" ([#1535](https://togithub.com/TypeStrong/ts-node/issues/1535), [#1540](https://togithub.com/TypeStrong/ts-node/issues/1540)) - When you have target es2022 in tsconfig, will use swc's es2022 target **Changed** - Initialize TypeScript compiler before starting REPL prompt ([#1498](https://togithub.com/TypeStrong/ts-node/issues/1498)) [@TheUnlocked](https://togithub.com/TheUnlocked) - Improves responsiveness for first line of REPL input - Use `v8-compile-cache-lib` to load typescript - improves startup time ([#1339](https://togithub.com/TypeStrong/ts-node/issues/1339), [#1603](https://togithub.com/TypeStrong/ts-node/issues/1603)) - Support both `--camelCase` and `--hyphen-case` for all CLI flags; update documentation to use `--camelCase` ([#1598](https://togithub.com/TypeStrong/ts-node/issues/1598), [#1599](https://togithub.com/TypeStrong/ts-node/issues/1599)) - Not a breaking change; CLI continues to accept both forms - Make `TSError` `diagnosticText` property non-enumerable to prevent it from being logged below the stack ([#1632](https://togithub.com/TypeStrong/ts-node/issues/1632)) **Fixed** - Fix [#1538](https://togithub.com/TypeStrong/ts-node/issues/1538): REPL inputs fail to transpile via swc ([#1538](https://togithub.com/TypeStrong/ts-node/issues/1538), [#1541](https://togithub.com/TypeStrong/ts-node/issues/1541), [#1602](https://togithub.com/TypeStrong/ts-node/issues/1602)) - Fix [#1478](https://togithub.com/TypeStrong/ts-node/issues/1478): REPL erroneously logged `undefined` for all inputs after the first when using swc transpiler ([#1478](https://togithub.com/TypeStrong/ts-node/issues/1478), [#1580](https://togithub.com/TypeStrong/ts-node/issues/1580), [#1602](https://togithub.com/TypeStrong/ts-node/issues/1602)) - Fix [#1389](https://togithub.com/TypeStrong/ts-node/issues/1389): In `--showConfig` output, emit accurate `moduleTypes` paths resolved relative to the `tsconfig.json` which declared them ([#1389](https://togithub.com/TypeStrong/ts-node/issues/1389), [#1619](https://togithub.com/TypeStrong/ts-node/issues/1619)) - Fix: Remove indentation from `ts-node --help` output ([#1597](https://togithub.com/TypeStrong/ts-node/issues/1597), [#1600](https://togithub.com/TypeStrong/ts-node/issues/1600)) - Fix [#1425](https://togithub.com/TypeStrong/ts-node/issues/1425): Merged definitions correctly into `tsconfig.schemastore-schema.json` ([#1425](https://togithub.com/TypeStrong/ts-node/issues/1425), [#1618](https://togithub.com/TypeStrong/ts-node/issues/1618)) - Fix: Allow disabling `"use strict"` emit in SWC transpiler ([#1531](https://togithub.com/TypeStrong/ts-node/issues/1531), [#1537](https://togithub.com/TypeStrong/ts-node/issues/1537)) - Fix: Add missing `ERR_UNKNOWN_FILE_EXTENSION` constructor; was throwing `ERR_UNKNOWN_FILE_EXTENSION is not a constructor` ([#1562](https://togithub.com/TypeStrong/ts-node/issues/1562)) [@bluelovers](https://togithub.com/bluelovers) - Fix [#1565](https://togithub.com/TypeStrong/ts-node/issues/1565): entrypoint resolution failed on node v12.0.x and v12.1.x ([#1565](https://togithub.com/TypeStrong/ts-node/issues/1565), [#1566](https://togithub.com/TypeStrong/ts-node/issues/1566)) [@davidmurdoch](https://togithub.com/davidmurdoch) #### Docs - Explain `env -S` flag for shebangs ([docs](https://typestrong.org/ts-node/docs/usage#shebang)) ([#1448](https://togithub.com/TypeStrong/ts-node/issues/1448), [#1545](https://togithub.com/TypeStrong/ts-node/issues/1545)) [@sheeit](https://togithub.com/sheeit), [@chee](https://togithub.com/chee) - Suggest `skipIgnore` when you want to compile files in node_modules ([docs](https://typestrong.org/ts-node/docs/how-it-works)) ([#1553](https://togithub.com/TypeStrong/ts-node/issues/1553)) [@webstrand](https://togithub.com/webstrand) - Fix typo in `moduleTypes` on options page ([docs](https://typestrong.org/ts-node/docs/options)) ([#1630](https://togithub.com/TypeStrong/ts-node/issues/1630), [#1633](https://togithub.com/TypeStrong/ts-node/issues/1633)) #### Misc - Adds experimental `experimentalResolverFeatures` option, but it does not do anything yet ([#1514](https://togithub.com/TypeStrong/ts-node/issues/1514), [#1614](https://togithub.com/TypeStrong/ts-node/issues/1614)) https://github.com/TypeStrong/ts-node/milestone/4 ### [`v10.4.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.4.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.3.1...v10.4.0) **Added** - Adds support for targets "es2020" and "es2021" to swc transpiler ([#1521](https://togithub.com/TypeStrong/ts-node/issues/1521)) - Adds automatic target downgrade when using older versions of swc ([#1521](https://togithub.com/TypeStrong/ts-node/issues/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** - Improves types and API docs for `creatEsmHooks` ([API docs](https://typestrong.org/ts-node/api/index.html#createEsmHooks)) ([#1506](https://togithub.com/TypeStrong/ts-node/issues/1506), [#1529](https://togithub.com/TypeStrong/ts-node/issues/1529)) **Fixed** - Fix [#1526](https://togithub.com/TypeStrong/ts-node/issues/1526): data URL handling in new ESM loader hooks API ([#1526](https://togithub.com/TypeStrong/ts-node/issues/1526), [#1529](https://togithub.com/TypeStrong/ts-node/issues/1529)) https://github.com/TypeStrong/ts-node/milestone/8 ### [`v10.3.1`](https://togithub.com/TypeStrong/ts-node/releases/v10.3.1) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.3.0...v10.3.1) **Fixed** - Add version check to use new loader hooks API for node >=16.12.0 ([#1522](https://togithub.com/TypeStrong/ts-node/issues/1522)) [@shrujalshah28](https://togithub.com/shrujalshah28) https://github.com/TypeStrong/ts-node/milestone/7 ### [`v10.3.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.3.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.2.1...v10.3.0) Questions about this release? Ask in the official discussion thread: [#1507](https://togithub.com/TypeStrong/ts-node/issues/1507) **Added** - Declare types for node builtin modules within REPL so you do not need to import them ([#1424](https://togithub.com/TypeStrong/ts-node/issues/1424), [#1500](https://togithub.com/TypeStrong/ts-node/issues/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)` or `fs.readFileSync('example.txt')` - Add `createEsmHooks()` function to create ESM loader hooks ([API docs](https://typestrong.org/ts-node/api/index.html#createEsmHooks)) ([#1439](https://togithub.com/TypeStrong/ts-node/issues/1439)) [@nonara](https://togithub.com/nonara) - Can be used to compose our loader hooks with another loader or additional logic - `register()` accepts a ts-node `Service` ([API docs](https://typestrong.org/ts-node/api/index.html#register)) ([#1474](https://togithub.com/TypeStrong/ts-node/issues/1474)) - `register(options)` is still supported; no breaking changes - Add support for Node.js's new loader hooks API ([#1372](https://togithub.com/TypeStrong/ts-node/issues/1372), [#1457](https://togithub.com/TypeStrong/ts-node/issues/1457), [#1007](https://togithub.com/TypeStrong/ts-node/issues/1007)) [@jonaskello](https://togithub.com/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 `--emit` to `--help` output ([#1400](https://togithub.com/TypeStrong/ts-node/issues/1400), [#1484](https://togithub.com/TypeStrong/ts-node/issues/1484)) [@markbradley27](https://togithub.com/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](https://togithub.com/TypeStrong/ts-node/issues/1440), [#1441](https://togithub.com/TypeStrong/ts-node/issues/1441), [#1438](https://togithub.com/TypeStrong/ts-node/issues/1438), [#1495](https://togithub.com/TypeStrong/ts-node/issues/1495): Incorrect stack traces when third-party libraries use `source-map-support` instead of `@cspotcode/source-map-support` ([#1440](https://togithub.com/TypeStrong/ts-node/issues/1440), [#1441](https://togithub.com/TypeStrong/ts-node/issues/1441), [#1438](https://togithub.com/TypeStrong/ts-node/issues/1438), [#1495](https://togithub.com/TypeStrong/ts-node/issues/1495), [cspotcode/node-source-map-support#23](https://togithub.com/cspotcode/node-source-map-support/issues/23), [#1496](https://togithub.com/TypeStrong/ts-node/issues/1496), [#1497](https://togithub.com/TypeStrong/ts-node/issues/1497)) [@ejose19](https://togithub.com/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-support` for the fixes and enhancements listed here: [`@cspotcode/source-map-support` changelog](https://togithub.com/cspotcode/node-source-map-support/issues/24) - To ensure correct stack traces, all libraries must share a compatible sourcemap support implementation - Fix [#1363](https://togithub.com/TypeStrong/ts-node/issues/1363): REPL may erroneously combine previous input with next input, eval both as a single statement ([#1363](https://togithub.com/TypeStrong/ts-node/issues/1363), [#1480](https://togithub.com/TypeStrong/ts-node/issues/1480)) [@TheUnlocked](https://togithub.com/TheUnlocked) - For example, entering `100` on first line and `* 2` on second line would erronously be interpreted as `100 * 2` - REPL now ensures both lines are separate statements, both when typechecking and when evaluating - Fix [#1488](https://togithub.com/TypeStrong/ts-node/issues/1488): Node may log "circular dependency" warning when using `allowJs` ([#1488](https://togithub.com/TypeStrong/ts-node/issues/1488), [#1489](https://togithub.com/TypeStrong/ts-node/issues/1489)) - Fix [#1301](https://togithub.com/TypeStrong/ts-node/issues/1301): Filter empty strings from `TS_NODE_IGNORE` and `TS_NODE_IGNORE_DIAGNOSTICS`; treat empty environment variable as empty array ([#1301](https://togithub.com/TypeStrong/ts-node/issues/1301), [#1483](https://togithub.com/TypeStrong/ts-node/issues/1483)) [@ValeriaVG](https://togithub.com/ValeriaVG) - `TS_NODE_IGNORE= ts-node ./example.ts` will disable default ignore rules; will compile files in `./node_modules` **Docs** - Update VSCode debug configuration ([Docs](https://typestrong.org/ts-node/docs/recipes/visual-studio-code)) ([#1466](https://togithub.com/TypeStrong/ts-node/issues/1466)) - Update ESM-related messaging to clarify that experimental status is due to Node.js, not ts-node ([#1455](https://togithub.com/TypeStrong/ts-node/issues/1455)) - Refer to ts-node consistently ([#1481](https://togithub.com/TypeStrong/ts-node/issues/1481)) [@animafps](https://togithub.com/animafps) https://github.com/TypeStrong/ts-node/milestone/5 ### [`v10.2.1`](https://togithub.com/TypeStrong/ts-node/releases/v10.2.1) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.2.0...v10.2.1) **Fixed** - Fixes [#1426](https://togithub.com/TypeStrong/ts-node/issues/1426): Do not import typescript outside of configuration/project loading ([#1433](https://togithub.com/TypeStrong/ts-node/issues/1433), [#1426](https://togithub.com/TypeStrong/ts-node/issues/1426)) [@Songkeys](https://togithub.com/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`](https://togithub.com/TypeStrong/ts-node/releases/v10.2.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.1.0...v10.2.0) Questions about this release? Ask in the official discussion thread: [#1423](https://togithub.com/TypeStrong/ts-node/issues/1423) **Added** - Adds top-level await support to REPL ([#1383](https://togithub.com/TypeStrong/ts-node/issues/1383), [#245](https://togithub.com/TypeStrong/ts-node/issues/245)) [@ejose19](https://togithub.com/ejose19) - can be disabled with `--no-experimental-repl-await`, `experimentalReplAwait`, or `TS_NODE_EXPERIMENTAL_REPL_AWAIT` ([CLI docs](https://typestrong.org/ts-node/docs/options), [API docs](https://typestrong.org/ts-node/api/interfaces/CreateOptions.html#experimentalReplAwait)) - Setting `"pretty": false` disables pretty formatting of diagnostics even when stdout is a TTY ([#1418](https://togithub.com/TypeStrong/ts-node/issues/1418), [#1420](https://togithub.com/TypeStrong/ts-node/issues/1420)) [@elevatebart](https://togithub.com/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](https://togithub.com/TypeStrong/ts-node/issues/1396), [#1120](https://togithub.com/TypeStrong/ts-node/issues/1120), [#729](https://togithub.com/TypeStrong/ts-node/issues/729), [#850](https://togithub.com/TypeStrong/ts-node/issues/850), [#469](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/TypeStrong/ts-node/issues/1412), [#1405](https://togithub.com/TypeStrong/ts-node/issues/1405)) **Fixed** - Fix [#1397](https://togithub.com/TypeStrong/ts-node/issues/1397): SWC transpiler should emit ECMAScript imports and exports when configuration dictates ([#1409](https://togithub.com/TypeStrong/ts-node/issues/1409), [#1397](https://togithub.com/TypeStrong/ts-node/issues/1397)) - Enables SWC transpiler to be used alongside `--loader` - Fix [#1403](https://togithub.com/TypeStrong/ts-node/issues/1403): source-map-support breaks rendering of node errors ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1403](https://togithub.com/TypeStrong/ts-node/issues/1403)) - Fix [#1410](https://togithub.com/TypeStrong/ts-node/issues/1410): rendering of async stack frames should include `async` annotations ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1410](https://togithub.com/TypeStrong/ts-node/issues/1410)) - Fix [#1411](https://togithub.com/TypeStrong/ts-node/issues/1411): wrong order of process 'exit' event and logging unhandled exception ([#1405](https://togithub.com/TypeStrong/ts-node/issues/1405), [#1411](https://togithub.com/TypeStrong/ts-node/issues/1411)) - Fix [#1419](https://togithub.com/TypeStrong/ts-node/issues/1419): Should not throw `require.resolve` error when `@types/node` peerDependency is missing ([#1419](https://togithub.com/TypeStrong/ts-node/issues/1419), [#1422](https://togithub.com/TypeStrong/ts-node/issues/1422)) https://github.com/TypeStrong/ts-node/milestone/2 ### [`v10.1.0`](https://togithub.com/TypeStrong/ts-node/releases/v10.1.0) [Compare Source](https://togithub.com/TypeStrong/ts-node/compare/v10.0.0...v10.1.0) Questions about this release? Ask in the official discussion thread: [#1390](https://togithub.com/TypeStrong/ts-node/issues/1390) **Added** - Add `"moduleType"` option to override module type -- CommonJS or ECMAScript -- on select files. ([docs](https://typestrong.org/ts-node/docs/module-type-overrides)) ([#1342](https://togithub.com/TypeStrong/ts-node/issues/1342), [#1371](https://togithub.com/TypeStrong/ts-node/issues/1371), [#1376](https://togithub.com/TypeStrong/ts-node/issues/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](https://togithub.com/jayaddison) for help on test coverage - Implement `"extends"` support for `"ts-node"` options in `tsconfig.json` ([#1328](https://togithub.com/TypeStrong/ts-node/issues/1328), [#1356](https://togithub.com/TypeStrong/ts-node/issues/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](https://typestrong.org/ts-node/docs/options)) ([#1346](https://togithub.com/TypeStrong/ts-node/issues/1346), [#1367](https://togithub.com/TypeStrong/ts-node/issues/1367)) **Changed** - Improve error messages thrown by native ESM loader hooks ([#1357](https://togithub.com/TypeStrong/ts-node/issues/1357), [#1373](https://togithub.com/TypeStrong/ts-node/issues/1373)) [@tars0x9752](https://togithub.com/tars0x9752) - messages more closely match node; are more descriptive - Emit `"ts-node"` object at the top of `--showConfig` output instead of the bottom ([#1355](https://togithub.com/TypeStrong/ts-node/issues/1355)) **Fixed** - Fix [#1282](https://togithub.com/TypeStrong/ts-node/issues/1282): Set correct globals in `[stdin]`, `[eval]`, and `Configuration
📅 Schedule: At any time (no schedule defined).
🚦 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.
This PR has been generated by WhiteSource Renovate. View repository job log here.