create-bubbles 0.1.13 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/dist/index.js +7 -8
  2. package/package.json +3 -3
  3. package/template-nextjs-vinext-eslint/.dockerignore +0 -3
  4. package/template-nextjs-vinext-eslint/.vscode/settings.json +0 -53
  5. package/template-nextjs-vinext-eslint/Dockerfile +0 -21
  6. package/template-nextjs-vinext-eslint/README.md +0 -100
  7. package/template-nextjs-vinext-eslint/commitlint.config.js +0 -1
  8. package/template-nextjs-vinext-eslint/docker-compose.yaml +0 -22
  9. package/template-nextjs-vinext-eslint/eslint.config.js +0 -20
  10. package/template-nextjs-vinext-eslint/lefthook.yml +0 -11
  11. package/template-nextjs-vinext-eslint/next.config.ts +0 -8
  12. package/template-nextjs-vinext-eslint/nginx.conf +0 -14
  13. package/template-nextjs-vinext-eslint/package.json +0 -50
  14. package/template-nextjs-vinext-eslint/pnpm-workspace.yaml +0 -7
  15. package/template-nextjs-vinext-eslint/public/file.svg +0 -1
  16. package/template-nextjs-vinext-eslint/public/globe.svg +0 -1
  17. package/template-nextjs-vinext-eslint/public/logo-white.svg +0 -128
  18. package/template-nextjs-vinext-eslint/public/next.svg +0 -1
  19. package/template-nextjs-vinext-eslint/public/vercel.svg +0 -1
  20. package/template-nextjs-vinext-eslint/public/window.svg +0 -1
  21. package/template-nextjs-vinext-eslint/src/app/_components/Header/header.module.css +0 -0
  22. package/template-nextjs-vinext-eslint/src/app/_components/Header/header.tsx +0 -7
  23. package/template-nextjs-vinext-eslint/src/app/_components/Main/index.tsx +0 -13
  24. package/template-nextjs-vinext-eslint/src/app/antd-provider.tsx +0 -30
  25. package/template-nextjs-vinext-eslint/src/app/icon.svg +0 -26
  26. package/template-nextjs-vinext-eslint/src/app/layout.tsx +0 -68
  27. package/template-nextjs-vinext-eslint/src/app/page.module.css +0 -141
  28. package/template-nextjs-vinext-eslint/src/app/page.tsx +0 -43
  29. package/template-nextjs-vinext-eslint/src/app/uno-css.tsx +0 -7
  30. package/template-nextjs-vinext-eslint/src/assets/icon/logo-white.svg +0 -128
  31. package/template-nextjs-vinext-eslint/src/assets/icon/logo.svg +0 -26
  32. package/template-nextjs-vinext-eslint/src/assets/image/QR.png +0 -0
  33. package/template-nextjs-vinext-eslint/src/assets/image/banner_1.png +0 -0
  34. package/template-nextjs-vinext-eslint/src/assets/image/banner_2.png +0 -0
  35. package/template-nextjs-vinext-eslint/src/assets/image/banner_3.png +0 -0
  36. package/template-nextjs-vinext-eslint/src/assets/image/banner_4.png +0 -0
  37. package/template-nextjs-vinext-eslint/src/assets/image/banner_top.png +0 -0
  38. package/template-nextjs-vinext-eslint/src/assets/image/icon_title_left.png +0 -0
  39. package/template-nextjs-vinext-eslint/src/assets/image/icon_title_right.png +0 -0
  40. package/template-nextjs-vinext-eslint/src/assets/image/img.png +0 -0
  41. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_COCT.png +0 -0
  42. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/207/347/247/221.png +0 -0
  43. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/205/264.png +0 -0
  44. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/206/266/345/273/272/345/267/245.png +0 -0
  45. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/270/255/351/223/201.png +0 -0
  46. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/272/224/345/206/266.png +0 -0
  47. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/344/272/244/351/200/232/345/273/272/350/256/276.png +0 -0
  48. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/345/273/272/344/270/232.png +0 -0
  49. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/345/273/272/347/255/221/347/247/221/345/255/246/351/231/242.png +0 -0
  50. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/347/224/265/345/273/272.png +0 -0
  51. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/344/270/255/345/233/275/351/223/201/345/273/272.png +0 -0
  52. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/345/256/234/351/200/232/344/270/226/347/272/252.png +0 -0
  53. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/225/260/347/273/264/347/251/272/351/227/264.png +0 -0
  54. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/226/260/346/230/212/350/276/260/345/273/272/350/256/276.png +0 -0
  55. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/236/227/345/220/214/346/243/252/345/233/275/351/231/205.png +0 -0
  56. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/346/270/235/351/232/206/351/233/206/345/233/242.png +0 -0
  57. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/347/273/264/345/241/224/347/247/221/346/212/200.png +0 -0
  58. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/350/205/276/350/256/257.png +0 -0
  59. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/350/265/233/350/277/252/344/277/241/346/201/257.png +0 -0
  60. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/344/272/244/351/200/232/345/244/247/345/255/246.png +0 -0
  61. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/344/272/244/351/200/232/350/201/214/344/270/232/345/255/246/351/231/242.png +0 -0
  62. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/244/247/345/255/246.png +0 -0
  63. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/267/245/345/225/206/350/201/214/344/270/232/345/255/246/351/231/242.png +0 -0
  64. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/267/245/347/250/213/350/201/214/344/270/232/346/212/200/346/234/257/345/255/246/351/231/242.png +0 -0
  65. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/207/215/345/272/206/345/273/272/345/267/245.png +0 -0
  66. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/230/277/351/207/214/344/272/221.png +0 -0
  67. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/231/206/345/206/233/345/206/233/345/214/273/345/244/247/345/255/246.png +0 -0
  68. package/template-nextjs-vinext-eslint/src/assets/image/parteners/logo_/351/276/231/346/271/226.png +0 -0
  69. package/template-nextjs-vinext-eslint/src/styles/globals.css +0 -47
  70. package/template-nextjs-vinext-eslint/src/types/vite-env.d.ts +0 -18
  71. package/template-nextjs-vinext-eslint/src/utils/env.ts +0 -14
  72. package/template-nextjs-vinext-eslint/src/utils/index.ts +0 -0
  73. package/template-nextjs-vinext-eslint/src/utils/request/core/index.ts +0 -182
  74. package/template-nextjs-vinext-eslint/src/utils/request/core/utils.ts +0 -30
  75. package/template-nextjs-vinext-eslint/src/utils/request/index.ts +0 -48
  76. package/template-nextjs-vinext-eslint/tsconfig.json +0 -34
  77. package/template-nextjs-vinext-eslint/uno.config.ts +0 -8
  78. package/template-nextjs-vinext-eslint/vite.config.ts +0 -8
  79. package/template-react-rsbuild-biome/.env +0 -5
  80. package/template-react-rsbuild-biome/.env.development +0 -1
  81. package/template-react-rsbuild-biome/.env.production +0 -1
  82. package/template-react-rsbuild-biome/.prettierignore +0 -34
  83. package/template-react-rsbuild-biome/.prettierrc +0 -16
  84. package/template-react-rsbuild-biome/.vscode/settings.json +0 -10
  85. package/template-react-rsbuild-biome/README.md +0 -29
  86. package/template-react-rsbuild-biome/biome.json +0 -116
  87. package/template-react-rsbuild-biome/commitlint.config.js +0 -1
  88. package/template-react-rsbuild-biome/index.html +0 -7
  89. package/template-react-rsbuild-biome/lefthook.yml +0 -14
  90. package/template-react-rsbuild-biome/package.json +0 -42
  91. package/template-react-rsbuild-biome/public/.gitkeep +0 -0
  92. package/template-react-rsbuild-biome/rsbuild.config.ts +0 -44
  93. package/template-react-rsbuild-biome/src/App.tsx +0 -9
  94. package/template-react-rsbuild-biome/src/assets/font/AlimamaShuHeiTi-Bold.ttf +0 -0
  95. package/template-react-rsbuild-biome/src/assets/icon/logo.svg +0 -7
  96. package/template-react-rsbuild-biome/src/components/Loading/PageLoading.tsx +0 -11
  97. package/template-react-rsbuild-biome/src/env.d.ts +0 -1
  98. package/template-react-rsbuild-biome/src/index.tsx +0 -18
  99. package/template-react-rsbuild-biome/src/layout/default/index.tsx +0 -10
  100. package/template-react-rsbuild-biome/src/pages/home/index.tsx +0 -5
  101. package/template-react-rsbuild-biome/src/router/index.tsx +0 -38
  102. package/template-react-rsbuild-biome/src/store/index.ts +0 -0
  103. package/template-react-rsbuild-biome/src/store/modules/user.ts +0 -11
  104. package/template-react-rsbuild-biome/src/styles/fonts.scss +0 -4
  105. package/template-react-rsbuild-biome/src/styles/index.scss +0 -19
  106. package/template-react-rsbuild-biome/src/styles/variables.scss +0 -4
  107. package/template-react-rsbuild-biome/src/types/auto-import.d.ts +0 -49
  108. package/template-react-rsbuild-biome/src/utils/env.ts +0 -10
  109. package/template-react-rsbuild-biome/src/utils/request/core/index.ts +0 -166
  110. package/template-react-rsbuild-biome/src/utils/request/core/utils.ts +0 -38
  111. package/template-react-rsbuild-biome/src/utils/request/index.ts +0 -43
  112. package/template-react-rsbuild-biome/tsconfig.json +0 -35
  113. package/template-react-rsbuild-biome/uno.config.ts +0 -8
  114. package/template-taro-vue-eslint/.editorconfig +0 -12
  115. package/template-taro-vue-eslint/.env +0 -3
  116. package/template-taro-vue-eslint/.env.development +0 -5
  117. package/template-taro-vue-eslint/.env.production +0 -5
  118. package/template-taro-vue-eslint/.vscode/settings.json +0 -57
  119. package/template-taro-vue-eslint/babel.config.js +0 -12
  120. package/template-taro-vue-eslint/commitlint.config.mjs +0 -1
  121. package/template-taro-vue-eslint/config/dev.ts +0 -27
  122. package/template-taro-vue-eslint/config/index.ts +0 -129
  123. package/template-taro-vue-eslint/config/output-root.ts +0 -11
  124. package/template-taro-vue-eslint/config/prod.ts +0 -39
  125. package/template-taro-vue-eslint/config/release.ts +0 -113
  126. package/template-taro-vue-eslint/eslint.config.mjs +0 -22
  127. package/template-taro-vue-eslint/lefthook.yaml +0 -13
  128. package/template-taro-vue-eslint/package.json +0 -115
  129. package/template-taro-vue-eslint/patches/@tarojs__plugin-mini-ci.patch +0 -13
  130. package/template-taro-vue-eslint/pnpm-workspace.yaml +0 -2
  131. package/template-taro-vue-eslint/project.config.json +0 -16
  132. package/template-taro-vue-eslint/src/api/common/upload.ts +0 -53
  133. package/template-taro-vue-eslint/src/app.config.ts +0 -19
  134. package/template-taro-vue-eslint/src/app.ts +0 -14
  135. package/template-taro-vue-eslint/src/assets/image/.gitkeep +0 -0
  136. package/template-taro-vue-eslint/src/index.html +0 -17
  137. package/template-taro-vue-eslint/src/pages/example/upload/index.config.ts +0 -3
  138. package/template-taro-vue-eslint/src/pages/example/upload/index.module.scss +0 -4
  139. package/template-taro-vue-eslint/src/pages/example/upload/index.vue +0 -71
  140. package/template-taro-vue-eslint/src/pages/index/index.config.ts +0 -3
  141. package/template-taro-vue-eslint/src/pages/index/index.module.scss +0 -4
  142. package/template-taro-vue-eslint/src/pages/index/index.vue +0 -71
  143. package/template-taro-vue-eslint/src/store/index.ts +0 -10
  144. package/template-taro-vue-eslint/src/store/modules/user.ts +0 -15
  145. package/template-taro-vue-eslint/src/store/taroStorage.ts +0 -7
  146. package/template-taro-vue-eslint/src/styles/index.css +0 -1
  147. package/template-taro-vue-eslint/src/styles/nut-theme.css +0 -4
  148. package/template-taro-vue-eslint/src/utils/env.ts +0 -13
  149. package/template-taro-vue-eslint/src/utils/index.ts +0 -40
  150. package/template-taro-vue-eslint/src/utils/request/core/index.ts +0 -193
  151. package/template-taro-vue-eslint/src/utils/request/core/utils.ts +0 -30
  152. package/template-taro-vue-eslint/src/utils/request/index.ts +0 -73
  153. package/template-taro-vue-eslint/tsconfig.json +0 -30
  154. package/template-taro-vue-eslint/types/components.d.ts +0 -12
  155. package/template-taro-vue-eslint/types/global.d.ts +0 -31
  156. package/template-taro-vue-eslint/types/vue.d.ts +0 -10
  157. package/template-taro-vue-eslint/unocss.config.ts +0 -38
  158. package/template-vp-monorepo-react-nestjs/.oxfmtrc.jsonc +0 -8
  159. package/template-vp-monorepo-react-nestjs/.oxlintrc.jsonc +0 -3
  160. package/template-vp-monorepo-react-nestjs/.specs//351/234/200/346/261/202.md +0 -5
  161. package/template-vp-monorepo-react-nestjs/.vite-hooks/commit-msg +0 -1
  162. package/template-vp-monorepo-react-nestjs/.vite-hooks/pre-commit +0 -1
  163. package/template-vp-monorepo-react-nestjs/README.md +0 -29
  164. package/template-vp-monorepo-react-nestjs/apps/service/.oxlintrc.jsonc +0 -3
  165. package/template-vp-monorepo-react-nestjs/apps/web/.env +0 -1
  166. package/template-vp-monorepo-react-nestjs/apps/web/.oxlintrc.jsonc +0 -4
  167. package/template-vp-monorepo-react-nestjs/apps/web/index.html +0 -13
  168. package/template-vp-monorepo-react-nestjs/apps/web/package.json +0 -39
  169. package/template-vp-monorepo-react-nestjs/apps/web/public/favicon.svg +0 -1
  170. package/template-vp-monorepo-react-nestjs/apps/web/public/icons.svg +0 -24
  171. package/template-vp-monorepo-react-nestjs/apps/web/src/App.tsx +0 -24
  172. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/hero.png +0 -0
  173. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/react.svg +0 -1
  174. package/template-vp-monorepo-react-nestjs/apps/web/src/assets/vite.svg +0 -1
  175. package/template-vp-monorepo-react-nestjs/apps/web/src/components/Loading/PageLoading.tsx +0 -11
  176. package/template-vp-monorepo-react-nestjs/apps/web/src/main.tsx +0 -5
  177. package/template-vp-monorepo-react-nestjs/apps/web/src/pages/home/index.tsx +0 -17
  178. package/template-vp-monorepo-react-nestjs/apps/web/src/router/index.tsx +0 -25
  179. package/template-vp-monorepo-react-nestjs/apps/web/src/router/modules/.gitkeep +0 -0
  180. package/template-vp-monorepo-react-nestjs/apps/web/src/styles/index.css +0 -7
  181. package/template-vp-monorepo-react-nestjs/apps/web/src/types/auto-imports.d.ts +0 -58
  182. package/template-vp-monorepo-react-nestjs/apps/web/tsconfig.json +0 -32
  183. package/template-vp-monorepo-react-nestjs/apps/web/vite.config.ts +0 -32
  184. package/template-vp-monorepo-react-nestjs/commitlint.config.js +0 -0
  185. package/template-vp-monorepo-react-nestjs/package.json +0 -20
  186. package/template-vp-monorepo-react-nestjs/packages/utils/README.md +0 -23
  187. package/template-vp-monorepo-react-nestjs/packages/utils/package.json +0 -39
  188. package/template-vp-monorepo-react-nestjs/packages/utils/src/index.ts +0 -3
  189. package/template-vp-monorepo-react-nestjs/packages/utils/tests/index.test.ts +0 -6
  190. package/template-vp-monorepo-react-nestjs/packages/utils/tsconfig.json +0 -20
  191. package/template-vp-monorepo-react-nestjs/packages/utils/tsdown.config.ts +0 -9
  192. package/template-vp-monorepo-react-nestjs/packages/utils/vite.config.ts +0 -7
  193. package/template-vp-monorepo-react-nestjs/pnpm-workspace.yaml +0 -23
  194. package/template-vp-monorepo-react-nestjs/tsconfig.json +0 -9
  195. package/template-vp-monorepo-react-nestjs/vite.config.ts +0 -8
  196. package/template-vp-react/.env +0 -1
  197. package/template-vp-react/.oxfmtrc.jsonc +0 -8
  198. package/template-vp-react/.oxlintrc.jsonc +0 -11
  199. package/template-vp-react/.vite-hooks/commit-msg +0 -1
  200. package/template-vp-react/.vite-hooks/pre-commit +0 -1
  201. package/template-vp-react/.vscode/extensions.json +0 -3
  202. package/template-vp-react/.vscode/settings.json +0 -11
  203. package/template-vp-react/commitlint.config.js +0 -0
  204. package/template-vp-react/index.html +0 -13
  205. package/template-vp-react/package.json +0 -41
  206. package/template-vp-react/public/favicon.svg +0 -1
  207. package/template-vp-react/public/icons.svg +0 -24
  208. package/template-vp-react/src/App.tsx +0 -24
  209. package/template-vp-react/src/assets/hero.png +0 -0
  210. package/template-vp-react/src/assets/react.svg +0 -1
  211. package/template-vp-react/src/assets/vite.svg +0 -1
  212. package/template-vp-react/src/components/Loading/PageLoading.tsx +0 -11
  213. package/template-vp-react/src/main.tsx +0 -5
  214. package/template-vp-react/src/pages/home/index.tsx +0 -17
  215. package/template-vp-react/src/router/index.tsx +0 -25
  216. package/template-vp-react/src/router/modules/.gitkeep +0 -0
  217. package/template-vp-react/src/styles/index.css +0 -7
  218. package/template-vp-react/src/types/auto-imports.d.ts +0 -58
  219. package/template-vp-react/tsconfig.json +0 -32
  220. package/template-vp-react/vite.config.ts +0 -35
  221. package/template-vp-react-shadcn/.env +0 -1
  222. package/template-vp-react-shadcn/.oxfmtrc.jsonc +0 -8
  223. package/template-vp-react-shadcn/.oxlintrc.jsonc +0 -3
  224. package/template-vp-react-shadcn/.vite-hooks/commit-msg +0 -1
  225. package/template-vp-react-shadcn/.vite-hooks/pre-commit +0 -1
  226. package/template-vp-react-shadcn/.vscode/extensions.json +0 -3
  227. package/template-vp-react-shadcn/.vscode/settings.json +0 -12
  228. package/template-vp-react-shadcn/agents.md +0 -44
  229. package/template-vp-react-shadcn/commitlint.config.js +0 -1
  230. package/template-vp-react-shadcn/components.json +0 -25
  231. package/template-vp-react-shadcn/index.html +0 -13
  232. package/template-vp-react-shadcn/package.json +0 -56
  233. package/template-vp-react-shadcn/public/favicon.svg +0 -1
  234. package/template-vp-react-shadcn/public/icons.svg +0 -24
  235. package/template-vp-react-shadcn/src/App.tsx +0 -24
  236. package/template-vp-react-shadcn/src/api/.gitkeep +0 -0
  237. package/template-vp-react-shadcn/src/assets/hero.png +0 -0
  238. package/template-vp-react-shadcn/src/assets/react.svg +0 -1
  239. package/template-vp-react-shadcn/src/assets/vite.svg +0 -1
  240. package/template-vp-react-shadcn/src/components/Loading/PageLoading.tsx +0 -11
  241. package/template-vp-react-shadcn/src/components/Player/VideoJS/index.tsx +0 -163
  242. package/template-vp-react-shadcn/src/components/Player/index.ts +0 -7
  243. package/template-vp-react-shadcn/src/components/ui/button.tsx +0 -67
  244. package/template-vp-react-shadcn/src/components/ui/sonner.tsx +0 -43
  245. package/template-vp-react-shadcn/src/components/ui/spinner.tsx +0 -17
  246. package/template-vp-react-shadcn/src/hooks/.gitkeep +0 -0
  247. package/template-vp-react-shadcn/src/lib/utils.ts +0 -6
  248. package/template-vp-react-shadcn/src/main.tsx +0 -5
  249. package/template-vp-react-shadcn/src/pages/home/index.tsx +0 -96
  250. package/template-vp-react-shadcn/src/router/index.tsx +0 -25
  251. package/template-vp-react-shadcn/src/router/modules/.gitkeep +0 -0
  252. package/template-vp-react-shadcn/src/store/.gitkeep +0 -0
  253. package/template-vp-react-shadcn/src/styles/index.css +0 -16
  254. package/template-vp-react-shadcn/src/styles/shadcn.css +0 -127
  255. package/template-vp-react-shadcn/src/types/auto-imports.d.ts +0 -58
  256. package/template-vp-react-shadcn/src/utils/env/index.tsx +0 -6
  257. package/template-vp-react-shadcn/src/utils/request/alova-core/index.ts +0 -276
  258. package/template-vp-react-shadcn/src/utils/request/alova-core/utils.ts +0 -24
  259. package/template-vp-react-shadcn/src/utils/request/index.ts +0 -48
  260. package/template-vp-react-shadcn/src/utils/request/readme.md +0 -176
  261. package/template-vp-react-shadcn/tsconfig.json +0 -32
  262. package/template-vp-react-shadcn/vite.config.ts +0 -35
  263. package/template-vue-rolldown-oxc/.env +0 -4
  264. package/template-vue-rolldown-oxc/.env.development +0 -1
  265. package/template-vue-rolldown-oxc/.env.production +0 -1
  266. package/template-vue-rolldown-oxc/.gitlab-ci.yml +0 -84
  267. package/template-vue-rolldown-oxc/.oxlintrc.json +0 -4
  268. package/template-vue-rolldown-oxc/.prettierignore +0 -34
  269. package/template-vue-rolldown-oxc/.prettierrc +0 -18
  270. package/template-vue-rolldown-oxc/.vscode/settings.json +0 -11
  271. package/template-vue-rolldown-oxc/README.md +0 -3
  272. package/template-vue-rolldown-oxc/commitlint.config.js +0 -1
  273. package/template-vue-rolldown-oxc/index.html +0 -13
  274. package/template-vue-rolldown-oxc/lefthook.yml +0 -11
  275. package/template-vue-rolldown-oxc/package.json +0 -55
  276. package/template-vue-rolldown-oxc/public/vite.svg +0 -1
  277. package/template-vue-rolldown-oxc/src/App.vue +0 -17
  278. package/template-vue-rolldown-oxc/src/assets/icon/vue.svg +0 -1
  279. package/template-vue-rolldown-oxc/src/components/Icon/svg-icon.vue +0 -29
  280. package/template-vue-rolldown-oxc/src/layout/default/index.vue +0 -3
  281. package/template-vue-rolldown-oxc/src/main.ts +0 -13
  282. package/template-vue-rolldown-oxc/src/router/guard/index.tsx +0 -7
  283. package/template-vue-rolldown-oxc/src/router/guard/permissionGuard.ts +0 -8
  284. package/template-vue-rolldown-oxc/src/router/index.tsx +0 -15
  285. package/template-vue-rolldown-oxc/src/router/modules/index.tsx +0 -31
  286. package/template-vue-rolldown-oxc/src/store/index.ts +0 -10
  287. package/template-vue-rolldown-oxc/src/store/modules/user.ts +0 -17
  288. package/template-vue-rolldown-oxc/src/styles/element-plus-variables.css +0 -4
  289. package/template-vue-rolldown-oxc/src/styles/font.scss +0 -0
  290. package/template-vue-rolldown-oxc/src/styles/index.scss +0 -31
  291. package/template-vue-rolldown-oxc/src/styles/variables.scss +0 -3
  292. package/template-vue-rolldown-oxc/src/utils/env.ts +0 -10
  293. package/template-vue-rolldown-oxc/src/utils/request/core/index.ts +0 -166
  294. package/template-vue-rolldown-oxc/src/utils/request/core/utils.ts +0 -38
  295. package/template-vue-rolldown-oxc/src/utils/request/index.ts +0 -39
  296. package/template-vue-rolldown-oxc/src/views/home/index.vue +0 -16
  297. package/template-vue-rolldown-oxc/src/views/model/index.vue +0 -7
  298. package/template-vue-rolldown-oxc/src/vite-env.d.ts +0 -13
  299. package/template-vue-rolldown-oxc/tsconfig.json +0 -36
  300. package/template-vue-rolldown-oxc/uno.config.ts +0 -10
  301. package/template-vue-rolldown-oxc/vite.config.ts +0 -51
  302. package/template-vue-vite-eslint/.env +0 -6
  303. package/template-vue-vite-eslint/.env.development +0 -2
  304. package/template-vue-vite-eslint/.env.production +0 -1
  305. package/template-vue-vite-eslint/README.md +0 -3
  306. package/template-vue-vite-eslint/commitlint.config.js +0 -1
  307. package/template-vue-vite-eslint/eslint.config.js +0 -69
  308. package/template-vue-vite-eslint/index.html +0 -13
  309. package/template-vue-vite-eslint/lefthook.yml +0 -11
  310. package/template-vue-vite-eslint/package.json +0 -56
  311. package/template-vue-vite-eslint/public/vite.svg +0 -1
  312. package/template-vue-vite-eslint/src/App.vue +0 -19
  313. package/template-vue-vite-eslint/src/api/index.ts +0 -12
  314. package/template-vue-vite-eslint/src/assets/icon/computer-data.svg +0 -3
  315. package/template-vue-vite-eslint/src/assets/icon/cpu.svg +0 -3
  316. package/template-vue-vite-eslint/src/assets/icon/data-search.svg +0 -3
  317. package/template-vue-vite-eslint/src/assets/icon/home.svg +0 -3
  318. package/template-vue-vite-eslint/src/assets/icon/knowledge-graph.svg +0 -3
  319. package/template-vue-vite-eslint/src/assets/icon/logo.svg +0 -1
  320. package/template-vue-vite-eslint/src/assets/icon/robot.svg +0 -3
  321. package/template-vue-vite-eslint/src/assets/image/.gitkeep +0 -0
  322. package/template-vue-vite-eslint/src/components/Icon/svg-icon.vue +0 -29
  323. package/template-vue-vite-eslint/src/hooks/chart/lib.ts +0 -57
  324. package/template-vue-vite-eslint/src/hooks/chart/useEcharts.ts +0 -65
  325. package/template-vue-vite-eslint/src/layout/default/header/index.vue +0 -12
  326. package/template-vue-vite-eslint/src/layout/default/index.vue +0 -55
  327. package/template-vue-vite-eslint/src/main.ts +0 -16
  328. package/template-vue-vite-eslint/src/router/guard/index.ts +0 -7
  329. package/template-vue-vite-eslint/src/router/guard/permissionGuard.ts +0 -13
  330. package/template-vue-vite-eslint/src/router/index.ts +0 -18
  331. package/template-vue-vite-eslint/src/router/interface.ts +0 -9
  332. package/template-vue-vite-eslint/src/router/modules/example.ts +0 -21
  333. package/template-vue-vite-eslint/src/router/modules/index.ts +0 -36
  334. package/template-vue-vite-eslint/src/store/index.ts +0 -11
  335. package/template-vue-vite-eslint/src/store/modules/user.ts +0 -20
  336. package/template-vue-vite-eslint/src/styles/font.scss +0 -0
  337. package/template-vue-vite-eslint/src/styles/index.scss +0 -29
  338. package/template-vue-vite-eslint/src/styles/variables.scss +0 -3
  339. package/template-vue-vite-eslint/src/types/auto-import.d.ts +0 -78
  340. package/template-vue-vite-eslint/src/types/components.d.ts +0 -18
  341. package/template-vue-vite-eslint/src/types/vite-env.d.ts +0 -15
  342. package/template-vue-vite-eslint/src/utils/env.ts +0 -11
  343. package/template-vue-vite-eslint/src/utils/request/core/index.ts +0 -186
  344. package/template-vue-vite-eslint/src/utils/request/core/utils.ts +0 -41
  345. package/template-vue-vite-eslint/src/utils/request/index.ts +0 -42
  346. package/template-vue-vite-eslint/src/views/example/echart/config.ts +0 -1794
  347. package/template-vue-vite-eslint/src/views/example/echart/index.vue +0 -22
  348. package/template-vue-vite-eslint/src/views/example/h-full.vue +0 -24
  349. package/template-vue-vite-eslint/src/views/example/tree-chart.vue +0 -94
  350. package/template-vue-vite-eslint/src/views/home/index.vue +0 -25
  351. package/template-vue-vite-eslint/src/views/login/index.vue +0 -9
  352. package/template-vue-vite-eslint/tsconfig.json +0 -36
  353. package/template-vue-vite-eslint/uno.config.ts +0 -21
  354. package/template-vue-vite-eslint/vite.config.ts +0 -60
