From a41a756186ad9825b2297a47e4e1c7deabed3132 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Thu, 7 Sep 2023 17:00:13 +0800 Subject: [PATCH] chore: using `tsx` instead of `ts-node` (#44688) * chore: using `tsx` instead of `ts-node` * chore: update script * chore: missing tsx --- package.json | 22 ++++++++++------------ scripts/test-all.sh | 2 +- tsconfig.node.json | 11 ----------- 3 files changed, 11 insertions(+), 24 deletions(-) delete mode 100644 tsconfig.node.json diff --git a/package.json b/package.json index 4864ea9e1fc9..6fbef97103a2 100644 --- a/package.json +++ b/package.json @@ -47,16 +47,16 @@ "scripts": { "prepare": "is-ci || husky install", "api-collection": "antd-tools run api-collection", - "authors": "ts-node --esm --project tsconfig.node.json scripts/generate-authors.ts", + "authors": "tsx scripts/generate-authors.ts", "build": "npm run compile && NODE_OPTIONS='--max-old-space-size=4096' npm run dist", "size-limit": "size-limit", - "check-commit": "ts-node --esm --project tsconfig.node.json scripts/check-commit.ts", - "check-ts-demo": "ts-node --esm --project tsconfig.node.json scripts/check-ts-demo.ts", + "check-commit": "tsx scripts/check-commit.ts", + "check-ts-demo": "tsx scripts/check-ts-demo.ts", "clean": "antd-tools run clean && rm -rf es lib coverage dist report.html", "clean-lockfiles": "rm -rf package-lock.json yarn.lock", - "collect-token-statistic": "ts-node --esm --project tsconfig.node.json scripts/collect-token-statistic.ts", - "token-meta": "ts-node --esm --project tsconfig.node.json scripts/generate-token-meta.ts", - "component-changelog": "ts-node --esm --project tsconfig.node.json scripts/generate-component-changelog.ts", + "collect-token-statistic": "tsx scripts/collect-token-statistic.ts", + "token-meta": "tsx scripts/generate-token-meta.ts", + "component-changelog": "tsx scripts/generate-component-changelog.ts", "prestart": "npm run version && npm run collect-token-statistic && npm run token-meta && npm run component-changelog", "precompile": "npm run prestart", "pretest": "npm run version && npm run component-changelog", @@ -77,7 +77,7 @@ "lint:demo": "eslint components/*/demo/*.md", "lint:deps": "antd-tools run deps-lint", "lint:md": "remark . -f -q", - "lint:style": "ts-node --esm --project tsconfig.node.json scripts/check-cssinjs.ts", + "lint:style": "tsx scripts/check-cssinjs.ts", "lint:script": "npm run component-changelog && eslint . --ext .js,.jsx,.ts,.tsx --cache", "pre-publish": "npm run test-all -- --skip-build && node ./scripts/pre-publish-notice.js", "prettier": "prettier -c --write **/* --cache", @@ -96,8 +96,8 @@ "tsc": "tsc --noEmit", "site:test": "jest --config .jest.site.js --no-cache --force-exit", "test-image": "jest --config .jest.image.js --no-cache -i -u", - "argos": "ts-node --esm --project tsconfig.node.json scripts/argos-upload.ts", - "version": "ts-node --esm --project tsconfig.node.json scripts/generate-version.ts", + "argos": "tsx scripts/argos-upload.ts", + "version": "tsx scripts/generate-version.ts", "install-react-16": "npm i --no-save --legacy-peer-deps react@16 react-dom@16 @testing-library/react@12", "install-react-17": "npm i --no-save --legacy-peer-deps react@17 react-dom@17 @testing-library/react@12", "install-react-18": "npm i --no-save --legacy-peer-deps react@18 react-dom@18" @@ -177,8 +177,6 @@ "@qixian.cs/github-contributors-list": "^1.1.0", "@size-limit/file": "^9.0.0", "@stackblitz/sdk": "^1.3.0", - "@swc/core": "1.3.82", - "@swc/helpers": "^0.5.0", "@testing-library/dom": "^9.0.0", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^14.0.0", @@ -299,7 +297,7 @@ "stylelint-prettier": "^4.0.0", "sylvanas": "^0.6.1", "terser": "^5.16.1", - "ts-node": "^10.8.2", + "tsx": "^3.12.8", "typedoc": "^0.25.0", "typescript": "~5.2.2", "vanilla-jsoneditor": "^0.18.0", diff --git a/scripts/test-all.sh b/scripts/test-all.sh index d7349a361623..26fff26931e4 100755 --- a/scripts/test-all.sh +++ b/scripts/test-all.sh @@ -2,7 +2,7 @@ echo "[TEST ALL] test changelog" echo "[TEST ALL] test changelog" > ~test-all.txt -ts-node --esm --project tsconfig.node.json ./scripts/check-version-md.ts +tsx ./scripts/check-version-md.ts echo "[TEST ALL] check-commit" echo "[TEST ALL] check-commit" > ~test-all.txt diff --git a/tsconfig.node.json b/tsconfig.node.json deleted file mode 100644 index 36fda0a65086..000000000000 --- a/tsconfig.node.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "ts-node": { - "swc": true - }, - "compilerOptions": { - "module": "CommonJS", - "types": ["node"], - "resolveJsonModule": true - } -}