Packages

ts-node

10.9.2 · 8 Dec 2023MIT60.2M / weekRepositoryHomepagenpmAtom feed

Your version

10.8.0

21 May 2022Where it was published

10.9.2 is the newest release of 10.x.

In short

3 new1 faster4 fixed9 changed

Release note

Questions about this release? Ask in the official discussion thread

Added

  • Added support for module=NodeNext, module=Node16, .mts, .cts, .mjs, and .cjs file extensions (#1414, #1694, #1744, #1745, #1727, #1717, #1753, #1757)

    • For best results, enable experimentalResolver (docs)

    • See TypeScript's official documentation: typescriptlang.org/docs/handbook/esm-node.html

    • enables mixed-mode projects with both ESM and CommonJS

    • enables all supported file extensions in TypeScript 4.7

    • Obeys package.json "type"

  • Added ability to include file extensions in CommonJS imports (#1727, #1753)

    • Enables consistency with ESM, where file extensions are often mandatory

  • Resolves from emitted to source file extensions (#1727, #1753)

    • Must enable experimentalResolver, will be enabled by default in a future version (docs)

    • Typechecker requires importing the emitted file extension; ts-node resolves correctly to the source file. E.g. import "./foo.js" will execute foo.ts See also: TypeScript issue #37582

    • If typechecking is disabled, you can also use source file extensions. E.g. import "./foo.ts"

  • Added experimentalSpecifierResolution (#1727, #1753)

    • the same as Node's --experimental-specifier-resolution (Node docs)

    • can also be specified in tsconfig.json for convenience, to avoid the CLI flag

    • allows omitting file extensions in ESM imports, plus a few other CommonJS-style conveniences

  • Adds diagnostics property to TSError, with array of TypeScript diagnostic objects from the compiler (API docs) (#1705, #1706)

Changed

  • Renames option experimentalResolverFeatures to experimentalResolver (docs)

  • Internal change to ESM loader for compatibility with forthcoming node versions: returns shortCircuit: true (#1714, #1715)

  • Performance: Optimize filesystem stat calls in ESM loader and new CommonJS resolver (#1758, #1759)

  • Performance, maintenance: Upgrade source-mapper dependency "@cspotcode/source-map-support"

    • Switches to "trace-mapping" for underlying source-map parsing

Fixed

  • Fixed bug where REPL .type command was not showing any type information when using TypeScript nightly builds (#1761, #1762)

  • Correctly suppress "Custom ESM Loaders" warning on newer node versions where the warning's prose changed

  • Fixed REPL bug where function signatures could not be entered across multiple lines (#1667, #1677)

  • REPL treats unparenthesized object literals as objects, instead of as block scopes (#1697, #1699)

  • Fixed bug where preferTsExts combined with third-party transpiler hooks could disrupt nyc code coverage

  • Fixed bug where file:// URLs in stack traces did not always use percent-encoding (#1738, #1726, #1729)

  • Fixed bug where v8-compile-cache-lib did not correctly unhook itself (#1717, #1718, #1719)

    • This internal dependency is used to speed up loading the TypeScript compiler

Docs

  • Many docs improvements

  • Options page: each option its own linkable header w/usage example

  • Categorize APIs in typedoc, make entrypoints more prominent

  • Clarify that the shorthand for --project is -P, not -p (#1731, #1734)

  • Add common ESM errors to Troubleshooting page

v10.7.0...v10.8.0
github.com/TypeStrong/ts-node/milestone/12