@moluoxixi/create-app 2.0.403 → 2.0.406

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 (292) hide show
  1. package/dist/commands/create.js +0 -1
  2. package/dist/generators/react.js +0 -2
  3. package/dist/generators/vue.js +0 -2
  4. package/dist/test.js +8 -0
  5. package/dist/utils/deepMerge.js +1 -1
  6. package/dist/utils/featureMapping.d.ts +2 -2
  7. package/dist/utils/featureMapping.js +3 -5
  8. package/dist/utils/generateFrameworkProject.d.ts +0 -4
  9. package/dist/utils/generateFrameworkProject.js +1 -1
  10. package/dist/utils/install.js +1 -1
  11. package/dist/utils/prompts.js +5 -30
  12. package/dist/utils/renderTemplate.js +9 -4
  13. package/package.json +2 -1
  14. package/templates/common/base/.gitmodules +4 -0
  15. package/templates/common/base/package.json +3 -1
  16. package/templates/common/base/scripts/build.mts +17 -17
  17. package/templates/common/base/src/apis/index.ts +3 -4
  18. package/templates/common/base/src/apis/types/example.ts +0 -1
  19. package/templates/common/base/src/assets/fonts/index.css +0 -1
  20. package/templates/common/base/src/assets/styles/base.scss +1 -9
  21. package/templates/common/base/src/assets/styles/custom.scss +0 -1
  22. package/templates/common/base/src/assets/styles/tailwind.scss +0 -1
  23. package/templates/common/base/src/constants/index.ts +3 -4
  24. package/templates/common/base/src/utils/index.ts +22 -23
  25. package/templates/common/base/vite.config.ts.ejs +16 -1
  26. package/templates/common/features/husky/.husky/install.mjs +3 -0
  27. package/templates/common/features/husky/package.json +2 -1
  28. package/templates/react/base/index.html +1 -2
  29. package/templates/react/base/node_modules/.bin/browserslist +17 -0
  30. package/templates/react/base/node_modules/.bin/browserslist.CMD +12 -0
  31. package/templates/react/base/node_modules/.bin/browserslist.ps1 +41 -0
  32. package/templates/react/base/node_modules/.bin/jiti +17 -0
  33. package/templates/react/base/node_modules/.bin/jiti.CMD +12 -0
  34. package/templates/react/base/node_modules/.bin/jiti.ps1 +41 -0
  35. package/templates/react/base/node_modules/.bin/parser +17 -0
  36. package/templates/react/base/node_modules/.bin/parser.CMD +12 -0
  37. package/templates/react/base/node_modules/.bin/parser.ps1 +41 -0
  38. package/templates/react/base/node_modules/.bin/rollup +17 -0
  39. package/templates/react/base/node_modules/.bin/rollup.CMD +12 -0
  40. package/templates/react/base/node_modules/.bin/rollup.ps1 +41 -0
  41. package/templates/react/base/node_modules/.bin/sass +17 -0
  42. package/templates/react/base/node_modules/.bin/sass.CMD +12 -0
  43. package/templates/react/base/node_modules/.bin/sass.ps1 +41 -0
  44. package/templates/react/base/node_modules/.bin/terser +17 -0
  45. package/templates/react/base/node_modules/.bin/terser.CMD +12 -0
  46. package/templates/react/base/node_modules/.bin/terser.ps1 +41 -0
  47. package/templates/react/base/node_modules/.bin/tsc +17 -0
  48. package/templates/react/base/node_modules/.bin/tsc.CMD +12 -0
  49. package/templates/react/base/node_modules/.bin/tsc.ps1 +41 -0
  50. package/templates/react/base/node_modules/.bin/tsserver +17 -0
  51. package/templates/react/base/node_modules/.bin/tsserver.CMD +12 -0
  52. package/templates/react/base/node_modules/.bin/tsserver.ps1 +41 -0
  53. package/templates/react/base/node_modules/.bin/tsx +17 -0
  54. package/templates/react/base/node_modules/.bin/tsx.CMD +12 -0
  55. package/templates/react/base/node_modules/.bin/tsx.ps1 +41 -0
  56. package/templates/react/base/node_modules/.bin/vite +2 -2
  57. package/templates/react/base/node_modules/.bin/vite.CMD +2 -2
  58. package/templates/react/base/node_modules/.bin/vite.ps1 +4 -4
  59. package/templates/react/base/node_modules/.bin/yaml +17 -0
  60. package/templates/react/base/node_modules/.bin/yaml.CMD +12 -0
  61. package/templates/react/base/node_modules/.bin/yaml.ps1 +41 -0
  62. package/templates/react/base/package.json +4 -3
  63. package/templates/react/base/src/main.tsx.ejs +0 -1
  64. package/templates/react/{features/qiankun → base}/src/qiankun/index.ts +5 -2
  65. package/templates/react/base/src/stores/index.ts +5 -0
  66. package/templates/react/base/src/stores/user.ts +55 -0
  67. package/templates/react/base/tsconfig.app.json +0 -1
  68. package/templates/react/base/tsconfig.base.json +0 -1
  69. package/templates/react/base/tsconfig.json +0 -1
  70. package/templates/react/base/tsconfig.node.json +0 -1
  71. package/templates/react/features/eslint/eslint.config.ts +0 -1
  72. package/templates/react/features/eslint/node_modules/.bin/browserslist +17 -0
  73. package/templates/react/features/eslint/node_modules/.bin/browserslist.CMD +12 -0
  74. package/templates/react/features/eslint/node_modules/.bin/browserslist.ps1 +41 -0
  75. package/templates/react/features/eslint/node_modules/.bin/jiti +17 -0
  76. package/templates/react/features/eslint/node_modules/.bin/jiti.CMD +12 -0
  77. package/templates/react/features/eslint/node_modules/.bin/jiti.ps1 +41 -0
  78. package/templates/react/features/eslint/node_modules/.bin/tsc +17 -0
  79. package/templates/react/features/eslint/node_modules/.bin/tsc.CMD +12 -0
  80. package/templates/react/features/eslint/node_modules/.bin/tsc.ps1 +41 -0
  81. package/templates/react/features/eslint/node_modules/.bin/tsserver +17 -0
  82. package/templates/react/features/eslint/node_modules/.bin/tsserver.CMD +12 -0
  83. package/templates/react/features/eslint/node_modules/.bin/tsserver.ps1 +41 -0
  84. package/templates/react/features/i18n/node_modules/.bin/tsc +17 -0
  85. package/templates/react/features/i18n/node_modules/.bin/tsc.CMD +12 -0
  86. package/templates/react/features/i18n/node_modules/.bin/tsc.ps1 +41 -0
  87. package/templates/react/features/i18n/node_modules/.bin/tsserver +17 -0
  88. package/templates/react/features/i18n/node_modules/.bin/tsserver.CMD +12 -0
  89. package/templates/react/features/i18n/node_modules/.bin/tsserver.ps1 +41 -0
  90. package/templates/react/features/i18n/src/locales/index.ts +0 -1
  91. package/templates/react/features/i18n/src/locales/lang/en.ts +1 -2
  92. package/templates/react/features/i18n/src/locales/lang/es.ts +1 -2
  93. package/templates/react/features/i18n/src/locales/lang/zh.ts +1 -2
  94. package/templates/react/{base/src/router/index.tsx.ejs → features/manualRoutes/src/router/index.tsx} +6 -5
  95. package/templates/react/features/manualRoutes/src/router/routes.tsx +4 -3
  96. package/templates/react/features/pageRoutes/node_modules/.bin/jiti +17 -0
  97. package/templates/react/features/pageRoutes/node_modules/.bin/jiti.CMD +12 -0
  98. package/templates/react/features/pageRoutes/node_modules/.bin/jiti.ps1 +41 -0
  99. package/templates/react/features/pageRoutes/node_modules/.bin/sass +17 -0
  100. package/templates/react/features/pageRoutes/node_modules/.bin/sass.CMD +12 -0
  101. package/templates/react/features/pageRoutes/node_modules/.bin/sass.ps1 +41 -0
  102. package/templates/react/features/pageRoutes/node_modules/.bin/terser +17 -0
  103. package/templates/react/features/pageRoutes/node_modules/.bin/terser.CMD +12 -0
  104. package/templates/react/features/pageRoutes/node_modules/.bin/terser.ps1 +41 -0
  105. package/templates/react/features/pageRoutes/node_modules/.bin/tsx +17 -0
  106. package/templates/react/features/pageRoutes/node_modules/.bin/tsx.CMD +12 -0
  107. package/templates/react/features/pageRoutes/node_modules/.bin/tsx.ps1 +41 -0
  108. package/templates/react/features/pageRoutes/node_modules/.bin/vite +17 -0
  109. package/templates/react/features/pageRoutes/node_modules/.bin/vite.CMD +12 -0
  110. package/templates/react/features/pageRoutes/node_modules/.bin/vite.ps1 +41 -0
  111. package/templates/react/features/pageRoutes/node_modules/.bin/yaml +17 -0
  112. package/templates/react/features/pageRoutes/node_modules/.bin/yaml.CMD +12 -0
  113. package/templates/react/features/pageRoutes/node_modules/.bin/yaml.ps1 +41 -0
  114. package/templates/react/features/pageRoutes/src/router/index.tsx +30 -0
  115. package/templates/react/features/sentry/src/utils/sentry.ts +0 -1
  116. package/templates/react/features/zustand/src/types/stores.ts +0 -1
  117. package/templates/vue/base/env.d.ts +11 -12
  118. package/templates/vue/base/index.html +1 -2
  119. package/templates/vue/base/node_modules/.bin/browserslist +17 -0
  120. package/templates/vue/base/node_modules/.bin/browserslist.CMD +12 -0
  121. package/templates/vue/base/node_modules/.bin/browserslist.ps1 +41 -0
  122. package/templates/vue/base/node_modules/.bin/jiti +17 -0
  123. package/templates/vue/base/node_modules/.bin/jiti.CMD +12 -0
  124. package/templates/vue/base/node_modules/.bin/jiti.ps1 +41 -0
  125. package/templates/vue/base/node_modules/.bin/parser +17 -0
  126. package/templates/vue/base/node_modules/.bin/parser.CMD +12 -0
  127. package/templates/vue/base/node_modules/.bin/parser.ps1 +41 -0
  128. package/templates/vue/base/node_modules/.bin/rollup +17 -0
  129. package/templates/vue/base/node_modules/.bin/rollup.CMD +12 -0
  130. package/templates/vue/base/node_modules/.bin/rollup.ps1 +41 -0
  131. package/templates/vue/base/node_modules/.bin/sass +17 -0
  132. package/templates/vue/base/node_modules/.bin/sass.CMD +12 -0
  133. package/templates/vue/base/node_modules/.bin/sass.ps1 +41 -0
  134. package/templates/vue/base/node_modules/.bin/terser +17 -0
  135. package/templates/vue/base/node_modules/.bin/terser.CMD +12 -0
  136. package/templates/vue/base/node_modules/.bin/terser.ps1 +41 -0
  137. package/templates/vue/base/node_modules/.bin/tsc +17 -0
  138. package/templates/vue/base/node_modules/.bin/tsc.CMD +12 -0
  139. package/templates/vue/base/node_modules/.bin/tsc.ps1 +41 -0
  140. package/templates/vue/base/node_modules/.bin/tsserver +17 -0
  141. package/templates/vue/base/node_modules/.bin/tsserver.CMD +12 -0
  142. package/templates/vue/base/node_modules/.bin/tsserver.ps1 +41 -0
  143. package/templates/vue/base/node_modules/.bin/tsx +17 -0
  144. package/templates/vue/base/node_modules/.bin/tsx.CMD +12 -0
  145. package/templates/vue/base/node_modules/.bin/tsx.ps1 +41 -0
  146. package/templates/vue/base/node_modules/.bin/vite +2 -2
  147. package/templates/vue/base/node_modules/.bin/vite.CMD +2 -2
  148. package/templates/vue/base/node_modules/.bin/vite.ps1 +4 -4
  149. package/templates/vue/base/node_modules/.bin/yaml +17 -0
  150. package/templates/vue/base/node_modules/.bin/yaml.CMD +12 -0
  151. package/templates/vue/base/node_modules/.bin/yaml.ps1 +41 -0
  152. package/templates/vue/base/package.json +6 -3
  153. package/templates/vue/base/src/App.vue +5 -5
  154. package/templates/vue/base/src/assets/styles/base.scss +69 -0
  155. package/templates/vue/base/src/assets/styles/custom.scss +40 -0
  156. package/templates/vue/base/src/assets/styles/main.scss +0 -1
  157. package/templates/vue/base/src/assets/styles/tailwind.scss +3 -0
  158. package/templates/vue/base/src/directives/index.ts +9 -9
  159. package/templates/vue/base/src/layouts/index.ts +21 -0
  160. package/templates/vue/base/src/main.ts.ejs +1 -1
  161. package/templates/vue/base/src/pages/about/index.vue +6 -7
  162. package/templates/vue/base/src/pages/home/index.vue +6 -7
  163. package/templates/vue/base/src/router/layout.vue +15 -0
  164. package/templates/vue/base/src/stores/index.ts +6 -0
  165. package/templates/vue/base/src/stores/modules/system.ts +51 -0
  166. package/templates/vue/base/src/stores/modules/user.ts +41 -0
  167. package/templates/vue/base/src/utils/index.ts +5 -0
  168. package/templates/vue/base/src/utils/modifyComponent.tsx +43 -0
  169. package/templates/vue/base/tsconfig.app.json +25 -17
  170. package/templates/vue/base/tsconfig.base.json +29 -23
  171. package/templates/vue/base/tsconfig.json +11 -12
  172. package/templates/vue/base/tsconfig.node.json +14 -15
  173. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsc +17 -0
  174. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsc.CMD +12 -0
  175. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsc.ps1 +41 -0
  176. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsserver +17 -0
  177. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsserver.CMD +12 -0
  178. package/templates/vue/features/ant-design-vue/node_modules/.bin/tsserver.ps1 +41 -0
  179. package/templates/vue/features/ant-design-vue/src/layouts/AntDesign.vue +13 -14
  180. package/templates/vue/features/element-plus/node_modules/.bin/tsc +17 -0
  181. package/templates/vue/features/element-plus/node_modules/.bin/tsc.CMD +12 -0
  182. package/templates/vue/features/element-plus/node_modules/.bin/tsc.ps1 +41 -0
  183. package/templates/vue/features/element-plus/node_modules/.bin/tsserver +17 -0
  184. package/templates/vue/features/element-plus/node_modules/.bin/tsserver.CMD +12 -0
  185. package/templates/vue/features/element-plus/node_modules/.bin/tsserver.ps1 +41 -0
  186. package/templates/vue/features/element-plus/src/assets/styles/element/fixQiankun.scss +10 -0
  187. package/templates/vue/features/element-plus/src/assets/styles/element/index.scss +4 -2
  188. package/templates/vue/features/element-plus/src/components/SubMenu/index.ts +0 -1
  189. package/templates/vue/features/element-plus/src/components/SubMenu/src/_types/index.ts +1 -6
  190. package/templates/vue/features/element-plus/src/components/SubMenu/src/_types/props.ts +16 -11
  191. package/templates/vue/features/element-plus/src/components/SubMenu/src/index.vue +60 -24
  192. package/templates/vue/features/element-plus/src/layouts/element.vue +108 -69
  193. package/templates/vue/features/eslint/eslint.config.ts +0 -1
  194. package/templates/vue/features/eslint/node_modules/.bin/browserslist +17 -0
  195. package/templates/vue/features/eslint/node_modules/.bin/browserslist.CMD +12 -0
  196. package/templates/vue/features/eslint/node_modules/.bin/browserslist.ps1 +41 -0
  197. package/templates/vue/features/eslint/node_modules/.bin/jiti +17 -0
  198. package/templates/vue/features/eslint/node_modules/.bin/jiti.CMD +12 -0
  199. package/templates/vue/features/eslint/node_modules/.bin/jiti.ps1 +41 -0
  200. package/templates/vue/features/eslint/node_modules/.bin/tsc +17 -0
  201. package/templates/vue/features/eslint/node_modules/.bin/tsc.CMD +12 -0
  202. package/templates/vue/features/eslint/node_modules/.bin/tsc.ps1 +41 -0
  203. package/templates/vue/features/eslint/node_modules/.bin/tsserver +17 -0
  204. package/templates/vue/features/eslint/node_modules/.bin/tsserver.CMD +12 -0
  205. package/templates/vue/features/eslint/node_modules/.bin/tsserver.ps1 +41 -0
  206. package/templates/vue/features/i18n/node_modules/.bin/tsc +17 -0
  207. package/templates/vue/features/i18n/node_modules/.bin/tsc.CMD +12 -0
  208. package/templates/vue/features/i18n/node_modules/.bin/tsc.ps1 +41 -0
  209. package/templates/vue/features/i18n/node_modules/.bin/tsserver +17 -0
  210. package/templates/vue/features/i18n/node_modules/.bin/tsserver.CMD +12 -0
  211. package/templates/vue/features/i18n/node_modules/.bin/tsserver.ps1 +41 -0
  212. package/templates/vue/features/i18n/src/locales/lang/en.ts +1 -2
  213. package/templates/vue/features/i18n/src/locales/lang/es.ts +1 -2
  214. package/templates/vue/features/i18n/src/locales/lang/zh.ts +1 -2
  215. package/templates/vue/features/manualRoutes/node_modules/.bin/jiti +17 -0
  216. package/templates/vue/features/manualRoutes/node_modules/.bin/jiti.CMD +12 -0
  217. package/templates/vue/features/manualRoutes/node_modules/.bin/jiti.ps1 +41 -0
  218. package/templates/vue/features/manualRoutes/node_modules/.bin/sass +17 -0
  219. package/templates/vue/features/manualRoutes/node_modules/.bin/sass.CMD +12 -0
  220. package/templates/vue/features/manualRoutes/node_modules/.bin/sass.ps1 +41 -0
  221. package/templates/vue/features/manualRoutes/node_modules/.bin/terser +17 -0
  222. package/templates/vue/features/manualRoutes/node_modules/.bin/terser.CMD +12 -0
  223. package/templates/vue/features/manualRoutes/node_modules/.bin/terser.ps1 +41 -0
  224. package/templates/vue/features/manualRoutes/node_modules/.bin/tsc +17 -0
  225. package/templates/vue/features/manualRoutes/node_modules/.bin/tsc.CMD +12 -0
  226. package/templates/vue/features/manualRoutes/node_modules/.bin/tsc.ps1 +41 -0
  227. package/templates/vue/features/manualRoutes/node_modules/.bin/tsserver +17 -0
  228. package/templates/vue/features/manualRoutes/node_modules/.bin/tsserver.CMD +12 -0
  229. package/templates/vue/features/manualRoutes/node_modules/.bin/tsserver.ps1 +41 -0
  230. package/templates/vue/features/manualRoutes/node_modules/.bin/tsx +17 -0
  231. package/templates/vue/features/manualRoutes/node_modules/.bin/tsx.CMD +12 -0
  232. package/templates/vue/features/manualRoutes/node_modules/.bin/tsx.ps1 +41 -0
  233. package/templates/vue/features/manualRoutes/node_modules/.bin/vite +17 -0
  234. package/templates/vue/features/manualRoutes/node_modules/.bin/vite.CMD +12 -0
  235. package/templates/vue/features/manualRoutes/node_modules/.bin/vite.ps1 +41 -0
  236. package/templates/vue/features/manualRoutes/node_modules/.bin/yaml +17 -0
  237. package/templates/vue/features/manualRoutes/node_modules/.bin/yaml.CMD +12 -0
  238. package/templates/vue/features/manualRoutes/node_modules/.bin/yaml.ps1 +41 -0
  239. package/templates/vue/features/manualRoutes/package.json +7 -0
  240. package/templates/vue/features/manualRoutes/src/router/index.ts +45 -0
  241. package/templates/vue/features/manualRoutes/src/router/layout.vue +12 -7
  242. package/templates/vue/features/manualRoutes/src/stores/index.ts +6 -0
  243. package/templates/vue/features/manualRoutes/src/stores/modules/system.ts +51 -0
  244. package/templates/vue/features/manualRoutes/src/stores/modules/user.ts +41 -0
  245. package/templates/vue/features/pageRoutes/node_modules/.bin/jiti +17 -0
  246. package/templates/vue/features/pageRoutes/node_modules/.bin/jiti.CMD +12 -0
  247. package/templates/vue/features/pageRoutes/node_modules/.bin/jiti.ps1 +41 -0
  248. package/templates/vue/features/pageRoutes/node_modules/.bin/sass +17 -0
  249. package/templates/vue/features/pageRoutes/node_modules/.bin/sass.CMD +12 -0
  250. package/templates/vue/features/pageRoutes/node_modules/.bin/sass.ps1 +41 -0
  251. package/templates/vue/features/pageRoutes/node_modules/.bin/terser +17 -0
  252. package/templates/vue/features/pageRoutes/node_modules/.bin/terser.CMD +12 -0
  253. package/templates/vue/features/pageRoutes/node_modules/.bin/terser.ps1 +41 -0
  254. package/templates/vue/features/pageRoutes/node_modules/.bin/tsc +17 -0
  255. package/templates/vue/features/pageRoutes/node_modules/.bin/tsc.CMD +12 -0
  256. package/templates/vue/features/pageRoutes/node_modules/.bin/tsc.ps1 +41 -0
  257. package/templates/vue/features/pageRoutes/node_modules/.bin/tsserver +17 -0
  258. package/templates/vue/features/pageRoutes/node_modules/.bin/tsserver.CMD +12 -0
  259. package/templates/vue/features/pageRoutes/node_modules/.bin/tsserver.ps1 +41 -0
  260. package/templates/vue/features/pageRoutes/node_modules/.bin/tsx +17 -0
  261. package/templates/vue/features/pageRoutes/node_modules/.bin/tsx.CMD +12 -0
  262. package/templates/vue/features/pageRoutes/node_modules/.bin/tsx.ps1 +41 -0
  263. package/templates/vue/features/pageRoutes/node_modules/.bin/vite +17 -0
  264. package/templates/vue/features/pageRoutes/node_modules/.bin/vite.CMD +12 -0
  265. package/templates/vue/features/pageRoutes/node_modules/.bin/vite.ps1 +41 -0
  266. package/templates/vue/features/pageRoutes/node_modules/.bin/yaml +17 -0
  267. package/templates/vue/features/pageRoutes/node_modules/.bin/yaml.CMD +12 -0
  268. package/templates/vue/features/pageRoutes/node_modules/.bin/yaml.ps1 +41 -0
  269. package/templates/vue/features/pageRoutes/package.json +4 -1
  270. package/templates/vue/features/pageRoutes/src/router/index.ts +46 -0
  271. package/templates/vue/features/pageRoutes/src/router/layout.vue +15 -0
  272. package/templates/vue/features/pageRoutes/src/stores/index.ts +6 -0
  273. package/templates/vue/features/pageRoutes/src/stores/modules/system.ts +51 -0
  274. package/templates/vue/features/pageRoutes/src/stores/modules/user.ts +41 -0
  275. package/templates/vue/features/sentry/node_modules/.bin/tsc +17 -0
  276. package/templates/vue/features/sentry/node_modules/.bin/tsc.CMD +12 -0
  277. package/templates/vue/features/sentry/node_modules/.bin/tsc.ps1 +41 -0
  278. package/templates/vue/features/sentry/node_modules/.bin/tsserver +17 -0
  279. package/templates/vue/features/sentry/node_modules/.bin/tsserver.CMD +12 -0
  280. package/templates/vue/features/sentry/node_modules/.bin/tsserver.ps1 +41 -0
  281. package/templates/vue/features/sentry/package.json +3 -1
  282. package/templates/vue/features/sentry/src/stores/index.ts +13 -0
  283. package/templates/vue/features/sentry/src/utils/sentry.ts +0 -1
  284. package/templates/react/features/qiankun/package.json +0 -6
  285. package/templates/vue/base/src/router/index.ts.ejs +0 -36
  286. package/templates/vue/features/pinia/package.json +0 -7
  287. package/templates/vue/features/pinia/src/stores/index.ts +0 -16
  288. package/templates/vue/features/pinia/src/stores/system.ts +0 -60
  289. package/templates/vue/features/pinia/src/stores/user.ts +0 -56
  290. package/templates/vue/features/qiankun/package.json +0 -5
  291. package/templates/vue/features/qiankun/src/qiankun/index.ts +0 -75
  292. package/templates/vue/features/router/package.json +0 -5
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
17
+ fi
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@sentry/vue": "^9.27.0",
4
- "@sentry/vite-plugin": "^3.5.0"
4
+ "@sentry/vite-plugin": "^3.5.0",
5
+ "pinia": "^2.2.7",
6
+ "pinia-plugin-persistedstate": "^3.2.1"
5
7
  }
