194 Commits

Author SHA1 Message Date
8090896dda chore(deps): update all non-major dependencies
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Failing after 1m32s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2026-01-10 20:05:03 +08:00
c4b93140f0 chore(deps): update dependency vite to v7.3.1
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m13s
测试最新依赖 / build-and-test (push) Failing after 1m29s
测试最新依赖 / playwright (push) Successful in 2m23s
2026-01-10 16:06:22 +08:00
1a9257249f chore(deps): update dependency @pinia/colada to ^0.20.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m7s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
测试最新依赖 / build-and-test (push) Successful in 1m32s
测试最新依赖 / playwright (push) Successful in 1m57s
2026-01-07 01:48:38 +08:00
严浩
66280dc6a1 chore(devcontainer): remove AI setup configurations
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m55s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
测试最新依赖 / build-and-test (push) Successful in 1m44s
测试最新依赖 / playwright (push) Successful in 1m49s
2026-01-04 23:31:37 +08:00
16c93a82a2 chore(deps): replace dependency @tsconfig/node22 with @tsconfig/node24
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
测试最新依赖 / build-and-test (push) Successful in 1m28s
测试最新依赖 / playwright (push) Successful in 1m53s
2026-01-02 01:06:25 +08:00
16d4b3f749 chore(deps): update primevue pkgs to v4.5.4
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m38s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m57s
测试最新依赖 / build-and-test (push) Successful in 1m43s
测试最新依赖 / playwright (push) Successful in 1m54s
2026-01-01 22:28:04 +08:00
42f63f7134 chore(deps): update dependency unplugin-vue-router to v0.19.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m7s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
2026-01-01 19:08:32 +08:00
9d12927793 chore(deps): update dependency @pinia/colada to ^0.19.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m59s
测试最新依赖 / playwright (push) Successful in 1m59s
测试最新依赖 / build-and-test (push) Successful in 2m7s
2025-12-31 06:25:53 +08:00
bb82a6ab83 chore(deps): update dependency @vitejs/plugin-vue-jsx to v5.1.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m53s
测试最新依赖 / playwright (push) Successful in 1m41s
测试最新依赖 / build-and-test (push) Successful in 1m51s
2025-12-27 12:15:40 +08:00
76d2a45015 chore(deps): update primevue pkgs to v4.5.3
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m10s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m57s
测试最新依赖 / playwright (push) Failing after 1m2s
测试最新依赖 / build-and-test (push) Failing after 1m28s
2025-12-24 23:32:51 +08:00
严浩
935251ee53 chore(devcontainer): update configuration and lifecycle scripts
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m43s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m14s
测试最新依赖 / playwright (push) Successful in 1m46s
测试最新依赖 / build-and-test (push) Successful in 2m6s
2025-12-24 00:19:05 +08:00
5472f1c9b9 chore(deps): update dependency eslint-plugin-perfectionist to v5
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
测试最新依赖 / build-and-test (push) Successful in 1m54s
测试最新依赖 / playwright (push) Successful in 1m58s
2025-12-23 01:06:20 +08:00
744703811a chore(deps): update primevue pkgs to v4.5.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m38s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m53s
2025-12-22 19:25:58 +08:00
be3d59691b chore(deps): update dependency primelocale to v2.2.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m38s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
测试最新依赖 / build-and-test (push) Successful in 1m35s
测试最新依赖 / playwright (push) Successful in 1m46s
2025-12-19 04:51:01 +08:00
f6bccd7536 chore(deps): update dependency unplugin-vue-router to v0.19.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m45s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m46s
测试最新依赖 / build-and-test (push) Successful in 1m59s
测试最新依赖 / playwright (push) Successful in 2m28s
2025-12-18 23:35:22 +08:00
4673d622b6 chore(deps): update dependency vite to v7.3.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m18s
2025-12-18 20:56:11 +08:00
0e467a1e9d chore(deps): update primevue pkgs to v4.5.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m44s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m15s
测试最新依赖 / build-and-test (push) Successful in 1m28s
测试最新依赖 / playwright (push) Successful in 2m16s
2025-12-17 23:51:43 +08:00
7a5610c0dc chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m35s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
测试最新依赖 / playwright (push) Successful in 1m42s
测试最新依赖 / build-and-test (push) Successful in 2m9s
2025-12-17 03:32:37 +08:00
80d989f6d0 chore(deps): update dependency @pinia/colada to ^0.18.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m54s
2025-12-17 00:53:21 +08:00
6097d39752 chore(deps): update dependency @primeuix/themes to v2
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m28s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m57s
2025-12-16 23:17:01 +08:00
4bc62221b6 chore(deps): update dependency @vitejs/plugin-vue to v6.0.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m37s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m54s
测试最新依赖 / build-and-test (push) Successful in 1m33s
测试最新依赖 / playwright (push) Successful in 2m22s
2025-12-15 17:45:16 +08:00
c405bc9481 chore(deps): update dependency @intlify/unplugin-vue-i18n to v11.0.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m44s
测试最新依赖 / build-and-test (push) Successful in 1m44s
测试最新依赖 / playwright (push) Successful in 2m22s
2025-12-14 21:56:20 +08:00
54cc46b33a chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m36s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m58s
测试最新依赖 / build-and-test (push) Successful in 1m29s
测试最新依赖 / playwright (push) Successful in 2m26s
2025-12-12 23:14:48 +08:00
65ee7cccb3 chore(deps): update dependency happy-dom to v20.0.11
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m45s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m12s
2025-12-12 09:52:28 +08:00
6da6e59b6d chore(deps): update primevue pkgs to v4.5.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m10s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m54s
2025-12-12 03:56:01 +08:00
8e6d7488f4 chore(deps): update dependency vite-plugin-checker to ^0.12.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m5s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
测试最新依赖 / build-and-test (push) Successful in 1m32s
测试最新依赖 / playwright (push) Successful in 2m22s
2025-12-12 01:36:17 +08:00
严浩
9e050306bb feat: refactor Vite plugin loading mechanism and improve plugin management
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m3s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m6s
2025-12-12 00:09:53 +08:00
7f1811098f 更新 .github/workflows/测试最新依赖.yaml
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m37s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m46s
2025-12-11 21:04:48 +08:00
40b3686f2e chore(deps): update dependency @playwright/test to v1.57.0
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-12-11 21:03:49 +08:00
dfc64ecece 更新 .github/workflows/ci-cd.yaml
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 2m0s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-12-11 20:58:32 +08:00
1df5110034 chore(deps): update dependency @prettier/plugin-oxc to ^0.1.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m36s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
2025-12-11 17:44:41 +08:00
731a3da55d chore(deps): update dependency @vueuse/core to v14.1.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m48s
2025-12-11 15:08:52 +08:00
4e5b3cb96c chore(deps): update dependency vite to v7.2.7
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m44s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m56s
2025-12-11 11:47:59 +08:00
5e8df2572f chore(deps): update dependency @cloudflare/vite-plugin to v1.15.3
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m5s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
测试最新依赖 / build-and-test (push) Successful in 1m41s
测试最新依赖 / playwright (push) Failing after 2m12s
2025-12-11 01:01:20 +08:00
严浩
7d6474c92b refactor: update loadPlugin to use async/await and improve vueRouter configuration
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m44s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m40s
2025-12-11 00:05:04 +08:00
严浩
86920da611 refactor: update component names to PascalCase and improve structure
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m17s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
- Changed component names from kebab-case to PascalCase in various files for consistency.
- Updated `<router-view>` and `<transition>` to `<RouterView>` and `<Transition>` respectively in App.vue and base-layout.vue.
- Refactored AppNaiveUIProvider.vue to use PascalCase for Naive UI providers.
- Adjusted language and theme switch buttons to use PascalCase for icon components.
- Updated button components in demo pages to use PascalCase for Naive UI buttons.
- Modified ESLint rules in route message files to use perfectionist/sort-objects for better key sorting.
- Enhanced Vite plugin files to export loadPlugin functions for better plugin management.
- Improved plugin loading logic to handle errors and warnings more effectively.
2025-12-10 22:52:23 +08:00
3828f12a2d chore(deps): update dependency vue-i18n to v11.2.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m50s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
2025-12-10 14:06:40 +08:00
f269a25968 chore(deps): update dependency vitest to v4.0.14
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m1s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m41s
测试最新依赖 / playwright (push) Failing after 1m58s
测试最新依赖 / build-and-test (push) Successful in 2m12s
2025-12-09 23:45:38 +08:00
4a97eca056 chore(deps): update yanhao98/composite-actions digest to faab20a
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
2025-12-09 07:24:47 +08:00
e91476f55c chore(deps): update dependency @pinia/colada to v0.17.9
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m41s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m2s
测试最新依赖 / build-and-test (push) Failing after 2m3s
测试最新依赖 / playwright (push) Failing after 2m25s
2025-12-08 20:33:22 +08:00
afd08f05fc chore(deps): update dependency @iconify-json/material-symbols to v1.2.48
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
2025-12-08 15:17:29 +08:00
b2f9b9d3b3 chore(deps): update dependency unplugin-vue-router to ^0.19.0
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m3s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m46s
测试最新依赖 / playwright (push) Failing after 1m47s
测试最新依赖 / build-and-test (push) Failing after 1m56s
2025-12-08 03:37:20 +08:00
严浩
9cb70b7827 chore: remove unused h-setup-ai-tools command and update vue-devtools plugin logic
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m1s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m49s
2025-12-07 16:38:52 +08:00
52b1e4fb6b chore(deps): update all non-major dependencies to v3.1.5
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m48s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m40s
2025-12-07 05:42:51 +08:00
f101237792 chore(deps): update dependency vite to v7.2.6
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m41s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m49s
测试最新依赖 / build-and-test (push) Successful in 1m36s
测试最新依赖 / playwright (push) Failing after 2m10s
2025-12-04 15:17:40 +08:00
c84380836a chore(deps): update dependency unplugin-vue-router to ^0.18.0
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m37s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m7s
测试最新依赖 / playwright (push) Failing after 1m39s
测试最新依赖 / build-and-test (push) Successful in 2m16s
2025-12-01 21:04:41 +08:00
aca2c29946 chore(deps): update dependency unplugin-vue-router to v0.17.2
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m52s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m39s
测试最新依赖 / build-and-test (push) Successful in 1m35s
测试最新依赖 / playwright (push) Failing after 2m29s
2025-12-01 02:12:49 +08:00
9d1374d53c chore(deps): update dependency unplugin-auto-import to v20.3.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m42s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m49s
2025-11-30 12:22:47 +08:00
严浩
814130af34 refactor: devcontainer
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 2m40s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
测试最新依赖 / build-and-test (push) Successful in 1m30s
测试最新依赖 / playwright (push) Failing after 2m12s
2025-11-23 00:00:26 +08:00
4a5ae8d2de chore(deps): update vite packages
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m53s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
2025-11-22 10:52:13 +08:00
18fd9cb226 chore(deps): update dependency rollup to v4.53.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m51s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m46s
2025-11-22 06:03:12 +08:00
188c813447 chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m6s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m11s
测试最新依赖 / playwright (push) Successful in 2m5s
测试最新依赖 / build-and-test (push) Successful in 2m9s
2025-11-22 00:48:21 +08:00
737da9c585 chore(deps): update dependency @pinia/colada to v0.17.8
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m35s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
2025-11-21 19:01:10 +08:00
80090fdb90 chore(deps): update dependency @cloudflare/vite-plugin to v1.14.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m36s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
2025-11-21 06:43:22 +08:00
abcf706acc chore(deps): update dependency vite-plugin-vue-devtools to v8.0.5
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m56s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m4s
2025-11-21 03:52:52 +08:00
760b75083d chore(deps): update dependency sharp to v0.34.5
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m35s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m49s
测试最新依赖 / build-and-test (push) Successful in 1m32s
测试最新依赖 / playwright (push) Successful in 2m7s
2025-11-20 23:58:52 +08:00
0b4575b181 chore(deps): update dependency pinia to v3.0.4
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m52s
测试最新依赖 / build-and-test (push) Successful in 1m48s
测试最新依赖 / playwright (push) Successful in 1m51s
2025-11-19 18:59:22 +08:00
57fb6d5256 chore(deps): update dependency unplugin-vue-router to ^0.17.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m40s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
测试最新依赖 / playwright (push) Successful in 1m38s
测试最新依赖 / build-and-test (push) Successful in 1m48s
2025-11-19 01:15:14 +08:00
e516dd4ba6 chore(deps): update dependency @cloudflare/vite-plugin to v1.13.19
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m7s
2025-11-18 22:50:15 +08:00
6fc619315a chore(deps): update dependency vite-plugin-fake-server to v2.2.2
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m38s
CI/CD Pipeline / build-and-deploy (push) Failing after 2m21s
2025-11-18 20:01:02 +08:00
a5082ef4e4 chore(deps): update dependency unplugin-vue-router to v0.16.2
Some checks failed
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m35s
CI/CD Pipeline / build-and-deploy (push) Failing after 1m49s
2025-11-18 17:31:38 +08:00
9be884be20 chore(deps): update dependency @pinia/colada to v0.17.7
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m57s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
2025-11-18 14:33:36 +08:00
Yanhao-MBP
bbec2a3ff9 refactor(devcontainer): 合并配置脚本为单一环境设置脚本
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m48s
2025-11-18 13:41:14 +08:00
Yanhao
aa851bb920 chore(devcontainer): update image tag to main in devcontainer configuration
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m58s
2025-11-18 10:48:41 +08:00
Yanhao
5610d3ea20 fix(.gitignore): add .pnpm-store to ignore list 2025-11-18 10:43:15 +08:00
7a20a45035 chore(deps): update yanhao98/composite-actions digest to 94776ed
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m49s
2025-11-18 06:58:54 +08:00
db3f77d6d3 chore(deps): update all non-major dependencies to v3.1.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m36s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
2025-11-18 03:39:30 +08:00
严浩
e6731afff5 chore: update devcontainer configuration and add setup scripts
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m53s
测试最新依赖 / build-and-test (push) Successful in 1m31s
测试最新依赖 / playwright (push) Successful in 2m26s
2025-11-18 00:47:42 +08:00
3affb21d99 chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m59s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
测试最新依赖 / playwright (push) Successful in 1m50s
测试最新依赖 / build-and-test (push) Successful in 2m6s
2025-11-15 17:32:55 +08:00
严浩
2585b70f6b fix(Dockerfile): comment out VS Code shell integration line in zsh configuration
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m59s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m53s
2025-11-15 16:20:56 +08:00
严浩
a4e162cab0 build(devcontainer): configure pnpm cache and workspace settings
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m43s
测试最新依赖 / playwright (push) Successful in 1m49s
测试最新依赖 / build-and-test (push) Successful in 1m55s
2025-11-13 23:14:49 +08:00
严浩
88cc365935 build(devcontainer): adjust pnpm store directory creation 2025-11-13 22:51:55 +08:00
严浩
33801ca211 style(eslint): enforce padding between blocks in vue components
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m56s
2025-11-13 22:16:40 +08:00
严浩
4f79426206 build(devcontainer): 添加 VS Code shell 集成配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m51s
2025-11-13 13:52:38 +08:00
严浩
1185843982 feat(.devcontainer): 调整 VS Code 扩展配置与 Copilot 相关设置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m39s
2025-11-13 13:37:04 +08:00
0620651b12 chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m35s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
测试最新依赖 / build-and-test (push) Successful in 1m48s
测试最新依赖 / playwright (push) Successful in 2m27s
2025-11-13 01:07:40 +08:00
严浩
a82190d4aa chore(devcontainer): configure chat tool auto-approval
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m55s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m45s
2025-11-13 00:27:35 +08:00
严浩
d0a7afd5df chore(devcontainer): refine configuration and simplify tasks
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m12s
2025-11-12 23:56:59 +08:00
严浩
10fcb40d1d docs: 更新开发服务器部分,添加关于 Playwright 测试的说明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m45s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
2025-11-12 22:37:44 +08:00
严浩
c7dccb0664 build(tooling): configure pnpm workspaces and update dev tooling
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 1m13s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-11-12 14:17:15 +08:00
严浩
1bcecabf7b chore(devcontainer): add todo-tree vscode extension
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m55s
2025-11-12 11:31:45 +08:00
严浩
b7b508af08 chore(devcontainer): add gcmp vscode extension
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-11-12 11:29:47 +08:00
严浩
917b3c7324 fix(devcontainer): 优化端口转发配置并添加 iflow 权限修复脚本
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 1m39s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
2025-11-12 11:19:07 +08:00
严浩
6a73a274bd chore(vscode): enable i18n-ally editing and configure json formatting
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m58s
2025-11-12 11:09:09 +08:00
严浩
82897ea690 build(devcontainer): add iflow-cli support
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 1m45s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
2025-11-12 11:05:57 +08:00
严浩
e04310c2c9 style(devcontainer): format JSON configuration and add reference link 2025-11-12 11:05:57 +08:00
d2a21581ff chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m32s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
测试最新依赖 / build-and-test (push) Successful in 1m41s
测试最新依赖 / playwright (push) Successful in 1m52s
2025-11-11 16:39:11 +08:00
严浩
a2c49cf600 refactor: 删除 use-safe-n-form-auto-imports.tsx 文件
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m5s
2025-11-11 12:42:15 +08:00
严浩
3429c75600 build(devcontainer): 添加容器名称配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m56s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m17s
测试最新依赖 / playwright (push) Successful in 1m59s
测试最新依赖 / build-and-test (push) Successful in 2m13s
2025-11-10 22:42:49 +08:00
0f57624cdf chore(deps): update dependency vite to v7.2.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m59s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m2s
2025-11-10 18:35:56 +08:00
严浩
68fc6ad1a3 fix(i18n-auto-imports): 修复菜单翻译缺失时的提示信息
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m46s
2025-11-10 15:52:43 +08:00
严浩
b4727a1946 feat(devcontainer): 添加 antfu.unocss 插件支持
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m31s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m44s
2025-11-10 13:44:17 +08:00
严浩
f757b70174 build(devcontainer): use dynamic workspace folder name
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m39s
2025-11-10 12:53:33 +08:00
严浩
3033a8a707 build(devcontainer): 将PNPM环境变量从ARG改为ENV声明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m8s
将Dockerfile中的PNPM_HOME和PATH从构建参数(ARG)改为环境变量(ENV)声明,
确保在容器运行时这些变量仍然有效。
2025-11-10 11:23:43 +08:00
严浩
fa77b772be build(devcontainer): 添加 host.docker.internal 作为主机网关
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m32s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m43s
2025-11-10 10:53:18 +08:00
严浩
2440605fce feat(vscode): 配置开发任务在文件夹打开时自动运行 [skip ci] 2025-11-10 00:46:18 +08:00
严浩
386b65cd05 Revert "fix(devcontainer): 修改 pnpm-store 卷挂载路径 [skip ci]"
This reverts commit b6fd7c698c.
2025-11-10 00:21:01 +08:00
严浩
b6fd7c698c fix(devcontainer): 修改 pnpm-store 卷挂载路径 [skip ci] 2025-11-10 00:11:14 +08:00
严浩
9376f8e68e feat(demos): 移除 Naive UI Demo 中的 SafeNForm 示例 [skip ci] 2025-11-10 00:07:22 +08:00
严浩
3a3e9aead5 docs(AGENTS.md): 移除关于 Naive UI 表单布局的冗余内容 2025-11-10 00:05:04 +08:00
严浩
97009158e8 refactor(scripts): 调整 all 脚本命令中任务执行顺序 [skip ci] 2025-11-10 00:04:34 +08:00
严浩
a9b916221c refactor(devcontainer): 调整 Dockerfile 和 devcontainer 配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m46s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m44s
测试最新依赖 / build-and-test (push) Successful in 2m13s
测试最新依赖 / playwright (push) Successful in 2m31s
将 DEVCONTAINER 和 SANDBOX 环境变量从 Dockerfile 移至 devcontainer.json,
以提升配置的灵活性和一致性。同时,更新注释内容以准确反映当前安装脚本的功能。
2025-11-09 22:26:03 +08:00
严浩
ac7cb6a31c build(devcontainer): 调整 pnpm LTS 版本配置时机
将 `pnpm env use lts --global` 命令从 Dockerfile 和 postCreateCommand 中移除,
并在 devcontainer.json 的 onCreateCommand 阶段添加该命令