@@ -1,276 +0,0 @@
1
- import type { Alova, AlovaDefaultCacheAdapter, AlovaOptions } from "alova";
2
- import { createAlova } from "alova";
3
- import adapterFetch, { type FetchRequestAdapter, type FetchRequestInit } from "alova/fetch";
4
- import type { ReactHookExportType } from "alova/react";
5
-
6
- import { deepMergeObject, isPlainObject } from "./utils";
7
-
8
- type StatusMatcher = number | number[];
9
- type HeaderValue = string | (() => string);
10
- type RequestAlovaGenerics = {
11
- Responded: unknown;
12
- Transformed: unknown;
13
- RequestConfig: FetchRequestInit;
14
- Response: Response;
15
- ResponseHeader: Headers;
16
- L1Cache: AlovaDefaultCacheAdapter;
17
- L2Cache: AlovaDefaultCacheAdapter;
18
- StatesExport: ReactHookExportType<unknown>;
19
- };
20
-
21
- interface StatusMap {
22
- success?: StatusMatcher;
23
- unAuthorized?: StatusMatcher;
24
- }
25
-
26
- interface CodeMap {
27
- success?: number[];
28
- unAuthorized?: number[];
29
- }
30
-
31
- export interface BaseRequestOption {
32
- baseUrl?: string;
33
- timeout?: number;
34
- commonHeaders?: Record<string, HeaderValue>;
35
- statusMap?: StatusMap;
36
- codeMap?: CodeMap;
37
- responseDataKey?: string;
38
- responseMessageKey?: string;
39
- isTransformResponse?: boolean;
40
- isShowSuccessMessage?: boolean;
41
- successDefaultMessage?: string;
42
- isShowErrorMessage?: boolean;
43
- errorDefaultMessage?: string;
44
- statesHook?: AlovaOptions<RequestAlovaGenerics>["statesHook"];
45
- successMessageFunc?: (message: string) => void;
46
- errorMessageFunc?: (message: string) => void;
47
- unAuthorizedResponseFunc?: () => void;
48
- requestAdapter?: FetchRequestAdapter;
49
- }
50
-
51
- export interface CustomConfig {
52
- isTransformResponse?: boolean;
53
- isShowSuccessMessage?: boolean;
54
- isShowErrorMessage?: boolean;
55
- }
56
-
57
- declare module "alova" {
58
- interface AlovaCustomTypes {
59
- meta: CustomConfig;
60
- }
61
- }
62
-
63
- interface RequestErrorOptions {
64
- status?: number;
65
- code?: unknown;
66
- data?: unknown;
67
- response?: Response;
68
- }
69
-
70
- export class RequestError extends Error {
71
- status?: number;
72
- code?: unknown;
73
- data?: unknown;
74
- response?: Response;
75
-
76
- constructor(message: string, options: RequestErrorOptions = {}) {
77
- super(message);
78
- this.name = "RequestError";
79
- this.status = options.status;
80
- this.code = options.code;
81
- this.data = options.data;
82
- this.response = options.response;
83
- }
84
- }
85
-
86
- export type RequestInstance = Alova<RequestAlovaGenerics>;
87
- export type DualCallInstance = RequestInstance & ((option?: CustomConfig) => RequestInstance);
88
-
89
- type RequestOption = BaseRequestOption & CustomConfig;
90
-
91
- const DEFAULT_REQUEST_ADAPTER = adapterFetch();
92
- const DEFAULT_RESPONSE_DATA_KEY = "data";
93
- const DEFAULT_RESPONSE_MESSAGE_KEY = "message";
94
- const DEFAULT_SUCCESS_MESSAGE = "操作成功";
95
- const DEFAULT_ERROR_MESSAGE = "服务异常";
96
- const DEFAULT_REQUEST_OPTION: RequestOption = {
97
- baseUrl: "/",
98
- timeout: 0,
99
- statusMap: {
100
- success: [200, 201, 204],
101
- unAuthorized: 401,
102
- },
103
- codeMap: {
104
- success: [200],
105
- unAuthorized: [401],
106
- },
107
- responseDataKey: DEFAULT_RESPONSE_DATA_KEY,
108
- responseMessageKey: DEFAULT_RESPONSE_MESSAGE_KEY,
109
- isTransformResponse: true,
110
- isShowSuccessMessage: false,
111
- successDefaultMessage: DEFAULT_SUCCESS_MESSAGE,
112
- isShowErrorMessage: true,
113
- errorDefaultMessage: DEFAULT_ERROR_MESSAGE,
114
- requestAdapter: DEFAULT_REQUEST_ADAPTER,
115
- };
116
-
117
- function isMatchedStatus(status: number, matcher?: StatusMatcher) {
118
- if (matcher === undefined) return status >= 200 && status < 300;
119
- return Array.isArray(matcher) ? matcher.includes(status) : matcher === status;
120
- }
121
-
122
- function isMatchedCode(code: unknown, codes?: number[]) {
123
- if (!codes?.length) return true;
124
-
125
- const normalizedCode = Number(code);
126
- return Number.isFinite(normalizedCode) && codes.includes(normalizedCode);
127
- }
128
-
129
- function getResponseMessage(data: unknown, messageKey: string, defaultMessage: string) {
130
- if (!isPlainObject(data)) return defaultMessage;
131
-
132
- const message = data[messageKey] ?? data.message ?? data.msg;
133
- if (typeof message === "string") return message || defaultMessage;
134
- if (typeof message === "number") return String(message);
135
-
136
- return defaultMessage;
137
- }
138
-
139
- function getRuntimeConfig(option: RequestOption, customConfig?: CustomConfig) {
140
- return {
141
- isTransformResponse: customConfig?.isTransformResponse ?? option.isTransformResponse ?? true,
142
- isShowSuccessMessage:
143
- customConfig?.isShowSuccessMessage ?? option.isShowSuccessMessage ?? false,
144
- isShowErrorMessage: customConfig?.isShowErrorMessage ?? option.isShowErrorMessage ?? true,
145
- };
146
- }
147
-
148
- async function parseResponse(response: Response) {
149
- if (!response.body || response.status === 204) return undefined;
150
-
151
- const contentType = response.headers.get("content-type") ?? "";
152
- if (contentType.includes("application/json")) return response.json();
153
- if (contentType.startsWith("text/")) return response.text();
154
-
155
- const clonedResponse = response.clone();
156
- try {
157
- return await response.json();
158
- } catch {
159
- try {
160
- return await clonedResponse.text();
161
- } catch {
162
- return undefined;
163
- }
164
- }
165
- }
166
-
167
- export function createInstance(option: RequestOption): RequestInstance {
168
- const mergeOption = deepMergeObject(DEFAULT_REQUEST_OPTION, option);
169
-
170
- return createAlova({
171
- baseURL: mergeOption.baseUrl,
172
- timeout: mergeOption.timeout,
173
- statesHook: mergeOption.statesHook,
174
- requestAdapter: mergeOption.requestAdapter ?? DEFAULT_REQUEST_ADAPTER,
175
- beforeRequest: (method) => {
176
- for (const [key, value] of Object.entries(mergeOption.commonHeaders ?? {})) {
177
- method.config.headers[key] = typeof value === "function" ? value() : value;
178
- }
179
- },
180
- cacheFor: null,
181
- responded: {
182
- onSuccess: async (response, method) => {
183
- const runtimeConfig = getRuntimeConfig(mergeOption, method.config.meta);
184
- if (!runtimeConfig.isTransformResponse) return response;
185
-
186
- const data = await parseResponse(response);
187
- const responseMessageKey = mergeOption.responseMessageKey ?? DEFAULT_RESPONSE_MESSAGE_KEY;
188
- const errorDefaultMessage = mergeOption.errorDefaultMessage ?? DEFAULT_ERROR_MESSAGE;
189
-
190
- if (!isMatchedStatus(response.status, mergeOption.statusMap?.success)) {
191
- if (isMatchedStatus(response.status, mergeOption.statusMap?.unAuthorized)) {
192
- mergeOption.unAuthorizedResponseFunc?.();
193
- }
194
-
195
- const errorMessage = getResponseMessage(data, responseMessageKey, errorDefaultMessage);
196
- if (runtimeConfig.isShowErrorMessage) {
197
- mergeOption.errorMessageFunc?.(errorMessage);
198
- }
199
- throw new RequestError(errorMessage, {
200
- status: response.status,
201
- data,
202
- response,
203
- });
204
- }
205
-
206
- if (!isPlainObject(data)) return data;
207
-
208
- const responseCode = data.code;
209
- const responseMessage = getResponseMessage(
210
- data,
211
- responseMessageKey,
212
- mergeOption.successDefaultMessage ?? DEFAULT_SUCCESS_MESSAGE,
213
- );
214
-
215
- if (
216
- responseCode !== undefined &&
217
- !isMatchedCode(responseCode, mergeOption.codeMap?.success)
218
- ) {
219
- if (isMatchedCode(responseCode, mergeOption.codeMap?.unAuthorized)) {
220
- mergeOption.unAuthorizedResponseFunc?.();
221
- }
222
-
223
- const errorMessage = getResponseMessage(data, responseMessageKey, errorDefaultMessage);
224
- if (runtimeConfig.isShowErrorMessage) {
225
- mergeOption.errorMessageFunc?.(errorMessage);
226
- }
227
- throw new RequestError(errorMessage, {
228
- status: response.status,
229
- code: responseCode,
230
- data,
231
- response,
232
- });
233
- }
234
-
235
- if (runtimeConfig.isShowSuccessMessage) {
236
- mergeOption.successMessageFunc?.(responseMessage);
237
- }
238
-
239
- const responseDataKey = mergeOption.responseDataKey ?? DEFAULT_RESPONSE_DATA_KEY;
240
- return responseDataKey in data ? data[responseDataKey] : data;
241
- },
242
- onError: (error) => {
243
- const errorMessage =
244
- error instanceof Error
245
- ? error.message
246
- : (mergeOption.errorDefaultMessage ?? DEFAULT_ERROR_MESSAGE);
247
-
248
- if (mergeOption.isShowErrorMessage) {
249
- mergeOption.errorMessageFunc?.(errorMessage);
250
- }
251
-
252
- throw error;
253
- },
254
- },
255
- });
256
- }
257
-
258
- export function createDualCallInstance(baseConfig: BaseRequestOption): DualCallInstance {
259
- const defaultInstance = createInstance(baseConfig);
260
- const dualInstance = ((option?: CustomConfig) => {
261
- if (!option) return defaultInstance;
262
- return createInstance(deepMergeObject(baseConfig, option));
263
- }) as DualCallInstance;
264
-
265
- Object.assign(dualInstance, defaultInstance);
266
- dualInstance.Get = defaultInstance.Get.bind(defaultInstance);
267
- dualInstance.Post = defaultInstance.Post.bind(defaultInstance);
268
- dualInstance.Put = defaultInstance.Put.bind(defaultInstance);
269
- dualInstance.Delete = defaultInstance.Delete.bind(defaultInstance);
270
- dualInstance.Patch = defaultInstance.Patch.bind(defaultInstance);
271
- dualInstance.Head = defaultInstance.Head.bind(defaultInstance);
272
- dualInstance.Options = defaultInstance.Options.bind(defaultInstance);
273
- dualInstance.Request = defaultInstance.Request.bind(defaultInstance);
274
-
275
- return dualInstance;
276
- }
@@ -1,24 +0,0 @@
1
- type AnyRecord = Record<string, unknown>;
2
-
3
- export function isPlainObject(value: unknown): value is AnyRecord {
4
- return (
5
- value !== null &&
6
- typeof value === "object" &&
7
- !Array.isArray(value) &&
8
- Object.getPrototypeOf(value) === Object.prototype
9
- );
10
- }
11
-
12
- export function deepMergeObject<T extends object>(source: T, target: Partial<T>) {
13
- const result = { ...source } as AnyRecord;
14
-
15
- for (const [key, value] of Object.entries(target)) {
16
- const sourceValue = result[key];
17
- result[key] =
18
- isPlainObject(sourceValue) && isPlainObject(value)
19
- ? deepMergeObject(sourceValue, value)
20
- : value;
21
- }
22
-
23
- return result as T;
24
- }
@@ -1,48 +0,0 @@
1
- import reactHook from "alova/react";
2
- import { toast } from "sonner";
3
-
4
- import { navigator } from "@/router";
5
- import { envVariables } from "@/utils/env";
6
-
7
- import { createDualCallInstance } from "./alova-core";
8
-
9
- function normalizeBaseUrl(apiAffix?: string) {
10
- if (!apiAffix) return "/";
11
- if (/^https?:\/\//.test(apiAffix) || apiAffix.startsWith("/")) {
12
- return apiAffix;
13
- }
14
-
15
- return `/${apiAffix}`;
16
- }
17
-
18
- function getBaseConfig(): Parameters<typeof createDualCallInstance>[0] {
19
- return {
20
- baseUrl: normalizeBaseUrl(envVariables.API_AFFIX),
21
- statusMap: {
22
- success: [200, 201, 204],
23
- unAuthorized: 401,
24
- },
25
- codeMap: {
26
- success: [200],
27
- unAuthorized: [401],
28
- },
29
- responseDataKey: "data",
30
- responseMessageKey: "msg",
31
- commonHeaders: {},
32
- successMessageFunc: (msg) => {
33
- toast.success(msg);
34
- },
35
- errorMessageFunc: (msg) => {
36
- toast.error(msg);
37
- },
38
- unAuthorizedResponseFunc: () => {
39
- navigator("/login");
40
- toast.error("登录过期或未登录");
41
- },
42
- statesHook: reactHook,
43
- };
44
- }
45
-
46
- const alovaRequest = createDualCallInstance(getBaseConfig());
47
-
48
- export default alovaRequest;
@@ -1,176 +0,0 @@
1
- # request 使用说明
2
-
3
- `src/utils/request/index.ts` 导出的是项目统一的 alova 请求实例,业务接口建议统一放在 `src/api` 里封装,页面和组件不要直接散写请求配置。
4
-
5
- ## 基础用法
6
-
7
- 请求方法会创建 alova `Method` 实例,不会在创建时立刻发送请求。可以在组件中交给 `useRequest`,也可以在普通函数里直接 `await`。
8
-
9
- ```ts
10
- import alovaRequest from "@/utils/request";
11
-
12
- interface DramaItem {
13
- id: number;
14
- title: string;
15
- }
16
-
17
- interface DramaListParams {
18
- page: number;
19
- pageSize: number;
20
- }
21
-
22
- export const getDramaList = (params: DramaListParams) => {
23
- return alovaRequest.Get<DramaItem[]>("/drama/list", { params });
24
- };
25
- ```
26
-
27
- 组件中使用:
28
-
29
- ```tsx
30
- import { useRequest } from "alova/client";
31
-
32
- import { getDramaList } from "@/api";
33
-
34
- export function DramaList() {
35
- const { data, loading, error } = useRequest(getDramaList({ page: 1, pageSize: 20 }), {
36
- initialData: [],
37
- });
38
-
39
- // ...
40
- }
41
- ```
42
-
43
- 普通异步函数中使用:
44
-
45
- ```ts
46
- const list = await getDramaList({ page: 1, pageSize: 20 });
47
- ```
48
-
49
- ## 请求参数
50
-
51
- GET 查询参数放在第二个参数的 `params` 里:
52
-
53
- ```ts
54
- alovaRequest.Get<UserInfo>("/user/detail", {
55
- params: {
56
- id: 1,
57
- },
58
- });
59
- ```
60
-
61
- POST、PUT、PATCH、DELETE 的 body 放在第二个参数,配置放在第三个参数:
62
-
63
- ```ts
64
- alovaRequest.Post<CreateUserResult>("/user/create", {
65
- name: "Tom",
66
- });
67
-
68
- alovaRequest.Post<CreateUserResult>(
69
- "/user/create",
70
- { name: "Tom" },
71
- {
72
- meta: {
73
- isShowSuccessMessage: true,
74
- },
75
- },
76
- );
77
- ```
78
-
79
- ## 返回结构
80
-
81
- 默认按下面这种后端格式处理:
82
-
83
- ```ts
84
- interface ApiResponse<T> {
85
- code: number;
86
- data: T;
87
- msg: string;
88
- }
89
- ```
90
-
91
- 默认规则:
92
-
93
- - HTTP 状态码 `200`、`201`、`204` 视为成功。
94
- - 业务 `code` 在 `codeMap.success` 中视为成功,当前默认是 `[200]`。
95
- - 成功后返回 `data` 字段,所以 `alovaRequest.Get<User[]>` 的最终数据类型就是 `User[]`。
96
- - 如果响应不是普通对象,会直接返回解析后的原始数据,比如字符串。
97
-
98
- ## 提示开关
99
-
100
- 单次请求可以通过 `meta` 控制是否转换响应、是否显示成功提示、是否显示错误提示。
101
-
102
- ```ts
103
- alovaRequest.Post(
104
- "/user/update",
105
- { id: 1, name: "Tom" },
106
- {
107
- meta: {
108
- isShowSuccessMessage: true,
109
- isShowErrorMessage: false,
110
- },
111
- },
112
- );
113
- ```
114
-
115
- 也可以创建一个带临时配置的请求实例:
116
-
117
- ```ts
118
- const silentRequest = alovaRequest({
119
- isShowErrorMessage: false,
120
- });
121
-
122
- silentRequest.Get<UserInfo>("/user/detail", {
123
- params: { id: 1 },
124
- });
125
- ```
126
-
127
- ## 原始响应
128
-
129
- 下载文件、读取响应头、或不想走业务 `code/data/msg` 转换时,关闭 `isTransformResponse`。
130
-
131
- ```ts
132
- const downloadFile = () => {
133
- return alovaRequest.Get<Response>("/file/download", {
134
- meta: {
135
- isTransformResponse: false,
136
- },
137
- });
138
- };
139
-
140
- const response = await downloadFile();
141
- const blob = await response.blob();
142
- ```
143
-
144
- ## 错误处理
145
-
146
- HTTP 状态码错误、业务 `code` 错误都会抛出 `RequestError`,alova hook 会进入 `error` 分支。
147
-
148
- ```ts
149
- import { RequestError } from "@/utils/request/alova-core";
150
-
151
- try {
152
- await getDramaList({ page: 1, pageSize: 20 });
153
- } catch (error) {
154
- if (error instanceof RequestError) {
155
- console.log(error.status, error.code, error.message);
156
- }
157
- }
158
- ```
159
-
160
- `401` 会自动执行 `unAuthorizedResponseFunc`,当前行为是跳转到 `/login` 并提示登录过期。
161
-
162
- ## 环境变量
163
-
164
- 请求基础路径来自 `VITE_API_AFFIX`:
165
-
166
- ```env
167
- VITE_API_AFFIX=/api
168
- ```
169
-
170
- 没有配置时会使用 `/`,避免出现 `/undefined`。
171
-
172
- ## 注意事项
173
-
174
- - 业务接口优先写成函数并标注返回泛型,例如 `alovaRequest.Get<UserInfo>()`,组件里的 `useRequest` 会自动推断数据类型。
175
- - 不要把 GET 查询参数直接作为第二个裸对象传入,第二个参数是配置对象,查询参数必须放到 `{ params }`。
176
- - 需要局部关闭错误提示时优先用 `meta.isShowErrorMessage`,不要在组件里重复 toast。
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2023",
4
- "useDefineForClassFields": true,
5
- "module": "ESNext",
6
- "lib": ["ES2023", "DOM", "DOM.Iterable"],
7
- "types": ["vite/client"],
8
- "skipLibCheck": true,
9
-
10
- /* Bundler mode */
11
- "moduleResolution": "bundler",
12
- "allowImportingTsExtensions": true,
13
- "verbatimModuleSyntax": true,
14
- "moduleDetection": "force",
15
- "noEmit": true,
16
- "jsx": "react-jsx",
17
-
18
- /* Linting */
19
- "strict": true,
20
- "noUnusedLocals": true,
21
- "noUnusedParameters": true,
22
- "erasableSyntaxOnly": true,
23
- "noFallthroughCasesInSwitch": true,
24
- "noUncheckedSideEffectImports": true,
25
-
26
- "baseUrl": ".",
27
- "paths": {
28
- "@/*": ["src/*"]
29
- }
30
- },
31
- "include": ["src"]
32
- }
@@ -1,35 +0,0 @@
1
- import path from "path";
2
-
3
- import tailwindcss from "@tailwindcss/vite";
4
- import react from "@vitejs/plugin-react";
5
- import AutoImport from "unplugin-auto-import/vite";
6
- import { defineConfig, loadEnv } from "vite-plus";
7
-
8
- export default defineConfig(({ mode }) => {
9
- const root = process.cwd();
10
- const env = loadEnv(mode, root);
11
- const { VITE_PORT } = env;
12
-
13
- return {
14
- resolve: {
15
- alias: {
16
- "@": path.resolve(__dirname, "src"),
17
- },
18
- },
19
- server: {
20
- port: Number(VITE_PORT),
21
- host: "0.0.0.0",
22
- },
23
- plugins: [
24
- react(),
25
- AutoImport({
26
- imports: ["react", "react-router", "react-dom"],
27
- dts: "./src/types/auto-imports.d.ts",
28
- }),
29
- tailwindcss(),
30
- ],
31
- staged: {
32
- "*": "vp check --fix",
33
- },
34
- };
35
- });
@@ -1,4 +0,0 @@
1
- VITE_PORT = 9405
2
- VITE_PATH = '/'
3
- VITE_APP_NAME = "xxx"
4
- VITE_API_AFFIX = 'api'
@@ -1 +0,0 @@
1
- PUBLIC_API_URL = 'http://localhost:8080'
@@ -1 +0,0 @@
1
- PUBLIC_API_URL = 'http://localhost:8080'
@@ -1,84 +0,0 @@
1
- .send_dingtalk_notification: &send_dingtalk_notification |
2
- case "$CI_JOB_STAGE" in
3
- "build")
4
- stage_name="构建"
5
- ;;
6
- "deploy")
7
- stage_name="部署"
8
- ;;
9
- esac
10
-
11
- if [ "$CI_JOB_STATUS" == "success" ]; then
12
- title="==✅ ${stage_name}成功=="
13
- else
14
- title="==❌ ${stage_name}失败=="
15
- fi
16
-
17
- curl -s -X POST ${DINGTALK_WEBHOOK} \
18
- -H "Content-Type: application/json" \
19
- -d "{
20
- \"msgtype\": \"markdown\",
21
- \"markdown\": {
22
- \"title\": \"GitLab CI/CD 通知\",
23
- \"text\": \"### ${title}\n\n- **项目**: ${CI_PROJECT_NAME}\n- **项目地址**: ${CI_PROJECT_URL}\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
24
- }
25
- }"
26
-
27
- stages:
28
- - build
29
- - deploy
30
-
31
- variables:
32
- DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model'
33
- MOCK_DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model-mock'
34
- DINGTALK_WEBHOOK: 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TALK_ACCESS_TOKEN}'
35
-
36
- cache:
37
- paths:
38
- - node_modules/
39
-
40
- # 打包
41
- build:
42
- stage: build
43
- script:
44
- - cd ${CI_PROJECT_DIR}
45
- - whoami
46
- - echo "===== 开始构建 ====="
47
- - pnpm install
48
- - pnpm build
49
- - echo "===== 构建完成 ====="
50
- only:
51
- - dev
52
- - mock
53
- artifacts:
54
- paths:
55
- - dist/
56
- after_script:
57
- #钉钉通知
58
- - *send_dingtalk_notification
59
-
60
- # 部署
61
- deploy:
62
- stage: deploy
63
- needs: ['build']
64
- only:
65
- - dev
66
- - mock
67
- script:
68
- - echo "-----------------开始部署------------------"
69
- - |
70
- if [ "$CI_COMMIT_BRANCH" == "dev" ]; then
71
- ssh root@192.168.2.245 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理245失败"; exit 1; }
72
- scp -r dist/* root@192.168.2.245:$DEPLOY_PATH || { echo "❌ 传输到245失败"; exit 1; }
73
- ssh root@192.168.2.57 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
74
- scp -r dist/* root@192.168.2.57:$DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
75
- elif [ "$CI_COMMIT_BRANCH" == "mock" ]; then
76
- ssh root@192.168.2.57 "rm -rf $MOCK_DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
77
- scp -r dist/* root@192.168.2.57:$MOCK_DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
78
- else
79
- echo "没有匹配到需要部署的分支或标签,跳过部署"
80
- exit 0
81
- fi
82
- after_script:
83
- #钉钉通知
84
- - *send_dingtalk_notification
@@ -1,4 +0,0 @@
1
- {
2
- "plugins": ["vue", "import", "oxc", "unicorn"],
3
- "ignorePatterns": ["node_modules", "dist", "public", "*.d.ts"]
4
- }