Skip to content

Commit 1da4200

Browse files
committed
Declare scripts as an ESM package
1 parent 7f37b5e commit 1da4200

File tree

4 files changed

+16
-141
lines changed

4 files changed

+16
-141
lines changed

tools/scripts/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"name": "scripts",
33
"version": "0.31.25",
44
"private": true,
5+
"type": "module",
56
"scripts": {
67
"resolve-workspace-deps": "run-s .:resolve-workspace-deps:run-script .:resolve-workspace-deps:update-lockfile .:resolve-workspace-deps:git-commit",
7-
".:resolve-workspace-deps:run-script": "ts-node src/resolve-workspace-deps.ts",
8+
".:resolve-workspace-deps:run-script": "node src/resolve-workspace-deps.ts",
89
".:resolve-workspace-deps:update-lockfile": "cross-env YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn",
910
".:resolve-workspace-deps:git-commit": "git -c user.name='Rocket.Chat' -c user.email='[email protected]' commit --all --amend --no-edit --no-verify",
1011
"lint": "eslint .",
@@ -18,7 +19,9 @@
1819
"fast-glob": "~3.3.3",
1920
"npm-run-all": "^4.1.5",
2021
"prettier": "~3.6.2",
21-
"ts-node": "~10.9.2",
2222
"typescript": "~5.9.3"
23+
},
24+
"volta": {
25+
"extends": "../../package.json"
2326
}
2427
}

tools/scripts/src/resolve-workspace-deps.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { readFile, writeFile } from 'fs/promises';
2-
import { join } from 'path';
1+
import { readFile, writeFile } from 'node:fs/promises';
2+
import { dirname, join } from 'node:path';
3+
import { fileURLToPath } from 'node:url';
34

45
import fg from 'fast-glob';
56

6-
const rootDir = join(__dirname, '../../..');
7+
const rootDir = join(dirname(fileURLToPath(import.meta.url)), '../../..');
78

89
type PackageList = {
910
[packageName: string]: string;

tools/scripts/tsconfig.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"target": "ES2015",
5-
"module": "CommonJS",
6-
"lib": ["ES2020"],
7-
"declaration": true,
8-
"declarationMap": true,
9-
"sourceMap": true,
10-
"esModuleInterop": true,
11-
"skipLibCheck": true,
12-
"forceConsistentCasingInFileNames": true,
13-
"moduleResolution": "node",
14-
"resolveJsonModule": true
4+
"target": "es2024",
5+
"module": "nodenext",
6+
"moduleResolution": "nodenext",
157
}
168
}

yarn.lock

Lines changed: 4 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,15 +2108,6 @@ __metadata:
21082108
languageName: node
21092109
linkType: hard
21102110

2111-
"@cspotcode/source-map-support@npm:^0.8.0":
2112-
version: 0.8.1
2113-
resolution: "@cspotcode/source-map-support@npm:0.8.1"
2114-
dependencies:
2115-
"@jridgewell/trace-mapping": "npm:0.3.9"
2116-
checksum: 10/b6e38a1712fab242c86a241c229cf562195aad985d0564bd352ac404be583029e89e93028ffd2c251d2c407ecac5fb0cbdca94a2d5c10f29ac806ede0508b3ff
2117-
languageName: node
2118-
linkType: hard
2119-
21202111
"@csstools/cascade-layer-name-parser@npm:^2.0.5":
21212112
version: 2.0.5
21222113
resolution: "@csstools/cascade-layer-name-parser@npm:2.0.5"
@@ -3335,7 +3326,7 @@ __metadata:
33353326
languageName: node
33363327
linkType: hard
33373328

3338-
"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0":
3329+
"@jridgewell/resolve-uri@npm:^3.1.0":
33393330
version: 3.1.2
33403331
resolution: "@jridgewell/resolve-uri@npm:3.1.2"
33413332
checksum: 10/97106439d750a409c22c8bff822d648f6a71f3aa9bc8e5129efdc36343cd3096ddc4eeb1c62d2fe48e9bdd4db37b05d4646a17114ecebd3bbcacfa2de51c3c1d
@@ -3373,16 +3364,6 @@ __metadata:
33733364
languageName: node
33743365
linkType: hard
33753366

3376-
"@jridgewell/trace-mapping@npm:0.3.9":
3377-
version: 0.3.9
3378-
resolution: "@jridgewell/trace-mapping@npm:0.3.9"
3379-
dependencies:
3380-
"@jridgewell/resolve-uri": "npm:^3.0.3"
3381-
"@jridgewell/sourcemap-codec": "npm:^1.4.10"
3382-
checksum: 10/83deafb8e7a5ca98993c2c6eeaa93c270f6f647a4c0dc00deb38c9cf9b2d3b7bf15e8839540155247ef034a052c0ec4466f980bf0c9e2ab63b97d16c0cedd3ff
3383-
languageName: node
3384-
linkType: hard
3385-
33863367
"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9":
33873368
version: 0.3.25
33883369
resolution: "@jridgewell/trace-mapping@npm:0.3.25"
@@ -6720,34 +6701,6 @@ __metadata:
67206701
languageName: node
67216702
linkType: hard
67226703