[skip ci]
2025-11-09 22:20:34 +08:00
严浩
fdf928028c chore(pnpm-workspace): 清理工作区配置文件
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m33s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m44s
移除不必要的包路径配置和注释项
2025-11-09 21:58:19 +08:00
严浩
3f31d188f6 build(devcontainer): 更新 pnpm 配置为全局设置存储目录 [skip ci] 2025-11-09 21:53:19 +08:00
c200206487 chore(deps): update dependency vite to v7.2.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m45s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m40s
2025-11-09 13:46:09 +08:00
严浩
b7aab0a6a5 build(devcontainer): 添加SANDBOX环境变量配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m46s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m41s
测试最新依赖 / build-and-test (push) Successful in 1m47s
测试最新依赖 / playwright (push) Successful in 1m56s
2025-11-09 02:49:47 +08:00
严浩
37a0d59f13 docs(package.json): 更新 devEngines.runtime 文档链接位置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m34s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m42s
2025-11-09 02:28:26 +08:00
严浩
163af5e80c build(devcontainer): 优化 zsh 配置与 pnpm 环境设置
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 1m58s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-11-09 00:55:03 +08:00
8e148c6408 chore(deps): update dependency vite to v7.2.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 1m43s
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
2025-11-08 20:35:14 +08:00
严浩
1f78af72fc refactor(devcontainer): 修改开发容器名称
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 1m56s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m3s
2025-11-08 19:07:00 +08:00
169e0984a4 chore(deps): update yanhao98/composite-actions digest to 336b588
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m2s
2025-11-08 18:46:53 +08:00
严浩
be9093fa77 feat(devcontainer): 调整挂载卷命名并优化容器命令执行流程
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m20s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m38s
2025-11-08 17:14:23 +08:00
严浩
5a6fdc0efd feat: 更新 Dockerfile 和 devcontainer.json,修改工作目录路径为 /wrkspc
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m53s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m57s
2025-11-08 16:22:54 +08:00
7551eed484 chore(deps): update dependency vue-tsc to v3.1.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m37s
2025-11-08 11:33:24 +08:00
严浩
a4068df0be feat: 更新 devcontainer.json,添加终端配置图标
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m22s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m26s
测试最新依赖 / build-and-test (push) Successful in 1m40s
测试最新依赖 / playwright (push) Successful in 2m35s
2025-11-08 03:00:56 +08:00
严浩
ccf61ee6c3 feat: 更新 Dockerfile 和 devcontainer.json
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m25s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m32s
2025-11-08 02:51:05 +08:00
严浩
3170fe889b chore: 清理 .npmrc 文件,更新 pnpm-workspace.yaml 配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m12s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m40s
2025-11-08 00:41:56 +08:00
严浩
aa55508ed7 feat: 更新 Dockerfile 和 devcontainer.json,添加别名和配置目录
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m11s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m13s
2025-11-07 11:44:59 +00:00
严浩
8d052bcac8 feat: 更新 Dockerfile 和 devcontainer.json,优化开发环境配置和扩展推荐
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m17s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m26s
2025-11-07 08:18:45 +00:00
严浩
ce2f5338de feat: 更新 VSCode 扩展推荐列表,添加 stylelint 和 lokalise.i18n-ally 2025-11-07 02:11:50 +00:00
966c40a338 chore(deps): update dependency @cloudflare/vite-plugin to v1.13.15
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m14s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m27s
测试最新依赖 / build-and-test (push) Successful in 1m50s
测试最新依赖 / playwright (push) Successful in 2m47s
2025-11-07 03:23:09 +08:00
严浩
fd42a4d6d5 chore(devcontainer): update forwarded ports to 4730 and 4731
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m2s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m13s
2025-11-06 17:43:14 +00:00
严浩
f883e0bec1 feat: 更新 pnpm 配置以设置全局存储目录 2025-11-07 01:38:48 +08:00
严浩
17bdbce8c8 feat: 添加 Dockerfile 和 devcontainer.json 文件以支持开发环境配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m17s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m48s
2025-11-07 01:34:21 +08:00
严浩
61e86e731d chore(husky): 移除时间命令以简化 commit-msg、post-merge 和 pre-commit 钩子
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m1s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m17s
2025-11-06 13:39:02 +08:00
严浩
ff790c7a3a feat: 添加 @intlify/eslint-plugin-vue-i18n 支持并更新相关配置
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-11-06 13:37:29 +08:00
076b8f3407 chore(deps): update dependency vitest to v4
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m14s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m48s
2025-11-06 00:46:19 +08:00
269d93187c chore(deps): update dependency @vueuse/core to v14
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m19s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m4s
测试最新依赖 / playwright (push) Successful in 2m24s
测试最新依赖 / build-and-test (push) Successful in 2m34s
2025-11-05 23:50:27 +08:00
33676dcc8b chore(deps): update dependency unplugin-vue-components to v30
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-11-05 23:50:18 +08:00
严浩
290aed74f2 fix(App): 调整 Toast 组件 z-index 并优化国际化缺失提示
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
- 为 Toast 组件添加 style="z-index: 5000" 以确保其层级高于其他 UI 元素
- 在开发模式下,当菜单翻译缺失时,通过 ToastService 弹出警告提示
- 更新 app-config 插件中的 __DEV__ 注释,明确其来源于 vite.config.ts 的 define 配置
- 提高 PrimeVue 的 zIndex 配置值,避免与自定义组件层级冲突
2025-11-05 23:23:28 +08:00
严浩
fd0543dcc2 build(package.json): 调整脚本执行顺序并增强格式化与检查命令
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m45s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m3s
2025-11-05 23:09:08 +08:00
严浩
fcd840d4fe feat(primevue): 配置PrimeVue的zIndex和类型约束
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m47s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m4s
2025-11-05 14:01:20 +08:00
严浩
2ba453bbed feat(app-store): 添加主题模式类型定义和初始值配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m31s
更新 useColorMode 钩子的类型参数,明确指定为 BasicColorSchema 类型,
并设置 initialValue 为 'auto',确保主题模式的类型安全和默认行为。
同时添加 attribute 配置项以支持 class 属性切换。
2025-11-05 13:45:15 +08:00
严浩
4b645bb916 feat(auto-imports): 添加 routeI18nT 类型声明
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-11-05 13:41:46 +08:00
0a8f1f8248 chore(deps): update dependency happy-dom to v20.0.8
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 3m40s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m0s
2025-11-05 08:29:46 +08:00
eaafbef793 chore(deps): update dependency primelocale to v2.2.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 4m3s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m29s
2025-11-05 06:03:43 +08:00
9f57c8fe0b chore(deps): update dependency @cloudflare/vite-plugin to v1.13.14
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 3m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m3s
测试最新依赖 / build-and-test (push) Successful in 1m50s
测试最新依赖 / playwright (push) Successful in 2m3s
2025-11-04 22:48:37 +08:00
严浩
e912b2c710 feat(i18n): 导出路由国际化实例的翻译函数
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 5m15s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m39s
2025-11-04 11:15:25 +08:00
严浩
c0c5e9763e feat(i18n): 优化国际化路由标题设置逻辑并修复响应式问题
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m3s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
2025-11-04 11:09:39 +08:00
严浩
6e915a5977 feat(eslint): 添加 jsonc 插件并启用 JSON 文件键排序规则
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m53s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m55s
测试最新依赖 / playwright (push) Successful in 2m1s
测试最新依赖 / build-and-test (push) Successful in 2m35s
新增 `eslint-plugin-jsonc` 插件,并在 `.json` 文件中启用 `jsonc/sort-keys` 规则,
以确保本地化文件中的键名按字母顺序排列。此举有助于减少多人协作时的合并冲突,
同时提升代码一致性和可维护性。

此外,调整了 VS Code 配置项顺序以优化读写逻辑,并更新相关依赖版本。
2025-11-04 01:28:01 +08:00
严浩
acd7c0db13 feat(i18n): 强制路由标题键名按字母顺序排序
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m41s
2025-11-03 23:41:36 +08:00
1ad46a62fd chore(deps): update dependency vite-plugin-image-optimizer to v2.0.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m47s
2025-11-03 20:47:17 +08:00
bb02b796aa chore(deps): update dependency unplugin-vue-router to v0.16.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m26s
2025-11-03 17:45:06 +08:00
严浩
a4ea7ce56e fix(useMetaLayoutsMenuOptions): 移除调试日志输出
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m16s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m40s
2025-11-03 16:42:40 +08:00
严浩
166d76d980 feat(router): 支持通过 activeMenuName 指定菜单高亮路径
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m24s
2025-11-03 15:54:11 +08:00
严浩
f9f82e4d29 feat(i18n): 引入 routeI18nInstance 以支持路由菜单标题的多语言处理
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 5m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m48s
2025-11-03 15:03:22 +08:00
严浩
b4fcde324d feat(auth): 添加用户认证模块与登录页面
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m38s
2025-11-03 13:46:47 +08:00
严浩
b669889bb0 refactor(plugins): 重构插件自动加载逻辑
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 7m17s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-11-03 11:52:54 +08:00
严浩
8a3b9e03fd feat(router): 添加路由就绪等待逻辑
Some checks failed
CI/CD Pipeline / playwright (push) Failing after 7m9s
CI/CD Pipeline / build-and-deploy (push) Has been skipped
2025-11-03 11:41:35 +08:00
ec02658ede chore(deps): update dependency happy-dom to v20.0.7
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m23s
2025-11-03 07:18:20 +08:00
严浩
bd9acc06a8 feat(vite-plugins): 添加 vant-touch-emulator 和 eruda 脚本支持
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m20s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m21s
测试最新依赖 / build-and-test (push) Successful in 2m10s
测试最新依赖 / playwright (push) Successful in 2m15s
2025-11-03 01:16:27 +08:00
严浩
f790691d5a fix(useMetaLayoutsNMenuOptions): 优化路由标题设置逻辑
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m4s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m39s
2025-11-02 23:05:20 +08:00
严浩
838d5cfb6e fix(useMetaLayoutsMenuOptions): 调整路由标题设置逻辑以支持多语言
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m17s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m27s
2025-11-02 22:33:06 +08:00
ac544a8ff5 chore(deps): update dependency wrangler to v4.45.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m18s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m25s
2025-11-02 18:20:03 +08:00
严浩
e7a4a7aff9 fix: 优化404页面返回按钮逻辑
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m27s
2025-11-02 17:19:16 +08:00
严浩
0d1a20d88d build(ci-cd): 添加构建时间环境变量支持
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m3s
2025-11-02 16:50:22 +08:00
19aaddc4e2 chore(deps): update dependency unplugin-icons to v22.5.0
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 3m42s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m20s
2025-11-02 12:19:18 +08:00
1e24193b84 chore(deps): update dependency primelocale to v2.2.1
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 3m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m41s
2025-11-02 09:14:20 +08:00
cdec0c1a23 chore(deps): update dependency @types/node to v22.18.13
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m5s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m49s
2025-11-02 06:36:37 +08:00
94cdecb075 chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 4m6s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m24s
2025-11-02 04:01:43 +08:00
严浩
7f0cf5dd8f feat(package): 添加 sharp 依赖,版本为 0.34.4
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 5m0s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m17s
测试最新依赖 / build-and-test (push) Successful in 1m58s
测试最新依赖 / playwright (push) Successful in 2m39s
2025-10-31 19:15:38 +08:00
严浩
c8b8a3caa4 fix(use-safe-n-form): 更改 formRef 为 formInst
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m38s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m46s
2025-10-31 13:43:27 +08:00
严浩
48eb653f1a feat(demo): 添加 Naive UI 组件表单演示功能
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-10-31 13:40:23 +08:00
严浩
b3fbfe2d9d feat(i18n): 添加语言变更时更新html lang属性的功能
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m30s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m2s
测试最新依赖 / build-and-test (push) Successful in 2m5s
测试最新依赖 / playwright (push) Successful in 2m27s
2025-10-30 22:43:38 +08:00
严浩
da80cad976 chore(AppNaiveUIProvider): 移除 BUILD_TIME 常量声明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m0s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m55s
2025-10-30 22:34:32 +08:00
严浩
d6e05a8b44 feat(vite.config): 添加 CI 环境变量日志输出
Some checks failed
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
CI/CD Pipeline / playwright (push) Has been cancelled
2025-10-30 22:32:53 +08:00
5a196564d0 chore(deps): update dependency vite to v7.1.12
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 3m37s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m43s
2025-10-30 18:14:05 +08:00
7ec1751ba6 chore(deps): update all non-major dependencies
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
CI/CD Pipeline / playwright (push) Successful in 2m1s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m59s
2025-10-30 15:24:10 +08:00
严浩
270a838185 feat(AppNaiveUIProvider): 添加日期本地化支持
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m5s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m23s
2025-10-30 14:32:12 +08:00
严浩
5b54fe5182 feat(naive-ui): 添加 Modal 命令式 API 支持并完善类型声明
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m10s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m16s
2025-10-30 14:18:06 +08:00
严浩
21676c11ff Revert "feat(AppNaiveUIProvider): 添加对 NModal 的支持"
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m58s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m21s
This reverts commit 75f461df0f.
2025-10-30 14:05:19 +08:00
严浩
75f461df0f feat(AppNaiveUIProvider): 添加对 NModal 的支持
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m6s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled
2025-10-30 14:00:43 +08:00
严浩
b623365e38 feat(demos): 添加 Naive UI 组件演示页面
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m2s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m6s
2025-10-30 13:37:31 +08:00
严浩
8130915d0e feat(env): 添加构建时间和提交信息的环境变量
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 5m1s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m42s
2025-10-30 12:08:58 +08:00
严浩
eeb72b24b5 feat(i18n): 更新 i18n-ally 配置
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m50s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m19s
2025-10-30 10:27:29 +08:00
严浩
68e320637e feat(main): 将 import.meta.glob 的 eager 选项添加注释说明,
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m11s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m34s
2025-10-30 09:35:51 +08:00
严浩
f81c7614be feat(store): 重构应用状态管理,移除旧的 app-store 并引入 app-store-auto-imports
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m10s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m33s
测试最新依赖 / playwright (push) Successful in 2m16s
测试最新依赖 / build-and-test (push) Failing after 2m26s
2025-10-29 23:37:31 +08:00
严浩
2874fdfaa7 feat(locales): 避免冲突 src/locales/demo
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m24s
2025-10-29 19:07:06 +08:00
严浩
7dd7ce73bc refactor(i18n): 重构国际化模块结构
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m14s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m39s
2025-10-29 13:16:18 +08:00
严浩
94d09d0bdd feat(dependencies): 添加 svgo 依赖项以优化图像处理
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m31s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m25s
2025-10-29 10:56:36 +08:00
严浩
b0b65b454c feat(toast): 添加一键打开所有 Toast 消息功能并优化显示时间
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m6s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m22s
测试最新依赖 / playwright (push) Successful in 1m50s
测试最新依赖 / build-and-test (push) Failing after 2m24s
2025-10-29 00:13:08 +08:00
严浩
c490cb1c8e feat: 添加 PrimeVue 组件演示页面
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 2m39s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m51s
2025-10-28 23:50:40 +08:00
严浩
33e8a4a5d6 refactor(env): 统一环境变量命名规范
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m46s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m5s
2025-10-28 19:18:00 +08:00
严浩
35640a2ade feat(vite-config): 扩展primevue库匹配规则
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m50s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m0s
2025-10-28 16:10:42 +08:00
严浩
8db7ded1b5 feat(dependencies): 添加 vue-component-type-helpers 依赖项 [skip ci] 2025-10-28 11:36:32 +08:00
严浩
aa8e3467d3 fix(scripts): 修复 _all 脚本的并行执行方式 [skip ci] 2025-10-28 11:20:53 +08:00
严浩
8ed289a917 fix(stylelint): 允许非 kebab-case 的类选择器 [skip ci] 2025-10-28 10:55:52 +08:00
严浩
88ca601d07 feat(i18n): 实现应用语言本地存储功能
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m46s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m6s
2025-10-28 09:55:28 +08:00
严浩
50911ada4e build(vite): 注释掉 layouts 手动分块逻辑
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m49s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m34s
测试最新依赖 / playwright (push) Successful in 1m51s
测试最新依赖 / build-and-test (push) Failing after 2m25s
2025-10-27 22:42:50 +08:00
严浩
d065c90e71 feat(dependencies): 添加 vue-memoize-dict 依赖项
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m24s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m29s
2025-10-27 22:09:24 +08:00
严浩
ad0a50d8c7 refactor(eslint): 添加 vue/attributes-order 规则以规范属性排序 2025-10-27 22:05:59 +08:00
严浩
d4d9620db2 refactor(useMetaLayoutsMenuOptions): 优化路由过滤与排序逻辑
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m9s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m27s
2025-10-27 14:04:58 +08:00
严浩
267bf75bc1 chore(useMetaLayoutsMenuOptions): 优化调试日志输出格式
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 3m55s
CI/CD Pipeline / build-and-deploy (push) Successful in 4m11s
2025-10-27 13:46:06 +08:00
94 changed files with 6724 additions and 3950 deletions

View File

@@ -0,0 +1,39 @@
{
"image": "ghcr.io/yanhao98/h-devcontainer:main",
"runArgs": [
"--hostname=devcontainer-host",
"--name=${localWorkspaceFolderBasename}-devcontainer"
],
"forwardPorts": [4730, 4731, 5901],
"portsAttributes": {
"4730": { "label": "开发服务器端口", "onAutoForward": "notify" },
"4731": { "label": "预览服务器端口", "onAutoForward": "notify" }
},
"containerEnv": {
"TZ": "${localEnv:TZ:Asia/Shanghai}"
},
"customizations": {
"vscode": {
"extensions": ["prettier.prettier-vscode", "vue.volar"],
"settings": {
// "tasks": { "version": "2.0.0", "tasks": [] },
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "This dev container includes a lightweight Fluxbox based desktop that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS Code terminal will open on the desktop automatically."
}
]
}
}
},
"mounts": [
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
"source=${localWorkspaceFolder}/.devcontainer/lifecycle-scripts.d,target=/usr/local/etc/lifecycle-scripts.d,type=bind,consistency=delegated"
],
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind,consistency=delegated",
"initializeCommand": "docker pull ghcr.io/yanhao98/h-devcontainer:main;",
"onCreateCommand": "/usr/local/bin/run-lifecycle-scripts.sh onCreateCommand",
"updateContentCommand": "/usr/local/bin/run-lifecycle-scripts.sh updateContentCommand",
"postCreateCommand": "/usr/local/bin/run-lifecycle-scripts.sh postCreateCommand",
"postStartCommand": "/usr/local/bin/run-lifecycle-scripts.sh postStartCommand",
"postAttachCommand": "/usr/local/bin/run-lifecycle-scripts.sh postAttachCommand"
}

View File

@@ -0,0 +1,14 @@
#!/bin/zsh -eu
h-setup-zh-locale
h-setup-bun-bin
h-setup-pnpm-bin
h-setup-chromium
h-setup-desktop-lite
h-install-node-modules
echo "-----------------------------"
echo "开发容器已启动并配置完成!"
echo "-----------------------------"

21
.env
View File

@@ -1,10 +1,15 @@
VITE_APP_BUILD_TIME=NOT_SET
VITE_APP_BUILD_COMMIT=NOT_SET
VITE_BUILD_SOURCE_MAP=true
VITE_BUILD_MINIFY=true
VITE_CLOUDFLARE_SERVER_ENABLED=true
VITE_APP_TITLE=vue-ts-example-2025
VITE_APP_BASE=/
VITE_APP_BUILD_SOURCE_MAP=true
VITE_APP_BUILD_MINIFY=true
VITE_APP_BUILD_COMMIT=
VITE_APP_BUILD_TIME=
VITE_ENABLE_VUE_DEVTOOLS=true
VITE_MENU_SHOW_DEMOS=true
VITE_MENU_SHOW_ORDER=true
VITE_CLOUDFLARE_SERVER_ENABLED=true
VITE_APP_ENABLE_VUE_DEVTOOLS=true
VITE_APP_MENU_SHOW_DEMOS=true
VITE_APP_MENU_SHOW_ORDER=true
VITE_APP_ENABLE_ROUTER_LOG_GUARD=true
VITE_APP_API_URL=/API
VITE_APP_PROXY=[["/API","https://jsonplaceholder.typicode.com"]]

View File

@@ -14,10 +14,10 @@ on:
jobs:
playwright:
runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.56.1-noble
container: mcr.microsoft.com/playwright:v1.57.0-noble
steps:
- name: ⚙️ 设置 Node 环境
uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8
uses: yanhao98/composite-actions/setup-node-environment@faab20ac2f9c85dfce1a4147fca493bf632bd744
# - name: 📥 安装 Playwright 浏览器
# run: pnpm exec playwright install --with-deps
- name: 📦 构建项目
@@ -32,13 +32,15 @@ jobs:
steps:
- name: 🛠️ 设置Node环境
uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8
uses: yanhao98/composite-actions/setup-node-environment@faab20ac2f9c85dfce1a4147fca493bf632bd744
- name: 🔍 静态代码分析
run: pnpm run lint
- name: 📦 构建项目
run: pnpm run build-only
run: |
export VITE_APP_BUILD_TIME=$(date +"%Y-%m-%d %H:%M:%S")
pnpm run build-only
env:
VITE_APP_BUILD_COMMIT: ${{ github.sha }}

View File

@@ -60,7 +60,7 @@ jobs:
playwright:
runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.56.1-noble
container: mcr.microsoft.com/playwright:v1.57.0-noble
steps:
- uses: actions/checkout@main
with:

1
.gitignore vendored
View File

@@ -7,6 +7,7 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.pnpm-store
node_modules
.DS_Store
dist

View File

@@ -8,6 +8,6 @@ cat $1
echo "🟢 [Commit-msg] Node 版本:$(node -v)"
# pnpm exec commitlint --edit $1
time node node_modules/@commitlint/cli/cli.js --edit $1
node node_modules/@commitlint/cli/cli.js --edit $1
echo "📝 [Commit-msg] commit-msg 钩子完成!"

View File

@@ -1,4 +1,4 @@
# 此钩子在 git merge 或 git pull 成功完成后运行。
echo "🔗 [Post-merge] 正在安装依赖..."
time pnpm install
pnpm install
echo "🔗 [Post-merge] 依赖安装完成!"

View File

@@ -1,5 +1,6 @@
# 此钩子在执行 git commit 命令时,在创建提交之前运行。
echo "🧹 [Pre-commit] 正在运行 lint-staged..."
time pnpm exec lint-staged
time pnpm run lint:vue-i18n-extract
pnpm exec lint-staged
pnpm run lint:vue-i18n-extract
# pnpm run type-check
echo "🧹 [Pre-commit] lint-staged 完成!"

3
.ignore Normal file
View File

@@ -0,0 +1,3 @@
# VS Code 搜索忽略
pnpm-lock.yaml

8
.npmrc
View File

@@ -1,9 +1 @@
# registry=https://registry.npmmirror.com/
# https://pnpm.io/zh/npmrc#node-mirrorltreleasedir
use-node-version=24.7.0
node-mirror:release=https://npmmirror.com/mirrors/node/ # pnpm config set node-mirror:release=https://npmmirror.com/mirrors/node/
node-mirror:rc=https://npmmirror.com/mirrors/node-rc/
node-mirror:nightly=https://npmmirror.com/mirrors/node-nightly/
# shamefully-hoist=true

View File

@@ -4,5 +4,6 @@
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "all"
"trailingComma": "all",
"plugins": ["@prettier/plugin-oxc"]
}

View File

@@ -2,10 +2,11 @@
"recommendations": [
"Vue.volar",
"vitest.explorer",
"ms-playwright.playwright",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"oxc.oxc-vscode",
"esbenp.prettier-vscode"
"prettier.prettier-vscode",
"stylelint.vscode-stylelint",
"lokalise.i18n-ally"
]
}

69
.vscode/settings.json vendored
View File

