diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 62940487e..9f6becb2c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -46,3 +46,37 @@ jobs: - name: Frontend contract tests (npm test → node --test) working-directory: frontend-vue run: npm test + + admin-frontend-test: + # 2026-10-08 加:后管此前是 0 CI 覆盖(本 workflow 只有 backend-java 与 frontend-vue 两个 job, + # `.gitea` 下 grep admin-frontend-vue 命中 0)⇒ 1,7xx 例契约/棘轮用例与 vue-tsc 只能手跑。 + # 本机实跑过的:npm install(112 包 3m34s,再 72 包 2m35s)→ vue-tsc --noEmit 退出 0(49.7s) + # → node --test tests/*.test.ts 1,764 例全绿 → vitest run 挂载例 7 例全绿 → npm ci 复现通过。 + # 没跑的那半:`npm run build` 的后半 `vite build` 本机没执行——它会重写 dist/, + # 而 dist/ 正是 scripts/_deploy_admin_vue.py 的发布输入,脏树上构建会把别人未提交的改动带进产物。 + # + # ⚠ 前提未证实,别把这个 job 当成"CI 会跑":Gitea 26.4.5 的匿名接口 + # /api/v1/repos/super/crawler-plugin/actions/tasks 只列得出 3 次 run,最后一个停在 + # 2026-08-11T14:50(三次 status 全为 failure);此后 origin/master 又推进了 1,131 笔 + # (含 2026-10-08 12:14:57 那次 push,仓库 updated_at 也是这一刻)却没有产生任何新 run。 + # ⇒ 只能证到"这条 workflow 历史上真被 runner 执行过",证不到"现在还在执行"。 + # 要让它真兜住这一面,先恢复 runner / 确认 Actions 未被关停。 + runs-on: ubuntu-latest + container: node:24-alpine + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + working-directory: admin-frontend-vue + run: npm ci + - name: Type check + build (vue-tsc --noEmit && vite build) + working-directory: admin-frontend-vue + run: npm run build + - name: Admin contract & ratchet tests (node --test, 不是 vitest) + working-directory: admin-frontend-vue + run: node --test tests/*.test.ts + - name: Admin component mount tests (vitest + @vue/test-utils + jsdom) + working-directory: admin-frontend-vue + run: npm run test:mount + diff --git a/admin-frontend-vue/package-lock.json b/admin-frontend-vue/package-lock.json index 415d6c33b..eedd54765 100644 --- a/admin-frontend-vue/package-lock.json +++ b/admin-frontend-vue/package-lock.json @@ -18,11 +18,47 @@ "@playwright/test": "^1.63.0", "@types/node": "^26.4.1", "@vitejs/plugin-vue": "^6.0.1", + "@vue/test-utils": "^2.5.1", + "jsdom": "^30.1.2", "typescript": "^5.9.2", "vite": "^7.3.1", + "vitest": "^5.0.3", "vue-tsc": "^3.0.6" } }, + "node_modules/@asamuzakjp/css-color": { + "version": "7.1.3", + "resolved": "https://registry.npmmirror.com/@asamuzakjp/css-color/-/css-color-7.1.3.tgz", + "integrity": "sha512-1t1U8Cm3RBl9vh3RAZhjkPaduzLSvQJRToRrxpGR/eDRW99mOREleuu+mWfiFa795bUzjwht7NgphCKTs2ianQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^3.4.2", + "@csstools/css-color-parser": "^4.2.5", + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2", + "lru-cache": "^11.5.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/@asamuzakjp/dom-selector": { + "version": "9.2.4", + "resolved": "https://registry.npmmirror.com/@asamuzakjp/dom-selector/-/dom-selector-9.2.4.tgz", + "integrity": "sha512-YnVzxDxLaqL0t7Q4wfcgHZjg55Wm6y5EaO7Bhu3q9J7wq/8iw3PhsnWiOQhYekx4VexnbkgWpTT6n+QIV7kczw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bidi-js": "^1.1.0", + "css-tree": "^3.2.1", + "is-potential-custom-element-name": "^1.0.1", + "lru-cache": "^11.5.3" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", @@ -69,6 +105,159 @@ "node": ">=6.9.0" } }, + "node_modules/@bramus/specificity": { + "version": "2.4.3", + "resolved": "https://registry.npmmirror.com/@bramus/specificity/-/specificity-2.4.3.tgz", + "integrity": "sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "css-tree": "^3.2.1" + }, + "bin": { + "specificity": "bin/cli.js" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "6.1.2", + "resolved": "https://registry.npmmirror.com/@csstools/color-helpers/-/color-helpers-6.1.2.tgz", + "integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/@csstools/css-calc": { + "version": "3.4.3", + "resolved": "https://registry.npmmirror.com/@csstools/css-calc/-/css-calc-3.4.3.tgz", + "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "4.2.6", + "resolved": "https://registry.npmmirror.com/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz", + "integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^6.1.2", + "@csstools/css-calc": "^3.4.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz", + "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^4.0.2" + } + }, + "node_modules/@csstools/css-syntax-patches-for-csstree": { + "version": "1.1.15", + "resolved": "https://registry.npmmirror.com/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz", + "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "peerDependencies": { + "css-tree": "^3.2.1" + }, + "peerDependenciesMeta": { + "css-tree": { + "optional": true + } + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz", + "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/@ctrl/tinycolor": { "version": "4.2.0", "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-4.2.0.tgz", @@ -529,6 +718,24 @@ "node": ">=18" } }, + "node_modules/@exodus/bytes": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, "node_modules/@floating-ui/core": { "version": "1.8.0", "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz", @@ -554,12 +761,33 @@ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", "license": "MIT" }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.6.0", "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "license": "MIT" }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@napi-rs/lzma-linux-x64-gnu": { "version": "1.5.1", "resolved": "https://registry.npmmirror.com/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", @@ -580,6 +808,13 @@ "node": "^22.20 || ^24.12 || >=25" } }, + "node_modules/@one-ini/wasm": { + "version": "0.2.1", + "resolved": "https://registry.npmmirror.com/@one-ini/wasm/-/wasm-0.2.1.tgz", + "integrity": "sha512-TUqERXGNTifZ9y2g3wPxQrw3HpHv/02DsW3D90T9x0hhonrL1ZqpSmNrU2XkoIq0fP1N6gZfVQzy2Fw1ZvGBNg==", + "dev": true, + "license": "MIT" + }, "node_modules/@playwright/test": { "version": "1.63.0", "resolved": "https://registry.npmmirror.com/@playwright/test/-/test-1.63.0.tgz", @@ -1003,6 +1238,24 @@ "win32" ] }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmmirror.com/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", @@ -1058,6 +1311,64 @@ "vue": "^3.2.25" } }, + "node_modules/@vitest/mocker": { + "version": "5.0.3", + "resolved": "https://registry.npmmirror.com/@vitest/mocker/-/mocker-5.0.3.tgz", + "integrity": "sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.0.3", + "estree-walker": "^3.0.3", + "magic-string": "^1.2.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/spy": { + "version": "5.0.3", + "resolved": "https://registry.npmmirror.com/@vitest/spy/-/spy-5.0.3.tgz", + "integrity": "sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/@volar/language-core": { "version": "2.4.28", "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.4.28.tgz", @@ -1234,6 +1545,27 @@ "integrity": "sha512-2rPxex1jQf4jvl9MOHl6YaXCPcrNqz/FstMOEh3QWY+/OME9nQTvl9WYeCwhW7AFjaR0SnngZGlp/wkR6rkI6g==", "license": "MIT" }, + "node_modules/@vue/test-utils": { + "version": "2.5.1", + "resolved": "https://registry.npmmirror.com/@vue/test-utils/-/test-utils-2.5.1.tgz", + "integrity": "sha512-V/4a99odJ7hapr0bRt35XxljGk8hefq31gSOnlKTcEq2fUeoj2qb+FcpJYfQu4qfYhW9Ug+O2+CZ3QmZ7gXDzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-beautify": "^2.0.0", + "vue-component-type-helpers": "^3.0.0" + }, + "peerDependencies": { + "@vue/compiler-dom": "3.x", + "@vue/server-renderer": "3.x", + "vue": "3.x" + }, + "peerDependenciesMeta": { + "@vue/server-renderer": { + "optional": true + } + } + }, "node_modules/@vueuse/core": { "version": "14.4.0", "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-14.4.0.tgz", @@ -1272,6 +1604,16 @@ "vue": "^3.5.0" } }, + "node_modules/abbrev": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-5.0.0.tgz", + "integrity": "sha512-/XrFJgzQQQHpti1raDJC6m4ws6aNktmjBlhk8Fdlk7LwCEuDoieEJJY9OFHjfiFJFFRM2tK+Ky/IsfbbmlMu1w==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", @@ -1291,6 +1633,16 @@ "dev": true, "license": "MIT" }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/async-validator": { "version": "4.2.5", "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", @@ -1315,6 +1667,26 @@ "proxy-from-env": "^2.1.0" } }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/bidi-js": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/bidi-js/-/bidi-js-1.1.0.tgz", + "integrity": "sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/birpc": { "version": "2.9.0", "resolved": "https://registry.npmmirror.com/birpc/-/birpc-2.9.0.tgz", @@ -1324,6 +1696,19 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -1337,6 +1722,16 @@ "node": ">= 0.4" } }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmmirror.com/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1349,6 +1744,27 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmmirror.com/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "node_modules/copy-anything": { "version": "4.1.0", "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-4.1.0.tgz", @@ -1361,12 +1777,40 @@ "url": "https://github.com/sponsors/mesqueeb" } }, + "node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "license": "MIT" }, + "node_modules/data-urls": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.1.2" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, "node_modules/dayjs": { "version": "1.11.23", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.23.tgz", @@ -1390,6 +1834,13 @@ } } }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1413,6 +1864,25 @@ "node": ">= 0.4" } }, + "node_modules/editorconfig": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/editorconfig/-/editorconfig-3.0.2.tgz", + "integrity": "sha512-T0ix8GhtxyKVfUFEcvdNDt3YGqlwkFHbD4/5bgFUDgFmxhI/cSRAeJ87/Sz//Cq8Eam6JX/e23RkoFO71P7aAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@one-ini/wasm": "0.2.1", + "commander": "^14.0.3", + "minimatch": "~10.2.4", + "semver": "^7.7.4" + }, + "bin": { + "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/element-plus": { "version": "2.14.5", "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.14.5.tgz", @@ -1469,6 +1939,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -1544,6 +2021,16 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "license": "MIT" }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz", @@ -1659,6 +2146,24 @@ "node": ">= 0.4" } }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmmirror.com/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", @@ -1716,6 +2221,19 @@ "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", "license": "MIT" }, + "node_modules/html-encoding-sniffer": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz", + "integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.15.1" + }, + "engines": { + "node": "^22.13.0 || >=24.0.0" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -1729,6 +2247,89 @@ "node": ">= 6" } }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmmirror.com/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-beautify": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/js-beautify/-/js-beautify-2.0.3.tgz", + "integrity": "sha512-cyFbh3tkPhknnTD/0bLf0T0yy2ZIbqL05mttzbt4y1Zfr7NxqXQZ62dkBLKs3oHH/lpjmDRAnciJiSUyOy8XwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "config-chain": "^1.1.13", + "editorconfig": "^3.0.2", + "glob": "^13.0.6", + "js-cookie": "^3.0.8", + "nopt": "^10.0.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/js-cookie": { + "version": "3.0.8", + "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-3.0.8.tgz", + "integrity": "sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "30.1.2", + "resolved": "https://registry.npmmirror.com/jsdom/-/jsdom-30.1.2.tgz", + "integrity": "sha512-0FFE/jE1rppmVfUrJUgxqXjcwolZYIGtAgj1pTussMhNZxIxi7W/PvfWaMNroGi2B36X1IKHbexpZ9DhkoOPiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^7.1.3", + "@asamuzakjp/dom-selector": "^9.2.4", + "@bramus/specificity": "^2.4.2", + "@csstools/css-syntax-patches-for-csstree": "^1.1.15", + "@exodus/bytes": "^1.16.0", + "css-tree": "^3.2.1", + "data-urls": "^8.0.0", + "decimal.js": "^10.6.0", + "html-encoding-sniffer": "^7.0.0", + "is-potential-custom-element-name": "^1.0.1", + "lru-cache": "^11.5.3", + "parse5": "^8.0.1", + "saxes": "^6.0.0", + "tough-cookie": "^6.0.2", + "undici": "^8.11.2", + "w3c-xmlserializer": "^6.0.0", + "webidl-conversions": "^8.0.1", + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.2.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + }, + "peerDependencies": { + "canvas": "^3.2.3" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, "node_modules/lodash": { "version": "4.18.1", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.18.1.tgz", @@ -1752,6 +2353,16 @@ "lodash-es": "*" } }, + "node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", @@ -1770,6 +2381,13 @@ "node": ">= 0.4" } }, + "node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/memoize-one": { "version": "6.0.0", "resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz", @@ -1797,6 +2415,32 @@ "node": ">= 0.6" } }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", @@ -1834,12 +2478,68 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/nopt": { + "version": "10.0.1", + "resolved": "https://registry.npmmirror.com/nopt/-/nopt-10.0.1.tgz", + "integrity": "sha512-df3sBr/6ax9hSGuC3CspvLlbnX8cP5L5nZwXF8cGN8l0zSWR6BvzmQ6jPUKjvo6+/xdpkNvEcucBNUdBeeV13g==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^5.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, "node_modules/normalize-wheel-es": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz", "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==", "license": "BSD-3-Clause" }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmmirror.com/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/parse5/-/parse5-8.0.1.tgz", + "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^8.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "8.1.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-8.1.0.tgz", + "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz", @@ -1847,6 +2547,23 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/perfect-debounce": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz", @@ -1950,6 +2667,13 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmmirror.com/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true, + "license": "ISC" + }, "node_modules/proxy-from-env": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz", @@ -1959,6 +2683,26 @@ "node": ">=10" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", @@ -2011,6 +2755,32 @@ "fsevents": "~2.3.2" } }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", @@ -2029,6 +2799,13 @@ "node": ">=0.10.0" } }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, "node_modules/superjson": { "version": "2.2.6", "resolved": "https://registry.npmmirror.com/superjson/-/superjson-2.2.6.tgz", @@ -2041,6 +2818,26 @@ "node": ">=16" } }, + "node_modules/tinybench": { + "version": "6.2.1", + "resolved": "https://registry.npmmirror.com/tinybench/-/tinybench-6.2.1.tgz", + "integrity": "sha512-IAbQaPJIIdhVxi0mqy9lez1wEwje0UQf9F1vwtbelEG5Nbgn0nPOxCvU+mNeNS9gyJTAhrHp74CbUaSynQpZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -2058,6 +2855,52 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tldts": { + "version": "7.4.18", + "resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.4.18.tgz", + "integrity": "sha512-somxA8xKAUzlAxl0TX/jMSYIbRNFIVGnI96pVGJPeMc5BsHmfVXn6mOJT6U++ELnl04eGfzpfcEuZe8WiASkXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^7.4.18" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "7.4.18", + "resolved": "https://registry.npmmirror.com/tldts-core/-/tldts-core-7.4.18.tgz", + "integrity": "sha512-KI2PKvCmvQI/xD6ypPqkU0i7oxNXR/O58RLRaHR4svsgVUQ2JE/XC8BtMbG6PSehD27I8sZJRcC1ASnCy6lp3g==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.0.2.tgz", + "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^7.0.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/tr46/-/tr46-7.0.0.tgz", + "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", @@ -2072,6 +2915,16 @@ "node": ">=14.17" } }, + "node_modules/undici": { + "version": "8.11.2", + "resolved": "https://registry.npmmirror.com/undici/-/undici-8.11.2.tgz", + "integrity": "sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.19.0" + } + }, "node_modules/undici-types": { "version": "8.3.0", "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-8.3.0.tgz", @@ -2154,6 +3007,99 @@ } } }, + "node_modules/vitest": { + "version": "5.0.3", + "resolved": "https://registry.npmmirror.com/vitest/-/vitest-5.0.3.tgz", + "integrity": "sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.0.3", + "chai": "^6.2.2", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.2.3", + "obug": "^2.1.4", + "picomatch": "^4.0.7", + "std-env": "^4.2.0", + "tinybench": "^6.1.4", + "tinyexec": "^1.3.0", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.0.3", + "@vitest/browser-preview": "5.0.3", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.0.3", + "@vitest/coverage-v8": "5.0.3", + "@vitest/ui": "5.0.3", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, "node_modules/vscode-uri": { "version": "3.2.0", "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.2.0.tgz", @@ -2225,6 +3171,84 @@ "peerDependencies": { "typescript": ">=5.0.0" } + }, + "node_modules/w3c-xmlserializer": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", + "integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-8.0.1.tgz", + "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=20" + } + }, + "node_modules/whatwg-mimetype": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz", + "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/whatwg-url": { + "version": "17.2.0", + "resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-17.2.0.tgz", + "integrity": "sha512-IhLIHNcBrzIixC5XXsbr4DxdjajyA5vQ5RwGZMtrUp+GbtE5Nrsge9QKau7jXrC0aTXLYGV0xiW7Tb4YS2aomw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@exodus/bytes": "^1.16.0", + "tr46": "^7.0.0", + "webidl-conversions": "^8.0.1" + }, + "engines": { + "node": "^22.14.0 || >=24.0.0" + } + }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" } } } diff --git a/admin-frontend-vue/package.json b/admin-frontend-vue/package.json index 0368c7338..f78db149d 100644 --- a/admin-frontend-vue/package.json +++ b/admin-frontend-vue/package.json @@ -8,6 +8,7 @@ "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", "test": "node --test tests/*.test.ts", + "test:mount": "vitest run", "test:live": "node --test tests/live/*.test.ts", "test:browser": "playwright test" }, @@ -22,8 +23,11 @@ "@playwright/test": "^1.63.0", "@types/node": "^26.4.1", "@vitejs/plugin-vue": "^6.0.1", + "@vue/test-utils": "^2.5.1", + "jsdom": "^30.1.2", "typescript": "^5.9.2", "vite": "^7.3.1", + "vitest": "^5.0.3", "vue-tsc": "^3.0.6" } } diff --git a/admin-frontend-vue/src/components/NotificationBell.vue b/admin-frontend-vue/src/components/NotificationBell.vue index 48b165889..15b1a92a2 100644 --- a/admin-frontend-vue/src/components/NotificationBell.vue +++ b/admin-frontend-vue/src/components/NotificationBell.vue @@ -136,12 +136,15 @@ import { type AdminNotificationItem, } from '@/api/notifications' import { useAdminSessionStore } from '@/stores/admin-session' +import { showAdminFeedback } from '@/components/admin-feedback-ui' import { NOTIFICATION_POLL_INTERVAL_MS, + createSummaryFailureAlerter, formatNotificationTime, formatUnreadBadge, groupNotificationsByDay, hasNewNotification, + markReadFailureMessage, readLastNotifiedId, writeLastNotifiedId, } from '@/layout/notification-bell-model' @@ -208,10 +211,17 @@ function normalizedDayRange(): { startDate?: string; endDate?: string } { return { startDate: start || undefined, endDate: end || undefined } } +/** + * 未读数轮询失败的可见提示闸门(同场故障只提示一次,轮询 60s 一轮)。 + * 出口只走 admin-feedback-ui 的 showAdminFeedback,不在组件里另起一层提示。 + */ +const summaryFailures = createSummaryFailureAlerter((message, kind) => showAdminFeedback(message, kind)) + /** 拉未读数:发现新通知提醒一次(localStorage 记录已提醒过的最大 id,避免重复弹)。 */ async function refreshSummary() { try { const summary = await fetchNotificationSummary() + summaryFailures.reportSuccess() unreadCount.value = Number(summary?.unreadCount ?? 0) const latestId = Number(summary?.latestId ?? 0) if (hasNewNotification(latestId, readLastNotifiedId(currentUid()))) { @@ -220,8 +230,10 @@ async function refreshSummary() { console.log('[admin-notification] 检测到新通知 latestId=', latestId) } } catch (error) { - // 通知接口失败静默降级:不显示红点、不打扰使用者 + // 接口失败时红点不亮(与改前一致),但要让用户知道「没数」不等于「没通知」: + // 同一场故障只提示一次,成功一轮后重新武装(见 createSummaryFailureAlerter)。 console.warn('[admin-notification] 未读数刷新失败(静默降级):', error) + summaryFailures.reportFailure(error) } } @@ -312,7 +324,9 @@ async function onItemClick(item: AdminNotificationItem) { item.read = true unreadCount.value = Math.max(0, unreadCount.value - 1) } catch (error) { + // 改前只 console.warn:点了通知没反应,用户只能反复点。失败必须可见(统一出口)。 console.warn('[admin-notification] 标记已读失败:', error) + showAdminFeedback(markReadFailureMessage(error), 'error') } } diff --git a/admin-frontend-vue/src/layout/CompanyTabs.vue b/admin-frontend-vue/src/layout/CompanyTabs.vue index 7b52afd90..398417711 100644 --- a/admin-frontend-vue/src/layout/CompanyTabs.vue +++ b/admin-frontend-vue/src/layout/CompanyTabs.vue @@ -7,7 +7,8 @@ import { useRoute } from 'vue-router' import { COMPANY_STATUS_ACTIVE } from '@/api/companies-dto' import { useCompanyTabStore } from '@/stores/company-tab' import { useAdminSessionStore } from '@/stores/admin-session' -import { companyTabAppliesTo } from '@/layout/company-tab-model' +import { companyTabAppliesTo, companyTabInitFailureMessage } from '@/layout/company-tab-model' +import { showAdminFeedback } from '@/components/admin-feedback-ui' const route = useRoute() const tab = useCompanyTabStore() @@ -22,8 +23,12 @@ watch(() => session.isSuperAdmin, (v) => { // 现场只剩"tab 条没画出来",Task 13 人工清单第一项无从判断是权限问题还是接口挂了。 // 取不到目录 ⇒ fail-closed 不画 tab 条:store 不翻转 loaded,visibleForOperator 仍为 false,观感与改前一致。 // store 照 admin-session.ts:37-39 的口径 catch 出 error 之后仍然 rethrow,所以这一侧必须 .catch 接住。 - // 只写 console.warn:不许在模板里长出任何新的用户可见文字/提示条/图标(§12 第 5 条未批的暴露)。 - tab.initialize().catch((error: unknown) => console.warn('[company-tab] 公司目录没取到,tab 条不渲染', error)) + // 模板里仍不长出任何新的常驻文字/提示条/图标(§12 第 5 条未批的暴露),但失败不许只剩 console.warn: + // 文案由 company-tab-model 出,可见出口统一走 admin-feedback-ui 的 showAdminFeedback(一次性提示)。 + tab.initialize().catch((error: unknown) => { + console.warn('[company-tab] 公司目录没取到,tab 条不渲染', error) + showAdminFeedback(companyTabInitFailureMessage(error), 'warning') + }) }, { immediate: true }) diff --git a/admin-frontend-vue/src/layout/company-tab-model.ts b/admin-frontend-vue/src/layout/company-tab-model.ts index 2b8f16593..5c422d6c4 100644 --- a/admin-frontend-vue/src/layout/company-tab-model.ts +++ b/admin-frontend-vue/src/layout/company-tab-model.ts @@ -23,6 +23,20 @@ export function companyIdForRequest(isSuperAdmin: boolean, activeId: number | nu return isSuperAdmin ? activeId : null } +/** + * 公司目录没取到时的可见文案(四面9分口径 §2 后管「错误静默」)。 + * + *
改前 CompanyTabs.vue 的 `.catch` 只 console.warn,现场只剩「tab 条没画出来」, + * 判断不了是权限问题还是接口挂了。文案住在这里(不引组件、不引 element-plus), + * 可见出口由组件用 admin-feedback-ui 的 showAdminFeedback 承接;tab 条模板本身仍不产出 + * 任何文字节点(§12 第 5 条那处未批的页头暴露没被绕过——这是一次性提示,不是常驻文案)。
+ */ +export function companyTabInitFailureMessage(error: unknown): string { + const base = '公司目录没取到,公司切换条暂不可用' + const reason = error instanceof Error ? error.message.trim() : String(error ?? '').trim() + return reason ? `${base}:${reason}` : base +} + /** 「默认选中第一家」= id 最小的启用公司(spec §4 口径:不是超管自己所属公司,也不是返回顺序首条)。 */ export function firstSelectableCompanyId(companies: readonly CompanyItem[]): number | null { const active = companies.filter((c) => c.status === COMPANY_STATUS_ACTIVE && c.id > 0) diff --git a/admin-frontend-vue/src/layout/notification-bell-model.ts b/admin-frontend-vue/src/layout/notification-bell-model.ts index 5981fea12..bf9dbbd60 100644 --- a/admin-frontend-vue/src/layout/notification-bell-model.ts +++ b/admin-frontend-vue/src/layout/notification-bell-model.ts @@ -145,3 +145,63 @@ export function formatNotificationTime( } return `${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${hourMinute}` } + +/** + * 失败反馈的文案与「同场故障只提示一次」的闸门(四面9分口径 §2 后管「错误静默」)。 + * + *改前 NotificationBell.vue 的两处 catch 只 console.warn:未读数接口挂了红点静默消失、 + * 点通知标已读失败界面纹丝不动,使用者无从判断是"没有通知"还是"接口没通"(全仓 src 无 + * errorHandler/unhandledrejection 兜底)。文案在这里出、可见出口由组件注入 + * ({@code showAdminFeedback}),模型层不引 element-plus ⇒ 这一族判据能用 node --test 直接跑真函数, + * 不必退化成读源码的钉子。
+ */ +export type BellFeedbackKind = 'success' | 'error' | 'warning' + +/** 可见提示的出口:组件把 admin-feedback-ui 的 showAdminFeedback 递进来。 */ +export type BellFeedbackSink = (message: string, kind: BellFeedbackKind) => void + +function failureReason(error: unknown): string { + if (error instanceof Error) { + return error.message.trim() + } + return String(error ?? '').trim() +} + +/** 未读数刷新失败的提示文案:带上原因,便于区分"接口挂了"与"没权限"。 */ +export function summaryFailureMessage(error: unknown): string { + const reason = failureReason(error) + return reason ? `通知未读数刷新失败:${reason}` : '通知未读数刷新失败' +} + +/** 标记已读失败的提示文案:点了必须有回应,失败也要有回应。 */ +export function markReadFailureMessage(error: unknown): string { + const reason = failureReason(error) + return reason ? `这条通知没能标记为已读:${reason}` : '这条通知没能标记为已读' +} + +/** + * 轮询失败的提示闸门:一轮 60s,同一场故障只提示一次,成功一轮后重新武装。 + * 不设闸等于把「静默失败」换成「每分钟打扰一次」,两个都是错的口径。 + */ +export function createSummaryFailureAlerter(feedback: BellFeedbackSink): { + reportFailure(error: unknown): void + reportSuccess(): void + isArmed(): boolean +} { + let alerted = false + return { + reportFailure(error: unknown): void { + if (alerted) { + return + } + alerted = true + feedback(summaryFailureMessage(error), 'warning') + }, + reportSuccess(): void { + alerted = false + }, + isArmed(): boolean { + return alerted + }, + } +} diff --git a/admin-frontend-vue/tests/baselines/source-pin-ledger.json b/admin-frontend-vue/tests/baselines/source-pin-ledger.json new file mode 100644 index 000000000..9f86fe9a0 --- /dev/null +++ b/admin-frontend-vue/tests/baselines/source-pin-ledger.json @@ -0,0 +1,954 @@ +{ + "note": "readSource 钉子逐文件基线。只许减;台账外新文件带钉子同样算破口。由 tests/source-pin-ratchet.test.ts 生成。", + "totals": { + "files": 236, + "cases": 1698, + "pins": 434 + }, + "files": { + "admin-scaffold.test.ts": { + "cases": 1, + "pins": 1 + }, + "align-account-row-buttons.test.ts": { + "cases": 2, + "pins": 2 + }, + "align-asin-row-buttons.test.ts": { + "cases": 7, + "pins": 7 + }, + "align-category-tree.test.ts": { + "cases": 6, + "pins": 5 + }, + "align-column-width.test.ts": { + "cases": 4, + "pins": 4 + }, + "align-dedupe-summary.test.ts": { + "cases": 7, + "pins": 1 + }, + "align-delete-copy.test.ts": { + "cases": 2, + "pins": 0 + }, + "align-digital-human.test.ts": { + "cases": 7, + "pins": 2 + }, + "align-dup-console.test.ts": { + "cases": 10, + "pins": 9 + }, + "align-edit-user-auth-guard.test.ts": { + "cases": 1, + "pins": 1 + }, + "align-group-editor.test.ts": { + "cases": 10, + "pins": 2 + }, + "align-group-visibility.test.ts": { + "cases": 0, + "pins": 0 + }, + "align-history-clear.test.ts": { + "cases": 3, + "pins": 3 + }, + "align-history-copy.test.ts": { + "cases": 3, + "pins": 2 + }, + "align-image-video.test.ts": { + "cases": 5, + "pins": 2 + }, + "align-invalid-asin-shared.test.ts": { + "cases": 2, + "pins": 2 + }, + "align-locale.test.ts": { + "cases": 3, + "pins": 3 + }, + "align-menu-auto-key.test.ts": { + "cases": 5, + "pins": 3 + }, + "align-menu-manage.test.ts": { + "cases": 10, + "pins": 2 + }, + "align-message-z-overlay.test.ts": { + "cases": 3, + "pins": 3 + }, + "align-operation-guide.test.ts": { + "cases": 10, + "pins": 2 + }, + "align-pagination.test.ts": { + "cases": 3, + "pins": 3 + }, + "align-product-category.test.ts": { + "cases": 7, + "pins": 2 + }, + "align-query-asin.test.ts": { + "cases": 6, + "pins": 2 + }, + "align-shop-columns.test.ts": { + "cases": 2, + "pins": 2 + }, + "align-shop-data-cards.test.ts": { + "cases": 4, + "pins": 4 + }, + "align-shop-data-grid.test.ts": { + "cases": 5, + "pins": 5 + }, + "align-shop-records-row-buttons.test.ts": { + "cases": 3, + "pins": 3 + }, + "align-skip-price.test.ts": { + "cases": 9, + "pins": 4 + }, + "align-software-version.test.ts": { + "cases": 1, + "pins": 1 + }, + "align-tutorial.test.ts": { + "cases": 4, + "pins": 3 + }, + "align-user-createdby.test.ts": { + "cases": 6, + "pins": 1 + }, + "align-user-menu-auth-app.test.ts": { + "cases": 3, + "pins": 2 + }, + "align-user-menu-grantable.test.ts": { + "cases": 5, + "pins": 1 + }, + "align-user-menu-parent-check.test.ts": { + "cases": 6, + "pins": 1 + }, + "company-config-entry-super-only.test.ts": { + "cases": 4, + "pins": 3 + }, + "company-directory.test.ts": { + "cases": 8, + "pins": 0 + }, + "company-menu-route.test.ts": { + "cases": 0, + "pins": 0 + }, + "company-super-admin-only.test.ts": { + "cases": 8, + "pins": 1 + }, + "company-tab-failure.test.ts": { + "cases": 4, + "pins": 2 + }, + "company-tab-model.test.ts": { + "cases": 4, + "pins": 0 + }, + "company-tab-wiring.test.ts": { + "cases": 7, + "pins": 3 + }, + "company-user-create.test.ts": { + "cases": 9, + "pins": 3 + }, + "company-user-list.test.ts": { + "cases": 5, + "pins": 2 + }, + "date-filter-default-today.test.ts": { + "cases": 3, + "pins": 1 + }, + "datetime-format.test.ts": { + "cases": 8, + "pins": 0 + }, + "datetime-sweep.test.ts": { + "cases": 6, + "pins": 6 + }, + "device-logs-user-filter.test.ts": { + "cases": 5, + "pins": 5 + }, + "duplicate-console.test.ts": { + "cases": 5, + "pins": 0 + }, + "expiry-notice.test.ts": { + "cases": 7, + "pins": 2 + }, + "forbidden-not-login-redirect.test.ts": { + "cases": 5, + "pins": 1 + }, + "login-failure-must-show-reason.test.ts": { + "cases": 7, + "pins": 1 + }, + "normal-account-no-own-expiry.test.ts": { + "cases": 9, + "pins": 2 + }, + "notification-bell-failure.test.ts": { + "cases": 6, + "pins": 2 + }, + "notification-bell.test.ts": { + "cases": 6, + "pins": 0 + }, + "ops-cell-must-wrap.test.ts": { + "cases": 2, + "pins": 0 + }, + "perf-admin-repeat-requests.test.ts": { + "cases": 3, + "pins": 3 + }, + "perf-element-on-demand.test.ts": { + "cases": 5, + "pins": 5 + }, + "shop-key-filter-params.test.ts": { + "cases": 7, + "pins": 4 + }, + "single-device-kick.test.ts": { + "cases": 3, + "pins": 2 + }, + "task-1.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-10.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-101.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-102.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-103.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-104.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-105.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-106.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-107.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-108.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-109.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-11.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-110.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-111.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-112.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-113.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-114.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-115.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-116.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-117.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-118.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-119.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-12.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-121.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-122.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-123.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-124.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-125.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-126.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-127.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-128.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-129.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-13.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-130.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-131.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-132.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-133.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-134.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-135.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-136.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-137.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-138.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-139.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-14.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-15.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-16.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-181.test.ts": { + "cases": 0, + "pins": 0 + }, + "task-182.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-183.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-184.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-185.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-186.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-187.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-188.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-189.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-190.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-191.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-192.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-193.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-194.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-195.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-196.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-197.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-198.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-199.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-2.test.ts": { + "cases": 0, + "pins": 0 + }, + "task-21.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-22.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-23.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-24.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-241.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-242.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-243.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-244.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-245.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-246.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-247.test.ts": { + "cases": 2, + "pins": 1 + }, + "task-25.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-250.test.ts": { + "cases": 8, + "pins": 7 + }, + "task-251.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-252.test.ts": { + "cases": 8, + "pins": 7 + }, + "task-253.test.ts": { + "cases": 8, + "pins": 7 + }, + "task-254.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-255.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-256.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-257.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-258.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-259.test.ts": { + "cases": 8, + "pins": 3 + }, + "task-26.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-260.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-261.test.ts": { + "cases": 8, + "pins": 4 + }, + "task-262.test.ts": { + "cases": 8, + "pins": 5 + }, + "task-263.test.ts": { + "cases": 8, + "pins": 8 + }, + "task-264.test.ts": { + "cases": 8, + "pins": 5 + }, + "task-265.test.ts": { + "cases": 8, + "pins": 6 + }, + "task-266.test.ts": { + "cases": 8, + "pins": 6 + }, + "task-267.test.ts": { + "cases": 8, + "pins": 7 + }, + "task-268.test.ts": { + "cases": 8, + "pins": 7 + }, + "task-27.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-28.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-29.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-3.test.ts": { + "cases": 6, + "pins": 6 + }, + "task-30.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-31.test.ts": { + "cases": 8, + "pins": 3 + }, + "task-32.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-33.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-34.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-35.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-36.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-37.test.ts": { + "cases": 8, + "pins": 0 + }, + "task-38.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-39.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-4.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-41.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-42.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-43.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-44.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-45.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-46.test.ts": { + "cases": 8, + "pins": 2 + }, + "task-47.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-48.test.ts": { + "cases": 10, + "pins": 3 + }, + "task-49.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-5.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-50.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-51.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-52.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-53.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-54.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-55.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-56.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-57.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-58.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-59.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-6.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-61.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-62.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-63.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-64.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-65.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-66.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-67.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-68.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-69.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-7.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-70.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-71.test.ts": { + "cases": 10, + "pins": 1 + }, + "task-72.test.ts": { + "cases": 11, + "pins": 1 + }, + "task-73.test.ts": { + "cases": 9, + "pins": 1 + }, + "task-74.test.ts": { + "cases": 9, + "pins": 1 + }, + "task-75.test.ts": { + "cases": 10, + "pins": 1 + }, + "task-76.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-77.test.ts": { + "cases": 10, + "pins": 1 + }, + "task-78.test.ts": { + "cases": 9, + "pins": 1 + }, + "task-79.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-8.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-81.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-82.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-83.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-84.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-85.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-86.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-87.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-88.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-89.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-9.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-90.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-91.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-92.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-93.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-94.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-95.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-96.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-97.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-98.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-99.test.ts": { + "cases": 8, + "pins": 1 + }, + "task-center-board.test.ts": { + "cases": 7, + "pins": 3 + } + } +} \ No newline at end of file diff --git a/admin-frontend-vue/tests/company-tab-failure.test.ts b/admin-frontend-vue/tests/company-tab-failure.test.ts new file mode 100644 index 000000000..134717613 --- /dev/null +++ b/admin-frontend-vue/tests/company-tab-failure.test.ts @@ -0,0 +1,73 @@ +/** + * 公司 tab 取数失败的可见性(四面9分口径 §2 后管「错误静默」第 4 处)。 + * + * 前 2 支是**行为断言**:`src/layout/company-tab-model.ts` 是纯模块,node --test 直接 import 跑真函数。 + * 第 3 支是**源码钉子**(readSource,钉形状不钉运行时),第 4 支是这枚钉子的内存变异自证。 + * 运行时那一面(组件的 watch 真把 store 的 rethrow 接成了可见提示)由 + * `tests/mount/company-tabs-failure.mount.test.ts` 覆盖(`npm run test:mount`,vitest + jsdom); + * 钉子留在零依赖的 `node --test` 里,是为了没装 node_modules 的机器也拦得住回退。 + */ +import test from 'node:test' +import assert from 'node:assert/strict' + +import { readSource } from './helpers.ts' +import { companyTabInitFailureMessage } from '../src/layout/company-tab-model.ts' + +const TABS = 'src/layout/CompanyTabs.vue' + +/** 钉子判据:store 的 rethrow 被接住,且接住之后必须有一次用户可见提示。 */ +function tabFailureWiring(src: string): string[] { + const missing: string[] = [] + if (!/tab\.initialize\(\)\.catch\(/.test(src)) missing.push('组件侧没接住 store 的 rethrow(会又变回 unhandled rejection)') + const at = src.indexOf('console.warn(\'[company-tab] 公司目录没取到') + if (at < 0) missing.push('console.warn 本体不在了:catch 被挪走或整段删除') + else if (!/showAdminFeedback\(companyTabInitFailureMessage\(error\)/.test(src.slice(at, at + 220))) { + missing.push('console.warn 之后 220 字符内没有可见提示出口') + } + if (!src.includes(`import { showAdminFeedback } from '@/components/admin-feedback-ui'`)) { + missing.push('没接 admin-feedback-ui 的统一出口') + } + return missing +} + +test('公司目录取数失败的文案:带原因、非 Error 抛值不塌、空原因不加冒号', () => { + assert.equal(companyTabInitFailureMessage(new Error('503 Service Unavailable')), '公司目录没取到,公司切换条暂不可用:503 Service Unavailable') + assert.equal(companyTabInitFailureMessage('网络中断'), '公司目录没取到,公司切换条暂不可用:网络中断') + assert.equal(companyTabInitFailureMessage(undefined), '公司目录没取到,公司切换条暂不可用') + assert.equal(companyTabInitFailureMessage(new Error(' ')), '公司目录没取到,公司切换条暂不可用') +}) + +test('文案里不许长出未批的界面暴露:既不是"当前公司"提示条,也不读 store 的 error', () => { + const text = companyTabInitFailureMessage(new Error('boom')) + assert.equal(text.includes('当前公司'), false, '这句是瞬时提示,不是页头"当前公司"文案(§12 第 5 条那处未批的暴露)') + assert.equal(text.includes('tab.error'), false, '提示里不许带 store 内部字段名') +}) + +test('源码钉子(非行为断言):initialize().catch 之后既有 console.warn 也有可见提示', () => { + const src = readSource(TABS) + assert.ok(src.length > 0, '取样集非空自检:CompanyTabs.vue 读到了') + assert.deepEqual(tabFailureWiring(src), [], '公司 tab 的失败路径又退回只 console 了') + // 反向钉:tab 条模板本身仍不渲染 error(那条约束由 company-tab-wiring 钉,这里只保证我没把它带回来) + assert.equal(src.includes('tab.error'), false, '不许把 error 渲染进模板') +}) + +test('判据自证(内存变异):摘掉提示出口或摘掉 catch,钉子必须变红', () => { + const src = readSource(TABS) + assert.deepEqual(tabFailureWiring(src), [], '基线就该是干净的,否则这条自证测不出任何东西') + + const variants: Array<[string, string, string]> = [ + ['摘掉可见提示', " showAdminFeedback(companyTabInitFailureMessage(error), 'warning')\n", ''], + ['退回改前那版只 console 的箭头函数', + ' tab.initialize().catch((error: unknown) => {\n' + + " console.warn('[company-tab] 公司目录没取到,tab 条不渲染', error)\n" + + " showAdminFeedback(companyTabInitFailureMessage(error), 'warning')\n" + + ' })\n', + " tab.initialize().catch((error: unknown) => console.warn('[company-tab] 公司目录没取到,tab 条不渲染', error))\n"], + ] + for (const [label, anchor, replaced] of variants) { + assert.equal(src.split(anchor).length - 1, 1, `「${label}」的锚串在源码里不唯一,变异不作数`) + const mutated = src.replace(anchor, replaced) + assert.notEqual(mutated, src, `「${label}」的变异没落地`) + assert.ok(tabFailureWiring(mutated).length > 0, `「${label}」之后判据仍然全绿=这条钉子恒绿`) + } +}) diff --git a/admin-frontend-vue/tests/mount/company-tabs-failure.mount.test.ts b/admin-frontend-vue/tests/mount/company-tabs-failure.mount.test.ts new file mode 100644 index 000000000..7466d2eda --- /dev/null +++ b/admin-frontend-vue/tests/mount/company-tabs-failure.mount.test.ts @@ -0,0 +1,82 @@ +/** + * 首批组件挂载用例(四面9分口径 §2 后管「0 组件挂载测试」)。 + * + * 靶子是改掉的那处静默 catch:CompanyTabs 的 `tab.initialize().catch(...)`。 + * 这三支跑的是真组件、真 pinia store、真 watch ⇒ 判的是运行时行为,不是读源码的形状钉子。 + * + * 跑法:`npm run test:mount`(vitest + jsdom,配置见 vitest.config.ts)。 + * 放在 tests/mount/ 且 `node --test tests/*.test.ts` 的 glob 不递归 ⇒ 两套 runner 互不干扰。 + */ +import { beforeEach, describe, expect, it, vi } from 'vitest' +import { flushPromises, mount } from '@vue/test-utils' +import { createPinia, setActivePinia, type Pinia } from 'pinia' + +import CompanyTabs from '@/layout/CompanyTabs.vue' +import { useAdminSessionStore } from '@/stores/admin-session' +import { COMPANY_STATUS_ACTIVE } from '@/api/companies-dto' + +const feedback = vi.hoisted(() => ({ showAdminFeedback: vi.fn(), runBusy: vi.fn() })) +const companiesApi = vi.hoisted(() => ({ fetchCompanies: vi.fn() })) + +vi.mock('@/components/admin-feedback-ui', () => feedback) +vi.mock('@/api/companies', () => companiesApi) +vi.mock('vue-router', () => ({ + useRoute: () => ({ meta: { menuKey: 'admin_users' } }), +})) + +const company = (id: number, name: string) => ({ + id, + companyName: name, + status: COMPANY_STATUS_ACTIVE, + remark: null, + createdAt: null, + updatedAt: null, +}) + +describe('CompanyTabs:公司目录取数失败必须让用户看得见', () => { + let pinia: Pinia + + beforeEach(() => { + vi.clearAllMocks() + pinia = createPinia() + setActivePinia(pinia) + useAdminSessionStore().user = { id: 1, username: 'root', role: 'super_admin' } + }) + + it('GET /companies 抛错时经统一出口给一条 warning,而不是只剩 console.warn', async () => { + companiesApi.fetchCompanies.mockRejectedValue(new Error('503 Service Unavailable')) + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + mount(CompanyTabs, { global: { plugins: [pinia] } }) + await flushPromises() + + expect(feedback.showAdminFeedback).toHaveBeenCalledTimes(1) + const [message, kind] = feedback.showAdminFeedback.mock.calls[0] + expect(message).toContain('公司目录没取到') + expect(message).toContain('503 Service Unavailable') + expect(kind).toBe('warning') + expect(warn).toHaveBeenCalledTimes(1) + warn.mockRestore() + }) + + it('反向钉:目录取到时一句提示都不许有,而 tab 条要真画出公司名', async () => { + companiesApi.fetchCompanies.mockResolvedValue([company(1, '甲公司'), company(2, '乙公司')]) + + const wrapper = mount(CompanyTabs, { global: { plugins: [pinia] } }) + await flushPromises() + + expect(feedback.showAdminFeedback).not.toHaveBeenCalled() + expect(wrapper.findAll('button[role="tab"]').map((b) => b.text())).toEqual(['甲公司', '乙公司']) + }) + + it('非超管根本不发这个请求,也就不会凭空弹一条"取不到目录"', async () => { + useAdminSessionStore().user = { id: 2, username: 'ops', role: 'admin' } + companiesApi.fetchCompanies.mockRejectedValue(new Error('不该被调用')) + + mount(CompanyTabs, { global: { plugins: [pinia] } }) + await flushPromises() + + expect(companiesApi.fetchCompanies).not.toHaveBeenCalled() + expect(feedback.showAdminFeedback).not.toHaveBeenCalled() + }) +}) diff --git a/admin-frontend-vue/tests/mount/notification-bell-failure.mount.test.ts b/admin-frontend-vue/tests/mount/notification-bell-failure.mount.test.ts new file mode 100644 index 000000000..4398d3ba7 --- /dev/null +++ b/admin-frontend-vue/tests/mount/notification-bell-failure.mount.test.ts @@ -0,0 +1,157 @@ +/** + * 首批组件挂载用例之二(四面9分口径 §2 后管「0 组件挂载测试」)。 + * + * 靶子是 NotificationBell.vue 的两处静默 catch(未读数轮询、点通知标已读)。 + * 这里跑真组件:真 pinia 会话、真 `notification-bell-model` 里的提示闸门、真定时器 + * (用 vi 的假时钟推进 60s 轮询),只把两个出口(api 与 admin-feedback-ui)换成可断言的假件 + * ⇒ 判的是运行时行为,不是读源码的形状钉子。 + * + * ⚠ 面板是 `