Skip to content

Commit a1c1cf6

Browse files
committed
chore: fix build error
1 parent 9268daa commit a1c1cf6

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@pkgr/rollup": "^6.0.0",
6666
"@swc-node/register": "^1.10.10",
6767
"@types/jest": "^29.5.14",
68-
"@types/node": "^20.17.24",
68+
"@types/node": "^22.13.11",
6969
"@unts/patch-package": "^8.1.1",
7070
"clean-pkg-json": "^1.2.1",
7171
"concurrently": "^9.1.2",

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import module from 'node:module'
44
import path from 'node:path'
55
import { fileURLToPath, pathToFileURL } from 'node:url'
66
import {
7-
MessageChannel,
8-
MessagePort,
7+
type MessagePort,
98
type TransferListItem,
9+
MessageChannel,
1010
Worker,
1111
parentPort,
1212
receiveMessageOnPort,
@@ -60,7 +60,7 @@ const {
6060
export const MTS_SUPPORTED_NODE_VERSION = 16
6161
export const LOADER_SUPPORTED_NODE_VERSION = 20
6262
export const TYPESCRIPT_DEFAULT_NODE_VERSION = 23.6
63-
export const TYPESCRIPT_SUPPORTED_NODE_VERSION = 22.10
63+
export const TYPESCRIPT_SUPPORTED_NODE_VERSION = 22.1
6464

6565
const NODE_TYPESCRIPT = process.features.typescript
6666
const NODE_VERSION = Number.parseFloat(process.versions.node)
@@ -221,13 +221,13 @@ const setupTsRunner = (
221221

222222
switch (tsRunner) {
223223
case TsRunner.Node: {
224-
if (typeof NODE_TYPESCRIPT === 'undefined') {
224+
if (!NODE_TYPESCRIPT) {
225225
throw new Error(
226226
'type stripping is not supported in this node version',
227227
)
228228
}
229229
execArgv = [
230-
'--experimental-transform-types',
230+
'--experimental-transform-types',
231231
...(NODE_VERSION >= TYPESCRIPT_DEFAULT_NODE_VERSION
232232
? execArgv.filter(arg => arg !== '--no-experimental-strip-types')
233233
: execArgv),

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MessagePort } from 'node:worker_threads'
1+
import type { MessagePort } from 'node:worker_threads'
22

33
// eslint-disable-next-line @typescript-eslint/no-explicit-any
44
export type AnyFn<R = any, T extends any[] = any[]> = (...args: T) => R

yarn.lock

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4829,12 +4829,12 @@ __metadata:
48294829
languageName: node
48304830
linkType: hard
48314831

4832-
"@types/node@npm:*, @types/node@npm:^22.0.0":
4833-
version: 22.13.10
4834-
resolution: "@types/node@npm:22.13.10"
4832+
"@types/node@npm:*, @types/node@npm:^22.0.0, @types/node@npm:^22.13.11":
4833+
version: 22.13.11
4834+
resolution: "@types/node@npm:22.13.11"
48354835
dependencies:
48364836
undici-types: "npm:~6.20.0"
4837-
checksum: 10c0/a3865f9503d6f718002374f7b87efaadfae62faa499c1a33b12c527cfb9fd86f733e1a1b026b80c5a0e4a965701174bc3305595a7d36078aa1abcf09daa5dee9
4837+
checksum: 10c0/f6ee33d36372242535c38640fe7550a6640d8a775ec19b55bfc11775b521cba072d892ca92a912332ce01b317293d645c1bf767f3f882ec719f2404a3d2a5b96
48384838
languageName: node
48394839
linkType: hard
48404840

@@ -4845,15 +4845,6 @@ __metadata:
48454845
languageName: node
48464846
linkType: hard
48474847

4848-
"@types/node@npm:^20.17.24":
4849-
version: 20.17.24
4850-
resolution: "@types/node@npm:20.17.24"
4851-
dependencies:
4852-
undici-types: "npm:~6.19.2"
4853-
checksum: 10c0/2a39ce4c4cd4588a05b2a485cc0a1407cbea608dd1ab03e36add59d61712718d95c84b492ca5190753f0be2bce748aeeb0f2a1412e712775462befe3820b3ff9
4854-
languageName: node
4855-
linkType: hard
4856-
48574848
"@types/normalize-package-data@npm:^2.4.3":
48584849
version: 2.4.4
48594850
resolution: "@types/normalize-package-data@npm:2.4.4"
@@ -15575,7 +15566,7 @@ __metadata:
1557515566
"@pkgr/rollup": "npm:^6.0.0"
1557615567
"@swc-node/register": "npm:^1.10.10"
1557715568
"@types/jest": "npm:^29.5.14"
15578-
"@types/node": "npm:^20.17.24"
15569+
"@types/node": "npm:^22.13.11"
1557915570
"@unts/patch-package": "npm:^8.1.1"
1558015571
clean-pkg-json: "npm:^1.2.1"
1558115572
concurrently: "npm:^9.1.2"
@@ -16132,13 +16123,6 @@ __metadata:
1613216123
languageName: node
1613316124
linkType: hard
1613416125

16135-
"undici-types@npm:~6.19.2":
16136-
version: 6.19.8
16137-
resolution: "undici-types@npm:6.19.8"
16138-
checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344
16139-
languageName: node
16140-
linkType: hard
16141-
1614216126
"undici-types@npm:~6.20.0":
1614316127
version: 6.20.0
1614416128
resolution: "undici-types@npm:6.20.0"

0 commit comments

Comments
 (0)