@@ -1,34 +1,65 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": [
"vue-router$",
"**/src/composables/**",
"**/*-auto-imports.ts",
"**/*-auto-imports.types.ts"
],
"search.exclude": {
"public/report-ui-dist": true
},
// ============================================================
// 代码格式化相关配置
// ============================================================
"prettier.enable": true,
"files.readonlyInclude": {
"dist/**": true
},
"eslint.enable": true,
"oxc.enable": true,
"stylelint.enable": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit",
"source.fixAll.oxc": "explicit",
"source.organizeImports": "never"
"source.fixAll.stylelint": "explicit",
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue"],
"scss.lint.unknownAtRules": "ignore",
"css.lint.unknownAtRules": "ignore",
"less.lint.unknownAtRules": "ignore",
"eslint.enable": true,
"oxc.enable": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "prettier.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "prettier.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"i18n-ally.localesPaths": ["src/locales"],
"i18n-ally.sourceLanguage": "zh-CN", // 翻译源语言 (源文件) 根据此语言文件翻译其他语言文件的变量和内容
"i18n-ally.displayLanguage": "zh-CN", // 显示语言 (显示文件/翻译文件)
// ============================================================
// i18n-ally 配置
// ============================================================
// >>>>>
"i18n-ally.readonly": false,
"i18n-ally.namespace": false /* @intlify/unplugin-vue-i18n */,
"i18n-ally.localesPaths": ["src/locales/demo", "src/locales"],
// https://github.com/lokalise/i18n-ally/wiki/Path-Matcher
// 默认: 🗃 Path Matcher Regex: /^(?<locale>[\w-_]+)(?:.*\/|^).*\.(?<ext>json|ya?ml|json5)$/
"i18n-ally.pathMatcher": "{locale}.json",
"i18n-ally.enabledParsers": ["json"],
"i18n-ally.keystyle": "nested",
// https://github.com/copilot/share/8a1a019a-0180-80e7-8141-a40be02c4006
"i18n-ally.sourceLanguage": "zh-CN", // 翻译源语言 (源文件) 根据此语言文件翻译其他语言文件的变量和内容
"i18n-ally.displayLanguage": "zh-CN" // 显示语言 (显示文件/翻译文件)
// <<<<<
// "iconify.customCollectionJsonPaths": ["https://example.com/my-icons.json", "./local/icons.json"],
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": ["vue-router/auto$"]
}

24
.vscode/tasks.json vendored
View File

@@ -6,16 +6,12 @@
"script": "dev",
"label": "🚀 dev",
"detail": "启动开发服务器",
"problemMatcher": {
"pattern": { "regexp": "." },
"background": {
"activeOnStart": true,
"beginsPattern": "VITE.*ready in",
"endsPattern": "(Local|Network):.*http"
}
},
"problemMatcher": [],
"isBackground": true,
"presentation": { "reveal": "always", "panel": "dedicated" },
"presentation": {
"reveal": "always", // 控制运行任务的终端是否显示。可按选项 "revealProblems" 进行替代。默认设置为“始终”。
"panel": "dedicated" // dedicated一个任务独占一个终端方便查看特定任务的日志不会被其他任务干扰。
},
"group": { "kind": "build", "isDefault": false }
},
{
@@ -23,7 +19,6 @@
"script": "build-only",
"label": "🔨 build-only",
"detail": "" /* VSCode 使 package.json scripts[scriptName] detail */,
"problemMatcher": ["$tsc"],
"presentation": { "reveal": "always", "panel": "shared" },
"group": { "kind": "none", "isDefault": false }
},
@@ -33,14 +28,7 @@
"label": "☁️ wrangler:dev",
"detail": "启动 Cloudflare Workers 开发服务器,相当于预览",
"dependsOn": ["🔨 build-only"],
"problemMatcher": {
"pattern": { "regexp": "." },
"background": {
"activeOnStart": true,
"beginsPattern": "wrangler dev",
"endsPattern": "Ready on"
}
},
"problemMatcher": [],
"isBackground": true,
"presentation": { "reveal": "always", "panel": "dedicated" },
"group": { "kind": "build", "isDefault": false }

View File

@@ -9,6 +9,7 @@ Vue 3 TypeScript application with Vite.
## 开发服务器
- **不要启动开发服务器**: 开发服务器通常已经由用户启动。除非特别要求,否则不要执行 `pnpm dev` 之类的命令。
- **不要执行 Playwright 测试**: 除非用户明确要求,否则不要运行 Playwright 端到端测试。
### Routing & Layouts
@@ -46,25 +47,6 @@ Multiple auto-import systems are active:
Project has multiple UI frameworks configured:
- **Naive UI**
- **Form Layout**: When using `NGrid` for form layouts, prefer `NFormItemGi` over nesting `NFormItem` inside `NGridItem` for more concise code.
```vue
<!-- ❌ Avoid: Verbose nesting -->
<NGrid :cols="4">
<NGridItem>
<NFormItem label="Username">
<NInput />
</NFormItem>
</NGridItem>
</NGrid>
<!-- ✅ Use: Concise and direct -->
<NGrid :cols="4">
<NFormItemGi label="Username">
<NInput />
</NFormItemGi>
</NGrid>
```
- **PrimeVue**:

672
auto-imports.d.ts vendored
View File

