From c3003dd47d04521046a64c222b2f00452d8e308c Mon Sep 17 00:00:00 2001 From: zhsama Date: Fri, 5 Dec 2025 14:42:37 +0800 Subject: [PATCH] chore: update TypeScript type-check command and add native-preview dependency for faster performance (#29179) --- .github/workflows/style.yml | 2 +- web/.husky/pre-commit | 8 ++-- web/package.json | 4 +- web/pnpm-lock.yaml | 73 +++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 6 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index e652657705..5a8a34be79 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -106,7 +106,7 @@ jobs: - name: Web type check if: steps.changed-files.outputs.any_changed == 'true' working-directory: ./web - run: pnpm run type-check + run: pnpm run type-check:tsgo docker-compose-template: name: Docker Compose Template diff --git a/web/.husky/pre-commit b/web/.husky/pre-commit index 26e9bf69d4..dd4140b47e 100644 --- a/web/.husky/pre-commit +++ b/web/.husky/pre-commit @@ -61,13 +61,13 @@ if $web_modified; then lint-staged if $web_ts_modified; then - echo "Running TypeScript type-check" - if ! pnpm run type-check; then - echo "Type check failed. Please run 'pnpm run type-check' to fix the errors." + echo "Running TypeScript type-check:tsgo" + if ! pnpm run type-check:tsgo; then + echo "Type check failed. Please run 'pnpm run type-check:tsgo' to fix the errors." exit 1 fi else - echo "No staged TypeScript changes detected, skipping type-check" + echo "No staged TypeScript changes detected, skipping type-check:tsgo" fi echo "Running unit tests check" diff --git a/web/package.json b/web/package.json index 4c2bf2dfb5..58105ae8e8 100644 --- a/web/package.json +++ b/web/package.json @@ -28,6 +28,7 @@ "lint:quiet": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --quiet", "lint:complexity": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --rule 'complexity: [error, {max: 15}]' --quiet", "type-check": "tsc --noEmit", + "type-check:tsgo": "tsgo --noEmit", "prepare": "cd ../ && node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky ./web/.husky", "gen-icons": "node ./app/components/base/icons/script.mjs", "uglify-embed": "node ./bin/uglify-embed", @@ -206,6 +207,7 @@ "sass": "^1.93.2", "storybook": "9.1.13", "tailwindcss": "^3.4.18", + "@typescript/native-preview": "^7.0.0-dev", "ts-node": "^10.9.2", "typescript": "^5.9.3", "uglify-js": "^3.19.3" @@ -283,4 +285,4 @@ "sharp" ] } -} +} \ No newline at end of file diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 82bca67203..db15a09961 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -463,6 +463,9 @@ importers: '@types/uuid': specifier: ^10.0.0 version: 10.0.0 + '@typescript/native-preview': + specifier: ^7.0.0-dev + version: 7.0.0-dev.20251204.1 autoprefixer: specifier: ^10.4.21 version: 10.4.22(postcss@8.5.6) @@ -3653,6 +3656,45 @@ packages: resolution: {integrity: sha512-BmxxndzEWhE4TIEEMBs8lP3MBWN3jFPs/p6gPm/wkv02o41hI6cq9AuSmGAaTTHPtA1FTi2jBre4A9rm5ZmX+Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-CgIzuO/LFRufdVjJmll6x7jnejYqqLo4kJwrsUxQipJ/dcGeP0q2XMcxNBzT7F9L4Sd5dphRPOZFXES4kS0lig==} + cpu: [arm64] + os: [darwin] + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-X76oQeDMQHJiukkPPbk7STrfu97pfPe5ixwiN6nXzSGXLE+tzrXRecNkYhz4XWeAW2ASNmGwDJJ2RAU5l8MbgQ==} + cpu: [x64] + os: [darwin] + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-+1as+h6ZNpc9TqlHwvDkBP7jg0FoCMUf6Rrc9/Mkllau6etznfVsWMADWT4t76gkGZKUIXOZqsl2Ya3uaBrCBQ==} + cpu: [arm64] + os: [linux] + + '@typescript/native-preview-linux-arm@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-3zl/Jj5rzkK9Oo5KVSIW+6bzRligoI+ZnA1xLpg0BBH2sk27a8Vasj7ZaGPlFvlSegvcaJdIjSt7Z8nBtiF9Ww==} + cpu: [arm] + os: [linux] + + '@typescript/native-preview-linux-x64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-YD//l6yv7iPNlKn9OZDzBxrI+QGLN6d4RV3dSucsyq/YNZUulcywGztbZiaQxdUzKPwj70G+LVb9WCgf5ITOIQ==} + cpu: [x64] + os: [linux] + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-eDXYR5qfPFA8EfQ0d9SbWGLn02VbAaeTM9jQ5VeLlPLcBP81nGRaGQ9Quta5zeEHev1S9iCdyRj5BqCRtl0ohw==} + cpu: [arm64] + os: [win32] + + '@typescript/native-preview-win32-x64@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-CRWI2OPdqXbzOU52R2abWMb3Ie2Wp6VPrCFzR3pzP53JabTAe8+XoBWlont9bw/NsqbPKp2aQbdfbLQX5RI44g==} + cpu: [x64] + os: [win32] + + '@typescript/native-preview@7.0.0-dev.20251204.1': + resolution: {integrity: sha512-nyMp0ybgJVZFtDOWmcKDqaRqtj8dOg65+fDxbjIrnZuMWIqlOUGH+imFwofqlW+KndAA7KtAio2YSZMMZB25WA==} + hasBin: true + '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} @@ -12527,6 +12569,37 @@ snapshots: '@typescript-eslint/types': 8.48.1 eslint-visitor-keys: 4.2.1 + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-linux-arm@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-linux-x64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview-win32-x64@7.0.0-dev.20251204.1': + optional: true + + '@typescript/native-preview@7.0.0-dev.20251204.1': + optionalDependencies: + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20251204.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20251204.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20251204.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20251204.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20251204.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20251204.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20251204.1 + '@ungap/structured-clone@1.3.0': {} '@vitest/eslint-plugin@1.5.1(eslint@9.39.1(jiti@1.21.7))(typescript@5.9.3)':