Skip to content

Commit 3a680c1

Browse files
committed
chore: migrate ts-node to swc
1 parent 1e77176 commit 3a680c1

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.env-cmdrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"version": {
3-
"IN_VERSION_SCRIPT": "true"
3+
"IN_VERSION_SCRIPT": "true",
4+
"SYNCKIT_TS_RUNNER": "swc"
45
},
56
"version-ci": {
67
"IN_VERSION_CI_SCRIPT": "true"

.github/workflows/NodeCI.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [master]
88

9+
env:
10+
SYNCKIT_TS_RUNNER: swc
11+
912
jobs:
1013
lint:
1114
runs-on: ubuntu-latest
@@ -83,6 +86,8 @@ jobs:
8386
run: npm install
8487
- name: Test
8588
run: npm run test:transpile-only
89+
env:
90+
SYNCKIT_TS_RUNNER: oxc
8691
test-with-eslint6:
8792
runs-on: ubuntu-latest
8893
strategy:
@@ -101,6 +106,8 @@ jobs:
101106
npm install
102107
- name: Test
103108
run: npm run test:transpile-only
109+
env:
110+
SYNCKIT_TS_RUNNER: oxc
104111
test-with-eslint7:
105112
runs-on: ubuntu-latest
106113
strategy:
@@ -119,6 +126,8 @@ jobs:
119126
npm install
120127
- name: Test
121128
run: npm run test:transpile-only
129+
env:
130+
SYNCKIT_TS_RUNNER: oxc
122131
test-and-coverage:
123132
runs-on: ubuntu-latest
124133
steps:

.github/workflows/Release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ jobs:
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
SYNCKIT_TS_RUNNER: swc

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
"scripts": {
1919
"prebuild": "npm run -s clean",
2020
"build": "npm run build:meta && npm run build:ts && npm run build:dts",
21-
"build:meta": "ts-node --transpile-only ./tools/update-meta.ts",
21+
"build:meta": "node -r @swc-node/register ./tools/update-meta.ts",
2222
"build:ts": "tsc --project ./tsconfig.build.json",
2323
"build:dts": "npm run build:dts-step1 && npm run build:dts-step2",
2424
"build:dts-step1": "tsc --declaration --outDir dist-ts --project ./tsconfig.build.json",
2525
"build:dts-step2": "dts-bundle --name eslint-plugin-jsonc --main ./dist-ts/index.d.ts --out ../index.d.ts",
2626
"clean": "rimraf .nyc_output dist coverage",
2727
"lint": "eslint .",
2828
"eslint-fix": "eslint . --fix",
29-
"test:base": "mocha --require ts-node/register \"tests/lib/**/*.ts\" --reporter dot --timeout 60000",
29+
"test:base": "env-cmd -e test mocha --require @swc-node/register \"tests/lib/**/*.ts\" --reporter dot --timeout 60000",
3030
"test": "npm run test:base",
3131
"test:nyc": "nyc --reporter=lcov npm run test:base",
32-
"test:transpile-only": "mocha --require ts-node/register/transpile-only \"tests/lib/**/*.ts\" --reporter dot --timeout 60000",
32+
"test:transpile-only": "mocha --require @swc-node/register/transpile-only \"tests/lib/**/*.ts\" --reporter dot --timeout 60000",
3333
"pretest:integrations": "npm run build:ts && npm pack",
34-
"test:integrations": "mocha --require ts-node/register \"tests-integrations/lib/**/*.ts\" --reporter dot --timeout 120000",
35-
"update": "ts-node --transpile-only ./tools/update.ts && npm run eslint-fix && npm run test:nyc",
36-
"update-only": "ts-node --transpile-only ./tools/update.ts",
34+
"test:integrations": "mocha --require @swc-node/register \"tests-integrations/lib/**/*.ts\" --reporter dot --timeout 120000",
35+
"update": "node -r @swc-node/register ./tools/update.ts && npm run eslint-fix && npm run test:nyc",
36+
"update-only": "node -r @swc-node/register ./tools/update.ts",
3737
"new": "ts-node ./tools/new-rule.ts",
3838
"predocs:watch": "npm run build:ts",
3939
"docs:watch": "vitepress dev docs",
@@ -86,6 +86,9 @@
8686
"@eslint/json": "^0.11.0",
8787
"@ota-meshi/eslint-plugin": "^0.17.6",
8888
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.4",
89+
"@oxc-node/core": "^0.0.27",
90+
"@swc-node/register": "^1.10.10",
91+
"@swc/core": "^1.11.24",
8992
"@types/eslint-scope": "^3.7.7",
9093
"@types/mocha": "^10.0.10",
9194
"@types/natural-compare": "^1.4.3",
@@ -122,7 +125,6 @@
122125
"stylelint-config-standard": "^37.0.0",
123126
"stylelint-config-standard-vue": "^1.0.0",
124127
"stylelint-stylus": "^1.0.0",
125-
"ts-node": "^10.9.2",
126128
"typescript": "^5.8.2",
127129
"typescript-eslint": "^8.28.0",
128130
"vite-plugin-eslint4b": "^0.5.1",

0 commit comments

Comments
 (0)