@@ -6,328 +6,335 @@
// biome-ignore lint: disable
export {}
declare global {
const APP_THEME_MODES: typeof import('./src/stores/app-store')['APP_THEME_MODES']
const EffectScope: typeof import('vue')['EffectScope']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const arrayToTree: typeof import('utils4u/array')['arrayToTree']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
const computedAsync: typeof import('@vueuse/core')['computedAsync']
const computedEager: typeof import('@vueuse/core')['computedEager']
const computedInject: typeof import('@vueuse/core')['computedInject']
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
const consola: typeof import('consola/browser')['consola']
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
const controlledRef: typeof import('@vueuse/core')['controlledRef']
const convertFileToBase64: typeof import('utils4u/browser')['convertFileToBase64']
const createApp: typeof import('vue')['createApp']
const createEventHook: typeof import('@vueuse/core')['createEventHook']
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
const createLogGuard: typeof import('utils4u/vue-router')['createLogGuard']
const createNProgressGuard: typeof import('utils4u/vue-router')['createNProgressGuard']
const createPinia: typeof import('pinia')['createPinia']
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
const createRef: typeof import('@vueuse/core')['createRef']
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
const createStackGuard: typeof import('utils4u/vue-router')['createStackGuard']
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
const customRef: typeof import('vue')['customRef']
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
const deepFreeze: typeof import('deep-freeze-es6')['default']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope']
const extendRef: typeof import('@vueuse/core')['extendRef']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const getCurrentWatcher: typeof import('vue')['getCurrentWatcher']
const h: typeof import('vue')['h']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const isShallow: typeof import('vue')['isShallow']
const locales4RouteMessages: typeof import('./src/locales-4-route/_messages-auto-imports')['locales4RouteMessages']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
const onDeactivated: typeof import('vue')['onDeactivated']
const onElementRemoval: typeof import('@vueuse/core')['onElementRemoval']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
const onLongPress: typeof import('@vueuse/core')['onLongPress']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
const reactive: typeof import('vue')['reactive']
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
const reactivePick: typeof import('@vueuse/core')['reactivePick']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
const refDebounced: typeof import('@vueuse/core')['refDebounced']
const refDefault: typeof import('@vueuse/core')['refDefault']
const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const setViewportCSSVars: typeof import('utils4u/browser')['setViewportCSSVars']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const showOpenFilePicker: typeof import('utils4u/browser')['showOpenFilePicker']
const storeToRefs: typeof import('pinia')['storeToRefs']
const syncRef: typeof import('@vueuse/core')['syncRef']
const syncRefs: typeof import('@vueuse/core')['syncRefs']
const templateRef: typeof import('@vueuse/core')['templateRef']
const throttledRef: typeof import('@vueuse/core')['throttledRef']
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
const toRaw: typeof import('vue')['toRaw']
const toReactive: typeof import('@vueuse/core')['toReactive']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
const unref: typeof import('vue')['unref']
const unrefElement: typeof import('@vueuse/core')['unrefElement']
const until: typeof import('@vueuse/core')['until']
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
const useAnimate: typeof import('@vueuse/core')['useAnimate']
const useAppStore: typeof import('./src/stores/app-store')['useAppStore']
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
const useArraySome: typeof import('@vueuse/core')['useArraySome']
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
const useAttrs: typeof import('vue')['useAttrs']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
const useCached: typeof import('@vueuse/core')['useCached']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCountdown: typeof import('@vueuse/core')['useCountdown']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVar: typeof import('@vueuse/core')['useCssVar']
const useCssVars: typeof import('vue')['useCssVars']
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
const useCycleList: typeof import('@vueuse/core')['useCycleList']
const useDark: typeof import('@vueuse/core')['useDark']
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
const useDebounce: typeof import('@vueuse/core')['useDebounce']
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
const useDialog: typeof import('naive-ui')['useDialog']
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
const useDraggable: typeof import('@vueuse/core')['useDraggable']
const useDropZone: typeof import('@vueuse/core')['useDropZone']
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
const useElementHover: typeof import('@vueuse/core')['useElementHover']
const useElementSize: typeof import('@vueuse/core')['useElementSize']
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
const useEventBus: typeof import('@vueuse/core')['useEventBus']
const useEventListener: typeof import('@vueuse/core')['useEventListener']
const useEventSource: typeof import('@vueuse/core')['useEventSource']
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
const useFavicon: typeof import('@vueuse/core')['useFavicon']
const useFetch: typeof import('@vueuse/core')['useFetch']
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useFps: typeof import('@vueuse/core')['useFps']
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
const useGamepad: typeof import('@vueuse/core')['useGamepad']
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
const useI18n: typeof import('vue-i18n')['useI18n']
const useId: typeof import('vue')['useId']
const useIdle: typeof import('@vueuse/core')['useIdle']
const useImage: typeof import('@vueuse/core')['useImage']
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
const useInterval: typeof import('@vueuse/core')['useInterval']
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router/auto')['useLink']
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
const useMemoize: typeof import('@vueuse/core')['useMemoize']
const useMemory: typeof import('@vueuse/core')['useMemory']
const useMessage: typeof import('naive-ui')['useMessage']
const useMetaLayoutsNMenuOptions: typeof import('./src/composables/useMetaLayoutsMenuOptions')['useMetaLayoutsNMenuOptions']
const useModal: typeof import('naive-ui')['useModal']
const useModel: typeof import('vue')['useModel']
const useMounted: typeof import('@vueuse/core')['useMounted']
const useMouse: typeof import('@vueuse/core')['useMouse']
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
const useNetwork: typeof import('@vueuse/core')['useNetwork']
const useNotification: typeof import('naive-ui')['useNotification']
const useNow: typeof import('@vueuse/core')['useNow']
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
const useOnline: typeof import('@vueuse/core')['useOnline']
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
const useParallax: typeof import('@vueuse/core')['useParallax']
const useParentElement: typeof import('@vueuse/core')['useParentElement']
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
const usePermission: typeof import('@vueuse/core')['usePermission']
const usePointer: typeof import('@vueuse/core')['usePointer']
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
const usePreferredReducedTransparency: typeof import('@vueuse/core')['usePreferredReducedTransparency']
const usePrevious: typeof import('@vueuse/core')['usePrevious']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useRefs: typeof import('utils4u/vue-use')['useRefs']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth']
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
const useScroll: typeof import('@vueuse/core')['useScroll']
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
const useShare: typeof import('@vueuse/core')['useShare']
const useSlots: typeof import('vue')['useSlots']
const useSorted: typeof import('@vueuse/core')['useSorted']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useStepper: typeof import('@vueuse/core')['useStepper']
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSupported: typeof import('@vueuse/core')['useSupported']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTemplateRef: typeof import('vue')['useTemplateRef']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
const useThrottle: typeof import('@vueuse/core')['useThrottle']
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
const useTimeAgoIntl: typeof import('@vueuse/core')['useTimeAgoIntl']
const useTimeout: typeof import('@vueuse/core')['useTimeout']
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
const useTitle: typeof import('@vueuse/core')['useTitle']
const useToNumber: typeof import('@vueuse/core')['useToNumber']
const useToString: typeof import('@vueuse/core')['useToString']
const useToggle: typeof import('@vueuse/core')['useToggle']
const useTransition: typeof import('@vueuse/core')['useTransition']
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
const useVModel: typeof import('@vueuse/core')['useVModel']
const useVModels: typeof import('@vueuse/core')['useVModels']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
const watch: typeof import('vue')['watch']
const watchArray: typeof import('@vueuse/core')['watchArray']
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
const watchDeep: typeof import('@vueuse/core')['watchDeep']
const watchEffect: typeof import('vue')['watchEffect']
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
const watchOnce: typeof import('@vueuse/core')['watchOnce']
const watchPausable: typeof import('@vueuse/core')['watchPausable']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever']
const ConfirmationService: typeof import('utils4u/primevue').ConfirmationService
const DialogService: typeof import('utils4u/primevue').DialogService
const EffectScope: typeof import('vue').EffectScope
const ToastService: typeof import('utils4u/primevue').ToastService
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
const arrayToTree: typeof import('utils4u/array').arrayToTree
const asyncComputed: typeof import('@vueuse/core').asyncComputed
const autoResetRef: typeof import('@vueuse/core').autoResetRef
const computed: typeof import('vue').computed
const computedAsync: typeof import('@vueuse/core').computedAsync
const computedEager: typeof import('@vueuse/core').computedEager
const computedInject: typeof import('@vueuse/core').computedInject
const computedWithControl: typeof import('@vueuse/core').computedWithControl
const consola: typeof import('consola/browser').consola
const controlledComputed: typeof import('@vueuse/core').controlledComputed
const controlledRef: typeof import('@vueuse/core').controlledRef
const convertFileToBase64: typeof import('utils4u/browser').convertFileToBase64
const createApp: typeof import('vue').createApp
const createEventHook: typeof import('@vueuse/core').createEventHook
const createGlobalState: typeof import('@vueuse/core').createGlobalState
const createInjectionState: typeof import('@vueuse/core').createInjectionState
const createLogGuard: typeof import('utils4u/vue-router').createLogGuard
const createNProgressGuard: typeof import('utils4u/vue-router').createNProgressGuard
const createPinia: typeof import('pinia').createPinia
const createReactiveFn: typeof import('@vueuse/core').createReactiveFn
const createRef: typeof import('@vueuse/core').createRef
const createReusableTemplate: typeof import('@vueuse/core').createReusableTemplate
const createSharedComposable: typeof import('@vueuse/core').createSharedComposable
const createStackGuard: typeof import('utils4u/vue-router').createStackGuard
const createTemplatePromise: typeof import('@vueuse/core').createTemplatePromise
const createUnrefFn: typeof import('@vueuse/core').createUnrefFn
const customRef: typeof import('vue').customRef
const debouncedRef: typeof import('@vueuse/core').debouncedRef
const debouncedWatch: typeof import('@vueuse/core').debouncedWatch
const deepFreeze: typeof import('deep-freeze-es6').default
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
const defineBasicLoader: typeof import('unplugin-vue-router/data-loaders/basic').defineBasicLoader
const defineComponent: typeof import('vue').defineComponent
const defineStore: typeof import('pinia').defineStore
const eagerComputed: typeof import('@vueuse/core').eagerComputed
const effectScope: typeof import('vue').effectScope
const extendRef: typeof import('@vueuse/core').extendRef
const getActivePinia: typeof import('pinia').getActivePinia
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
const h: typeof import('vue').h
const i18nInstance: typeof import('./src/locales-utils/i18n-auto-imports').i18nInstance
const i18nRouteMessages: typeof import('./src/locales-utils/route-messages/route-messages-auto-imports').i18nRouteMessages
const ignorableWatch: typeof import('@vueuse/core').ignorableWatch
const inject: typeof import('vue').inject
const injectLocal: typeof import('@vueuse/core').injectLocal
const isDefined: typeof import('@vueuse/core').isDefined
const isProxy: typeof import('vue').isProxy
const isReactive: typeof import('vue').isReactive
const isReadonly: typeof import('vue').isReadonly
const isRef: typeof import('vue').isRef
const isShallow: typeof import('vue').isShallow
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
const mapActions: typeof import('pinia').mapActions
const mapGetters: typeof import('pinia').mapGetters
const mapState: typeof import('pinia').mapState
const mapStores: typeof import('pinia').mapStores
const mapWritableState: typeof import('pinia').mapWritableState
const markRaw: typeof import('vue').markRaw
const nextTick: typeof import('vue').nextTick
const onActivated: typeof import('vue').onActivated
const onBeforeMount: typeof import('vue').onBeforeMount
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
const onClickOutside: typeof import('@vueuse/core').onClickOutside
const onDeactivated: typeof import('vue').onDeactivated
const onElementRemoval: typeof import('@vueuse/core').onElementRemoval
const onErrorCaptured: typeof import('vue').onErrorCaptured
const onKeyStroke: typeof import('@vueuse/core').onKeyStroke
const onLongPress: typeof import('@vueuse/core').onLongPress
const onMounted: typeof import('vue').onMounted
const onRenderTracked: typeof import('vue').onRenderTracked
const onRenderTriggered: typeof import('vue').onRenderTriggered
const onScopeDispose: typeof import('vue').onScopeDispose
const onServerPrefetch: typeof import('vue').onServerPrefetch
const onStartTyping: typeof import('@vueuse/core').onStartTyping
const onUnmounted: typeof import('vue').onUnmounted
const onUpdated: typeof import('vue').onUpdated
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
const pausableWatch: typeof import('@vueuse/core').pausableWatch
const provide: typeof import('vue').provide
const provideLocal: typeof import('@vueuse/core').provideLocal
const reactify: typeof import('@vueuse/core').reactify
const reactifyObject: typeof import('@vueuse/core').reactifyObject
const reactive: typeof import('vue').reactive
const reactiveComputed: typeof import('@vueuse/core').reactiveComputed
const reactiveOmit: typeof import('@vueuse/core').reactiveOmit
const reactivePick: typeof import('@vueuse/core').reactivePick
const readonly: typeof import('vue').readonly
const ref: typeof import('vue').ref
const refAutoReset: typeof import('@vueuse/core').refAutoReset
const refDebounced: typeof import('@vueuse/core').refDebounced
const refDefault: typeof import('@vueuse/core').refDefault
const refManualReset: typeof import('@vueuse/core').refManualReset
const refThrottled: typeof import('@vueuse/core').refThrottled
const refWithControl: typeof import('@vueuse/core').refWithControl
const resolveComponent: typeof import('vue').resolveComponent
const resolveRef: typeof import('@vueuse/core').resolveRef
const routeI18nInstance: typeof import('./src/locales-utils/i18n-auto-imports').routeI18nInstance
const routeI18nT: typeof import('./src/locales-utils/i18n-auto-imports').routeI18nT
const setActivePinia: typeof import('pinia').setActivePinia
const setMapStoreSuffix: typeof import('pinia').setMapStoreSuffix
const setViewportCSSVars: typeof import('utils4u/browser').setViewportCSSVars
const shallowReactive: typeof import('vue').shallowReactive
const shallowReadonly: typeof import('vue').shallowReadonly
const shallowRef: typeof import('vue').shallowRef
const showOpenFilePicker: typeof import('utils4u/browser').showOpenFilePicker
const storeToRefs: typeof import('pinia').storeToRefs
const syncRef: typeof import('@vueuse/core').syncRef
const syncRefs: typeof import('@vueuse/core').syncRefs
const templateRef: typeof import('@vueuse/core').templateRef
const throttledRef: typeof import('@vueuse/core').throttledRef
const throttledWatch: typeof import('@vueuse/core').throttledWatch
const toRaw: typeof import('vue').toRaw
const toReactive: typeof import('@vueuse/core').toReactive
const toRef: typeof import('vue').toRef
const toRefs: typeof import('vue').toRefs
const toValue: typeof import('vue').toValue
const triggerRef: typeof import('vue').triggerRef
const tryOnBeforeMount: typeof import('@vueuse/core').tryOnBeforeMount
const tryOnBeforeUnmount: typeof import('@vueuse/core').tryOnBeforeUnmount
const tryOnMounted: typeof import('@vueuse/core').tryOnMounted
const tryOnScopeDispose: typeof import('@vueuse/core').tryOnScopeDispose
const tryOnUnmounted: typeof import('@vueuse/core').tryOnUnmounted
const unref: typeof import('vue').unref
const unrefElement: typeof import('@vueuse/core').unrefElement
const until: typeof import('@vueuse/core').until
const useActiveElement: typeof import('@vueuse/core').useActiveElement
const useAnimate: typeof import('@vueuse/core').useAnimate
const useAppStore: typeof import('./src/stores/app-store-auto-imports').useAppStore
const useArrayDifference: typeof import('@vueuse/core').useArrayDifference
const useArrayEvery: typeof import('@vueuse/core').useArrayEvery
const useArrayFilter: typeof import('@vueuse/core').useArrayFilter
const useArrayFind: typeof import('@vueuse/core').useArrayFind
const useArrayFindIndex: typeof import('@vueuse/core').useArrayFindIndex
const useArrayFindLast: typeof import('@vueuse/core').useArrayFindLast
const useArrayIncludes: typeof import('@vueuse/core').useArrayIncludes
const useArrayJoin: typeof import('@vueuse/core').useArrayJoin
const useArrayMap: typeof import('@vueuse/core').useArrayMap
const useArrayReduce: typeof import('@vueuse/core').useArrayReduce
const useArraySome: typeof import('@vueuse/core').useArraySome
const useArrayUnique: typeof import('@vueuse/core').useArrayUnique
const useAsyncQueue: typeof import('@vueuse/core').useAsyncQueue
const useAsyncState: typeof import('@vueuse/core').useAsyncState
const useAttrs: typeof import('vue').useAttrs
const useAuthStore: typeof import('./src/stores/auth-store-auto-imports').useAuthStore
const useBase64: typeof import('@vueuse/core').useBase64
const useBattery: typeof import('@vueuse/core').useBattery
const useBluetooth: typeof import('@vueuse/core').useBluetooth
const useBreakpoints: typeof import('@vueuse/core').useBreakpoints
const useBroadcastChannel: typeof import('@vueuse/core').useBroadcastChannel
const useBrowserLocation: typeof import('@vueuse/core').useBrowserLocation
const useCached: typeof import('@vueuse/core').useCached
const useClipboard: typeof import('@vueuse/core').useClipboard
const useClipboardItems: typeof import('@vueuse/core').useClipboardItems
const useCloned: typeof import('@vueuse/core').useCloned
const useColorMode: typeof import('@vueuse/core').useColorMode
const useConfirmDialog: typeof import('@vueuse/core').useConfirmDialog
const useCountdown: typeof import('@vueuse/core').useCountdown
const useCounter: typeof import('@vueuse/core').useCounter
const useCssModule: typeof import('vue').useCssModule
const useCssVar: typeof import('@vueuse/core').useCssVar
const useCssVars: typeof import('vue').useCssVars
const useCurrentElement: typeof import('@vueuse/core').useCurrentElement
const useCycleList: typeof import('@vueuse/core').useCycleList
const useDark: typeof import('@vueuse/core').useDark
const useDateFormat: typeof import('@vueuse/core').useDateFormat
const useDebounce: typeof import('@vueuse/core').useDebounce
const useDebounceFn: typeof import('@vueuse/core').useDebounceFn
const useDebouncedRefHistory: typeof import('@vueuse/core').useDebouncedRefHistory
const useDeviceMotion: typeof import('@vueuse/core').useDeviceMotion
const useDeviceOrientation: typeof import('@vueuse/core').useDeviceOrientation
const useDevicePixelRatio: typeof import('@vueuse/core').useDevicePixelRatio
const useDevicesList: typeof import('@vueuse/core').useDevicesList
const useDialog: typeof import('naive-ui').useDialog
const useDisplayMedia: typeof import('@vueuse/core').useDisplayMedia
const useDocumentVisibility: typeof import('@vueuse/core').useDocumentVisibility
const useDraggable: typeof import('@vueuse/core').useDraggable
const useDropZone: typeof import('@vueuse/core').useDropZone
const useElementBounding: typeof import('@vueuse/core').useElementBounding
const useElementByPoint: typeof import('@vueuse/core').useElementByPoint
const useElementHover: typeof import('@vueuse/core').useElementHover
const useElementSize: typeof import('@vueuse/core').useElementSize
const useElementVisibility: typeof import('@vueuse/core').useElementVisibility
const useEventBus: typeof import('@vueuse/core').useEventBus
const useEventListener: typeof import('@vueuse/core').useEventListener
const useEventSource: typeof import('@vueuse/core').useEventSource
const useEyeDropper: typeof import('@vueuse/core').useEyeDropper
const useFavicon: typeof import('@vueuse/core').useFavicon
const useFetch: typeof import('@vueuse/core').useFetch
const useFileDialog: typeof import('@vueuse/core').useFileDialog
const useFileSystemAccess: typeof import('@vueuse/core').useFileSystemAccess
const useFocus: typeof import('@vueuse/core').useFocus
const useFocusWithin: typeof import('@vueuse/core').useFocusWithin
const useFps: typeof import('@vueuse/core').useFps
const useFullscreen: typeof import('@vueuse/core').useFullscreen
const useGamepad: typeof import('@vueuse/core').useGamepad
const useGeolocation: typeof import('@vueuse/core').useGeolocation
const useI18n: typeof import('vue-i18n').useI18n
const useId: typeof import('vue').useId
const useIdle: typeof import('@vueuse/core').useIdle
const useImage: typeof import('@vueuse/core').useImage
const useInfiniteScroll: typeof import('@vueuse/core').useInfiniteScroll
const useIntersectionObserver: typeof import('@vueuse/core').useIntersectionObserver
const useInterval: typeof import('@vueuse/core').useInterval
const useIntervalFn: typeof import('@vueuse/core').useIntervalFn
const useKeyModifier: typeof import('@vueuse/core').useKeyModifier
const useLastChanged: typeof import('@vueuse/core').useLastChanged
const useLoadingBar: typeof import('naive-ui').useLoadingBar
const useLocalStorage: typeof import('@vueuse/core').useLocalStorage
const useMagicKeys: typeof import('@vueuse/core').useMagicKeys
const useManualRefHistory: typeof import('@vueuse/core').useManualRefHistory
const useMediaControls: typeof import('@vueuse/core').useMediaControls
const useMediaQuery: typeof import('@vueuse/core').useMediaQuery
const useMemoize: typeof import('@vueuse/core').useMemoize
const useMemory: typeof import('@vueuse/core').useMemory
const useMessage: typeof import('naive-ui').useMessage
const useMetaLayoutsNMenuOptions: typeof import('./src/composables/useMetaLayoutsMenuOptions').useMetaLayoutsNMenuOptions
const useModal: typeof import('naive-ui').useModal
const useModel: typeof import('vue').useModel
const useMounted: typeof import('@vueuse/core').useMounted
const useMouse: typeof import('@vueuse/core').useMouse
const useMouseInElement: typeof import('@vueuse/core').useMouseInElement
const useMousePressed: typeof import('@vueuse/core').useMousePressed
const useMutationObserver: typeof import('@vueuse/core').useMutationObserver
const useNavigatorLanguage: typeof import('@vueuse/core').useNavigatorLanguage
const useNetwork: typeof import('@vueuse/core').useNetwork
const useNotification: typeof import('naive-ui').useNotification
const useNow: typeof import('@vueuse/core').useNow
const useObjectUrl: typeof import('@vueuse/core').useObjectUrl
const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination
const useOnline: typeof import('@vueuse/core').useOnline
const usePageLeave: typeof import('@vueuse/core').usePageLeave
const useParallax: typeof import('@vueuse/core').useParallax
const useParentElement: typeof import('@vueuse/core').useParentElement
const usePerformanceObserver: typeof import('@vueuse/core').usePerformanceObserver
const usePermission: typeof import('@vueuse/core').usePermission
const usePointer: typeof import('@vueuse/core').usePointer
const usePointerLock: typeof import('@vueuse/core').usePointerLock
const usePointerSwipe: typeof import('@vueuse/core').usePointerSwipe
const usePreferredColorScheme: typeof import('@vueuse/core').usePreferredColorScheme
const usePreferredContrast: typeof import('@vueuse/core').usePreferredContrast
const usePreferredDark: typeof import('@vueuse/core').usePreferredDark
const usePreferredLanguages: typeof import('@vueuse/core').usePreferredLanguages
const usePreferredReducedMotion: typeof import('@vueuse/core').usePreferredReducedMotion
const usePreferredReducedTransparency: typeof import('@vueuse/core').usePreferredReducedTransparency
const usePrevious: typeof import('@vueuse/core').usePrevious
const usePrimevueDialogRef: typeof import('utils4u/primevue').usePrimevueDialogRef
const useRafFn: typeof import('@vueuse/core').useRafFn
const useRefHistory: typeof import('@vueuse/core').useRefHistory
const useRefs: typeof import('utils4u/vue-use').useRefs
const useResizeObserver: typeof import('@vueuse/core').useResizeObserver
const useRoute: typeof import('vue-router').useRoute
const useRouter: typeof import('vue-router').useRouter
const useSSRWidth: typeof import('@vueuse/core').useSSRWidth
const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation
const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea
const useScriptTag: typeof import('@vueuse/core').useScriptTag
const useScroll: typeof import('@vueuse/core').useScroll
const useScrollLock: typeof import('@vueuse/core').useScrollLock
const useSessionStorage: typeof import('@vueuse/core').useSessionStorage
const useShare: typeof import('@vueuse/core').useShare
const useSlots: typeof import('vue').useSlots
const useSorted: typeof import('@vueuse/core').useSorted
const useSpeechRecognition: typeof import('@vueuse/core').useSpeechRecognition
const useSpeechSynthesis: typeof import('@vueuse/core').useSpeechSynthesis
const useStepper: typeof import('@vueuse/core').useStepper
const useStorage: typeof import('@vueuse/core').useStorage
const useStorageAsync: typeof import('@vueuse/core').useStorageAsync
const useStyleTag: typeof import('@vueuse/core').useStyleTag
const useSupported: typeof import('@vueuse/core').useSupported
const useSwipe: typeof import('@vueuse/core').useSwipe
const useTemplateRef: typeof import('vue').useTemplateRef
const useTemplateRefsList: typeof import('@vueuse/core').useTemplateRefsList
const useTextDirection: typeof import('@vueuse/core').useTextDirection
const useTextSelection: typeof import('@vueuse/core').useTextSelection
const useTextareaAutosize: typeof import('@vueuse/core').useTextareaAutosize
const useThrottle: typeof import('@vueuse/core').useThrottle
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
const useTimeAgoIntl: typeof import('@vueuse/core').useTimeAgoIntl
const useTimeout: typeof import('@vueuse/core').useTimeout
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
const useTimestamp: typeof import('@vueuse/core').useTimestamp
const useTitle: typeof import('@vueuse/core').useTitle
const useToNumber: typeof import('@vueuse/core').useToNumber
const useToString: typeof import('@vueuse/core').useToString
const useToggle: typeof import('@vueuse/core').useToggle
const useTransition: typeof import('@vueuse/core').useTransition
const useUrlSearchParams: typeof import('@vueuse/core').useUrlSearchParams
const useUserMedia: typeof import('@vueuse/core').useUserMedia
const useVModel: typeof import('@vueuse/core').useVModel
const useVModels: typeof import('@vueuse/core').useVModels
const useVibrate: typeof import('@vueuse/core').useVibrate
const useVirtualList: typeof import('@vueuse/core').useVirtualList
const useWakeLock: typeof import('@vueuse/core').useWakeLock
const useWebNotification: typeof import('@vueuse/core').useWebNotification
const useWebSocket: typeof import('@vueuse/core').useWebSocket
const useWebWorker: typeof import('@vueuse/core').useWebWorker
const useWebWorkerFn: typeof import('@vueuse/core').useWebWorkerFn
const useWindowFocus: typeof import('@vueuse/core').useWindowFocus
const useWindowScroll: typeof import('@vueuse/core').useWindowScroll
const useWindowSize: typeof import('@vueuse/core').useWindowSize
const watch: typeof import('vue').watch
const watchArray: typeof import('@vueuse/core').watchArray
const watchAtMost: typeof import('@vueuse/core').watchAtMost
const watchDebounced: typeof import('@vueuse/core').watchDebounced
const watchDeep: typeof import('@vueuse/core').watchDeep
const watchEffect: typeof import('vue').watchEffect
const watchIgnorable: typeof import('@vueuse/core').watchIgnorable
const watchImmediate: typeof import('@vueuse/core').watchImmediate
const watchOnce: typeof import('@vueuse/core').watchOnce
const watchPausable: typeof import('@vueuse/core').watchPausable
const watchPostEffect: typeof import('vue').watchPostEffect
const watchSyncEffect: typeof import('vue').watchSyncEffect
const watchThrottled: typeof import('@vueuse/core').watchThrottled
const watchTriggerable: typeof import('@vueuse/core').watchTriggerable
const watchWithFilter: typeof import('@vueuse/core').watchWithFilter
const whenever: typeof import('@vueuse/core').whenever
}
// for type re-export
declare global {
@@ -335,8 +342,8 @@ declare global {
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
// @ts-ignore
export type { AppThemeMode } from './src/stores/app-store'
import('./src/stores/app-store')
export type { AppThemeMode } from './src/stores/app-store-auto-imports'
import('./src/stores/app-store-auto-imports')
}
// for vue template auto import
@@ -344,8 +351,10 @@ import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly APP_THEME_MODES: UnwrapRef<typeof import('./src/stores/app-store')['APP_THEME_MODES']>
readonly ConfirmationService: UnwrapRef<typeof import('utils4u/primevue')['ConfirmationService']>
readonly DialogService: UnwrapRef<typeof import('utils4u/primevue')['DialogService']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ToastService: UnwrapRef<typeof import('utils4u/primevue')['ToastService']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly arrayToTree: UnwrapRef<typeof import('utils4u/array')['arrayToTree']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
@@ -378,6 +387,7 @@ declare module 'vue' {
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly deepFreeze: UnwrapRef<typeof import('deep-freeze-es6')['default']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineBasicLoader: UnwrapRef<typeof import('unplugin-vue-router/data-loaders/basic')['defineBasicLoader']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
@@ -388,6 +398,8 @@ declare module 'vue' {
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly i18nInstance: UnwrapRef<typeof import('./src/locales-utils/i18n-auto-imports')['i18nInstance']>
readonly i18nRouteMessages: UnwrapRef<typeof import('./src/locales-utils/route-messages/route-messages-auto-imports')['i18nRouteMessages']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
@@ -397,7 +409,6 @@ declare module 'vue' {
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly locales4RouteMessages: UnwrapRef<typeof import('./src/locales-4-route/_messages-auto-imports')['locales4RouteMessages']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
@@ -441,11 +452,13 @@ declare module 'vue' {
readonly refAutoReset: UnwrapRef<typeof import('@vueuse/core')['refAutoReset']>
readonly refDebounced: UnwrapRef<typeof import('@vueuse/core')['refDebounced']>
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refManualReset: UnwrapRef<typeof import('@vueuse/core')['refManualReset']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
readonly routeI18nInstance: UnwrapRef<typeof import('./src/locales-utils/i18n-auto-imports')['routeI18nInstance']>
readonly routeI18nT: UnwrapRef<typeof import('./src/locales-utils/i18n-auto-imports')['routeI18nT']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly setViewportCSSVars: UnwrapRef<typeof import('utils4u/browser')['setViewportCSSVars']>
@@ -475,7 +488,7 @@ declare module 'vue' {
readonly until: UnwrapRef<typeof import('@vueuse/core')['until']>
readonly useActiveElement: UnwrapRef<typeof import('@vueuse/core')['useActiveElement']>
readonly useAnimate: UnwrapRef<typeof import('@vueuse/core')['useAnimate']>
readonly useAppStore: UnwrapRef<typeof import('./src/stores/app-store')['useAppStore']>
readonly useAppStore: UnwrapRef<typeof import('./src/stores/app-store-auto-imports')['useAppStore']>
readonly useArrayDifference: UnwrapRef<typeof import('@vueuse/core')['useArrayDifference']>
readonly useArrayEvery: UnwrapRef<typeof import('@vueuse/core')['useArrayEvery']>
readonly useArrayFilter: UnwrapRef<typeof import('@vueuse/core')['useArrayFilter']>
@@ -491,6 +504,7 @@ declare module 'vue' {
readonly useAsyncQueue: UnwrapRef<typeof import('@vueuse/core')['useAsyncQueue']>
readonly useAsyncState: UnwrapRef<typeof import('@vueuse/core')['useAsyncState']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useAuthStore: UnwrapRef<typeof import('./src/stores/auth-store-auto-imports')['useAuthStore']>
readonly useBase64: UnwrapRef<typeof import('@vueuse/core')['useBase64']>
readonly useBattery: UnwrapRef<typeof import('@vueuse/core')['useBattery']>
readonly useBluetooth: UnwrapRef<typeof import('@vueuse/core')['useBluetooth']>
@@ -553,7 +567,6 @@ declare module 'vue' {
readonly useIntervalFn: UnwrapRef<typeof import('@vueuse/core')['useIntervalFn']>
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router/auto')['useLink']>
readonly useLoadingBar: UnwrapRef<typeof import('naive-ui')['useLoadingBar']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
@@ -593,6 +606,7 @@ declare module 'vue' {
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
readonly usePreferredReducedTransparency: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedTransparency']>
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly usePrimevueDialogRef: UnwrapRef<typeof import('utils4u/primevue')['usePrimevueDialogRef']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useRefs: UnwrapRef<typeof import('utils4u/vue-use')['useRefs']>

View File

@@ -1,9 +1,11 @@
import type { UserConfig } from '@commitlint/types';
const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
formatter: '@commitlint/format',
rules: {
'body-max-line-length': [2, 'always', 500],
},
};
export default Configuration;

View File

@@ -1,4 +1,4 @@
{
"extends": "@tsconfig/node22/tsconfig.json",
"extends": "@tsconfig/node24/tsconfig.json",
"include": ["./**/*"]
}

View File

@@ -1,15 +1,20 @@
import pluginImport from 'eslint-plugin-import';
import { globalIgnores } from 'eslint/config';
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 {
configureVueProject,
defineConfigWithVueTs,
vueTsConfigs,
configureVueProject,
} from '@vue/eslint-config-typescript';
import pluginVue from 'eslint-plugin-vue';
import pluginVitest from '@vitest/eslint-plugin';
import pluginPlaywright from 'eslint-plugin-playwright';
import pluginImport from 'eslint-plugin-import';
import pluginJsonc from 'eslint-plugin-jsonc';
import pluginOxlint from 'eslint-plugin-oxlint';
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
import pluginPerfectionist from 'eslint-plugin-perfectionist';
import pluginPlaywright from 'eslint-plugin-playwright';
import pluginVue from 'eslint-plugin-vue';
import { globalIgnores } from 'eslint/config';
import jsoncParser from 'jsonc-eslint-parser';
configureVueProject({ scriptLangs: ['ts', 'tsx'] });
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
@@ -20,7 +25,14 @@ export default defineConfigWithVueTs(
files: ['**/*.{ts,mts,tsx,vue}'],
},
globalIgnores(['worker-configuration.d.ts', '**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
globalIgnores([
'worker-configuration.d.ts',
'**/dist/**',
'**/dist-ssr/**',
'**/coverage/**',
'**/public/**',
'**/-----TEMP-----/**',
]),
pluginVue.configs['flat/essential'],
vueTsConfigs.recommended,
@@ -35,10 +47,29 @@ export default defineConfigWithVueTs(
files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'],
},
...pluginOxlint.configs['flat/recommended'],
// https://eslint-plugin-vue-i18n.intlify.dev/started.html#getting-started
...vueI18n.configs.recommended,
{
plugins: {
import: pluginImport,
rules: {
'@intlify/vue-i18n/no-raw-text': 'off',
'@intlify/vue-i18n/no-unused-keys': [
'error',
{
src: './src',
extensions: ['.js', '.ts', '.tsx', '.vue'],
},
],
},
settings: {
'vue-i18n': {
localeDir: './src/locales/**/*.json',
messageSyntaxVersion: '^11.0.0',
},
},
},
{
plugins: { import: pluginImport },
rules: {
'import/first': 'error',
'import/no-duplicates': 'error',
@@ -52,7 +83,25 @@ export default defineConfigWithVueTs(
},
},
{ plugins: { perfectionist: pluginPerfectionist } },
{
/**
* 启用 sort-keys 规则以强制对象键按字母顺序排序
* 原因:
* 1. 减少多人协作时的合并冲突
* 2. 保持代码一致性,提高可维护性
*/
files: ['src/locales/**/*.json'],
languageOptions: { parser: jsoncParser },
plugins: { jsonc: pluginJsonc },
rules: { 'jsonc/sort-keys': 'error' },
},
{
// plugins: {
// '@stylistic': stylistic,
// },
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'vue/block-order': [
@@ -65,7 +114,20 @@ export default defineConfigWithVueTs(
'error',
{ order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'] },
],
'vue/attributes-order': 'error',
'vue/multi-word-component-names': 'off',
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
{ registeredComponentsOnly: false, ignores: [] },
],
// '@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'] },
// ],
},
},

View File

@@ -11,40 +11,6 @@
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<script>
window.addEventListener('DOMContentLoaded', function () {
window.ontouchstart = function () {};
window.ontouchend = function () {};
});
window.onloadX = function () {
// 禁止双指缩放
document.addEventListener('touchstart', function (event) {
if (event.touches.length > 1) {
event.preventDefault();
}
});
// 禁止双击放大
var lastTouchEnd = 0;
document.addEventListener(
'touchend',
function (event) {
var now = new Date().getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
},
false,
);
// 禁止手势事件
document.addEventListener('gesturestart', function (event) {
event.preventDefault();
});
};
</script>
<meta name="color-scheme" content="light dark" />
<meta name="format-detection" content="telephone=no" />
@@ -132,35 +98,69 @@
<!-- <script src="https://testingcf.jsdelivr.net/npm/@vant/touch-emulator/dist/index.min.js"></script> -->
<!-- .min.js 是 jsDelivr 的特殊处理 -->
<!-- <script src="https://unpkg.luckincdn.com/@vant/touch-emulator@1.4.0/dist/index.js"></script> -->
</body>
<script>
(function (d) {
var config = {
kitId: 'whk2tto',
scriptTimeout: 3000,
async: true,
},
h = d.documentElement,
t = setTimeout(function () {
h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive';
}, config.scriptTimeout),
tk = d.createElement('script'),
f = false,
s = d.getElementsByTagName('script')[0],
a;
h.className += ' wf-loading';
tk.src = 'https://use.typekit.net/' + config.kitId + '.js';
tk.async = true;
tk.onload = tk.onreadystatechange = function () {
a = this.readyState;
if (f || (a && a != 'complete' && a != 'loaded')) return;
f = true;
clearTimeout(t);
try {
Typekit.load(config);
} catch (e) {}
<script>
window.addEventListener('DOMContentLoaded', function () {
window.ontouchstart = function () {};
window.ontouchend = function () {};
});
window.onloadX = function () {
// 禁止双指缩放
document.addEventListener('touchstart', function (event) {
if (event.touches.length > 1) {
event.preventDefault();
}
});
// 禁止双击放大
var lastTouchEnd = 0;
document.addEventListener(
'touchend',
function (event) {
var now = new Date().getTime();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
},
false,
);
// 禁止手势事件
document.addEventListener('gesturestart', function (event) {
event.preventDefault();
});
};
s.parentNode.insertBefore(tk, s);
}); /* (document) */
</script>
</script>
<script>
(function (d) {
var config = {
kitId: 'whk2tto',
scriptTimeout: 3000,
async: true,
},
h = d.documentElement,
t = setTimeout(function () {
h.className = h.className.replace(/\bwf-loading\b/g, '') + ' wf-inactive';
}, config.scriptTimeout),
tk = d.createElement('script'),
f = false,
s = d.getElementsByTagName('script')[0],
a;
h.className += ' wf-loading';
tk.src = 'https://use.typekit.net/' + config.kitId + '.js';
tk.async = true;
tk.onload = tk.onreadystatechange = function () {
a = this.readyState;
if (f || (a && a != 'complete' && a != 'loaded')) return;
f = true;
clearTimeout(t);
try {
Typekit.load(config);
} catch (e) {}
};
s.parentNode.insertBefore(tk, s);
}); /* (document) */
</script>
</body>
</html>

View File

@@ -1,45 +1,49 @@
{
"packageManager": "pnpm@10.18.3",
"packageManager": "pnpm@10.25.0",
"name": "vue-ts-example-2025",
"version": "0.0.0",
"private": true,
"type": "module",
"engines": {
"node": "^20.19.0 || >=22.12.0"
"_devenginesruntime_docs": "https://pnpm.io/zh/package_json#devenginesruntime",
"devEngines": {
"runtime": {
"name": "node",
"version": "^24.11.1",
"onFail": "download"
}
},
"scripts": {
"_all": "run-p build-only type-check lint format:prettier test:unit:DisableWatch",
"dev": "vite --port 4730 --host --strictPort",
"all": "run-s lint format:prettier build-only type-check test:unit:DisableWatch",
"dev": "nodemon --delay 280ms --watch vite-plugins --ext ts -x vite -- --port 4730 --host --strictPort",
"build": "run-p type-check \"build-only {@}\" --",
"build-only": "vite build",
"preview": "vite preview --port 4731 --host --strictPort",
"wrangler:dev": "wrangler dev --port 4732",
"format:prettier": "prettier --write src/",
"format:prettier": "prettier --config=.prettierrc.json --cache --write --log-level=warn src/",
"type-check": "vue-tsc --build",
"lint": "run-s lint:*",
"lint:vue-i18n-extract": "vue-i18n-extract report --vueFiles './src/**/*.?(ts|tsx|vue)' --languageFiles './src/locales/*.?(json|yml|yaml|js)' --ci",
"lint:stylelint": "stylelint \"**/*.{css,less,scss,vue}\" --fix --ignore-path .gitignore",
"lint:vue-i18n-extract": "vue-i18n-extract report --vueFiles './src/**/*.?(ts|tsx|vue)' --languageFiles './src/locales/**/*.?(json|yml|yaml|js)' --ci",
"lint:stylelint": "stylelint --config=stylelint.config.mjs --cache --output-file=node_modules/.cache/stylelint/stylelint-report.json --cache-location=node_modules/.cache/stylelint/.stylelintcache --fix --ignore-path=.gitignore '**/*.{css,less,scss,vue}'",
"lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
"lint:eslint": "eslint . --fix",
"lint:eslint": "eslint . --fix --config=eslint.config.ts --concurrency=auto --env-info --cache --cache-location=node_modules/.cache/eslint/.eslintcache",
"test:unit:DisableWatch": "vitest --run",
"test:playwright:headless": "HEADLESS=true playwright test --quiet",
"_stylelint-config": "stylelint --config=stylelint.config.mjs --print-config src/styles/scss/global.scss",
"postinstall": "wrangler types",
"prepare": "husky"
},
"lint-staged": {
"{server,src,e2e}/**/*.{js,jsx,ts,tsx,vue}": [
"prettier --write",
"{src,e2e}/**/*.{js,jsx,ts,tsx,vue}": [
"eslint --fix",
"oxlint --fix"
"oxlint --fix",
"prettier --write"
],
"{src,packages}/**/*.{css,less,scss,vue}": [
"stylelint --fix"
]
],
"{src/locales-utils,src/locales}/**/*": "node scripts/type-check-for-lint-staged.mjs"
},
"pnpm": {
"overrides": {
"vue-tsc": "$vue-tsc"
},
"onlyBuiltDependencies": [
"@parcel/watcher",
"esbuild",
@@ -50,95 +54,110 @@
]
},
"dependencies": {
"@commitlint/cli": "^20.0.0",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@formkit/auto-animate": "^0.9.0",
"@pinia/colada": "^0.17.4",
"@primeuix/themes": "^1.2.3",
"@pinia/colada": "^0.20.0",
"@primeuix/themes": "^2.0.0",
"@sa/materials": "workspace:*",
"@unhead/vue": "^2.0.14",
"@vueuse/core": "^13.9.0",
"@unhead/vue": "^2.0.19",
"@vueuse/core": "^14.0.0",
"highlight.js": "^11.11.1",
"naive-ui": "^2.43.1",
"pinia": "^3.0.3",
"primelocale": "^2.1.7",
"primevue": "^4.3.9",
"jsonc-eslint-parser": "^2.4.1",
"lodash-es": "^4.17.21",
"naive-ui": "^2.43.2",
"pinia": "^3.0.4",
"primeicons": "^7.0.0",
"primelocale": "^2.2.2",
"primevue": "^4.4.1",
"ts-enum-util": "^4.1.0",
"utils4u": "^4.2.3",
"vue": "^3.5.21",
"vue-i18n": "^11.1.12",
"utils4u": "^5",
"vue": "^3.5.24",
"vue-i18n": "^11.2.1",
"vue-memoize-dict": "^1.1.3",
"vue-router": "^4.6.3"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.13.2",
"@cloudflare/vite-plugin": "^1.15.2",
"@commitlint/types": "^20.0.0",
"@iconify-json/carbon": "^1.2.13",
"@iconify-json/carbon": "^1.2.14",
"@iconify-json/clarity": "^1.2.4",
"@iconify-json/line-md": "^1.2.11",
"@iconify-json/material-symbols": "^1.2.42",
"@intlify/unplugin-vue-i18n": "^11.0.0",
"@playwright/test": "^1.55.0",
"@prettier/plugin-oxc": "^0.0.4",
"@primevue/auto-import-resolver": "^4.3.9",
"@primevue/metadata": "^4.3.9",
"@iconify-json/material-symbols": "^1.2.47",
"@intlify/eslint-plugin-vue-i18n": "^4.1.0",
"@intlify/unplugin-vue-i18n": "^11.0.1",
"@playwright/test": "^1.57.0",
"@prettier/plugin-oxc": "^0.1.3",
"@primevue/auto-import-resolver": "^4.4.1",
"@primevue/metadata": "^4.4.1",
"@stylelint-types/stylelint-order": "^7.0.0",
"@stylelint-types/stylelint-scss": "^6.11.0",
"@tsconfig/node22": "^22.0.2",
"@stylistic/eslint-plugin": "^5.6.1",
"@tsconfig/node24": "^24.0.0",
"@types/html-minifier-terser": "^7.0.2",
"@types/jsdom": "^27.0.0",
"@types/node": "^22.18.1",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.10.1",
"@vant/auto-import-resolver": "^1.3.0",
"@vitejs/plugin-vue": "^6.0.1",
"@vitejs/plugin-vue-jsx": "^5.1.1",
"@vitest/eslint-plugin": "^1.3.9",
"@vitejs/plugin-vue": "^6.0.2",
"@vitejs/plugin-vue-jsx": "^5.1.2",
"@vitest/eslint-plugin": "^1.4.3",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.6.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.8.1",
"boxen": "^8.0.1",
"consola": "^3.4.2",
"eslint": "^9.35.0",
"eslint": "^9.39.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-oxlint": "~1.23.0",
"eslint-plugin-playwright": "^2.2.2",
"eslint-plugin-vue": "~10.5.0",
"happy-dom": "^20.0.1",
"eslint-plugin-jsonc": "^2.21.0",
"eslint-plugin-oxlint": "~1.32.0",
"eslint-plugin-perfectionist": "^5.0.0",
"eslint-plugin-playwright": "^2.3.0",
"eslint-plugin-vue": "~10.6.0",
"happy-dom": "^20.0.10",
"html-minifier-terser": "^7.2.0",
"husky": "^9.1.7",
"jsdom": "^27.0.0",
"lint-staged": "^16.1.6",
"jsdom": "^27.2.0",
"lint-staged": "^16.2.7",
"nodemon": "^3.1.11",
"npm-run-all2": "^8.0.4",
"nprogress": "^0.2.0",
"oxlint": "~1.23.0",
"oxlint": "~1.29.0",
"postcss-html": "^1.8.0",
"prettier": "3.6.2",
"rollup": "^4.52.5",
"sass-embedded": "^1.93.2",
"stylelint": "^16.25.0",
"stylelint-config-recess-order": "^7.3.0",
"prettier": "3.7.4",
"rollup": "^4.53.3",
"sass-embedded": "^1.93.3",
"sharp": "^0.34.5",
"stylelint": "^16.26.0",
"stylelint-config-recess-order": "^7.4.0",
"stylelint-config-standard": "^39.0.1",
"stylelint-config-standard-scss": "^16.0.0",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-define-config": "^16.24.0",
"svgo": "^4.0.0",
"tinyglobby": "^0.2.15",
"typescript": "~5.9.2",
"unocss": "^66.5.1",
"unocss-preset-animations": "^1.2.1",
"unplugin-auto-import": "^20.1.0",
"unplugin-icons": "^22.2.0",
"unplugin-vue-components": "^29.2.0",
"type-fest": "^5.2.0",
"typescript": "~5.9.3",
"unocss": "^66.5.9",
"unocss-preset-animations": "^1.3.0",
"unplugin-auto-import": "^20.2.0",
"unplugin-icons": "^22.5.0",
"unplugin-vue-components": "^30.0.0",
"unplugin-vue-markdown": "^29.2.0",
"unplugin-vue-router": "^0.16.0",
"vite": "^7.1.5",
"vite-plugin-checker": "^0.11.0",
"vite-plugin-fake-server": "^2.2.0",
"vite-plugin-image-optimizer": "^2.0.2",
"vite-plugin-vue-devtools": "^8.0.1",
"unplugin-vue-router": "^0.19.0",
"vite": "^7.2.4",
"vite-plugin-checker": "^0.12.0",
"vite-plugin-fake-server": "^2.2.2",
"vite-plugin-image-optimizer": "^2.0.3",
"vite-plugin-vue-devtools": "^8.0.5",
"vite-plugin-vue-meta-layouts": "^0.6.1",
"vite-plugin-webfont-dl": "^3.11.1",
"vitest": "^3.2.4",
"vitest": "^4.0.13",
"vue-component-type-helpers": "^3.1.4",
"vue-i18n-extract": "^2.0.7",
"vue-macros": "3.1.1",
"vue-tsc": "^3.1.0",
"wrangler": "^4.37.1"
"vue-tsc": "^3.1.8",
"wrangler": "^4.50.0"
}
}

5967
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,6 @@
packages:
- "packages/*"
- 'packages/*'
# shamefullyHoist: false # https://pnpm.io/zh/settings#shamefullyhoist
overrides:
vue-tsc: $vue-tsc

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env node
/**
* Type check script for lint-staged
* This script ignores file arguments passed by lint-staged and runs type-check on the entire project
*/
import { spawnSync } from 'child_process';
const result = spawnSync('pnpm', ['run', 'type-check'], {
stdio: 'inherit',
shell: process.platform === 'win32',
});
process.exit(result.status ?? 1);

View File

@@ -1,26 +1,18 @@
<script setup lang="ts">
import type { GlobalThemeOverrides } from 'naive-ui';
import { darkTheme } from 'naive-ui';
import { RouterView } from 'vue-router';
const appStore = useAppStore();
// https://www.naiveui.com/zh-CN/light/docs/customize-theme
const themeOverrides: GlobalThemeOverrides = {
common: {},
};
import AppNaiveUIProvider from './AppNaiveUIProvider.vue';
</script>
<template>
<DynamicDialog />
<ConfirmDialog />
<Toast />
<n-config-provider
:theme-overrides
preflight-style-disabled
:theme="appStore.isDark ? darkTheme : null"
abstract
>
<RouterView />
</n-config-provider>
<Toast style="z-index: 5000" />
<AppNaiveUIProvider>
<RouterView v-slot="{ Component }">
<Transition name="fade" mode="out-in">
<component :is="Component" />
</Transition>
</RouterView>
</AppNaiveUIProvider>
</template>

View File

@@ -0,0 +1,58 @@
<script setup lang="ts">
import type { GlobalThemeOverrides } from 'naive-ui';
import { darkTheme, dateZhCN, zhCN } from 'naive-ui';
import type { FunctionalComponent } from 'vue';
import { createTextVNode } from 'vue';
const appStore = useAppStore();
// https://www.naiveui.com/zh-CN/light/docs/customize-theme
const themeOverrides: GlobalThemeOverrides = {
common: {},
};
const ContextHolder: FunctionalComponent = () => {
window.$nLoadingBar = useLoadingBar();
window.$nModal = useModal();
window.$nDialog = useDialog();
window.$nMessage = useMessage();
window.$nNotification = useNotification();
return createTextVNode();
};
</script>
<script lang="ts">
declare global {
export interface Window {
$nLoadingBar?: import('naive-ui').LoadingBarProviderInst;
$nModal?: import('naive-ui').ModalProviderInst;
$nDialog?: import('naive-ui').DialogProviderInst;
$nMessage?: import('naive-ui').MessageProviderInst;
$nNotification?: import('naive-ui').NotificationProviderInst;
}
}
</script>
<template>
<NConfigProvider
:locale="zhCN"
:date-locale="dateZhCN"
:theme-overrides
preflight-style-disabled
:theme="appStore.isDark ? darkTheme : null"
abstract
>
<NLoadingBarProvider>
<NMessageProvider>
<NNotificationProvider>
<NModalProvider>
<NDialogProvider>
<slot></slot>
<ContextHolder />
</NDialogProvider>
</NModalProvider>
</NNotificationProvider>
</NMessageProvider>
</NLoadingBarProvider>
</NConfigProvider>
</template>

View File

@@ -8,16 +8,7 @@ import IconMenuRounded from '~icons/material-symbols/menu-rounded';
export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref<MenuInst | null> }) {
const router = useRouter();
const { t, te } = useI18n({
inheritLocale: true,
useScope: 'local',
missing: (locale, key) => {
consola.warn(`菜单翻译缺失: locale=${locale}, key=${key}`);
return key;
},
fallbackRoot: true,
messages: locales4RouteMessages,
});
const { t, te } = routeI18nInstance.global;
// 获取路由表但是不包含布局路由
const routes = createGetRoutes(router)();
@@ -26,10 +17,15 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref<M
const selectedKey = ref('');
watch(
() => router.currentRoute.value.path,
(newPath) => {
selectedKey.value = newPath;
menuInstRef.value?.showOption(newPath); // 展开菜单,确保设定的元素被显示,如果不传入 key 会展示当前选中元素
() => router.currentRoute.value,
(route) => {
// 优先使用 activeMenuName通过路由名称解析为路径如果没有则使用当前路径
const activeMenuPath = route.meta.activeMenuName
? router.resolve({ name: route.meta.activeMenuName }).path
: route.path;
selectedKey.value = activeMenuPath;
menuInstRef.value?.showOption(activeMenuPath); // 展开菜单,确保设定的元素被显示
},
{ immediate: true },
);
@@ -48,67 +44,73 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref<M
const menuMap = new Map<string, MenuOption>();
const rootMenus: MenuOption[] = [];
// 过滤和排序路由
const validRoutes = routes
.filter((route) => {
// 过滤掉不需要显示的路由
if (route.meta?.hideInMenu === true || route.meta?.layout === false) {
return false;
}
// 过滤掉通配符路径
if (route.path.includes('*')) {
return false;
}
// 根据环境变量判断是否显示 /demos 开头的路由
if (import.meta.env.VITE_MENU_SHOW_DEMOS !== 'true' && route.path.startsWith('/demos')) {
return false;
}
return true;
})
// 排序路由,确保父路由总是在子路由之前,同级路由则根据 `meta.order` 排序
.sort((a: RouteRecordRaw, b: RouteRecordRaw) => {
const pathA = a.path;
const pathB = b.path;
const segmentsA = pathA.split('/').filter(Boolean);
const segmentsB = pathB.split('/').filter(Boolean);
const parentAPath = `/${segmentsA.slice(0, -1).join('/')}`;
const parentBPath = `/${segmentsB.slice(0, -1).join('/')}`;
// 过滤路由
const validRoutes = routes.filter((route) => {
// 过滤掉不需要显示的路由
if (route.meta?.hideInMenu === true || route.meta?.layout === false) {
return false;
}
// 过滤掉通配符路径
if (route.path.includes('*')) {
return false;
}
// 根据环境变量判断是否显示 /demos 开头的路由
if (import.meta.env.VITE_APP_MENU_SHOW_DEMOS !== 'true' && route.path.startsWith('/demos')) {
return false;
}
return true;
});
// 如果不是同级路由,则按路径排序,确保父路由在前
if (parentAPath !== parentBPath) {
return pathA.localeCompare(pathB);
}
// 排序路由:先按路径深度分组,再按 order 排序
const sortedRoutes = validRoutes.slice().sort((a: RouteRecordRaw, b: RouteRecordRaw) => {
const pathA = a.path;
const pathB = b.path;
// 同级路由,处理 `meta.order`
const orderA = a.meta?.order;
const orderB = b.meta?.order;
const hasOrderA = orderA !== undefined;
const hasOrderB = orderB !== undefined;
// 1. 首先按路径深度排序(确保父路由在子路由之前)
const depthA = pathA.split('/').filter(Boolean).length;
const depthB = pathB.split('/').filter(Boolean).length;
if (depthA !== depthB) {
return depthA - depthB;
}
// 当一个有 order 而另一个没有时,有 order 的排在前面
if (hasOrderA !== hasOrderB) {
return hasOrderA ? -1 : 1;
}
// 2. 获取父路径,判断是否为同一父级下的路由
const segmentsA = pathA.split('/').filter(Boolean);
const segmentsB = pathB.split('/').filter(Boolean);
const parentA = segmentsA.length > 1 ? `/${segmentsA.slice(0, -1).join('/')}` : '/';
const parentB = segmentsB.length > 1 ? `/${segmentsB.slice(0, -1).join('/')}` : '/';
// 当两个都有 order 时,按 order 值升序排序
if (hasOrderA && hasOrderB) {
const orderDiff = orderA - orderB;
if (orderDiff !== 0) {
return orderDiff;
}
}
// 如果父路径不同,按父路径字母顺序排序
if (parentA !== parentB) {
return parentA.localeCompare(parentB);
}
// order 相同或都没有 order按路径字母顺序排序
return pathA.localeCompare(pathB);
});
// 3. 同一父级下的路由,按 order 排序
const orderA = a.meta?.order;
const orderB = b.meta?.order;
const hasOrderA = typeof orderA === 'number';
const hasOrderB = typeof orderB === 'number';
// 有 order 的排在没有 order 的前面
if (hasOrderA && !hasOrderB) return -1;
if (!hasOrderA && hasOrderB) return 1;
// 都有 order 时,按 order 数值升序排序
if (hasOrderA && hasOrderB) {
const diff = (orderA as number) - (orderB as number);
if (diff !== 0) return diff;
}
// order 相同或都没有 order按路径名字母顺序排序
return pathA.localeCompare(pathB);
});
// 构建菜单树
for (const route of validRoutes) {
for (const route of sortedRoutes) {
const pathSegments = route.path.split('/').filter(Boolean);
const routeName = route.name as string;
let text = te(routeName) ? t(routeName) : route.meta?.title || routeName;
if (import.meta.env.VITE_MENU_SHOW_ORDER === 'true' && route.meta?.order) {
let text = te(routeName) ? t(routeName) : routeName;
if (import.meta.env.VITE_APP_MENU_SHOW_ORDER === 'true' && route.meta?.order) {
const order = String(route.meta.order).padStart(orderMaxLength, '0');
text = `${order}. ${text}`;
}
@@ -147,11 +149,33 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref<M
}
}
// 添加调试日志
if (import.meta.env.DEV) {
console.debug(
'排序后的路由:',
sortedRoutes.map((route) => ({
path: route.path,
name: route.name,
order: route.meta?.order,
})),
);
}
return rootMenus;
}
// console.debug('原始路由:', JSON.stringify(routes, null, 0));
// console.debug('转换后的菜单:', JSON.stringify(menuOptions.value, null, 0));
if (import.meta.env.DEV) {
console.debug(
'原始路由:',
routes.map((route) => ({
path: route.path,
name: route.name,
order: route.meta?.order,
})),
);
console.debug('转换后的菜单:', options.value);
}
return {
options,
selectedKey,

View File

@@ -2,6 +2,7 @@
import LanguageSwitchButton from './components/LanguageSwitchButton.vue';
import ThemeSwitchButton from './components/ThemeSwitchButton.vue';
import ToggleSiderButton from './components/ToggleSiderButton.vue';
import UserDropdown from './components/UserDropdown.vue';
</script>
<template>
@@ -11,6 +12,7 @@ import ToggleSiderButton from './components/ToggleSiderButton.vue';
<div class="flex items-center">
<LanguageSwitchButton />
<ThemeSwitchButton />
<UserDropdown />
</div>
</div>
</template>

View File

@@ -25,7 +25,7 @@ function handleSelect(key: string) {
<NDropdown trigger="hover" placement="bottom-end" :options="options" @select="handleSelect">
<NButton quaternary class="flex items-center gap-1">
<template #icon>
<icon-clarity-language-line w-4.5 h-4.5 />
<IconClarityLanguageLine w-4.5 h-4.5 />
</template>
<span>{{ languageLabels[locale] }}</span>
</NButton>

View File

@@ -4,7 +4,7 @@ const appStore = useAppStore();
const themeLabels: Record<AppThemeMode, string> = {
light: '浅色',
dark: '深色',
system: '跟随系统',
auto: '跟随系统',
};
</script>
@@ -12,18 +12,18 @@ const themeLabels: Record<AppThemeMode, string> = {
<NTooltip :disabled="appStore.isMobile" placement="bottom-end">
{{ themeLabels[appStore.themeMode] }}
<template #trigger>
<NButton quaternary @click="appStore.cycleTheme">
<icon-line-md-sunny-filled-loop-to-moon-filled-loop-transition
<NButton quaternary @click="appStore.cycleTheme()">
<IconLineMdSunnyFilledLoopToMoonFilledLoopTransition
v-if="appStore.themeMode === 'light'"
w-4.5
h-4.5
/>
<icon-line-md-moon-filled-to-sunny-filled-loop-transition
<IconLineMdMoonFilledToSunnyFilledLoopTransition
v-else-if="appStore.themeMode === 'dark'"
w-4.5
h-4.5
/>
<icon-line-md-computer v-else w-4.5 h-4.5 />
<IconLineMdComputer v-else w-4.5 h-4.5 />
</NButton>
</template>
</NTooltip>

View File

@@ -15,8 +15,8 @@ function toggleCollapsed() {
{{ appStore.sidebarCollapsed ? '展开菜单' : '收起菜单' }}
<template #trigger>
<NButton ref="buttonRef" quaternary @click="toggleCollapsed">
<icon-line-md-menu-fold-right v-if="appStore.sidebarCollapsed" w-4.5 h-4.5 />
<icon-line-md-menu-fold-left v-else w-4.5 h-4.5 />
<IconLineMdMenuFoldRight v-if="appStore.sidebarCollapsed" w-4.5 h-4.5 />
<IconLineMdMenuFoldLeft v-else w-4.5 h-4.5 />
</NButton>
</template>
</NTooltip>

View File

@@ -0,0 +1,45 @@
<script setup lang="tsx">
const router = useRouter();
const userStore = useAuthStore();
const dialog = useDialog();
const options = computed(() => [
{
label: userStore.userInfo?.nickname || userStore.userInfo?.username || '用户',
key: 'user',
disabled: true,
},
{
type: 'divider',
key: 'd1',
},
{
label: '退出登录',
key: 'logout',
icon: () => <icon-material-symbols-logout class="w-4 h-4" />,
},
]);
function handleSelect(key: string) {
if (key === 'logout') {
dialog.warning({
title: '退出登录',
content: '确定要退出登录吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
userStore.clearToken('用户退出登录');
router.push('/login');
},
});
}
}
</script>
<template>
<NDropdown :options="options" placement="bottom-end" @select="handleSelect">
<NButton quaternary circle>
<IconMaterialSymbolsAccountCircle w-5 h-5 />
</NButton>
</NDropdown>
</template>

View File

@@ -1,5 +1,5 @@
<script setup lang="tsx">
import { useAppStore } from '@/stores/app-store';
import { useAppStore } from '@/stores/app-store-auto-imports';
const menuInstRef = useTemplateRef('menuInstRef');
const { options, selectedKey } = useMetaLayoutsNMenuOptions({
@@ -12,13 +12,13 @@ const appStore = useAppStore();
<template>
<!-- @update:value="handleMenuUpdate" -->
<NMenu
mode="vertical"
ref="menuInstRef"
v-model:value="selectedKey"
mode="vertical"
:collapsed="appStore.sidebarCollapsed"
:collapsed-width="64"
:icon-size="20"
:collapsed-icon-size="24"
v-model:value="selectedKey"
:options="options"
:inverted="false"
:root-indent="32"

View File

@@ -8,12 +8,12 @@ const appStore = useAppStore();
<template>
<AdminLayout
v-model:sider-collapse="appStore.sidebarCollapsed"
mode="horizontal"
:footer-visible="!false"
:tab-visible="!false"
scroll-mode="content"
:is-mobile="appStore.isMobile"
v-model:sider-collapse="appStore.sidebarCollapsed"
>
<template #header>
<BaseLayoutHeader />
@@ -29,11 +29,11 @@ const appStore = useAppStore();
<BaseLayoutSider />
</template>
<!-- <div>GlobalContent</div> -->
<router-view v-slot="{ Component }">
<transition name="fade" mode="out-in">
<RouterView v-slot="{ Component }">
<Transition name="fade" mode="out-in">
<component :is="Component" />
</transition>
</router-view>
</Transition>
</RouterView>
<!-- <div>ThemeDrawer</div> -->
<template #footer>
<div
@@ -49,14 +49,4 @@ const appStore = useAppStore();
#__SCROLL_EL_ID__ {
@include scrollbar;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.25s ease-in-out;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>

View File

@@ -1,10 +0,0 @@
export default {
Root: 'Index',
$Path: '$Path',
Demos: 'Demos',
DemosApiDemo: 'API Demo',
DemosCounterDemo: 'Counter Demo',
DemosI18nDemo: 'i18n Demo',
DemosWebsocketDemo: 'WebSocket Demo',
Home: 'Home',
} as const satisfies PageTitleLocalizations;

View File

@@ -1,10 +0,0 @@
export default {
Root: '根 (Gēn)',
$Path: '$Path',
Demos: '示例演示',
DemosApiDemo: 'API 调用示例',
DemosCounterDemo: '点击计数器',
DemosI18nDemo: '国际化示例',
DemosWebsocketDemo: 'WebSocket 示例',
Home: '首页',
} as const satisfies PageTitleLocalizations;

View File

@@ -0,0 +1,80 @@
/* https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#static-bundle-importing
* All i18n resources specified in the plugin `include` option can be loaded
* at once using the import syntax
*/
import messages from '@intlify/unplugin-vue-i18n/messages';
import { router } from '@/plugins/00.router-plugin';
import { createGetRoutes } from 'virtual:meta-layouts';
import { createI18n } from 'vue-i18n';
import { START_LOCATION } from 'vue-router';
const locale = useLocalStorage<string>('app-locale', navigator.language);
watchEffect(() => {
window.document.documentElement.setAttribute('lang', locale.value);
});
// https://vue-i18n.intlify.dev/guide/essentials/started.html#registering-the-i18n-plugin
export const i18nInstance = createI18n({
legacy: false, // you must set `false`, to use Composition API
locale: locale.value,
fallbackRoot: false,
// flatJson: true,
missing: (locale, key /* , instance, type */) => {
consola.warn(`缺少国际化内容: locale='${locale}', key='${key}'`);
return `[${key}]`;
},
missingWarn: !true,
fallbackWarn: !true,
messages,
});
export const routeI18nInstance = createI18n({
legacy: false, // you must set `false`, to use Composition API
locale: locale.value,
inheritLocale: true,
useScope: 'local',
missing: (locale, key) => {
consola.warn(`菜单翻译缺失: locale=${locale}, key=${key}`);
if (__DEV__) {
ToastService.add({
severity: 'warn',
summary: '菜单翻译缺失',
detail: `菜单翻译缺失: locale=${locale}, key=${key}`,
life: 5000,
});
}
return key;
},
fallbackRoot: true,
messages: i18nRouteMessages,
});
export const routeI18nT = routeI18nInstance.global.t;
watchEffect(
() => {
locale.value = i18nInstance.global.locale.value;
},
{ flush: 'sync' },
);
watch(
() => i18nInstance.global.locale.value,
() => {
const { t, te } = routeI18nInstance.global;
routeI18nInstance.global.locale.value = i18nInstance.global.locale.value;
if (router.currentRoute.value.name && router.currentRoute.value !== START_LOCATION) {
router.currentRoute.value.meta.title = t(router.currentRoute.value.name as string);
}
const routes = createGetRoutes(router)(); // 获取路由表但是不包含布局路由
routes.forEach((route) => {
const routeName = route.name as string;
route.meta.title = te(routeName) ? t(routeName) : routeName;
});
},
{ immediate: true, flush: 'sync' },
);

View File

@@ -1,4 +1,4 @@
# `locales-4-route`
# route-messages
此目录存放专门用于**路由名称**的国际化i18n消息。这些消息通过一套自定义的编译时安全机制为应用的导航菜单提供标题。
@@ -27,7 +27,7 @@
3. **编译时检查**:此目录下的每个语言环境文件(如 `en-US.ts`)都必须使用 `satisfies PageTitleLocalizations` 来进行类型断言。
```typescript
// src/locales-4-route/en-US.ts
// ./en-US.ts
export default { ... } satisfies PageTitleLocalizations;
```
@@ -52,13 +52,13 @@
使用上一步中自动生成的 `name` 作为键,在此目录的每个语言文件中添加翻译。
```ts
// src/locales-4-route/zh-CN.ts
// ./zh-CN.ts
export default {
// ... 其他翻译
DemosApiDemo: 'API 演示',
} satisfies PageTitleLocalizations;
// src/locales-4-route/en-US.ts
// ./en-US.ts
export default {
// ... 其他翻译
DemosApiDemo: 'API Demo',

View File

@@ -0,0 +1,25 @@
/*eslint perfectionist/sort-objects: "error"*/
/**
* 启用 perfectionist/sort-objects 规则以强制对象键按字母顺序排序
* 原因:
* 1. 减少多人协作时的合并冲突
* 2. 保持代码一致性,提高可维护性
*
* 运行以下命令自动修复排序:
* pnpm exec eslint --fix --no-ignore src/locales-utils/route-messages/
*/
export default {
$Path: '$Path',
Demos: 'Demos',
DemosApiDemo: 'API Demo',
DemosCounterDemo: 'Counter Demo',
DemosCreate: 'Create Demo',
DemosI18nDemo: 'i18n Demo',
DemosNaiveUiDemo: 'Naive UI Demo',
DemosPrimevueDemo: 'PrimeVue Demo',
DemosWebsocketDemo: 'WebSocket Demo',
Home: 'Home',
Login: 'Login',
Root: 'Index',
} satisfies PageTitleLocalizations;

View File

@@ -1,13 +1,13 @@
import type { I18nOptions } from 'vue-i18n';
const modules = import.meta.glob(['./*.ts', '!./_messages-auto-imports.ts'], {
eager: true,
const modules = import.meta.glob(['./*.ts', '!./route-messages-auto-imports'], {
eager: true /* true 为同步false 为异步 */,
import: 'default',
});
type MessageType = Record<string, string>;
export const locales4RouteMessages: I18nOptions['messages'] = Object.entries(modules).reduce(
export const i18nRouteMessages: I18nOptions['messages'] = Object.entries(modules).reduce(
(messages, [path, mod]) => {
const locale = path.replace(/(\.\/|\.ts)/g, '');
messages[locale] = mod as MessageType;

View File

@@ -0,0 +1,25 @@
/*eslint perfectionist/sort-objects: "error"*/
/**
* 启用 perfectionist/sort-objects 规则以强制对象键按字母顺序排序
* 原因:
* 1. 减少多人协作时的合并冲突
* 2. 保持代码一致性,提高可维护性
*
* 运行以下命令自动修复排序:
* pnpm exec eslint --fix --no-ignore src/locales-utils/route-messages/
*/
export default {
$Path: '$Path',
Demos: '示例演示',
DemosApiDemo: 'API 调用示例',
DemosCounterDemo: '点击计数器',
DemosCreate: '创建示例',
DemosI18nDemo: '国际化示例',
DemosNaiveUiDemo: 'Naive UI 组件示例',
DemosPrimevueDemo: 'PrimeVue 组件示例',
DemosWebsocketDemo: 'WebSocket 示例',
Home: '首页',
Login: '登录',
Root: '根 (Gēn)',
} satisfies PageTitleLocalizations;

View File

@@ -0,0 +1,10 @@
{
"page": {
"i18n-demo": {
"change-language": "Change Language",
"current-language": "Current Language",
"hello": "Hello, {name}!",
"title": "Vue I18n Demo"
}
}
}

View File

@@ -0,0 +1,10 @@
{
"page": {
"i18n-demo": {
"change-language": "切换语言",
"current-language": "当前语言",
"hello": "你好, {name}",
"title": "Vue I18n 示例"
}
}
}

View File

@@ -1,10 +1 @@
{
"page": {
"i18n-demo": {
"title": "Vue I18n Demo",
"current-language": "Current Language",
"change-language": "Change Language",
"hello": "Hello, {name}!"
}
}
}
{}

View File

@@ -1,10 +1 @@
{
"page": {
"i18n-demo": {
"title": "Vue I18n 示例",
"current-language": "当前语言",
"change-language": "切换语言",
"hello": "你好, {name}"
}
}
}
{}

View File

@@ -1,11 +1,14 @@
import './styles/index.ts';
import { LogLevels } from 'consola';
import App from './App.vue';
import { setupPlugins } from './plugins';
consola.level = LogLevels.verbose;
/* `import.meta.glob(${g}, { eager: ${isSync} })`; */
const autoInstallModules = import.meta.glob('./plugins/!(index).ts', { eager: true });
const app = createApp(App);
if (__DEV__) Object.defineProperty(window, '__APP__', { value: app });
setupPlugins(app);
setupPlugins(createApp(App), autoInstallModules).mount('#app');
await new Promise((resolve) => setTimeout(resolve, 280));
app.mount('#app');

87
src/pages/Login.page.vue Normal file
View File

@@ -0,0 +1,87 @@
<script setup lang="ts">
definePage({ meta: { ignoreAuth: true, layout: false } });
const router = useRouter();
const userStore = useAuthStore();
const message = useMessage();
const formValue = ref({
username: 'admin',
password: 'admin',
});
const loading = ref(false);
async function handleLogin() {
if (!formValue.value.username || !formValue.value.password) {
message.warning('请输入用户名和密码');
return;
}
loading.value = true;
try {
const result = await userStore.login(formValue.value.username, formValue.value.password);
if (result.success) {
message.success('登录成功');
router.push('/');
} else {
message.error(result.message || '登录失败');
}
} catch {
message.error('登录异常');
} finally {
loading.value = false;
}
}
</script>
<template>
<div class="login-page">
<NCard class="login-card" title="用户登录">
<NForm :model="formValue" label-placement="left" label-width="80">
<NFormItem label="用户名" path="username">
<NInput
v-model:value="formValue.username"
placeholder="请输入用户名"
@keyup.enter="handleLogin"
/>
</NFormItem>
<NFormItem label="密码" path="password">
<NInput
v-model:value="formValue.password"
type="password"
show-password-on="click"
placeholder="请输入密码"
@keyup.enter="handleLogin"
/>
</NFormItem>
<NFormItem :show-label="false">
<NButton type="primary" block :loading="loading" @click="handleLogin"> 登录 </NButton>
</NFormItem>
</NForm>
<div class="login-hint">
<NText depth="3">提示用户名和密码均为 admin</NText>
</div>
</NCard>
</div>
</template>
<style scoped lang="scss">
.login-page {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
width: 400px;
max-width: 90%;
}
.login-hint {
margin-top: 16px;
text-align: center;
}
</style>

View File

@@ -1,11 +1,29 @@
<script lang="ts" setup>
defineProps<{ path: string }>();
declare global {
interface Window {
stack?: ReturnType<typeof createStackGuard>;
}
}
const stack = window?.stack;
const canGoBack = stack && stack.length > 1;
const router = useRouter();
function handleBack() {
if (canGoBack) {
router.back();
} else {
router.push('/');
}
}
</script>
<template>
<main flex-1 class="flex flex-col items-center justify-center h-full space-y-4">
<h1>Not Found</h1>
<p>{{ path }} does not exist.</p>
<Button @click="$router.back()">Back</Button>
<Button @click="handleBack">{{ canGoBack ? 'Back' : 'Home' }}</Button>
</main>
</template>

View File

@@ -49,10 +49,10 @@ const callApi = async () => {
</div>
<button
@click="callApi"
:disabled="loading"
:aria-label="loading ? '正在调用API' : '调用API接口'"
class="w-full bg-gradient-to-br from-blue-500 via-blue-600 to-purple-600 text-white font-semibold py-3 px-4 rounded-xl hover:from-blue-600 hover:via-blue-700 hover:to-purple-700 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-sm"
@click="callApi"
>
<span v-if="loading" class="flex items-center justify-center">
<svg

View File

@@ -91,10 +91,10 @@ const resetCount = () => {
<div class="w-full flex flex-col gap-3">
<!-- 原生按钮 ( touch 事件) -->
<button
class="w-full bg-gradient-to-br from-orange-500 via-orange-600 to-red-600 text-white font-semibold py-4 px-6 rounded-xl hover:from-orange-600 hover:via-orange-700 hover:to-red-700 transition-all duration-500 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-lg"
@touchstart="() => {}"
@touchend="() => {}"
@click="incrementCount"
class="w-full bg-gradient-to-br from-orange-500 via-orange-600 to-red-600 text-white font-semibold py-4 px-6 rounded-xl hover:from-orange-600 hover:via-orange-700 hover:to-red-700 transition-all duration-500 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-lg"
>
<span class="flex items-center justify-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -111,8 +111,8 @@ const resetCount = () => {
<!-- 原生按钮 ( touch 事件) -->
<button
@click="incrementCount"
class="w-full bg-gradient-to-br from-blue-500 via-blue-600 to-purple-600 text-white font-semibold py-4 px-6 rounded-xl hover:from-blue-600 hover:via-blue-700 hover:to-purple-700 transition-all duration-500 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-lg"
@click="incrementCount"
>
<span class="flex items-center justify-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -128,14 +128,14 @@ const resetCount = () => {
</button>
<!-- Naive UI 按钮 -->
<n-button
@click="incrementCount"
<NButton
type="warning"
size="large"
block
strong
secondary
class="text-lg"
@click="incrementCount"
>
<template #icon>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -148,13 +148,13 @@ const resetCount = () => {
</svg>
</template>
点击 +1 (Naive UI)
</n-button>
</NButton>
<!-- 重置按钮 -->
<button
@click="resetCount"
:disabled="clickCount === 0"
class="w-full bg-gradient-to-br from-gray-500 via-gray-600 to-gray-700 text-white font-semibold py-3 px-6 rounded-xl hover:from-gray-600 hover:via-gray-700 hover:to-gray-800 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02]"
@click="resetCount"
>
<span class="flex items-center justify-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">

View File

@@ -0,0 +1,12 @@
<script setup lang="ts">
definePage({
meta: {
hideInMenu: true,
activeMenuName: 'Demos',
},
});
</script>
<template>
<div></div>
</template>

View File

@@ -1,34 +1,37 @@
<script setup lang="ts">
definePage({
meta: {
order: 1,
},
});
const { t, locale } = useI18n();
definePage({ meta: { order: 1 } });
const { t, locale } = useI18n({});
function setLocale(newLocale: 'en-US' | 'zh-CN') {
locale.value = newLocale;
i18nInstance.global.locale.value = newLocale;
}
</script>
<template>
<div class="p-4">
<n-h1>{{ t('page.i18n-demo.title') }}</n-h1>
<NH1>{{ t('page.i18n-demo.title') }}</NH1>
<n-card :title="t('page.i18n-demo.change-language')">
<n-p>
<NCard :title="t('page.i18n-demo.change-language')">
<NP>
{{ t('page.i18n-demo.current-language') }}:
<span class="font-bold">{{ locale }}</span>
</n-p>
</NP>
<n-p>
<NP>
{{ t('page.i18n-demo.hello', { name: 'Kilo' }) }}
</n-p>
</NP>
<n-space>
<n-button type="primary" @click="setLocale('en-US')"> English </n-button>
<n-button type="success" @click="setLocale('zh-CN')"> 简体中文 </n-button>
</n-space>
</n-card>
<NSpace>
<NButton type="primary" @click="setLocale('en-US')"> English </NButton>
<NButton type="success" @click="setLocale('zh-CN')"> 简体中文 </NButton>
</NSpace>
</NCard>
<!-- 这里响应式有问题: -->
<NP> $route.meta.title: {{ $route.meta.title }} </NP>
<!-- 这样才正常 -->
<NP>
routeI18nInstance.global.t($route.name): {{ routeI18nInstance.global.t($route.name) }}
</NP>
</div>
</template>

View File

@@ -24,6 +24,7 @@ const FComponent: FunctionalComponent<{ prop: string }> = (props /* context */)
</>
);
</script>
<template>
<NCard title="函数式组件TSX示例">
<FComponent prop="some-prop-value" />

View File

@@ -0,0 +1,96 @@
<script setup lang="ts">
import type { MessageType } from 'naive-ui';
import { useDialog, useMessage } from 'naive-ui';
definePage({ meta: {} });
const message = useMessage();
const dialog = useDialog();
const messageTypes = ['info', 'success', 'warning', 'error', 'loading'] satisfies MessageType[];
const dialogTypes = ['info', 'success', 'warning', 'error'] as const;
const openAllMessages = () => {
messageTypes.forEach((type, index) => {
setTimeout(() => {
message[type](`${index + 1}. 消息内容`, {
duration: 3000,
closable: true,
});
}, index * 500);
});
};
const openDialog = (type: (typeof dialogTypes)[number]) => {
dialog[type]({
title: `${type.charAt(0).toUpperCase() + type.slice(1)} 弹窗`,
content: '这是一个命令式 API 创建的弹窗示例。',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
message.success('点击了确定');
},
onNegativeClick: () => {
message.error('点击了取消');
},
});
};
const openModal = () => {
window.$nModal!.create({
title: '命令式 Modal 示例',
content: '这是一个命令式 API 创建的 Modal 示例,使用 preset="dialog"。',
preset: 'dialog',
onPositiveClick: () => {
message.success('点击了确定');
},
onNegativeClick: () => {
message.error('点击了取消');
},
positiveText: '确定',
negativeText: '取消',
});
};
</script>
<template>
<div class="naive-ui-demo-page">
<NCard>
<template #header>Naive UI 组件演示</template>
<NAlert title="信息" type="info" :bordered="false">
演示 Naive UI 各种组件的使用方法和功能特性
</NAlert>
<NCard title="Message 消息" class="mt-4">
<NSpace>
<NButton
v-for="(type, index) in messageTypes"
:key="type"
@click="
message[type](`${index + 1}. 消息内容`, {
duration: 3000,
closable: true,
})
"
>
{{ `${index + 1}. ${type}` }}
</NButton>
<NButton @click="openAllMessages"> 一键打开所有 </NButton>
</NSpace>
</NCard>
<NCard title="Dialog 弹窗 (命令式 API)" class="mt-4">
<NSpace>
<NButton v-for="type in dialogTypes" :key="type" @click="openDialog(type)">
{{ type }}
</NButton>
</NSpace>
</NCard>
<NCard title="Modal 弹窗 (命令式 API)" class="mt-4">
<NSpace>
<NButton @click="openModal"> 打开 Modal </NButton>
</NSpace>
</NCard>
</NCard>
</div>
</template>

View File

@@ -0,0 +1,61 @@
<script setup lang="ts">
import type { ToastMessageOptions } from 'primevue/toast';
definePage({
meta: {},
});
const tostSeverities = [
'secondary',
'success',
'info' /* 默认 */,
'warn',
'error',
'contrast',
undefined,
] satisfies ToastMessageOptions['severity'][];
const openAllToasts = () => {
tostSeverities.forEach((severity, index) => {
setTimeout(() => {
ToastService.add({
severity,
summary: `severity: ${severity ?? 'default'}`,
life: 3000,
detail: `${index + 1}. 消息内容`,
});
}, index * 500);
});
};
</script>
<template>
<div class="prime-vue-demo-page">
<Card>
<template #title>PrimeVue 组件演示</template>
<template #content>
<Message severity="info">演示 PrimeVue 各种组件的使用方法和功能特性</Message>
<Panel header="Toast 消息" class="mt-1.5">
<div flex="~ wrap" gap="4">
<Button
v-for="(severity, index) in tostSeverities"
:key="severity ?? 'default'"
@click="
ToastService.add({
severity: severity,
summary: `severity: ${severity ?? 'default'}`,
life: 3000,
detail: '消息内容',
})
"
>
{{ `${index + 1}. ${severity ?? 'default'}` }}
</Button>
<Button @click="openAllToasts"> 一键打开所有 </Button>
</div>
</Panel>
</template>
</Card>
</div>
</template>

View File

@@ -227,12 +227,12 @@ onUnmounted(() => {
<!-- 控制按钮 -->
<div class="grid grid-cols-2 gap-2">
<button
@click="connectWebSocket"
:disabled="wsConnected || wsLoading"
:aria-label="
wsLoading ? '正在连接WebSocket' : wsConnected ? 'WebSocket已连接' : '连接WebSocket'
"
class="flex items-center justify-center bg-gradient-to-br from-green-500 via-green-600 to-emerald-600 text-white font-semibold py-2.5 px-4 rounded-xl hover:from-green-600 hover:via-green-700 hover:to-emerald-700 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-sm"
@click="connectWebSocket"
>
<svg
v-if="wsLoading"
@@ -259,10 +259,10 @@ onUnmounted(() => {
</button>
<button
@click="disconnectWebSocket"
:disabled="!wsConnected || wsLoading"
:aria-label="!wsConnected ? 'WebSocket未连接' : '断开WebSocket连接'"
class="flex items-center justify-center bg-gradient-to-br from-red-500 via-red-600 to-pink-600 text-white font-semibold py-2.5 px-4 rounded-xl hover:from-red-600 hover:via-red-700 hover:to-pink-700 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-sm"
@click="disconnectWebSocket"
>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
@@ -284,19 +284,19 @@ onUnmounted(() => {
<input
id="messageInput"
v-model="messageInput"
@keyup.enter="sendMessage"
placeholder="输入要发送的消息..."
:disabled="!wsConnected"
:aria-describedby="!wsConnected ? 'ws-status' : undefined"
class="flex-1 w-full border-2 rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:text-gray-500 transition-all duration-300 border-gray-200 dark:border-gray-600 bg-white/60 dark:bg-gray-700/60 backdrop-blur-sm text-gray-800 dark:text-gray-100 disabled:bg-gray-100/60 dark:disabled:bg-gray-800/60 hover:border-gray-300 dark:hover:border-gray-500"
@keyup.enter="sendMessage"
/>
<button
@click="sendMessage"
:disabled="!canSendMessage"
:aria-label="
!wsConnected ? 'WebSocket未连接' : canSendMessage ? '发送消息' : '请输入消息内容'
"
class="flex items-center bg-gradient-to-br from-blue-500 via-blue-600 to-indigo-600 text-white font-semibold py-2.5 px-4 rounded-xl hover:from-blue-600 hover:via-blue-700 hover:to-indigo-700 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-sm"
@click="sendMessage"
>
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
@@ -309,11 +309,11 @@ onUnmounted(() => {
发送
</button>
<button
@click="sendMockData"
:disabled="!wsConnected"
:aria-label="!wsConnected ? 'WebSocket未连接' : '发送随机模拟数据'"
class="flex items-center bg-gradient-to-br from-purple-500 via-purple-600 to-violet-600 text-white font-semibold py-2.5 px-4 rounded-xl hover:from-purple-600 hover:via-purple-700 hover:to-violet-700 transition-all duration-500 disabled:opacity-50 shadow-lg hover:shadow-2xl transform hover:-translate-y-1 hover:scale-[1.02] text-sm"
:title="!wsConnected ? 'WebSocket未连接时不可用' : '发送随机模拟数据'"
@click="sendMockData"
>
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
@@ -354,9 +354,9 @@ onUnmounted(() => {
</h3>
<div class="flex gap-1">
<button
@click="exportMessages"
class="text-xs text-gray-500 hover:text-blue-500 transition-colors duration-200 flex items-center"
title="导出消息"
@click="exportMessages"
>
<svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
@@ -369,9 +369,9 @@ onUnmounted(() => {
导出
</button>
<button
@click="clearMessages"
class="text-xs text-gray-500 hover:text-red-500 transition-colors duration-200 flex items-center"
title="清空消息"
@click="clearMessages"
>
<svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path

View File

@@ -2,6 +2,6 @@
<template>
<div>
<h1>Index Page</h1>
<NButton @click="$router.push({ name: 'DemosCreate' })">DemosCreate</NButton>
</div>
</template>

View File

@@ -1,5 +1,6 @@
export function install({ app }: { app: import('vue').App<Element> }) {
app.config.globalProperties.__DEV__ = __DEV__;
app.config.globalProperties.__DEV__ =
__DEV__; /* vite.config.ts: define: { __DEV__: JSON.stringify(!isBuild) } */
app.config.errorHandler = (error, instance, info) => {
console.error('Global error:', error);
@@ -10,17 +11,4 @@ export function install({ app }: { app: import('vue').App<Element> }) {
// 2. 显示全局错误提示
// 3. 进行错误分析和处理
};
// if (import.meta.env.MODE === 'development' && '1' === ('2' as never)) {
// // TODO: https://github.com/hu3dao/vite-plugin-debug/
// // https://eruda.liriliri.io/zh/docs/#快速上手
// import('eruda').then(({ default: eruda }) => {
// eruda.init({
// defaults: {
// transparency: 0.9,
// },
// })
// /* eruda.show(); */
// })
// }
}

View File

@@ -2,8 +2,8 @@ import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders';
import { setupLayouts } from 'virtual:meta-layouts';
// import { createGetRoutes, setupLayouts } from 'virtual:generated-layouts';
import { createRouter, createWebHistory } from 'vue-router';
import type { RouteNamedMap } from 'vue-router/auto-routes';
import { routes, handleHotUpdate } from 'vue-router/auto-routes';
import type { Router } from 'vue-router';
import { handleHotUpdate, routes } from 'vue-router/auto-routes';
const setupLayoutsResult = setupLayouts(routes);
const router = createRouter({
@@ -15,6 +15,10 @@ const router = createRouter({
strict: true,
});
router.isReady().then(() => {
console.debug('✅ [router is ready]');
});
router.onError((error) => {
console.debug('🚨 [router error]:', error);
});
@@ -32,51 +36,25 @@ export function install({ app }: { app: import('vue').App<Element> }) {
{
// 警告:路由守卫的创建顺序会影响执行流程,请勿调整
createNProgressGuard(router);
createLogGuard(router);
Object.assign(globalThis, { stack: createStackGuard(router) });
if (import.meta.env.VITE_APP_ENABLE_ROUTER_LOG_GUARD === 'true') createLogGuard(router);
Object.assign(window, { stack: createStackGuard(router) });
// >>>
Object.values(
import.meta.glob<{
createGuard?: (router: Router) => void;
}>('./router-guard/*.ts', { eager: true /* true 为同步false 为异步 */ }),
).forEach((module) => {
module.createGuard?.(router);
});
// <<<
}
declare module 'vue-router' {
/* definePage({ meta: { title: '示例演示' } }); */
interface RouteMeta {
/**
* @description 是否在菜单中隐藏
*/
hideInMenu?: boolean;
if (__DEV__) Object.assign(window, { router });
/**
* @description 菜单标题
* @deprecated //!⚠️请通过多语言标题方案(搜`PageTitleLocalizations`)维护标题
*/
title?: string;
/**
* @description 使用的布局,设置为 false 则表示不使用布局
*/
layout?: string | false;
/**
* @description 菜单项是否渲染为可点击链接,默认为 true
* - true: 使用 RouterLink 包装,可点击跳转
* - false: 仅渲染纯文本标签,不可点击(适用于分组标题)
*/
link?: boolean;
/**
* @description 菜单排序权重,数值越小越靠前,未设置则按路径字母顺序排序
*/
order?: number;
}
}
export { router, setupLayoutsResult };
declare global {
type PageTitleLocalizations = Record<keyof RouteNamedMap, string>;
}
if (__DEV__) Object.assign(globalThis, { router });
// This will update routes at runtime without reloading the page
if (import.meta.hot) {
handleHotUpdate(router);
}
export { router, setupLayoutsResult };

View File

@@ -0,0 +1,50 @@
import type { RouteNamedMap } from 'vue-router/auto-routes';
declare global {
type PageTitleLocalizations = Record<keyof RouteNamedMap, string>;
}
declare module 'vue-router' {
/* definePage({ meta: { title: '示例演示' } }); */
interface RouteMeta {
/**
* @description 是否在菜单中隐藏
*/
hideInMenu?: boolean;
/**
* @description 菜单标题 // !⚠️通过多语言标题方案(搜`PageTitleLocalizations`)维护标题
*/
title?: string;
/**
* @description 使用的布局,设置为 false 则表示不使用布局
*/
layout?: string | false;
/**
* @description 菜单项是否渲染为可点击链接,默认为 true
* - true: 使用 RouterLink 包装,可点击跳转
* - false: 仅渲染纯文本标签,不可点击(适用于分组标题)
*/
link?: boolean;
/**
* @description 菜单排序权重,数值越小越靠前,未设置则按路径字母顺序排序
*/
order?: number;
/**
* @description 是否忽略权限,默认为 false
*/
ignoreAuth?: boolean;
/**
* @description 当前路由激活时应该高亮的菜单项(通过路由名称指定)
* - 用于隐藏在菜单中的子页面,指定其父级菜单项应该高亮
* - 使用路由名称而非路径,提供更好的类型安全和重构友好性
* - 例如:`activeMenuName: 'Demos'` 会高亮 Demos 菜单项
*/
activeMenuName?: keyof RouteNamedMap;
}
}

View File

@@ -1,25 +1,3 @@
/* https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#static-bundle-importing
* All i18n resources specified in the plugin `include` option can be loaded
* at once using the import syntax
*/
import messages from '@intlify/unplugin-vue-i18n/messages';
import { createI18n } from 'vue-i18n';
export function install({ app }: { app: import('vue').App<Element> }) {
// https://vue-i18n.intlify.dev/guide/essentials/started.html#registering-the-i18n-plugin
const i18n = createI18n({
legacy: false, // you must set `false`, to use Composition API
locale: navigator.language,
fallbackRoot: false,
// flatJson: true,
missing: (locale, key /* , instance, type */) => {
consola.warn(`缺少国际化内容: locale='${locale}', key='${key}'`);
return `[${key}]`;
},
missingWarn: !true,
fallbackWarn: !true,
messages,
});
app.use(i18n);
app.use(i18nInstance);
}

View File

@@ -5,11 +5,21 @@
import Aura from '@primeuix/themes/aura';
import zhCN from 'primelocale/zh-CN.json';
import PrimeVue from 'primevue/config';
import type { PrimeVueConfiguration } from 'primevue/config';
import StyleClass from 'primevue/styleclass';
import ToastService from 'primevue/toastservice';
export function install({ app }: { app: import('vue').App<Element> }) {
app.directive('styleclass', StyleClass);
// https://github.com/primefaces/primevue/blob/afe6f58ae55e9caf7f9bc094cd453a21a6113001/packages/core/src/config/PrimeVue.js
app.use(PrimeVue, {
zIndex: {
modal: 5100,
overlay: 5000,
menu: 5000,
tooltip: 5100,
},
locale: {
...zhCN['zh-CN'],
completed: '已上传',
@@ -24,5 +34,6 @@ export function install({ app }: { app: import('vue').App<Element> }) {
},
preset: Aura,
},
});
} satisfies PrimeVueConfiguration);
app.use(ToastService);
}

View File

@@ -4,13 +4,18 @@
type UserPlugin = (ctx: UserPluginContext) => void;
type AutoInstallModule = { [K: string]: unknown; install?: UserPlugin };
type UserPluginContext = { app: import('vue').App<Element> };
export function setupPlugins(
app: import('vue').App,
modules: AutoInstallModule | Record<string, unknown>,
) {
console.group('🔌 Plugins');
for (const path in modules) {
const module = modules[path] as AutoInstallModule;
const autoInstallModules: AutoInstallModule = import.meta.glob(
['./*.ts', '!./**/*.types.ts', '!./index.ts'],
{
eager: true /* true 为同步false 为异步 */,
},
);
export function setupPlugins(app: import('vue').App) {
console.group(`🔌 Installing ${Object.keys(autoInstallModules).length} plugins`);
for (const path in autoInstallModules) {
const module = autoInstallModules[path] as AutoInstallModule;
if (module.install) {
module.install({ app });
console.debug(`%c✔ ${path}`, 'color: #07a');

View File

@@ -0,0 +1,28 @@
import type { Router } from 'vue-router';
export function createGuard(router: Router) {
router.beforeEach(async (to /* , from */) => {
const userStore = useAuthStore();
if (to.name === 'Login') {
userStore.clearToken('User navigated to login page');
}
if (to.meta.ignoreAuth) {
return true;
}
if (!userStore.isLoggedIn) {
console.debug('🔑 [permission-guard] 用户未登录,重定向到登录页');
return { name: 'Login' };
}
});
router.beforeResolve(async (/* to, from */) => {
const userStore = useAuthStore();
if (userStore.isLoggedIn && !userStore.userInfo) {
console.debug('🔑 [permission-guard] 用户信息不存在,尝试获取用户信息');
await userStore.fetchUserInfo();
}
});
}

View File

@@ -0,0 +1,46 @@
import type { BasicColorSchema } from '@vueuse/core';
import { useLocalStorage, useMediaQuery } from '@vueuse/core';
import { defineStore } from 'pinia';
import { computed } from 'vue';
// >>>>>
// https://vueuse.org/core/useColorMode/#advanced-usage
const { system, store: themeMode } = useColorMode<BasicColorSchema>({
selector: 'html',
attribute: 'class',
modes: { light: '', dark: 'app-dark', auto: '' },
disableTransition: false,
initialValue: 'auto',
});
const { state, next: cycleTheme } = useCycleList(['light', 'dark', 'auto'] as const, {
initialValue: themeMode,
});
watchEffect(() => (themeMode.value = state.value));
export type AppThemeMode = typeof themeMode.value;
// <<<<<
export const useAppStore = defineStore('app', () => {
// 侧边栏展开/收起状态
const sidebarCollapsed = useLocalStorage<boolean>('app-sidebar-collapsed', false);
const toggleSidebar = useToggle(sidebarCollapsed);
// 主题模式
const actualTheme = computed(() => (themeMode.value === 'auto' ? system.value : themeMode.value));
const isDark = computed(() => actualTheme.value === 'dark');
// 是否是移动端
const isMobile = useMediaQuery('(max-width: 768px)');
return {
themeMode,
isDark,
isMobile,
cycleTheme,
sidebarCollapsed,
toggleSidebar,
};
});
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useAppStore, import.meta.hot));
}

View File

@@ -1,64 +0,0 @@
import { useLocalStorage, useMediaQuery, usePreferredColorScheme } from '@vueuse/core';
import { defineStore } from 'pinia';
import { computed, watch } from 'vue';
export const APP_THEME_MODES = ['light', 'dark', 'system'] as const;
export type AppThemeMode = (typeof APP_THEME_MODES)[number];
const DARK_CLASS = 'app-dark';
export const useAppStore = defineStore('app', () => {
const themeMode = useLocalStorage<AppThemeMode>('app-theme-mode', 'system');
const preferredColor = usePreferredColorScheme();
// 侧边栏展开/收起状态
const sidebarCollapsed = useLocalStorage<boolean>('app-sidebar-collapsed', false);
// 计算实际使用的主题
const actualTheme = computed(() =>
themeMode.value === 'system'
? preferredColor.value === 'dark'
? 'dark'
: 'light'
: themeMode.value,
);
// 是否是暗色主题
const isDark = computed(() => actualTheme.value === 'dark');
// 是否是移动端
const isMobile = useMediaQuery('(max-width: 768px)');
// 更新 DOM 类名
function updateDomClass() {
document.documentElement.classList.toggle(DARK_CLASS, isDark.value);
}
// 循环切换主题
function cycleTheme() {
const currentIndex = APP_THEME_MODES.indexOf(themeMode.value);
const nextIndex = (currentIndex + 1) % APP_THEME_MODES.length;
themeMode.value = APP_THEME_MODES[nextIndex]!;
}
// 切换侧边栏展开/收起
function toggleSidebar() {
sidebarCollapsed.value = !sidebarCollapsed.value;
}
// 监听主题变化,更新 DOM
watch(isDark, updateDomClass, { immediate: true });
return {
themeMode,
isDark,
isMobile,
cycleTheme,
sidebarCollapsed,
toggleSidebar,
};
});
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useAppStore, import.meta.hot));
}

View File

@@ -0,0 +1,45 @@
export const useAuthStore = defineStore('auth', () => {
const token = useLocalStorage<string | null>('auth-token', null);
const userInfo = ref<Record<string, any> | null>(null);
const isLoggedIn = computed(() => !!token.value);
function clearToken(reason?: string) {
consola.info('🚮 [auth-store] clear: ', reason);
token.value = null;
userInfo.value = null;
}
async function login(username: string, password: string) {
// 模拟登录延迟
await new Promise((resolve) => setTimeout(resolve, 500));
// 模拟验证
if (username === 'admin' && password === 'admin') {
token.value = `mock-token-${Date.now()}`;
await fetchUserInfo();
return { success: true };
}
return { success: false, message: '用户名或密码错误' };
}
async function fetchUserInfo() {
if (!token.value) {
return;
}
// 模拟获取用户信息延迟
await new Promise((resolve) => setTimeout(resolve, 300));
// 模拟从服务器获取用户信息
userInfo.value = {
id: 1,
username: 'admin',
nickname: '管理员',
roles: ['admin'],
};
}
return { token, isLoggedIn, userInfo, clearToken, login, fetchUserInfo };
});

View File

@@ -0,0 +1,8 @@
.p-confirmdialog,
.p-toast {
max-width: calc(100% - 50px);
}
.p-toast .p-toast-message-text {
margin-top: -0.2rem;
}

View File

@@ -0,0 +1,9 @@
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.25s ease-in-out;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}

View File

@@ -1,4 +1,8 @@
import 'nprogress/nprogress.css'; // <link rel="stylesheet" href="https://testingcf.jsdelivr.net/npm/nprogress/nprogress.css" />
//
import 'primeicons/primeicons.css';
import './css/reset-primevue.css';
import './css/transition.css';
import 'virtual:uno.css';

View File

@@ -41,5 +41,6 @@ export default defineConfig({
// SCSS 专用的 at-rule 规则会自动处理 @include, @mixin 等
// 'scss/at-rule-no-unknown': true,
// <<<<<
'selector-class-pattern': null,
},
});

View File

@@ -14,7 +14,15 @@
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"~/*": ["./src/*"]
}
},
"vueCompilerOptions": {
"plugins": [
"vue-macros/volar",
"unplugin-vue-router/volar/sfc-route-blocks",
"unplugin-vue-router/volar/sfc-typed-router"
]
}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node22/tsconfig.json",
"extends": "@tsconfig/node24/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",

54
typed-router.d.ts vendored
View File

@@ -2,7 +2,7 @@
/* prettier-ignore */
// @ts-nocheck
// noinspection ES6UnusedImports
// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️
// Generated by unplugin-vue-router. !! DO NOT MODIFY THIS FILE !!
// It's recommended to commit this file.
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry.
@@ -58,6 +58,13 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'DemosCreate': RouteRecordInfo<
'DemosCreate',
'/demos/create',
Record<never, never>,
Record<never, never>,
| never
>,
'DemosI18nDemo': RouteRecordInfo<
'DemosI18nDemo',
'/demos/i18n-demo',
@@ -65,6 +72,20 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'DemosNaiveUiDemo': RouteRecordInfo<
'DemosNaiveUiDemo',
'/demos/naive-ui-demo',
Record<never, never>,
Record<never, never>,
| never
>,
'DemosPrimevueDemo': RouteRecordInfo<
'DemosPrimevueDemo',
'/demos/primevue-demo',
Record<never, never>,
Record<never, never>,
| never
>,
'DemosWebsocketDemo': RouteRecordInfo<
'DemosWebsocketDemo',
'/demos/websocket-demo',
@@ -79,6 +100,13 @@ declare module 'vue-router/auto-routes' {
Record<never, never>,
| never
>,
'Login': RouteRecordInfo<
'Login',
'/Login',
Record<never, never>,
Record<never, never>,
| never
>,
}
/**
@@ -122,12 +150,30 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/pages/demos/create.page.vue': {
routes:
| 'DemosCreate'
views:
| never
}
'src/pages/demos/i18n-demo.page.vue': {
routes:
| 'DemosI18nDemo'
views:
| never
}
'src/pages/demos/naive-ui-demo/index.page.vue': {
routes:
| 'DemosNaiveUiDemo'
views:
| never
}
'src/pages/demos/primevue-demo.page.vue': {
routes:
| 'DemosPrimevueDemo'
views:
| never
}
'src/pages/demos/websocket-demo.page.vue': {
routes:
| 'DemosWebsocketDemo'
@@ -140,6 +186,12 @@ declare module 'vue-router/auto-routes' {
views:
| never
}
'src/pages/Login.page.vue': {
routes:
| 'Login'
views:
| never
}
}
/**

View File

@@ -1,26 +1,33 @@
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import { getPascalCaseRouteName } from 'unplugin-vue-router';
import vueRouter from 'unplugin-vue-router/vite';
import type { PluginOption } from 'vite';
import VueMacros from 'vue-macros/vite';
export default [
VueMacros({
plugins: {
vue: vue({ include: [/\.vue$/, /\.md$/] }),
vueJsx: vueJsx(),
import type { LoadPluginFunction } from './_loadPlugins';
// https://uvr.esm.is/guide/configuration.html
// https://github.com/posva/unplugin-vue-router
// ⚠️ Vue must be placed after VueRouter()
vueRouter: vueRouter({
exclude: ['**/__*', '**/__*/**/*'],
extensions: ['.page.vue', '.page.md'],
getRouteName: (routeNode) => getPascalCaseRouteName(routeNode),
logs: false,
routesFolder: 'src/pages',
}),
},
}),
] satisfies PluginOption;
export const loadPlugin: LoadPluginFunction = async (_pluginLoadOptions) => {
return [
VueMacros({
plugins: {
vue: vue({ include: [/\.vue$/, /\.md$/] }),
vueJsx: vueJsx(),
// https://uvr.esm.is/guide/configuration.html
// https://github.com/posva/unplugin-vue-router
// ⚠️ Vue must be placed after VueRouter()
vueRouter: vueRouter({
routesFolder: 'src/pages',
extensions: ['.page.vue', '.page.md'],
exclude: ['**/__*', '**/__*/**/*'],
getRouteName: (await import('unplugin-vue-router')).getPascalCaseRouteName,
beforeWriteFiles(rootRoute) {
for (/* 深度优先遍历 */ const route of rootRoute.traverseDFS()) {
route.addToMeta({ _: route.fullPath });
}
},
logs: !true,
}),
},
}),
];
};

View File

@@ -1,8 +1,13 @@
import type { PluginOption } from 'vite';
import UnoCSS from 'unocss/vite';
export default [
// https://github.com/antfu/unocss
// see uno.config.ts for config
UnoCSS(),
] satisfies PluginOption;
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/antfu/unocss
// see uno.config.ts for config
UnoCSS({
checkImport: true,
}),
];
};

View File

@@ -1,18 +1,21 @@
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import type { PluginOption } from 'vite';
export default [
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: ['src/locales/**'],
import type { LoadPluginFunction } from './_loadPlugins';
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#transformi18nblock
// transformI18nBlock(src) {
// console.debug(`src :>> `, src);
// console.debug(`typeof src :>> `, typeof src);
// return src as string;
// },
}),
] satisfies PluginOption;
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: ['src/locales/**'],
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#transformi18nblock
// transformI18nBlock(src) {
// console.debug(`src :>> `, src);
// console.debug(`typeof src :>> `, typeof src);
// return src as string;
// },
}),
];
};

View File

@@ -1,9 +1,12 @@
import type { PluginOption } from 'vite';
import Markdown from 'unplugin-vue-markdown/vite';
export default [
// https://github.com/unplugin/unplugin-vue-markdown
Markdown({
headEnabled: true,
}),
] satisfies PluginOption;
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/unplugin/unplugin-vue-markdown
Markdown({
headEnabled: true,
}),
];
};

View File

@@ -1,17 +1,20 @@
import type { PluginOption } from 'vite';
import MetaLayouts from 'vite-plugin-vue-meta-layouts';
export default [
// https://github.com/dishait/vite-plugin-vue-meta-layouts
MetaLayouts({
target: 'src/layouts',
excludes: ['**/!(the-)*.vue'], // 排除非 the- 开头的文件。
metaName: 'layout',
// defaultLayout: 'sakai-vue/AppLayout',
// defaultLayout: 'naive-ui/AppLayout',
defaultLayout: 'base-layout/the-base-layout',
// !⬇️: 当设置为 `sync` 时,注意`import 'virtual:uno.css'`的顺序问题。
// importMode: 'sync', // 默认为自动处理SSG 时为 sync非 SSG 时为 async
skipTopLevelRouteLayout: true, // 打开修复 https://github.com/JohnCampionJr/vite-plugin-vue-layouts/issues/134默认为 false 关闭
}),
] satisfies PluginOption;
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/dishait/vite-plugin-vue-meta-layouts
MetaLayouts({
target: 'src/layouts',
excludes: ['**/!(the-)*.vue'], // 排除非 the- 开头的文件。
metaName: 'layout',
// defaultLayout: 'sakai-vue/AppLayout',
// defaultLayout: 'naive-ui/AppLayout',
defaultLayout: 'base-layout/the-base-layout',
// !⬇️: 当设置为 `sync` 时,注意`import 'virtual:uno.css'`的顺序问题。
// importMode: 'sync', // 默认为自动处理SSG 时为 sync非 SSG 时为 async
skipTopLevelRouteLayout: true, // 打开修复 https://github.com/JohnCampionJr/vite-plugin-vue-layouts/issues/134默认为 false 关闭
}),
];
};

View File

@@ -9,7 +9,6 @@ import Icons from 'unplugin-icons/vite';
import Components from 'unplugin-vue-components/vite';
import { VueRouterAutoImports } from 'unplugin-vue-router';
import { createUtils4uAutoImports } from 'utils4u/auto-imports';
import type { ConfigEnv, PluginOption } from 'vite';
// >>>>>
// eslint-disable-next-line import/no-duplicates
@@ -26,6 +25,8 @@ import { PrimeVueResolver } from '@primevue/auto-import-resolver';
import { VantResolver } from '@vant/auto-import-resolver';
// <<<<<
import type { LoadPluginFunction } from './_loadPlugins';
function _getNaiveUiComponentNames() {
// [dtsTsx](https://github.com/unplugin/unplugin-vue-components/pull/673/files/84e80738885cfe11298f41f070cda94a7a779276)
@@ -55,7 +56,7 @@ function _getNaiveUiComponentNames() {
return [];
}
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/antfu/unplugin-auto-import
AutoImport({
@@ -63,7 +64,7 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
dirs: [
// 'src/utils',
'src/composables',
'src/stores',
// 'src/stores',
// 匹配所有 -auto-imports.ts / -auto-imports.tsx 结尾的文件
'src/**/*-auto-imports.{ts,tsx}',
],
@@ -73,10 +74,10 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
'pinia',
'@vueuse/core',
VueRouterAutoImports,
createUtils4uAutoImports([]),
createUtils4uAutoImports(['primevue']),
{
'consola/browser': ['consola'],
'vue-router/auto': ['useLink'],
'unplugin-vue-router/data-loaders/basic': ['defineBasicLoader'],
'naive-ui': [
'useModal',
'useDialog',
@@ -141,4 +142,4 @@ export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
},
}),
];
}
};

View File

@@ -1,5 +1,7 @@
import type { PluginOption } from 'vite';
import { minify as minifyHtml } from 'html-minifier-terser';
import type { PluginOption } from 'vite';
import type { LoadPluginFunction } from './_loadPlugins';
function IndexHtmlPlugin(): PluginOption {
return {
@@ -25,4 +27,79 @@ function IndexHtmlPlugin(): PluginOption {
};
}
export default [IndexHtmlPlugin()] satisfies PluginOption[];
function ___(): PluginOption {
// https://github.com/hu3dao/vite-plugin-debug/blob/2935025e8ce082b9a5aef04766bcae3e996b3e55/src/index.ts
return {
name: 'vant-touch-emulator-online',
apply: 'build',
transformIndexHtml(html) {
return {
html,
tags: [
{
tag: 'script',
attrs: {
src: 'https://testingcf.jsdelivr.net/npm/@vant/touch-emulator/dist/index.min.js',
// 这里的 `.min.js` 是 jsDelivr 的特殊处理
// src: 'https://unpkg.luckincdn.com/@vant/touch-emulator@1.4.0/dist/index.js',
},
injectTo: 'body',
},
// >>>>> eruda
{
tag: 'script',
attrs: {
src: 'https://testingcf.jsdelivr.net/npm/eruda/eruda.js',
},
injectTo: 'body',
},
{
tag: 'script',
children: `eruda.init();`,
injectTo: 'body',
},
// https://eruda.liriliri.io/zh/docs/#快速上手
// import('eruda').then(({ default: eruda }) => {
// eruda.init({
// defaults: {
// transparency: 0.9,
// },
// })
// /* eruda.show(); */
// })
// }
// <<<<<
// >>>>> vConsole
{
tag: 'script',
attrs: {
src: 'https://cdn.jsdelivr.net/npm/vconsole@latest/dist/vconsole.min.js',
},
injectTo: 'body',
},
{
tag: 'script',
children: `new window.VConsole();`,
injectTo: 'body',
},
// <<<<<
],
};
},
};
}
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
const { mode, env } = pluginLoadOptions;
// return [___()];
if (mode !== 'production') {
return { plugins: [], message: '仅在生产模式下启用' };
}
if (env.VITE_BUILD_MINIFY !== 'true') {
return { plugins: [], message: `已通过环境变量禁用: VITE_BUILD_MINIFY=${env.VITE_BUILD_MINIFY}` };
}
return IndexHtmlPlugin();
};

View File

@@ -1,16 +1,16 @@
import { consola } from 'consola';
import type { ConfigEnv, PluginOption } from 'vite';
import { vitePluginFakeServer } from 'vite-plugin-fake-server';
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
if (_configEnv.mode !== 'development') {
consola.info('fake server plugin is disabled in non-development mode.');
return [];
import type { LoadPluginFunction } from './_loadPlugins';
// https://github.com/condorheroblog/vite-plugin-fake-server?tab=readme-ov-file#usage
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
const { mode } = pluginLoadOptions;
if (mode !== 'development') {
return { plugins: [], message: '仅在开发模式下启用' };
}
return vitePluginFakeServer({
basename: 'fake-api',
enableProd: true,
include: 'fake',
});
}
};

View File

@@ -1,9 +1,12 @@
import type { PluginOption } from 'vite';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
export default [
// https://github.com/FatehAK/vite-plugin-image-optimizer?tab=readme-ov-file#default-configuration
ViteImageOptimizer({
/* pass your config */
}),
] satisfies PluginOption;
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/FatehAK/vite-plugin-image-optimizer?tab=readme-ov-file#default-configuration
ViteImageOptimizer({
/* pass your config */
}),
];
};

View File

@@ -1,20 +1,27 @@
import consola from 'consola';
import type { ConfigEnv, PluginOption } from 'vite';
import { loadEnv } from 'vite';
import vueDevTools from 'vite-plugin-vue-devtools';
export function loadPlugin(configEnv: ConfigEnv): PluginOption {
const env = loadEnv(configEnv.mode, process.cwd());
import type { LoadPluginFunction } from './_loadPlugins';
if (configEnv.command === 'build') {
consola.info('vue-devtools plugin is not used in build mode.');
return [];
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
const { mode } = _pluginLoadOptions;
if (mode !== 'development') {
return { plugins: [], message: '仅在开发模式下启用' };
}
if (env.VITE_ENABLE_VUE_DEVTOOLS !== 'true') {
consola.info('vue-devtools plugin disabled by env');
return [];
let launchEditor = 'code';
let message: string | undefined;
if (process.env.TERM_PROGRAM_VERSION?.toLowerCase()?.includes('insider')) {
launchEditor = 'code-insiders';
message = '检测到 VSCode Insiders 环境';
}
return [vueDevTools()];
}
return {
plugins: [
vueDevTools({
launchEditor: launchEditor,
}),
],
message,
};
};

View File

@@ -1,16 +1,17 @@
import { cloudflare } from '@cloudflare/vite-plugin';
import { loadEnv } from 'vite';
import type {ConfigEnv, PluginOption} from 'vite';
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
const env = loadEnv(_configEnv.mode, process.cwd());
if (_configEnv.mode === 'test') {
console.log('cloudflare plugin disabled in test mode');
return [];
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (pluginLoadOptions) => {
const { mode, env } = pluginLoadOptions;
if (mode === 'test') {
return { plugins: [], message: '在测试模式下禁用' };
}
if (env.VITE_CLOUDFLARE_SERVER_ENABLED !== 'true') {
console.log('cloudflare plugin disabled by env');
return [];
return {
plugins: [],
message: `已通过环境变量禁用: VITE_CLOUDFLARE_SERVER_ENABLED=${env.VITE_CLOUDFLARE_SERVER_ENABLED}`,
};
}
return [cloudflare()];
}
};

View File

@@ -1,28 +1,47 @@
import boxen from 'boxen';
import consola from 'consola';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
import consola from 'consola';
import { glob } from 'tinyglobby';
import type { ConfigEnv, PluginOption } from 'vite';
import { loadEnv } from 'vite';
export type LoadPluginFunction = (
configEnv: ConfigEnv & {
env: Record<string, string>;
},
) => PluginOption | LoadPluginResult;
export interface LoadPluginResult {
plugins: PluginOption;
message?: string;
}
type LoadPluginFunction = (configEnv: ConfigEnv) => PluginOption;
export async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]> {
const plugins: PluginOption[] = [];
consola.start('开始加载 Vite 插件...');
const cwd = path.resolve(import.meta.dirname);
const pluginEntries = await glob('**/*.ts', {
absolute: true,
cwd: path.resolve(import.meta.dirname),
cwd,
ignore: [
'**/*.d.ts',
'**/*.disabled.ts',
'**/x-*.ts', // 禁用以 x- 开头的插件文件
'**/*-x.ts', // 禁用以 -x 结尾的插件文件
'**/*-X.ts', // 禁用以 -X 结尾的插件文件
'**/_*',
],
});
consola.info(`找到 ${pluginEntries.length} 个插件文件`);
const relativeCwd = path.relative(process.cwd(), cwd);
console.time('加载插件');
consola.log(
boxen(`正在加载 Vite 插件... (./${relativeCwd})`, {
borderStyle: 'classic',
borderColor: 'cyan',
}),
);
// 计算最长的文件名长度,用于对齐输出
const maxNameLength = Math.max(...pluginEntries.map((entry) => path.basename(entry).length));
@@ -33,36 +52,39 @@ export async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]>
const imported = await import(pathToFileURL(entry).href);
const loadPlugin = imported.loadPlugin as LoadPluginFunction | undefined;
let plugin: PluginOption | undefined;
let loadMethod = '';
// 优先使用 loadPlugin 函数(接收 configEnv 参数)
if (loadPlugin && typeof loadPlugin === 'function') {
plugin = loadPlugin(configEnv);
loadMethod = 'loadPlugin';
} else if (imported.default) {
plugin = imported.default;
loadMethod = 'default';
} else {
consola.warn(`插件未导出有效内容: ${paddedName}`);
continue; // 跳过无效插件
if (!loadPlugin || typeof loadPlugin !== 'function') {
consola.warn(`插件未导出 loadPlugin 函数: ${paddedName}`);
continue;
}
if (plugin) {
const pluginArray = Array.isArray(plugin) ? plugin : [plugin];
const validPlugins = pluginArray.filter(Boolean); // 过滤掉 null/undefined
const pluginCount = validPlugins.length;
const env = loadEnv(configEnv.mode, process.cwd());
const result = loadPlugin({ ...configEnv, env });
if (pluginCount > 0) {
plugins.push(...validPlugins);
consola.success(`${paddedName}${pluginCount} 个实例 (${loadMethod})`);
} else {
consola.info(`${paddedName} 返回了空数组或无效值`);
}
// 判断是否是 LoadPluginResult 对象
const isResultObject = (val: unknown): val is LoadPluginResult =>
typeof val === 'object' && val !== null && 'plugins' in val;
const plugin = isResultObject(result) ? result.plugins : result;
const message = isResultObject(result) ? result.message : undefined;
const pluginArray = Array.isArray(plugin) ? plugin : [plugin];
const validPlugins = pluginArray.filter(Boolean);
const pluginCount = validPlugins.length;
if (pluginCount > 0) {
plugins.push(...validPlugins);
const suffix = message ? ` (${message})` : '';
consola.info(`${paddedName}${pluginCount} 个实例${suffix}`);
} else if (message) {
consola.info(`${paddedName}${message}`);
} else {
consola.info(`${paddedName} 返回了空数组或无效值`);
}
}
consola.success(`✅ 总共加载了 ${plugins.length} 个插件实例`);
consola.success(` ${pluginEntries.length} 个插件文件,已加载 ${plugins.length}实例`);
console.timeEnd('加载插件');
return plugins;
}

View File

@@ -1,9 +1,16 @@
import type { ConfigEnv, PluginOption } from 'vite';
import type { LoadPluginFunction } from './_loadPlugins';
export default [
// ...
] satisfies PluginOption;
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
const env = _pluginLoadOptions.env;
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
// 示例:根据环境变量禁用插件并返回消息
if (env.VITE_DEMO_ENABLED !== 'true') {
return {
plugins: [],
message: `已通过环境变量禁用: VITE_DEMO_ENABLED=${env.VITE_DEMO_ENABLED}`,
};
}
// 正常返回插件
return [];
}
};

View File

@@ -1,17 +0,0 @@
import type { PluginOption } from 'vite';
export default [
// // 检查是否在VS Code终端中运行
// if (process.env.TERM_PROGRAM === 'vscode' || process.env.VSCODE_PID) {
// // plugins.push(
// // // 构建后自动将dist目录打包成zip文件
// // viteArchiverPlugin({
// // addTimestamp: false, // 是否添加时间戳到输出文件名
// // format: 'zip', // 输出的压缩文件格式
// // outputDir: '', // 输出目录,默认为项目根目录
// // outputFileName: 'dist', // 输出的zip文件名不含扩展名
// // sourceDir: 'dist', // 要打包的源目录
// // }),
// // )
// }
] satisfies PluginOption;

View File

@@ -1,6 +1,6 @@
import type { ManualChunkMeta, PreRenderedAsset, RollupOptions } from 'rollup';
import type { /* ManualChunkMeta, PreRenderedAsset, */ RollupOptions } from 'rollup';
import path from 'node:path';
// import path from 'node:path';
// https://www.npmjs.com/package/utils4u/v/2.19.2?activeTab=code
@@ -12,101 +12,95 @@ export const viteConfigRollupOptions: RollupOptions = {
if (warning.code === 'EVAL' && warning.id?.includes('node_modules/protobufjs')) return;
warn(warning);
}, */
output: {
// Keep hashed file names predictable across entry, chunk, and asset outputs.
entryFileNames: 'entry/[name].[hash].js', // 默认: "[name].js"
chunkFileNames: 'chunk/[name].[hash].js', // 默认: "[name]-[hash].js"
// assetFileNames:'', // 默认: "assets/[name]-[hash][extname]"
// https://cn.rollupjs.org/configuration-options/#output-assetfilenames
assetFileNames(chunkInfo: PreRenderedAsset) {
const names = chunkInfo.names;
if (names.length !== 1) {
console.error('Multiple names for asset:', chunkInfo);
process.exit(1);
}
const assetName = names[0];
const ext = assetName.split('.').pop()?.toLowerCase();
if (ext && /png|jpe?g|gif|svg|webp|avif/.test(ext)) {
return 'chunks/images/[name].[hash][extname]';
}
if (ext && /woff2?|ttf|otf/.test(ext)) {
return 'chunks/fonts/[name].[hash][extname]';
}
if (ext === 'css') {
return 'chunks/css/[name].[hash][extname]';
}
return '_chunks/[name].[hash][extname]';
},
manualChunks: (id: string, _meta: ManualChunkMeta) => {
if (['/src/layouts'].some((prefix) => id.includes(prefix))) {
const url = new URL(id, 'file://');
if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
return 'layouts';
}
}
if (id.includes('meta-layouts')) {
// console.debug(`id :>> `, id); // id :>> virtual:meta-layouts
// 这里很奇怪,打印 id 是`virtual:meta-layouts`,但是 `'virtual:meta-layouts' === id` 却是 false
return 'lib-meta-layouts';
}
if (id.includes('index.page.vue')) {
const url = new URL(id, 'file://');
if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
const parentDir = path.basename(path.dirname(id));
return `${parentDir}-index.page`;
}
}
if (!id.includes('node_modules')) return;
// 处理 pnpm 的特殊路径结构
let packageName;
if (id.includes('.pnpm')) {
// pnpm 路径: .pnpm/naive-ui@2.43.1_vue@3.5.22/node_modules/naive-ui/...
const pnpmMatch = id.match(/\.pnpm\/(.+?)@/);
if (pnpmMatch) {
packageName = pnpmMatch[1];
}
} else {
// 普通路径: node_modules/lodash/...
const normalMatch = id.match(/node_modules\/(@[^/]+\/[^/]+|[^/]+)\//);
if (normalMatch) {
packageName = normalMatch[1];
}
}
if (packageName) {
if (['highlight.js'].includes(packageName)) {
return 'lib-hljs';
}
// 根据包名分组
if (['consola', 'lodash', '@juggle+resize-observer', 'vueuc'].includes(packageName)) {
return 'lib-vendor';
}
// // 拆了有问题
// if (['naive-ui'].includes(packageName) && id.includes('_internal')) {
// return 'lib-naive-ui-internal';
// }
if (['naive-ui'].includes(packageName)) {
return 'lib-naive-ui';
}
if (['primelocale', 'primevue', '@primeuix'].some((name) => packageName!.includes(name))) {
return 'lib-primevue';
}
if (['vue', 'vue-router', 'pinia', 'vue-demi', 'vue-i18n'].includes(packageName)) {
return 'lib-vue-vendor';
}
}
},
// 如果一个 chunk 小于 10KBRollup 会尝试将它合并到其他 chunk 中。这样可以避免产生大量碎片文件
experimentalMinChunkSize: 10 * 1024,
// // Keep hashed file names predictable across entry, chunk, and asset outputs.
// entryFileNames: 'entry/[name].[hash].js', // 默认: "[name].js"
// chunkFileNames: 'chunk/[name].[hash].js', // 默认: "[name]-[hash].js"
// // assetFileNames:'', // 默认: "assets/[name]-[hash][extname]"
// // https://cn.rollupjs.org/configuration-options/#output-assetfilenames
// assetFileNames(chunkInfo: PreRenderedAsset) {
// const names = [...new Set(chunkInfo.names)];
// if (names.length !== 1) {
// console.error('Multiple names for asset:', chunkInfo);
// process.exit(1);
// }
// const assetName = names[0];
// const ext = assetName.split('.').pop()?.toLowerCase();
// if (ext && /png|jpe?g|gif|svg|webp|avif/.test(ext)) {
// return 'chunks/images/[name].[hash][extname]';
// }
// if (ext && /woff2?|ttf|otf/.test(ext)) {
// return 'chunks/fonts/[name].[hash][extname]';
// }
// if (ext === 'css') {
// return 'chunks/css/[name].[hash][extname]';
// }
// return '_chunks/[name].[hash][extname]';
// },
// manualChunks: (id: string, _meta: ManualChunkMeta) => {
// // https://github.com/unocss/unocss/issues/4917
// // if (['/src/layouts'].some((prefix) => id.includes(prefix))) {
// // const url = new URL(id, 'file://');
// // if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
// // return 'layouts';
// // }
// // }
// if (id.includes('meta-layouts')) {
// // console.debug(`id :>> `, id); // id :>> virtual:meta-layouts
// // 这里很奇怪,打印 id 是`virtual:meta-layouts`,但是 `'virtual:meta-layouts' === id` 却是 false
// return 'lib-meta-layouts';
// }
// if (id.includes('index.page.vue')) {
// const url = new URL(id, 'file://');
// if (!url.search /* ?vue&type=script&setup=true&lang.ts */) {
// const parentDir = path.basename(path.dirname(id));
// return `${parentDir}-index.page`;
// }
// }
// if (!id.includes('node_modules')) return;
// // 处理 pnpm 的特殊路径结构
// let packageName;
// if (id.includes('.pnpm')) {
// // pnpm 路径: .pnpm/naive-ui@2.43.1_vue@3.5.22/node_modules/naive-ui/...
// const pnpmMatch = id.match(/\.pnpm\/(.+?)@/);
// if (pnpmMatch) {
// packageName = pnpmMatch[1];
// }
// } else {
// // 普通路径: node_modules/lodash/...
// const normalMatch = id.match(/node_modules\/(@[^/]+\/[^/]+|[^/]+)\//);
// if (normalMatch) {
// packageName = normalMatch[1];
// }
// }
// if (packageName) {
// if (['highlight.js'].includes(packageName)) {
// return 'lib-hljs';
// }
// // 根据包名分组
// if (['consola', 'lodash', '@juggle+resize-observer', 'vueuc'].includes(packageName)) {
// return 'lib-vendor';
// }
// // // 拆了有问题
// // if (['naive-ui'].includes(packageName) && id.includes('_internal')) {
// // return 'lib-naive-ui-internal';
// // }
// if (['naive-ui'].includes(packageName)) {
// return 'lib-naive-ui';
// }
// if (
// ['primelocale', 'primevue', 'primeuix', 'primeicons'].some((name) =>
// packageName!.includes(name),
// )
// ) {
// return 'lib-primevue';
// }
// if (['vue', 'vue-router', 'pinia', 'vue-demi', 'vue-i18n'].includes(packageName)) {
// return 'lib-vue-vendor';
// }
// }
// },
},
};

View File

@@ -13,12 +13,17 @@ export default defineConfig(async (configEnv) => {
const isBuild = command === 'build';
const env = loadEnv(mode, process.cwd());
if (process.env.CI) {
for (const [key, value] of Object.entries(env)) {
consola.info(`[vite.config.ts] env: ${key}: ${value}`);
}
}
return {
base: env.VITE_APP_BASE,
build: {
minify: env.VITE_APP_BUILD_MINIFY === 'true' ? undefined /* 即默认 */ : false, // 默认: 'terser'
sourcemap: env.VITE_APP_BUILD_SOURCE_MAP === 'true',
minify: env.VITE_BUILD_MINIFY === 'true' ? undefined /* 即默认 */ : false, // 默认: 'terser'
sourcemap: env.VITE_BUILD_SOURCE_MAP === 'true',
rollupOptions: viteConfigRollupOptions,
},
css: {
@@ -35,6 +40,7 @@ export default defineConfig(async (configEnv) => {
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~': fileURLToPath(new URL('./src', import.meta.url)),
},
},
define: {

File diff suppressed because it is too large Load Diff