-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow JSON imports in NodeJS 16.15 #1792
Conversation
Thanks, seems simple enough. Was this mentioned in the nodejs 16.15 changelog? Would be nice to keep a link to that changelog somewhere, in case questions arise in the future. |
Codecov Report
|
Awesome, thanks! We run our tests against a bunch of node versions to test stuff like this, and we conditionally check the node version in the tests to figure out what we should test. Here is the test for JSON imports, where we check the node version. Depending on the check, we either pass ts-node/src/test/esm-loader.spec.ts Lines 270 to 306 in 17aad13
Can you also update that version check in the tests? Most of the version checks are declared as boolean exports from helpers.ts, like this: Lines 60 to 78 in 17aad13
Can we move this version check into that file? Can be named something like |
Looks like the Lines 67 to 70 in 17aad13
|
Tests on node nightly are failing due to a node bug; you can safely ignore those test failures. |
Test updates completed -- I opted for the variable name |
Hey there! Just checking in to see if this needs anything more from my end, or if we're just waiting on review? |
@queengooborg Merged and will go out in the next release. Thanks! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-node](https://typestrong.org/ts-node) ([source](https://github.com/TypeStrong/ts-node)) | devDependencies | patch | [`10.8.1` -> `10.8.2`](https://renovatebot.com/diffs/npm/ts-node/10.8.1/10.8.2) | --- ### Release Notes <details> <summary>TypeStrong/ts-node</summary> ### [`v10.8.2`](https://github.com/TypeStrong/ts-node/releases/tag/v10.8.2) [Compare Source](TypeStrong/ts-node@v10.8.1...v10.8.2) **Fixed** - Revert "Use file URL for source map paths" ([#​1821](TypeStrong/ts-node#1821)) [@​cspotcode](https://github.com/cspotcode) - Fixes [#​1790](TypeStrong/ts-node#1790): ts-node 10.8.1 regression where `nyc` code coverage reports had incorrect paths - Fixes [#​1797](TypeStrong/ts-node#1797): ts-node 10.8.1 regression where breakpoints did not hit in VSCode debugging - Allow JSON imports in node 16.15 and up ([#​1792](TypeStrong/ts-node#1792)) [@​queengooborg](https://github.com/queengooborg) - JSON imports were already supported in v17.5 and up - this change extends support to >=16.15.0,<17.0.0 - These version ranges match vanilla node's support for JSON imports https://github.com/TypeStrong/ts-node/milestone/15?closed=1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1446 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
This PR is a quick fix that enables JSON module support by default in NodeJS v16.15 < v17 as well as v17.5 and up. The version number was selected based upon prior manual testing to determine when JSON module support was enabled by default.
This change was tested by attempting to run a script that uses a JSON import and performing the same tweak directly in
node_modules
.