Addono / container-registry-proxy

A proxy for modifying modifying requests to Docker-compatible container requests on the fly. Bring your own custom behaviour through an extensive plugin-system.
https://github.com/Addono/container-registry-proxy
MIT License
12 stars 2 forks source link

Upgrade ts-node: 9.1.1 → 10.8.1 (major) #347

Closed depfu[bot] closed 2 years ago

depfu[bot] commented 2 years ago

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

What changed?

✳️ ts-node (9.1.1 → 10.8.1) · Repo

Release Notes

10.8.1

Fixed

  • Fixed #1769: source URLs in source map cache were malformed on Windows, affecting code coverage reports (#1769, #1771) @cspotcode
  • Fixed #1778: typechecker was erronously resolving imports from ESM files as if they were from CJS files (#1778, #1782) @cspotcode

v10.8.0...v10.8.1
https://github.com/TypeStrong/ts-node/milestone/14

10.8.0

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

Added

  • Added support for module=NodeNext, module=Node16, .mts, .cts, .mjs, and .cjs file extensions (#1414, #1694, #1744, #1745, #1727, #1717, #1753, #1757) @cspotcode
  • Added ability to include file extensions in CommonJS imports (#1727, #1753) @cspotcode
    • Enables consistency with ESM, where file extensions are often mandatory
  • Resolves from emitted to source file extensions (#1727, #1753) @cspotcode
    • 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) @cspotcode
    • 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) @paulbrimicombe

Changed

  • Renames option experimentalResolverFeatures to experimentalResolver (docs) (#1727) @cspotcode
  • Internal change to ESM loader for compatibility with forthcoming node versions: returns shortCircuit: true (#1714, #1715) @cspotcode
  • Performance: Optimize filesystem stat calls in ESM loader and new CommonJS resolver (#1758, #1759) @cspotcode
  • Performance, maintenance: Upgrade source-mapper dependency "@cspotcode/source-map-support"
    • Switches to "trace-mapping" for underlying source-map parsing (#1729) @cspotcode

Fixed

  • Fixed bug where REPL .type command was not showing any type information when using TypeScript nightly builds (#1761, #1762) @cspotcode
  • Correctly suppress "Custom ESM Loaders" warning on newer node versions where the warning's prose changed (#1701) @cspotcode
  • Fixed REPL bug where function signatures could not be entered across multiple lines (#1667, #1677) @d9k
  • REPL treats unparenthesized object literals as objects, instead of as block scopes (#1697, #1699) @jhmaster2000
  • Fixed bug where preferTsExts combined with third-party transpiler hooks could disrupt nyc code coverage (#1755) @cspotcode
  • Fixed bug where file:// URLs in stack traces did not always use percent-encoding (#1738, #1726, #1729) @cspotcode
  • Fixed bug where v8-compile-cache-lib did not correctly unhook itself (#1717, #1718, #1719) @cspotcode
    • This internal dependency is used to speed up loading the TypeScript compiler

Docs

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

10.7.0

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

Added

  • Adds --esm flag, option, and ts-node-esm binary (#1258, #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, #1665) @Jamesernator
    • no longer requires --experimental-json-modules
  • Lazy-load dependencies to improve startup responsiveness. (#1676)

Fixed

  • Fixed bug where "compiler", "transpiler", and swc backend would not resolve relative to the tsconfig.json that declared them (#1662, #1655)
    • Enables reusable tsconfig.json shared via node module to include necessary dependencies

v10.6.0...v10.7.0
https://github.com/TypeStrong/ts-node/milestone/11

10.6.0

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

Added

  • Adds workaround for extensionless entrypoints with ESM loader (#1649, #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
    • Some tools, for example mocha, have an extensionless entrypoint. (source, source)
    • Combining NODE_OPTIONS=--loader ts-node/esm with these tools causes this error. mochajs/mocha#4645
    • node intends to fix this bug in a future release: nodejs/node#41711
    • In the interim, we have implemented a workaround in ts-node.
  • Adds support for target "ES2022" in moduleTypes overrides (#1650)

Fixed

  • Fixed bug where --swc and other third-party transpilers did not respect moduleTypes overrides (#1651, #1652, #1660)
  • Fixed bug where node flags were not preserved correctly in process.execArgv (#1657, #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, #1648)

v10.5.0...v10.6.0
https://github.com/TypeStrong/ts-node/milestone/9

10.5.0

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

Added

  • Eliminate "Emit Skipped" errors (#693, #1345, #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
  • Graduate swc transpiler out of experimental; add swc: true convenience option (docs) (#1487, #1536, #1613, #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, #1627)
    • global fallback only occurs when using a global installation of ts-node
  • Add support for TypeScript's traceResolution output (docs) (#1128, #1491) @TheUnlocked
  • Support import assertions in ESM loader (docs) (#1557, #1558, #1559, #1573) @Pokute, @geigerzaehler
    • Allows importing JSON files from ESM with the requisite flag (docs)
  • 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, #1620)
  • Add swc target "es2022" (#1535, #1540)
    • When you have target es2022 in tsconfig, will use swc's es2022 target

Changed

  • Initialize TypeScript compiler before starting REPL prompt (#1498) @TheUnlocked
    • Improves responsiveness for first line of REPL input
  • Use v8-compile-cache-lib to load typescript
  • Support both --camelCase and --hyphen-case for all CLI flags; update documentation to use --camelCase (#1598, #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)

Fixed

  • Fix #1538: REPL inputs fail to transpile via swc (#1538, #1541, #1602)
  • Fix #1478: REPL erroneously logged undefined for all inputs after the first when using swc transpiler (#1478, #1580, #1602)
  • Fix #1389: In --showConfig output, emit accurate moduleTypes paths resolved relative to the tsconfig.json which declared them (#1389, #1619)
  • Fix: Remove indentation from ts-node --help output (#1597, #1600)
  • Fix #1425: Merged definitions correctly into tsconfig.schemastore-schema.json (#1425, #1618)
  • Fix: Allow disabling "use strict" emit in SWC transpiler (#1531, #1537)
  • Fix: Add missing ERR_UNKNOWN_FILE_EXTENSION constructor; was throwing ERR_UNKNOWN_FILE_EXTENSION is not a constructor (#1562) @bluelovers
  • Fix #1565: entrypoint resolution failed on node v12.0.x and v12.1.x (#1565, #1566) @davidmurdoch

Docs

Misc

  • Adds experimental experimentalResolverFeatures option, but it does not do anything yet (#1514, #1614)

v10.4.0...v10.5.0
https://github.com/TypeStrong/ts-node/milestone/4

10.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

v10.3.1...v10.4.0
https://github.com/TypeStrong/ts-node/milestone/8

10.3.1

Fixed

v10.3.0...v10.3.1
https://github.com/TypeStrong/ts-node/milestone/7

10.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) or fs.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-node Service (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 --emit to --help output (#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-support instead 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-support for the fixes and enhancements listed here: @cspotcode/source-map-support changelog
    • To ensure correct stack traces, all libraries must share a compatible sourcemap support implementation
  • Fix #1363: REPL may erroneously combine previous input with next input, eval both as a single statement (#1363, #1480) @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: Node may log "circular dependency" warning when using allowJs (#1488, #1489)
  • Fix #1301: Filter empty strings from 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

  • 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

v10.2.1...v10.3.0
https://github.com/TypeStrong/ts-node/milestone/5

10.2.1

Fixed

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

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

10.2.0

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

Added

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

Fixed

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

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

10.1.0

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

Added

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

Changed

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

Fixed

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

Docs

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

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

10.0.0

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

Breaking changes are prefixed with [BREAKING]

Added

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

Changed

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

Deprecated

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

Removed

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

Fixed

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

Docs

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

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

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

Commits

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


Depfu Status

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

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

Codecov Report

Merging #347 (a973cd2) into main (d8b1702) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #347   +/-   ##
=======================================
  Coverage   60.97%   60.97%           
=======================================
  Files           3        3           
  Lines          41       41           
  Branches        9        7    -2     
=======================================
  Hits           25       25           
  Misses         16       16           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d8b1702...a973cd2. Read the comment docs.

depfu[bot] commented 2 years ago

Closed in favor of #353.