TypeScript execution and REPL for node.js
Fixed
https://github.com/TypeStrong/ts-node/compare/v10.3.0...v10.3.1 https://github.com/TypeStrong/ts-node/milestone/7
Questions about this release? Ask in the official discussion thread: #1507
Added
util.promisify(setTimeout)(1000)
or fs.readFileSync('example.txt')
createEsmHooks()
function to create ESM loader hooks (API docs) (#1439) @nonara
register()
accepts a ts-node Service
(API docs) (#1474)
register(options)
is still supported; no breaking changes--emit
to --help
output (#1400, #1484) @markbradley27Changed
require('source-map-support')
, they will be redirected to @cspotcode/source-map-support
Fixed
source-map-support
instead of @cspotcode/source-map-support
(#1440, #1441, #1438, #1495, cspotcode/node-source-map-support#23, #1496, #1497) @ejose19
require('source-map-support')
, they will be redirected to @cspotcode/source-map-support
@cspotcode/source-map-support
for the fixes and enhancements listed here: @cspotcode/source-map-support
changelog
100
on first line and * 2
on second line would erronously be interpreted as 100 * 2
allowJs
(#1488, #1489)TS_NODE_IGNORE
and TS_NODE_IGNORE_DIAGNOSTICS
; treat empty environment variable as empty array (#1301, #1483) @ValeriaVG
TS_NODE_IGNORE= ts-node ./example.ts
will disable default ignore rules; will compile files in ./node_modules
Docs
https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.3.0 https://github.com/TypeStrong/ts-node/milestone/5
Fixed
https://github.com/TypeStrong/ts-node/compare/v10.2.0...v10.2.1 https://github.com/TypeStrong/ts-node/milestone/6
Questions about this release? Ask in the official discussion thread: #1423
Added
"pretty": false
disables pretty formatting of diagnostics even when stdout is a TTY (#1418, #1420) @elevatebart
pretty
option, not to be confused with TypeScript's pretty
optionconst foo = 1
in the REPL, foo
is unused. We ignore the resulting diagnostic foo is declared but its value is never read
Fixed
--loader
async
annotations (#1405, #1410)require.resolve
error when @types/node
peerDependency is missing (#1419, #1422)https://github.com/TypeStrong/ts-node/compare/v10.1.0...v10.2.0 https://github.com/TypeStrong/ts-node/milestone/2
Questions about this release? Ask in the official discussion thread: #1390
Added
"moduleType"
option to override module type -- CommonJS or ECMAScript -- on select files. (docs) (#1342, #1371, #1376)
webpack.config.ts
, must execute as CommonJS but the rest of the project is ESMpackage.json
"type"
and tsconfig.json
"module"
.cjs
and .mjs
extensions, but for .ts
and .tsx
files"extends"
support for "ts-node"
options in tsconfig.json
(#1328, #1356)
"ts-node": {}
options will be parsed from extended tsconfigsscope
and scopeDir
; add both to CLI and tsconfig.json
options; un-deprecate TS_NODE_SCOPE
env var; add TS_NODE_SCOPE_DIR
env var (docs) (#1346, #1367)Changed
"ts-node"
object at the top of --showConfig
output instead of the bottom (#1355)Fixed
[stdin]
, [eval]
, and <repl>
contexts (#1333)
ts-node -e
__filename
, __dirname
, module
and sub-fields of module
, exports
, and builtin module aliases fs
, etckeepClassNames
to true
(#1344)Docs
node --loader ts-node/esm
(docs) (#1379)https://github.com/TypeStrong/ts-node/compare/v10.0.0...v10.1.0 https://github.com/TypeStrong/ts-node/milestone/3
Questions about this release? Ask in the official discussion thread: #1337
Breaking changes are prefixed with [BREAKING]
Added
--show-config
to log the resolved configuration (docs) (#1100, #1243)swc
integration and new --transpiler
option to use third-party transpilers for a massive speed boost on large codebases (docs) (#779, #1160)scopeDir
API option (docs) (#1155)projectSearchDir
API option (docs) (#1155)--cwd-mode
and ts-node-cwd
to resolve config file relative to cwd, not entrypoint script (#1155)Changed
--script-mode
default behavior; resolve tsconfig relative to entrypoint script instead of cwd (#949, #1197, #1155)
$PATH
, because ts-node
will respect the script's local tsconfig.json
--cwd-mode
or ts-node-cwd
if you need legacy behaviorignore
rules evaluate relative to tsconfig.json
directory, otherwise cwd
(#1155)--dir
to --cwd
; rename TS_NODE_DIR
to TS_NODE_CWD
(#1155)
--dir
and TS_NODE_DIR
are deprecated but still parsed for backwards-compatibility--dir
effectively changed the working directory of ts-node
; renaming makes this behavior more obviousDeprecated
TS_NODE_SCOPE
(#1155)--dir
and TS_NODE_DIR
(#1155)Removed
DEFAULTS
, normalizeSlashes
, parse
, split
ts-node
's programmatic APIFixed
ERR_REQUIRE_ESM
when attempting to execute ESM as CJS, even when not using --loader ts-node/esm
(#1232)
node
compiler
is loaded relative to tsconfig.json
instead of entrypoint script (#1155)
ts-node ./index
may execute the wrong file extension because tsconfig search poisons the require.resolve
cache (#1155)Docs
CONTRIBUTING.md
to document the codebase and our development workflowhttps://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.0.0 https://github.com/TypeStrong/ts-node/milestone/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
Added
--typeCheck
flag to override --transpileOnly
flag specified in tsconfig.json
(#1142)Changed
Register
to Service
. It is still aliased as Register
for backwards compatibility (#1158)Fixed
--es-module-specifier-resolution
as an alias of --experimental-specifier-resolution
for node 12 compatibility (#1122) @nguyensomniacDocs
ts-node-dev
in README (#1131) @iamandrewlucatransformers
description to clarify incompatibility with transpileOnly
(#1123)Misc
https://github.com/TypeStrong/ts-node/compare/v9.0.0...v9.1.0
Breaking changes are labelled [BREAKING] below.
Added
ERR_REQUIRE_ESM
when a file is require()
d which should be loaded as ESM (#1031)"exports"
declaration to package.json in backwards-compatible way, enabling node --loader ts-node/esm
without file extension (#1028)"require"
option via tsconfig (#925)NODE_NO_READLINE
environment variable (#1090)node --loader ts-node/esm/transpile-only
(#1102) @concisionChanged
Fixed
realpath
, which should fix workflows that use symlinks, such as pnpm
, Lerna workspaces, or other mono-repo configurations (#970)node_modules
when --skip-ignore
or --ignore
options are configured to allow it (#970)getSourceFileNames
/rootNames
(#999)projectVersion
every time getSourceFileNames
changes, avoiding accidentally outdated typechecking (#998)ts.transpileModule
(#1054) @thetutlage--experimental-specifier-resolution
coming from NODE_OPTIONS
in ESM loader (#1085) @evg656e.cjs
, .mjs
, and any unexpected file extensions (#1103) @concisionDocs
Misc
https://github.com/TypeStrong/ts-node/compare/v8.10.2...v9.0.0
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 install
ed ts-node (#1032)
Run CI tests on Windows (#1041)
Run CI only once per commit on pull requests and master (#1042)