6723-
"@tsconfig/node10@npm:^1.0.7":
6724-
version: 1.0.8
6725-
resolution: "@tsconfig/node10@npm:1.0.8"
6726-
checksum: 10/b8d5fffbc6b17ef64ef74f7fdbccee02a809a063ade785c3648dae59406bc207f70ea2c4296f92749b33019fa36a5ae716e42e49cc7f1bbf0fd147be0d6b970a
6727-
languageName: node
6728-
linkType: hard
6729-
6730-
"@tsconfig/node12@npm:^1.0.7":
6731-
version: 1.0.9
6732-
resolution: "@tsconfig/node12@npm:1.0.9"
6733-
checksum: 10/a01b2400ab3582b86b589c6d31dcd0c0656f333adecde85d6d7d4086adb059808b82692380bb169546d189bf771ae21d02544a75b57bd6da4a5dd95f8567bec9
6734-
languageName: node
6735-
linkType: hard
6736-
6737-
"@tsconfig/node14@npm:^1.0.0":
6738-
version: 1.0.1
6739-
resolution: "@tsconfig/node14@npm:1.0.1"
6740-
checksum: 10/976345e896c0f059867f94f8d0f6ddb8b1844fb62bf36b727de8a9a68f024857e5db97ed51d3325e23e0616a5e48c034ff51a8d595b3fe7e955f3587540489be
6741-
languageName: node
6742-
linkType: hard
6743-
6744-
"@tsconfig/node16@npm:^1.0.2":
6745-
version: 1.0.2
6746-
resolution: "@tsconfig/node16@npm:1.0.2"
6747-
checksum: 10/ca94d3639714672bbfd55f03521d3f56bb6a25479bd425da81faf21f13e1e9d15f40f97377dedbbf477a5841c5b0c8f4cd1b391f33553d750b9202c54c2c07aa
6748-
languageName: node
6749-
linkType: hard
6750-
67516704
"@tybys/wasm-util@npm:^0.9.0":
67526705
version: 0.9.0
67536706
resolution: "@tybys/wasm-util@npm:0.9.0"
@@ -8026,7 +7979,7 @@ __metadata:
80267979
languageName: node
80277980
linkType: hard
80287981

8029-
"acorn-walk@npm:^8.0.0, acorn-walk@npm:^8.1.1":
7982+
"acorn-walk@npm:^8.0.0":
80307983
version: 8.3.4
80317984
resolution: "acorn-walk@npm:8.3.4"
80327985
dependencies:
@@ -8035,7 +7988,7 @@ __metadata:
80357988
languageName: node
80367989
linkType: hard
80377990

8038-
"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.12.1, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.4.1, acorn@npm:^8.8.2":
7991+
"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.12.1, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.8.2":
80397992
version: 8.15.0
80407993
resolution: "acorn@npm:8.15.0"
80417994
bin:
@@ -8224,13 +8177,6 @@ __metadata:
82248177
languageName: node
82258178
linkType: hard
82268179

8227-
"arg@npm:^4.1.0":
8228-
version: 4.1.3
8229-
resolution: "arg@npm:4.1.3"
8230-
checksum: 10/969b491082f20cad166649fa4d2073ea9e974a4e5ac36247ca23d2e5a8b3cb12d60e9ff70a8acfe26d76566c71fd351ee5e6a9a6595157eb36f92b1fd64e1599
8231-
languageName: node
8232-
linkType: hard
8233-
82348180
"argparse@npm:^1.0.7":
82358181
version: 1.0.10
82368182
resolution: "argparse@npm:1.0.10"
@@ -9630,13 +9576,6 @@ __metadata:
96309576
languageName: node
96319577
linkType: hard
96329578

9633-
"create-require@npm:^1.1.0":
9634-
version: 1.1.1
9635-
resolution: "create-require@npm:1.1.1"
9636-
checksum: 10/a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff
9637-
languageName: node
9638-
linkType: hard
9639-
96409579
"cross-env@npm:^10.1.0":
96419580
version: 10.1.0
96429581
resolution: "cross-env@npm:10.1.0"
@@ -10237,13 +10176,6 @@ __metadata:
1023710176
languageName: node
1023810177
linkType: hard
1023910178

