Skip to content

Commit b16134b

Browse files
update version checks for v16 (#1522)
* update version checks for v16 Ref: nodejs/node#40504 * add test to check old ESM Loader Hooks API on v16.11.1 * fix wrong version number
1 parent 3b40365 commit b16134b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/continuous-integration.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
matrix:
4949
os: [ubuntu, windows]
5050
# Don't forget to add all new flavors to this list!
51-
flavor: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
51+
flavor: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
5252
include:
5353
# Node 12.15
5454
# 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
@@ -94,26 +94,33 @@ jobs:
9494
typescript: next
9595
typescriptFlag: next
9696
# Node 16
97+
# Node 16.11.1
98+
# Earliest version that supports old ESM Loader Hooks API: https://github.com/TypeStrong/ts-node/pull/1522
9799
- flavor: 8
100+
node: 16.11.1
101+
nodeFlag: 16_11_1
102+
typescript: latest
103+
typescriptFlag: latest
104+
- flavor: 9
98105
node: 16
99106
nodeFlag: 16
100107
typescript: latest
101108
typescriptFlag: latest
102109
downgradeNpm: true
103-
- flavor: 9
110+
- flavor: 10
104111
node: 16
105112
nodeFlag: 16
106113
typescript: 2.7
107114
typescriptFlag: 2_7
108115
downgradeNpm: true
109-
- flavor: 10
116+
- flavor: 11
110117
node: 16
111118
nodeFlag: 16
112119
typescript: next
113120
typescriptFlag: next
114121
downgradeNpm: true
115122
# Node nightly
116-
- flavor: 11
123+
- flavor: 12
117124
node: nightly
118125
nodeFlag: nightly
119126
typescript: latest

src/esm.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export function createEsmHooks(tsNodeService: Service) {
5454
});
5555

5656
// The hooks API changed in node version X so we need to check for backwards compatibility.
57-
// TODO: When the new API is backported to v12, v14, v16, update these version checks accordingly.
57+
// TODO: When the new API is backported to v12, v14, update these version checks accordingly.
5858
const newHooksAPI =
5959
versionGteLt(process.versions.node, '17.0.0') ||
60-
versionGteLt(process.versions.node, '16.999.999', '17.0.0') ||
60+
versionGteLt(process.versions.node, '16.12.0', '17.0.0') ||
6161
versionGteLt(process.versions.node, '14.999.999', '15.0.0') ||
6262
versionGteLt(process.versions.node, '12.999.999', '13.0.0');
6363

0 commit comments

Comments
 (0)