6
8
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Pinia Store 配置
3
+ * 配置 Pinia 状态管理,集成持久化插件和 Sentry 监控插件
4
+ */
5
+
6
+ import { createSentryPiniaPlugin } from '@sentry/vue'
7
+ import { createPinia } from 'pinia'
8
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
9
+
10
+ const store = createPinia()
11
+ store.use(piniaPluginPersistedstate)
12
+ store.use(createSentryPiniaPlugin())
13
+ export { store }
@@ -42,4 +42,3 @@ export function initSentry(app: App, router: Router, config: SentryConfig): void
42
42
  replaysOnErrorSampleRate: 1.0,
43
43
  })
44
44
  }
45
-
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "vite-plugin-qiankun": "^1.0.15"
4
- }
5
- }
6
-
@@ -1,36 +0,0 @@
1
- /**
2
- * 路由配置
3
- */
4
-
5
- <% if (qiankun) { -%>
6
- import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'
7
- <% } -%>
8
- import { createRouter, createWebHistory } from 'vue-router'
9
- <% if (routeMode === 'file-system') { -%>
10
- import routes from '~pages'
11
- <% } else { -%>
12
- import { routes } from './routes'
13
- <% } -%>
14
-
15
- /**
16
- * 获取路由实例
17
- * @param props 路由属性
18
- * @returns 路由实例
19
- */
20
- export default function getRouter(props: Record<string, unknown> = {}) {
21
- const router = createRouter({
22
- history: createWebHistory(
23
- <% if (qiankun) { -%>
24
- qiankunWindow.__POWERED_BY_QIANKUN__
25
- ? '/sub-app/'
26
- : import.meta.env.BASE_URL,
27
- <% } else { -%>
28
- import.meta.env.BASE_URL,
29
- <% } -%>
30
- ),
31
- routes,
32
- })
33
-
34
- return router
35
- }
36
-
@@ -1,7 +0,0 @@
1
- {
2
- "dependencies": {
3
- "pinia": "^2.3.0",
4
- "pinia-plugin-persistedstate": "^3.2.1",
5
- "vue": "latest"
6
- }
7
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Pinia 状态管理配置
3
- */
4
-
5
- import { createPinia } from 'pinia'
6
- import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
7
-
8
- export const store = createPinia()
9
-
10
- // 使用持久化插件
11
- store.use(piniaPluginPersistedstate)
12
-
13
- // 导出 store 模块
14
- export * from './user'
15
- export * from './system'
16
-
@@ -1,60 +0,0 @@
1
- /**
2
- * 系统状态管理
3
- */
4
-
5
- import { defineStore } from 'pinia'
6
- import { ref } from 'vue'
7
-
8
- export type ThemeType = 'light' | 'dark'
9
-
10
- export const useSystemStore = defineStore(
11
- 'system',
12
- () => {
13
- /** 当前主题 */
14
- const theme = ref<ThemeType>('light')
15
-
16
- /** 当前语言 */
17
- const language = ref<string>('zh')
18
-
19
- /** 侧边栏折叠状态 */
20
- const sidebarCollapsed = ref<boolean>(false)
21
-
22
- /**
23
- * 设置主题
24
- * @param value 主题类型('light' 或 'dark')
25
- */
26
- function setTheme(value: ThemeType): void {
27
- theme.value = value
28
- }
29
-
30
- /**
31
- * 设置语言
32
- * @param value 语言代码(如 'zh', 'en', 'es')
33
- */
34
- function setLanguage(value: string): void {
35
- language.value = value
36
- }
37
-
38
- /**
39
- * 切换侧边栏折叠状态
40
- */
41
- function toggleSidebar(): void {
42
- sidebarCollapsed.value = !sidebarCollapsed.value
43
- }
44
-
45
- return {
46
- theme,
47
- language,
48
- sidebarCollapsed,
49
- setTheme,
50
- setLanguage,
51
- toggleSidebar,
52
- }
53
- },
54
- {
55
- persist: {
56
- pick: ['theme', 'language', 'sidebarCollapsed'],
57
- },
58
- },
59
- )
60
-
@@ -1,56 +0,0 @@
1
- /**
2
- * 用户状态管理
3
- */
4
-
5
- import type { UserInfo } from '@/apis/types'
6
- import { defineStore } from 'pinia'
7
- import { ref } from 'vue'
8
-
9
- export const useUserStore = defineStore(
10
- 'user',
11
- () => {
12
- /** 用户信息 */
13
- const userInfo = ref<UserInfo | null>(null)
14
-
15
- /** token */
16
- const token = ref<string>('')
17
-
18
- /**
19
- * 设置用户信息
20
- * @param info 用户信息,为 null 时清空
21
- */
22
- function setUserInfo(info: UserInfo | null): void {
23
- userInfo.value = info
24
- }
25
-
26
- /**
27
- * 设置 token
28
- * @param value token 值
29
- */
30
- function setToken(value: string): void {
31
- token.value = value
32
- }
33
-
34
- /**
35
- * 清除用户信息
36
- * 清空用户信息和 token
37
- */
38
- function clearUser(): void {
39
- userInfo.value = null
40
- token.value = ''
41
- }
42
-
43
- return {
44
- userInfo,
45
- token,
46
- setUserInfo,
47
- setToken,
48
- clearUser,
49
- }
50
- },
51
- {
52
- persist: {
53
- pick: ['token'],
54
- },
55
- },
56
- )
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "vite-plugin-qiankun": "^1.0.15"
4
- }
5
- }
@@ -1,75 +0,0 @@
1
- import type { App } from 'vue'
2
- import type { Router } from 'vue-router'
3
- import {
4
- renderWithQiankun,
5
- qiankunWindow,
6
- } from 'vite-plugin-qiankun/dist/helper'
7
-
8
- let app: App | null = null
9
- let router: Router | null = null
10
-
11
- /**
12
- * Qiankun 微前端 Props 接口
13
- */
14
- interface QiankunProps {
15
- /** 容器元素(可选) */
16
- container?: Element
17
- /** 其他自定义属性 */
18
- [key: string]: unknown
19
- }
20
-
21
- /**
22
- * Qiankun 渲染选项接口
23
- */
24
- interface RenderOptions {
25
- /** 创建 Vue 应用实例的函数 */
26
- createApp: () => App
27
- /** 创建 Vue Router 实例的函数 */
28
- createRouter: (qiankunName?: string) => Router
29
- /** 挂载应用实例的函数 */
30
- mountApp: (app: App, router: Router, container: string | Element) => void
31
- }
32
-
33
- /**
34
- * 设置 Qiankun 微前端
35
- * @param options 渲染选项
36
- */
37
- export function setupQiankun(options: RenderOptions): void {
38
- const { createApp, createRouter, mountApp } = options
39
-
40
- renderWithQiankun({
41
- mount(props: QiankunProps) {
42
- app = createApp()
43
- const qiankunName = qiankunWindow.__POWERED_BY_QIANKUN__
44
- ? (qiankunWindow as { __INJECTED_PUBLIC_PATH_BY_QIANKUN__?: string }).__INJECTED_PUBLIC_PATH_BY_QIANKUN__?.split('/')[1]
45
- : undefined
46
- router = createRouter(qiankunName)
47
- const container = props.container
48
- ? props.container.querySelector('#app')!
49
- : '#app'
50
- mountApp(app, router, container)
51
- },
52
- bootstrap() {
53
- console.log('[Qiankun] bootstrap')
54
- },
55
- unmount() {
56
- if (app) {
57
- app.unmount()
58
- app = null
59
- router = null
60
- }
61
- },
62
- update() {
63
- console.log('[Qiankun] update')
64
- },
65
- })
66
- }
67
-
68
- /**
69
- * 判断是否运行在 Qiankun 微前端环境中
70
- * @returns 是否在 Qiankun 环境中
71
- */
72
- export function isQiankun(): boolean {
73
- return qiankunWindow.__POWERED_BY_QIANKUN__ || false
74
- }
75
-
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "vue-router": "^4.4.5"
4
- }
5
- }