From c7dccb066412cc090e47a4d03b5a8fe9ccd52096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Wed, 12 Nov 2025 14:17:15 +0800 Subject: [PATCH] build(tooling): configure pnpm workspaces and update dev tooling --- .devcontainer/devcontainer.json | 23 +++++++++ .vscode/tasks.json | 1 - auto-imports.d.ts | 2 - eslint.config.ts | 10 ++++ package.json | 12 +++-- pnpm-lock.yaml | 85 ++++++++++++++++++++------------- 6 files changed, 92 insertions(+), 41 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9fd6485..779d3f3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -61,6 +61,29 @@ "esbenp.prettier-vscode" ], "settings": { + "tasks": { + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "dev", + "label": "🚀 dev-in-container", + "detail": "启动开发服务器", + "runOptions": { "runOn": "folderOpen" }, + "problemMatcher": { + "pattern": { "regexp": "." }, + "background": { + "activeOnStart": true, + "beginsPattern": "VITE.*ready in", + "endsPattern": "(Local|Network):.*http" + } + }, + "isBackground": true, + "presentation": { "reveal": "always", "panel": "dedicated" }, + "group": { "kind": "build", "isDefault": false } + } + ] + }, "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 103d0e8..ff4784d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,7 +6,6 @@ "script": "dev", "label": "🚀 dev", "detail": "启动开发服务器", - "runOptions": { "runOn": "folderOpen" }, "problemMatcher": { "pattern": { "regexp": "." }, "background": { diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 2117469..47b3804 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -270,7 +270,6 @@ declare global { const useRoute: typeof import('vue-router')['useRoute'] const useRouter: typeof import('vue-router')['useRouter'] const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth'] - const useSafeNForm: typeof import('./src/utils/use-safe-n-form-auto-imports')['useSafeNForm'] const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation'] const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea'] const useScriptTag: typeof import('@vueuse/core')['useScriptTag'] @@ -617,7 +616,6 @@ declare module 'vue' { readonly useRoute: UnwrapRef readonly useRouter: UnwrapRef readonly useSSRWidth: UnwrapRef - readonly useSafeNForm: UnwrapRef readonly useScreenOrientation: UnwrapRef readonly useScreenSafeArea: UnwrapRef readonly useScriptTag: UnwrapRef diff --git a/eslint.config.ts b/eslint.config.ts index 34da99a..6d45cd5 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,4 +1,5 @@ import vueI18n from '@intlify/eslint-plugin-vue-i18n'; +// import stylistic from '@stylistic/eslint-plugin'; import pluginVitest from '@vitest/eslint-plugin'; import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'; import { @@ -83,6 +84,9 @@ export default defineConfigWithVueTs( }, { + // plugins: { + // '@stylistic': stylistic, + // }, rules: { '@typescript-eslint/no-explicit-any': 'off', 'vue/block-order': [ @@ -97,6 +101,12 @@ export default defineConfigWithVueTs( ], 'vue/attributes-order': 'error', 'vue/multi-word-component-names': 'off', + // '@stylistic/padding-line-between-statements': [ + // 'error', + // { blankLine: 'always', prev: '*', next: ['const', 'let', 'var'] }, + // { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' }, + // { blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] }, + // ], }, }, diff --git a/package.json b/package.json index b5754af..5e6fbbf 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,6 @@ "{src/locales-utils,src/locales}/**/*": "node scripts/type-check-for-lint-staged.mjs" }, "pnpm": { - "overrides": { - "vue-tsc": "$vue-tsc" - }, "onlyBuiltDependencies": [ "@parcel/watcher", "esbuild", @@ -95,6 +92,7 @@ "@primevue/metadata": "^4.3.9", "@stylelint-types/stylelint-order": "^7.0.0", "@stylelint-types/stylelint-scss": "^6.11.0", + "@stylistic/eslint-plugin": "^5.5.0", "@tsconfig/node22": "^22.0.2", "@types/html-minifier-terser": "^7.0.2", "@types/jsdom": "^27.0.0", @@ -158,5 +156,11 @@ "vue-macros": "3.1.1", "vue-tsc": "^3.1.0", "wrangler": "^4.37.1" - } + }, + "overrides": { + "vue-tsc": "$vue-tsc" + }, + "workspaces": [ + "packages/*" + ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 994d672..ce696a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - vue-tsc: ^3.1.0 - importers: .: @@ -120,6 +117,9 @@ importers: '@stylelint-types/stylelint-scss': specifier: ^6.11.0 version: 6.11.0(stylelint-define-config@16.24.0(stylelint@16.25.0(typescript@5.9.2)))(stylelint@16.25.0(typescript@5.9.2)) + '@stylistic/eslint-plugin': + specifier: ^5.5.0 + version: 5.5.0(eslint@9.38.0(jiti@2.6.1)) '@tsconfig/node22': specifier: ^22.0.2 version: 22.0.2 @@ -152,7 +152,7 @@ importers: version: 10.2.0(eslint@9.38.0(jiti@2.6.1))(prettier@3.6.2) '@vue/eslint-config-typescript': specifier: ^14.6.0 - version: 14.6.0(eslint-plugin-vue@10.5.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))))(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2) + version: 14.6.0(eslint-plugin-vue@10.5.1(@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1)))(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))))(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2) '@vue/test-utils': specifier: ^2.4.6 version: 2.4.6 @@ -179,7 +179,7 @@ importers: version: 2.2.2(eslint@9.38.0(jiti@2.6.1)) eslint-plugin-vue: specifier: ~10.5.0 - version: 10.5.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))) + version: 10.5.1(@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1)))(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))) happy-dom: specifier: ^20.0.1 version: 20.0.8 @@ -197,7 +197,7 @@ importers: version: 16.2.4 node: specifier: runtime:^24.11.0 - version: runtime:24.11.0 + version: runtime:24.11.1 npm-run-all2: specifier: ^8.0.4 version: 8.0.4 @@ -2115,6 +2115,12 @@ packages: stylelint: optional: true + '@stylistic/eslint-plugin@5.5.0': + resolution: {integrity: sha512-IeZF+8H0ns6prg4VrkhgL+yrvDXWDH2cKchrbh80ejG9dQgZWp10epHMbgRuQvgchLII/lfh6Xn3lu6+6L86Hw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: '>=9.0.0' + '@tsconfig/node22@22.0.2': resolution: {integrity: sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA==} @@ -2591,7 +2597,7 @@ packages: resolution: {integrity: sha512-3AVhFqOfvru3Orj6CO4uudmFO7JAsFSReBbbsZEsK9V4cc5tVzfk8SL1kTNQ1FIEam3A2vWxeFTkSuVCD2x7OA==} engines: {node: '>=20.19.0'} peerDependencies: - vue-tsc: ^3.1.0 + vue-tsc: 3.0.8 peerDependenciesMeta: vue-tsc: optional: true @@ -4501,94 +4507,94 @@ packages: node-releases@2.0.20: resolution: {integrity: sha512-7gK6zSXEH6neM212JgfYFXe+GmZQM+fia5SsusuBIUgnPheLFBmIPhtFoAQRj8/7wASYQnbDlHPVwY0BefoFgA==} - node@runtime:24.11.0: + node@runtime:24.11.1: resolution: type: variations variants: - resolution: archive: tarball bin: bin/node - integrity: sha256-AVGoDHkzXAEx+qQIOkGjWIQ1rqFNz2aDBq0+q/3nG2U= + integrity: sha256-mLqRmgOQ2MQi1LsxBexbd3I89UFDtMHkudd2kPoHUgY= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-aix-ppc64.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-aix-ppc64.tar.gz targets: - cpu: ppc64 os: aix - resolution: archive: tarball bin: bin/node - integrity: sha256-C+KrKBak+gLRrP8BSkNPKfVtjZVvWvapi3DO1sX00gE= + integrity: sha256-sFqjpm7+aAAj+TC9WvP9u9VCeU2lZEyirXEdaMvU3DU= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-darwin-arm64.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-darwin-arm64.tar.gz targets: - cpu: arm64 os: darwin - resolution: archive: tarball bin: bin/node - integrity: sha256-OIRnHof0b3c4MtmKCmyrzF7E9jcITw81FbaeZuon8vE= + integrity: sha256-CWCBttb83T9boPXx1EpH6DA3rS546tomZxwlL+ZN0RE= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-darwin-x64.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-darwin-x64.tar.gz targets: - cpu: x64 os: darwin - resolution: archive: tarball bin: bin/node - integrity: sha256-R4bQDE0lnT/wsjKDB/dk7zztZfLW6VAtQz5o1mI4UJ0= + integrity: sha256-Dck+xceYsNNH8GjbbSBdA96ppxdl5qU5IraCuRJl1x8= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-linux-arm64.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-linux-arm64.tar.gz targets: - cpu: arm64 os: linux - resolution: archive: tarball bin: bin/node - integrity: sha256-fnukMm/oWI8R52PFUhe89F9eC3vL8eJru7siJamuRyE= + integrity: sha256-zUFAfzNS3i8GbqJsXF0OqbY2I3TWthg4Wp8una0iBhY= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-linux-ppc64le.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-linux-ppc64le.tar.gz targets: - cpu: ppc64le os: linux - resolution: archive: tarball bin: bin/node - integrity: sha256-evDZLnSweiuOkQie5PzMe1Qz/YtjJZvO06NGaJmMvfc= + integrity: sha256-XUyLyl+PJZP5CB3uOYNHYOhaFvphyVDz6G7IWZbwBVA= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-linux-s390x.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-linux-s390x.tar.gz targets: - cpu: s390x os: linux - resolution: archive: tarball bin: bin/node - integrity: sha256-s8BxzfR6q4Z8OyqihyV98S7F18liv5IrMv0zImxClf0= + integrity: sha256-WKX/XMjyIA5Fi+oi4ynVwZlKobER1JnKRuwkEdWCOco= type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-linux-x64.tar.gz + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-linux-x64.tar.gz targets: - cpu: x64 os: linux - resolution: archive: zip bin: node.exe - integrity: sha256-EtOxqpaWt0EeEVpPoq71f5VWC17ha7Ys1phD5TXscr4= - prefix: node-v24.11.0-win-arm64 + integrity: sha256-zp7k5Ufr3/NVvrSOMJsWbCTfa+ApHJ6vEDzhXz3p5bQ= + prefix: node-v24.11.1-win-arm64 type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-win-arm64.zip + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-win-arm64.zip targets: - cpu: arm64 os: win32 - resolution: archive: zip bin: node.exe - integrity: sha256-EFRUC84itU7H5Q68B47F0JBwCndldgelj2pk3yH0n90= - prefix: node-v24.11.0-win-x64 + integrity: sha256-U1WubXxJ7dz959NKw0hoIGAKgxv4HcO9ylyNtqm7DnY= + prefix: node-v24.11.1-win-x64 type: binary - url: https://nodejs.org/download/release/v24.11.0/node-v24.11.0-win-x64.zip + url: https://nodejs.org/download/release/v24.11.1/node-v24.11.1-win-x64.zip targets: - cpu: x64 os: win32 - version: 24.11.0 + version: 24.11.1 hasBin: true nopt@7.2.1: @@ -5809,7 +5815,7 @@ packages: vite: '>=5.4.20' vls: '*' vti: '*' - vue-tsc: ^3.1.0 + vue-tsc: ~2.2.10 || ^3.0.0 peerDependenciesMeta: '@biomejs/biome': optional: true @@ -7689,6 +7695,16 @@ snapshots: optionalDependencies: stylelint: 16.25.0(typescript@5.9.2) + '@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1))': + dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.38.0(jiti@2.6.1)) + '@typescript-eslint/types': 8.46.2 + eslint: 9.38.0(jiti@2.6.1) + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + estraverse: 5.3.0 + picomatch: 4.0.3 + '@tsconfig/node22@22.0.2': {} '@tybys/wasm-util@0.10.1': @@ -8488,11 +8504,11 @@ snapshots: transitivePeerDependencies: - '@types/eslint' - '@vue/eslint-config-typescript@14.6.0(eslint-plugin-vue@10.5.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))))(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2)': + '@vue/eslint-config-typescript@14.6.0(eslint-plugin-vue@10.5.1(@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1)))(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))))(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2)': dependencies: '@typescript-eslint/utils': 8.46.2(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2) eslint: 9.38.0(jiti@2.6.1) - eslint-plugin-vue: 10.5.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))) + eslint-plugin-vue: 10.5.1(@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1)))(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))) fast-glob: 3.3.3 typescript-eslint: 8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2) vue-eslint-parser: 10.2.0(eslint@9.38.0(jiti@2.6.1)) @@ -9439,7 +9455,7 @@ snapshots: optionalDependencies: eslint-config-prettier: 10.1.8(eslint@9.38.0(jiti@2.6.1)) - eslint-plugin-vue@10.5.1(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))): + eslint-plugin-vue@10.5.1(@stylistic/eslint-plugin@5.5.0(eslint@9.38.0(jiti@2.6.1)))(@typescript-eslint/parser@8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2))(eslint@9.38.0(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.38.0(jiti@2.6.1))): dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.38.0(jiti@2.6.1)) eslint: 9.38.0(jiti@2.6.1) @@ -9450,6 +9466,7 @@ snapshots: vue-eslint-parser: 10.2.0(eslint@9.38.0(jiti@2.6.1)) xml-name-validator: 4.0.0 optionalDependencies: + '@stylistic/eslint-plugin': 5.5.0(eslint@9.38.0(jiti@2.6.1)) '@typescript-eslint/parser': 8.43.0(eslint@9.38.0(jiti@2.6.1))(typescript@5.9.2) eslint-scope@8.4.0: @@ -10468,7 +10485,7 @@ snapshots: node-releases@2.0.20: {} - node@runtime:24.11.0: {} + node@runtime:24.11.1: {} nopt@7.2.1: dependencies: