Skip to content
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

update version checks for v16 #1522

Merged
merged 3 commits into from Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -48,7 +48,7 @@ jobs:
matrix:
os: [ubuntu, windows]
# Don't forget to add all new flavors to this list!
flavor: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
flavor: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
include:
# Node 12.15
# TODO Add comments about why we test 12.15; I think git blame says it's because of an ESM behavioral change that happened at 12.16
Expand Down Expand Up @@ -94,26 +94,33 @@ jobs:
typescript: next
typescriptFlag: next
# Node 16
# Node 16.11.1
# Earliest version that supports old ESM Loader Hooks API: https://github.com/TypeStrong/ts-node/pull/1522
- flavor: 8
node: 16.11.1
nodeFlag: 16_11_1
typescript: latest
typescriptFlag: latest
- flavor: 9
node: 16
nodeFlag: 16
typescript: latest
typescriptFlag: latest
downgradeNpm: true
- flavor: 9
- flavor: 10
node: 16
nodeFlag: 16
typescript: 2.7
typescriptFlag: 2_7
downgradeNpm: true
- flavor: 10
- flavor: 11
node: 16
nodeFlag: 16
typescript: next
typescriptFlag: next
downgradeNpm: true
# Node nightly
- flavor: 11
- flavor: 12
node: nightly
nodeFlag: nightly
typescript: latest
Expand Down
4 changes: 2 additions & 2 deletions src/esm.ts
Expand Up @@ -54,10 +54,10 @@ export function createEsmHooks(tsNodeService: Service) {
});

// The hooks API changed in node version X so we need to check for backwards compatibility.
// TODO: When the new API is backported to v12, v14, v16, update these version checks accordingly.
// TODO: When the new API is backported to v12, v14, update these version checks accordingly.
const newHooksAPI =
versionGteLt(process.versions.node, '17.0.0') ||
versionGteLt(process.versions.node, '16.999.999', '17.0.0') ||
versionGteLt(process.versions.node, '16.20.0', '17.0.0') ||
shrujalshah28 marked this conversation as resolved.
Show resolved Hide resolved
versionGteLt(process.versions.node, '14.999.999', '15.0.0') ||
versionGteLt(process.versions.node, '12.999.999', '13.0.0');

Expand Down