10240-
"diff@npm:^4.0.1":
10241-
version: 4.0.2
10242-
resolution: "diff@npm:4.0.2"
10243-
checksum: 10/ec09ec2101934ca5966355a229d77afcad5911c92e2a77413efda5455636c4cf2ce84057e2d7715227a2eeeda04255b849bd3ae3a4dd22eb22e86e76456df069
10244-
languageName: node
10245-
linkType: hard
10246-
1024710179
"diff@npm:^5.0.0":
1024810180
version: 5.1.0
1024910181
resolution: "diff@npm:5.1.0"
@@ -14442,7 +14374,7 @@ __metadata:
1444214374
languageName: node
1444314375
linkType: hard
1444414376

14445-
"make-error@npm:^1.1.1, make-error@npm:^1.3.6":
14377+
"make-error@npm:^1.3.6":
1444614378
version: 1.3.6
1444714379
resolution: "make-error@npm:1.3.6"
1444814380
checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402
@@ -18050,7 +17982,6 @@ __metadata:
1805017982
fast-glob: "npm:~3.3.3"
1805117983
npm-run-all: "npm:^4.1.5"
1805217984
prettier: "npm:~3.6.2"
18053-
ts-node: "npm:~10.9.2"
1805417985
typescript: "npm:~5.9.3"
1805517986
languageName: unknown
1805617987
linkType: soft
@@ -19599,44 +19530,6 @@ __metadata:
1959919530
languageName: node
1960019531
linkType: hard
1960119532

19602-
"ts-node@npm:~10.9.2":
19603-
version: 10.9.2
19604-
resolution: "ts-node@npm:10.9.2"
19605-
dependencies:
19606-
"@cspotcode/source-map-support": "npm:^0.8.0"
19607-
"@tsconfig/node10": "npm:^1.0.7"
19608-
"@tsconfig/node12": "npm:^1.0.7"
19609-
"@tsconfig/node14": "npm:^1.0.0"
19610-
"@tsconfig/node16": "npm:^1.0.2"
19611-
acorn: "npm:^8.4.1"
19612-
acorn-walk: "npm:^8.1.1"
19613-
arg: "npm:^4.1.0"
19614-
create-require: "npm:^1.1.0"
19615-
diff: "npm:^4.0.1"
19616-
make-error: "npm:^1.1.1"
19617-
v8-compile-cache-lib: "npm:^3.0.1"
19618-
yn: "npm:3.1.1"
19619-
peerDependencies:
19620-
"@swc/core": ">=1.2.50"
19621-
"@swc/wasm": ">=1.2.50"
19622-
"@types/node": "*"
19623-
typescript: ">=2.7"
19624-
peerDependenciesMeta:
19625-
"@swc/core":
19626-
optional: true
19627-
"@swc/wasm":
19628-
optional: true
19629-
bin:
19630-
ts-node: dist/bin.js
19631-
ts-node-cwd: dist/bin-cwd.js
19632-
ts-node-esm: dist/bin-esm.js
19633-
ts-node-script: dist/bin-script.js
19634-
ts-node-transpile-only: dist/bin-transpile.js
19635-
ts-script: dist/bin-script-deprecated.js
19636-
checksum: 10/a91a15b3c9f76ac462f006fa88b6bfa528130dcfb849dd7ef7f9d640832ab681e235b8a2bc58ecde42f72851cc1d5d4e22c901b0c11aa51001ea1d395074b794
19637-
languageName: node
19638-
linkType: hard
19639-
1964019533
"tsconfig-paths@npm:^4.2.0":
1964119534
version: 4.2.0
1964219535
resolution: "tsconfig-paths@npm:4.2.0"
@@ -20486,13 +20379,6 @@ __metadata:
2048620379
languageName: node
2048720380
linkType: hard
2048820381

20489-
"v8-compile-cache-lib@npm:^3.0.1":
20490-
version: 3.0.1
20491-
resolution: "v8-compile-cache-lib@npm:3.0.1"
20492-
checksum: 10/88d3423a52b6aaf1836be779cab12f7016d47ad8430dffba6edf766695e6d90ad4adaa3d8eeb512cc05924f3e246c4a4ca51e089dccf4402caa536b5e5be8961
20493-
languageName: node
20494-
linkType: hard
20495-
2049620382
"v8-to-istanbul@npm:^9.0.1":
2049720383
version: 9.1.0
2049820384
resolution: "v8-to-istanbul@npm:9.1.0"
@@ -21222,13 +21108,6 @@ __metadata:
2122221108
languageName: node
2122321109
linkType: hard
2122421110

21225-
"yn@npm:3.1.1":
21226-
version: 3.1.1
21227-
resolution: "yn@npm:3.1.1"
21228-
checksum: 10/2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6
21229-
languageName: node
21230-
linkType: hard
21231-
2123221111
"yocto-queue@npm:^0.1.0":
2123321112
version: 0.1.0
2123421113
resolution: "yocto-queue@npm:0.1.0"

0 commit comments

Comments
 (0)