mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2026-09-04 14:52:56 +08:00
架构与目录: - 引入分层 API:transport/interceptors 收敛到 src/api/client.ts, 域名端点拆到 src/api/modules,页面不再直接依赖 Axios - 服务层(src/services)承载 AI 流式解析与框架无关的 provider - TanStack Query 接管服务端状态,Pinia 仅保留会话/主题等客户端状态 - 路由表显式懒加载,组件/组合式函数按职责拆分 功能: - AI 流式对话:fetchStreamProvider + useStreamingChat + 安全 Markdown 渲染 - 商店模块:商品列表/详情/购物车/后台管理,多语言(中/英/日) - 示例页:请求错误矩阵、query 缓存、移动端适配、图标演示 - 离线页、PWA、图片优化、eruda 调试等能力 工程化: - ESLint/Prettier 迁移到 oxlint/oxfmt,stylelint 保留 - 新增 oxlint.config.ts(移植自 monorepo 的 @vh5/oxlint-config 全套规则) - 新增 oxfmt.config.ts(移植自 @vh5/oxfmt-config,printWidth 80) - lint-staged、format、lint 脚本同步切换 - pnpm 作为唯一包管理器,删除 package-lock.json 与 yarn.lock - 引入 Vitest/Playwright/release-please,补充单元与组件测试 - OpenAPI schema 与生成类型入库 - 环境变量按 mode 拆分,重构 wrapperEnv 解析 清理: - 删除 .commitlintrc.js(CJS 配置在 type:module 下会崩溃),改用 commitlint.config.mjs - 删除 eslint.config.mjs、prettier.config.js、.prettierignore - 停止跟踪 .eslintrc-auto-import.json(已切 oxlint,无人引用) - 移除 iconfont、旧 demo/list 页与 useAxiosApi/useFetchApi 等遗留实现 - husky 钩子移除 DEPRECATED 的 shebang 写法 - .workbuddy/ 加入 .gitignore
161 lines
4.6 KiB
JSON
161 lines
4.6 KiB
JSON
{
|
|
"name": "vue-h5-template",
|
|
"version": "2.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"packageManager": "pnpm@9.15.9",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"dev:integration": "vite --mode integration",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"test": "vitest run",
|
|
"test:unit": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"test:e2e": "playwright test",
|
|
"lint": "pnpm lint:code && pnpm lint:styles",
|
|
"lint:code": "oxlint",
|
|
"lint:styles": "stylelint --cache \"src/**/*.{vue,scss,css}\" --cache-location node_modules/.cache/stylelint/",
|
|
"lint:fix": "oxlint --fix && pnpm lint:styles --fix",
|
|
"typecheck": "vue-tsc --build",
|
|
"check": "pnpm lint && pnpm typecheck && pnpm test && pnpm build",
|
|
"api:generate": "openapi-typescript openapi/schema.yaml -o src/types/api/generated.d.ts && oxfmt --write src/types/api/generated.d.ts",
|
|
"clean": "rm -rf dist",
|
|
"format": "oxfmt --write .",
|
|
"format:check": "oxfmt --check .",
|
|
"lint:lint-staged": "lint-staged",
|
|
"prepare": "husky",
|
|
"deps": "pnpm up -i",
|
|
"commit": "git add . && git-cz"
|
|
},
|
|
"dependencies": {
|
|
"@nutui/nutui": "^4.3.13",
|
|
"@tanstack/vue-query": "^5.102.8",
|
|
"@varlet/ui": "^3.20.6",
|
|
"axios": "1.20.0",
|
|
"dompurify": "^3.4.14",
|
|
"markdown-it": "^15.0.0",
|
|
"pinia": "^3.0.4",
|
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
"vant": "^4.10.0",
|
|
"vue": "^3.5.42",
|
|
"vue-i18n": "^11.4.10",
|
|
"vue-router": "^4.6.4"
|
|
},
|
|
"devDependencies": {
|
|
"@commitlint/cli": "^20.5.2",
|
|
"@commitlint/config-conventional": "^20.5.0",
|
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
"@nutui/auto-import-resolver": "^1.0.0",
|
|
"@playwright/test": "^1.62.1",
|
|
"@stylistic/stylelint-plugin": "^4.0.1",
|
|
"@tsconfig/node22": "^22.0.5",
|
|
"@types/jsdom": "^21.1.7",
|
|
"@types/markdown-it": "^14.2.0",
|
|
"@types/node": "^24.12.2",
|
|
"@vant/auto-import-resolver": "^1.3.0",
|
|
"@varlet/import-resolver": "^3.20.6",
|
|
"@vitejs/plugin-basic-ssl": "^2.3.0",
|
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
"@vitest/coverage-v8": "^4.1.11",
|
|
"@vue/test-utils": "^2.5.0",
|
|
"@vue/tsconfig": "^0.8.1",
|
|
"@zhaojjiang/vite-plugin-eruda": "^0.0.5",
|
|
"autoprefixer": "^10.5.4",
|
|
"cz-git": "^1.13.0",
|
|
"czg": "^1.13.0",
|
|
"eruda": "^3.4.1",
|
|
"esbuild": "^0.28.0",
|
|
"eslint-plugin-command": "^3.5.3",
|
|
"git-cz": "^4.9.0",
|
|
"husky": "9.1.7",
|
|
"jsdom": "^27.4.0",
|
|
"lint-staged": "16.2.7",
|
|
"openapi-typescript": "^7.13.0",
|
|
"oxfmt": "^0.61.0",
|
|
"oxlint": "^1.76.0",
|
|
"postcss": "8.5.26",
|
|
"postcss-html": "1.8.1",
|
|
"postcss-scss": "^4.0.9",
|
|
"rollup-plugin-visualizer": "^6.0.11",
|
|
"sharp": "^0.35.4",
|
|
"stylelint": "^16.26.1",
|
|
"stylelint-config-recess-order": "^7.7.0",
|
|
"stylelint-config-recommended": "^17.0.0",
|
|
"stylelint-config-recommended-scss": "^16.0.0",
|
|
"stylelint-config-recommended-vue": "^1.5.0",
|
|
"stylelint-config-standard": "^39.0.1",
|
|
"stylelint-order": "^7.0.1",
|
|
"stylelint-scss": "^6.14.0",
|
|
"svgo": "^4.1.0",
|
|
"typescript": "5.9.3",
|
|
"unplugin-auto-import": "^21.1.0",
|
|
"unplugin-vue-components": "^32.1.0",
|
|
"vite": "^8.2.2",
|
|
"vite-plugin-compression": "^0.5.1",
|
|
"vite-plugin-image-optimizer": "^2.0.3",
|
|
"vite-plugin-mock": "^3.0.2",
|
|
"vite-plugin-progress": "^0.0.7",
|
|
"vite-plugin-pwa": "^1.2.0",
|
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
"vitest": "^4.1.11",
|
|
"vue-tsc": "^3.3.11"
|
|
},
|
|
"engines": {
|
|
"node": ">=22.12.0",
|
|
"pnpm": ">=9.12.0"
|
|
},
|
|
"browserslist": [
|
|
"iOS >= 15",
|
|
"Android >= 8",
|
|
"Chrome >= 80"
|
|
],
|
|
"pnpm": {
|
|
"overrides": {
|
|
"axios": "1.20.0",
|
|
"brace-expansion@>=2 <3": "2.1.4",
|
|
"brace-expansion@>=5 <6": "5.0.9",
|
|
"defu": "6.1.5",
|
|
"esbuild": "0.28.2",
|
|
"js-cookie": "3.0.7",
|
|
"js-yaml": "4.3.1",
|
|
"lodash": "4.18.0",
|
|
"picomatch@<3": "2.3.2",
|
|
"picomatch@>=4 <5": "4.0.4",
|
|
"postcss": "8.5.26",
|
|
"qs": "6.15.2",
|
|
"uuid": "13.0.1"
|
|
}
|
|
},
|
|
"lint-staged": {
|
|
"*.{js,jsx,ts,tsx,mts,cts}": [
|
|
"oxlint --fix",
|
|
"oxfmt --write"
|
|
],
|
|
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
|
|
"oxfmt --write"
|
|
],
|
|
"package.json": [
|
|
"oxfmt --write"
|
|
],
|
|
"*.vue": [
|
|
"oxlint --fix",
|
|
"oxfmt --write",
|
|
"stylelint --fix"
|
|
],
|
|
"*.{scss,less,styl,html}": [
|
|
"stylelint --fix",
|
|
"oxfmt --write"
|
|
],
|
|
"*.md": [
|
|
"oxfmt --write"
|
|
]
|
|
},
|
|
"config": {
|
|
"commitizen": {
|
|
"path": "node_modules/cz-git"
|
|
}
|
|
}
|
|
}
|