@moluoxixi/create-app 2.0.4 → 2.0.403

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 (264) hide show
  1. package/LICENSE.txt +21 -21
  2. package/README.md +129 -129
  3. package/dist/commands/create.d.ts +2 -1
  4. package/dist/commands/create.js +12 -8
  5. package/dist/commands/index.d.ts +1 -2
  6. package/dist/commands/index.js +1 -2
  7. package/dist/constants/index.d.ts +17 -0
  8. package/dist/constants/index.js +17 -0
  9. package/dist/generators/index.d.ts +3 -4
  10. package/dist/generators/index.js +3 -4
  11. package/dist/generators/project.d.ts +3 -2
  12. package/dist/generators/project.js +5 -4
  13. package/dist/generators/react.d.ts +4 -2
  14. package/dist/generators/react.js +10 -30
  15. package/dist/generators/vue.d.ts +4 -2
  16. package/dist/generators/vue.js +10 -31
  17. package/dist/index.d.ts +0 -1
  18. package/dist/index.js +21 -3
  19. package/dist/test.d.ts +5 -2
  20. package/dist/test.js +252 -206
  21. package/dist/types/ejs.d.ts +0 -1
  22. package/dist/types/ejs.js +0 -1
  23. package/dist/types/features.d.ts +1 -2
  24. package/dist/types/features.js +1 -1
  25. package/dist/types/index.d.ts +2 -4
  26. package/dist/types/index.js +2 -4
  27. package/dist/types/packageJson.d.ts +24 -0
  28. package/dist/types/packageJson.js +4 -0
  29. package/dist/types/viteConfig.d.ts +11 -9
  30. package/dist/types/viteConfig.js +0 -1
  31. package/dist/utils/deepMerge.d.ts +3 -1
  32. package/dist/utils/deepMerge.js +8 -1
  33. package/dist/utils/ejs.d.ts +3 -2
  34. package/dist/utils/ejs.js +2 -1
  35. package/dist/utils/featureMapping.d.ts +44 -0
  36. package/dist/utils/featureMapping.js +119 -0
  37. package/dist/utils/file.d.ts +22 -2
  38. package/dist/utils/file.js +35 -2
  39. package/dist/utils/generateFrameworkProject.d.ts +27 -0
  40. package/dist/utils/generateFrameworkProject.js +47 -0
  41. package/dist/utils/index.d.ts +11 -9
  42. package/dist/utils/index.js +11 -9
  43. package/dist/utils/install.d.ts +7 -4
  44. package/dist/utils/install.js +55 -12
  45. package/dist/utils/npmConfig.d.ts +15 -0
  46. package/dist/utils/npmConfig.js +79 -0
  47. package/dist/utils/prompts.d.ts +3 -2
  48. package/dist/utils/prompts.js +51 -5
  49. package/dist/utils/renderFeatures.d.ts +3 -2
  50. package/dist/utils/renderFeatures.js +41 -37
  51. package/dist/utils/renderTemplate.d.ts +13 -1
  52. package/dist/utils/renderTemplate.js +128 -61
  53. package/dist/utils/sortDependencies.d.ts +3 -2
  54. package/dist/utils/sortDependencies.js +3 -2
  55. package/dist/utils/viteConfigRender.d.ts +11 -14
  56. package/dist/utils/viteConfigRender.js +10 -173
  57. package/package.json +4 -2
  58. package/templates/common/base/.env +7 -7
  59. package/templates/common/base/.env.development +5 -5
  60. package/templates/common/base/.env.production +5 -5
  61. package/templates/common/base/package.json +23 -27
  62. package/templates/common/base/scripts/build.mts +37 -31
  63. package/templates/common/base/src/apis/index.ts +8 -8
  64. package/templates/common/base/src/apis/request.ts +43 -43
  65. package/templates/common/base/src/apis/services/example.ts +61 -40
  66. package/templates/common/base/src/apis/services/user.ts +33 -23
  67. package/templates/common/base/src/apis/types/common.ts +43 -28
  68. package/templates/common/base/src/apis/types/example.ts +15 -3
  69. package/templates/common/base/src/apis/types/index.ts +7 -7
  70. package/templates/common/base/src/apis/types/user.ts +39 -24
  71. package/templates/common/base/src/assets/fonts/index.css +7 -7
  72. package/templates/common/base/src/assets/styles/base.scss +72 -72
  73. package/templates/common/base/src/assets/styles/custom.scss +7 -7
  74. package/templates/common/base/src/assets/styles/tailwind.scss +6 -6
  75. package/templates/common/base/src/constants/index.ts +29 -29
  76. package/templates/common/base/src/utils/index.ts +88 -83
  77. package/templates/{vue/base/vite.config.ts → common/base/vite.config.ts.ejs} +28 -11
  78. package/templates/common/features/husky/.cz-config.cjs +35 -35
  79. package/templates/common/features/husky/commitlint.config.ts +32 -32
  80. package/templates/common/features/husky/node_modules/.bin/commitizen +17 -0
  81. package/templates/common/features/husky/node_modules/.bin/commitizen.CMD +12 -0
  82. package/templates/common/features/husky/node_modules/.bin/commitizen.ps1 +41 -0
  83. package/templates/common/features/husky/node_modules/.bin/commitlint +17 -0
  84. package/templates/common/features/husky/node_modules/.bin/commitlint.CMD +12 -0
  85. package/templates/common/features/husky/node_modules/.bin/commitlint.ps1 +41 -0
  86. package/templates/common/features/husky/node_modules/.bin/cz +17 -0
  87. package/templates/common/features/husky/node_modules/.bin/cz-cust +17 -0
  88. package/templates/common/features/husky/node_modules/.bin/cz-cust.CMD +12 -0
  89. package/templates/common/features/husky/node_modules/.bin/cz-cust.ps1 +41 -0
  90. package/templates/common/features/husky/node_modules/.bin/cz-customizable +17 -0
  91. package/templates/common/features/husky/node_modules/.bin/cz-customizable.CMD +12 -0
  92. package/templates/common/features/husky/node_modules/.bin/cz-customizable.ps1 +41 -0
  93. package/templates/common/features/husky/node_modules/.bin/cz.CMD +12 -0
  94. package/templates/common/features/husky/node_modules/.bin/cz.ps1 +41 -0
  95. package/templates/common/features/husky/node_modules/.bin/git-cz +17 -0
  96. package/templates/common/features/husky/node_modules/.bin/git-cz.CMD +12 -0
  97. package/templates/common/features/husky/node_modules/.bin/git-cz.ps1 +41 -0
  98. package/templates/common/features/husky/node_modules/.bin/husky +17 -0
  99. package/templates/common/features/husky/node_modules/.bin/husky.CMD +12 -0
  100. package/templates/common/features/husky/node_modules/.bin/husky.ps1 +41 -0
  101. package/templates/common/features/husky/node_modules/.bin/lint-staged +17 -0
  102. package/templates/common/features/husky/node_modules/.bin/lint-staged.CMD +12 -0
  103. package/templates/common/features/husky/node_modules/.bin/lint-staged.ps1 +41 -0
  104. package/templates/common/features/husky/package.json +6 -6
  105. package/templates/react/base/env.d.ts +19 -19
  106. package/templates/react/base/index.html +14 -14
  107. package/templates/react/base/node_modules/.bin/vite +17 -0
  108. package/templates/react/base/node_modules/.bin/vite.CMD +12 -0
  109. package/templates/react/base/node_modules/.bin/vite.ps1 +41 -0
  110. package/templates/react/base/package.json +18 -15
  111. package/templates/react/base/src/App.tsx +18 -18
  112. package/templates/react/base/src/assets/styles/main.scss +8 -8
  113. package/templates/react/base/src/main.tsx.ejs +51 -6
  114. package/templates/react/base/src/pages/about/index.tsx +14 -14
  115. package/templates/react/base/src/pages/home/index.tsx +14 -14
  116. package/templates/react/base/tsconfig.app.json +17 -17
  117. package/templates/react/base/tsconfig.base.json +23 -23
  118. package/templates/react/base/tsconfig.json +12 -12
  119. package/templates/react/base/tsconfig.node.json +15 -15
  120. package/templates/react/features/ant-design/package.json +6 -7
  121. package/templates/react/features/eslint/node_modules/.bin/eslint +17 -0
  122. package/templates/react/features/eslint/node_modules/.bin/eslint.CMD +12 -0
  123. package/templates/react/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
  124. package/templates/react/features/eslint/package.json +3 -3
  125. package/templates/react/features/i18n/package.json +6 -7
  126. package/templates/react/features/i18n/src/locales/index.ts +7 -0
  127. package/templates/{common/base → react/features/i18n}/src/locales/lang/en.ts +30 -30
  128. package/templates/{common/base → react/features/i18n}/src/locales/lang/es.ts +30 -30
  129. package/templates/{common/base → react/features/i18n}/src/locales/lang/zh.ts +30 -30
  130. package/templates/react/features/manualRoutes/src/router/routes.tsx +13 -0
  131. package/templates/react/features/pageRoutes/package.json +1 -2
  132. package/templates/react/features/qiankun/package.json +6 -0
  133. package/templates/react/features/qiankun/src/qiankun/index.ts +80 -0
  134. package/templates/react/features/router/package.json +1 -1
  135. package/templates/react/features/sentry/package.json +6 -7
  136. package/templates/react/features/sentry/src/utils/sentry.ts +10 -0
  137. package/templates/react/features/zustand/package.json +1 -1
  138. package/templates/react/features/zustand/src/stores/user.ts +42 -6
  139. package/templates/react/features/zustand/src/types/stores.ts +8 -1
  140. package/templates/vue/base/env.d.ts +27 -27
  141. package/templates/vue/base/index.html +14 -14
  142. package/templates/vue/base/node_modules/.bin/vite +17 -0
  143. package/templates/vue/base/node_modules/.bin/vite.CMD +12 -0
  144. package/templates/vue/base/node_modules/.bin/vite.ps1 +41 -0
  145. package/templates/vue/base/node_modules/.bin/vue-tsc +17 -0
  146. package/templates/vue/base/node_modules/.bin/vue-tsc.CMD +12 -0
  147. package/templates/vue/base/node_modules/.bin/vue-tsc.ps1 +41 -0
  148. package/templates/vue/base/package.json +16 -13
  149. package/templates/vue/base/src/App.vue +13 -13
  150. package/templates/vue/base/src/assets/styles/main.scss +9 -9
  151. package/templates/vue/base/src/directives/index.ts +36 -36
  152. package/templates/vue/base/src/layouts/index.ts +5 -7
  153. package/templates/vue/base/src/main.ts.ejs +9 -25
  154. package/templates/vue/base/src/pages/about/index.vue +31 -31
  155. package/templates/vue/base/src/pages/home/index.vue +31 -31
  156. package/templates/vue/base/src/router/index.ts.ejs +10 -13
  157. package/templates/vue/base/tsconfig.app.json +17 -17
  158. package/templates/vue/base/tsconfig.base.json +23 -23
  159. package/templates/vue/base/tsconfig.json +12 -12
  160. package/templates/vue/base/tsconfig.node.json +15 -15
  161. package/templates/vue/features/ant-design-vue/package.json +6 -7
  162. package/templates/vue/{base → features/ant-design-vue}/src/layouts/AntDesign.vue +86 -86
  163. package/templates/vue/features/element-plus/package.json +6 -7
  164. package/templates/vue/{base → features/element-plus}/src/assets/styles/element/index.scss +27 -27
  165. package/templates/vue/features/element-plus/src/components/SubMenu/index.ts +9 -0
  166. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/index.ts +6 -6
  167. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/props.ts +11 -11
  168. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/index.vue +24 -24
  169. package/templates/vue/{base → features/element-plus}/src/layouts/element.vue +81 -81
  170. package/templates/vue/features/eslint/node_modules/.bin/eslint +17 -0
  171. package/templates/vue/features/eslint/node_modules/.bin/eslint.CMD +12 -0
  172. package/templates/vue/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
  173. package/templates/vue/features/eslint/package.json +3 -3
  174. package/templates/vue/features/i18n/package.json +5 -5
  175. package/templates/vue/features/i18n/src/locales/index.ts +23 -16
  176. package/templates/vue/features/i18n/src/locales/lang/en.ts +30 -0
  177. package/templates/vue/features/i18n/src/locales/lang/es.ts +30 -0
  178. package/templates/vue/features/i18n/src/locales/lang/zh.ts +30 -0
  179. package/templates/vue/features/manualRoutes/src/router/routes.ts +35 -27
  180. package/templates/vue/features/pageRoutes/package.json +5 -5
  181. package/templates/vue/features/pinia/package.json +3 -2
  182. package/templates/vue/features/pinia/src/stores/index.ts +8 -0
  183. package/templates/vue/features/pinia/src/stores/system.ts +60 -0
  184. package/templates/vue/features/pinia/src/stores/user.ts +33 -13
  185. package/templates/vue/features/qiankun/package.json +5 -5
  186. package/templates/vue/features/qiankun/src/qiankun/index.ts +19 -0
  187. package/templates/vue/features/router/package.json +1 -1
  188. package/templates/vue/features/sentry/package.json +6 -6
  189. package/templates/vue/features/sentry/src/utils/sentry.ts +12 -0
  190. package/dist/commands/create.d.ts.map +0 -1
  191. package/dist/commands/create.js.map +0 -1
  192. package/dist/commands/index.d.ts.map +0 -1
  193. package/dist/commands/index.js.map +0 -1
  194. package/dist/generators/index.d.ts.map +0 -1
  195. package/dist/generators/index.js.map +0 -1
  196. package/dist/generators/project.d.ts.map +0 -1
  197. package/dist/generators/project.js.map +0 -1
  198. package/dist/generators/react.d.ts.map +0 -1
  199. package/dist/generators/react.js.map +0 -1
  200. package/dist/generators/vue.d.ts.map +0 -1
  201. package/dist/generators/vue.js.map +0 -1
  202. package/dist/index.d.ts.map +0 -1
  203. package/dist/index.js.map +0 -1
  204. package/dist/test.d.ts.map +0 -1
  205. package/dist/test.js.map +0 -1
  206. package/dist/types/ejs.d.ts.map +0 -1
  207. package/dist/types/ejs.js.map +0 -1
  208. package/dist/types/features.d.ts.map +0 -1
  209. package/dist/types/features.js.map +0 -1
  210. package/dist/types/index.d.ts.map +0 -1
  211. package/dist/types/index.js.map +0 -1
  212. package/dist/types/viteConfig.d.ts.map +0 -1
  213. package/dist/types/viteConfig.js.map +0 -1
  214. package/dist/utils/deepMerge.d.ts.map +0 -1
  215. package/dist/utils/deepMerge.js.map +0 -1
  216. package/dist/utils/ejs.d.ts.map +0 -1
  217. package/dist/utils/ejs.js.map +0 -1
  218. package/dist/utils/file.d.ts.map +0 -1
  219. package/dist/utils/file.js.map +0 -1
  220. package/dist/utils/index.d.ts.map +0 -1
  221. package/dist/utils/index.js.map +0 -1
  222. package/dist/utils/install.d.ts.map +0 -1
  223. package/dist/utils/install.js.map +0 -1
  224. package/dist/utils/prompts.d.ts.map +0 -1
  225. package/dist/utils/prompts.js.map +0 -1
  226. package/dist/utils/renderFeatures.d.ts.map +0 -1
  227. package/dist/utils/renderFeatures.js.map +0 -1
  228. package/dist/utils/renderTemplate.d.ts.map +0 -1
  229. package/dist/utils/renderTemplate.js.map +0 -1
  230. package/dist/utils/sortDependencies.d.ts.map +0 -1
  231. package/dist/utils/sortDependencies.js.map +0 -1
  232. package/dist/utils/viteConfigRender.d.ts.map +0 -1
  233. package/dist/utils/viteConfigRender.js.map +0 -1
  234. package/templates/common/base/pnpm-workspace.yaml +0 -37
  235. package/templates/common/features/husky/pnpm-workspace.yaml +0 -9
  236. package/templates/react/base/pnpm-workspace.yaml +0 -9
  237. package/templates/react/base/src/stores/user.ts +0 -39
  238. package/templates/react/base/vite.config.ts +0 -52
  239. package/templates/react/features/ant-design/pnpm-workspace.yaml +0 -5
  240. package/templates/react/features/eslint/pnpm-workspace.yaml +0 -6
  241. package/templates/react/features/i18n/pnpm-workspace.yaml +0 -5
  242. package/templates/react/features/pageRoutes/pnpm-workspace.yaml +0 -4
  243. package/templates/react/features/pageRoutes/vite.config.data.ts +0 -10
  244. package/templates/react/features/router/pnpm-workspace.yaml +0 -3
  245. package/templates/react/features/sentry/pnpm-workspace.yaml +0 -5
  246. package/templates/react/features/sentry/vite.config.data.ts +0 -23
  247. package/templates/react/features/zustand/pnpm-workspace.yaml +0 -3
  248. package/templates/vue/base/pnpm-workspace.yaml +0 -6
  249. package/templates/vue/base/src/components/SubMenu/index.ts +0 -9
  250. package/templates/vue/base/src/stores/index.ts +0 -16
  251. package/templates/vue/base/src/stores/modules/system.ts +0 -52
  252. package/templates/vue/base/src/stores/modules/user.ts +0 -48
  253. package/templates/vue/features/ant-design-vue/pnpm-workspace.yaml +0 -5
  254. package/templates/vue/features/element-plus/pnpm-workspace.yaml +0 -5
  255. package/templates/vue/features/element-plus/vite.config.data.ts +0 -15
  256. package/templates/vue/features/eslint/pnpm-workspace.yaml +0 -6
  257. package/templates/vue/features/i18n/pnpm-workspace.yaml +0 -3
  258. package/templates/vue/features/pageRoutes/pnpm-workspace.yaml +0 -4
  259. package/templates/vue/features/pageRoutes/vite.config.data.ts +0 -9
  260. package/templates/vue/features/pinia/pnpm-workspace.yaml +0 -4
  261. package/templates/vue/features/qiankun/pnpm-workspace.yaml +0 -3
  262. package/templates/vue/features/router/pnpm-workspace.yaml +0 -3
  263. package/templates/vue/features/sentry/pnpm-workspace.yaml +0 -4
  264. package/templates/vue/features/sentry/vite.config.data.ts +0 -23
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  <% if (qiankun) { -%>
7
- import type { QiankunProps } from 'vite-plugin-qiankun/dist/helper'
8
7
  import { qiankunWindow, renderWithQiankun } from 'vite-plugin-qiankun/dist/helper'
9
8
  <% } -%>
10
9
  import { createApp } from 'vue'
@@ -26,11 +25,14 @@ import '@/assets/styles/element/index.scss'
26
25
  import '@/assets/styles/main.scss'
27
26
  import '@/assets/fonts/index.css'
28
27
 
29
- <% if (qiankun) { -%>
30
28
  let app: ReturnType<typeof createApp> | null = null
31
29
 
32
- async function render(props: QiankunProps = {}): Promise<void> {
33
- const { container } = props
30
+ /**
31
+ * 渲染应用
32
+ * @param props 渲染属性
33
+ */
34
+ async function render(props: Record<string, unknown> = {}): Promise<void> {
35
+ const { container } = props as { container?: Element }
34
36
  app = createApp(App)
35
37
 
36
38
  directives(app)
@@ -59,12 +61,13 @@ async function render(props: QiankunProps = {}): Promise<void> {
59
61
  }
60
62
  }
61
63
 
64
+ <% if (qiankun) { -%>
62
65
  if (!qiankunWindow.__POWERED_BY_QIANKUN__) {
63
66
  render({})
64
67
  }
65
68
  else {
66
69
  renderWithQiankun({
67
- async mount(props: QiankunProps) {
70
+ async mount(props: Record<string, unknown>) {
68
71
  await render(props)
69
72
  },
70
73
  bootstrap() {},
@@ -76,25 +79,6 @@ else {
76
79
  })
77
80
  }
78
81
  <% } else { -%>
79
- const app = createApp(App)
80
-
81
- directives(app)
82
- const router = getRouter({})
83
-
84
- <% if (sentry) { -%>
85
- initSentry(app, router, {
86
- dsn: import.meta.env.VITE_SENTRY_DSN,
87
- environment: import.meta.env.MODE,
88
- })
89
-
90
- <% } -%>
91
- app.use(store)
92
- <% if (i18n) { -%>
93
- app.use(i18n)
94
- <% } -%>
95
- app.use(router)
96
- app.config.warnHandler = () => null
97
-
98
- app.mount('#app')
82
+ render({})
99
83
  <% } -%>
100
84
 
@@ -1,31 +1,31 @@
1
- <script setup lang="ts">
2
- /**
3
- * 关于页面
4
- */
5
- </script>
6
-
7
- <template>
8
- <div class="about-page">
9
- <h1>关于</h1>
10
- <p>这是关于页面</p>
11
- </div>
12
- </template>
13
-
14
- <style scoped lang="scss">
15
- .about-page {
16
- padding: 24px;
17
- text-align: center;
18
-
19
- h1 {
20
- font-size: 32px;
21
- margin-bottom: 16px;
22
- color: #333;
23
- }
24
-
25
- p {
26
- font-size: 16px;
27
- color: #666;
28
- }
29
- }
30
- </style>
31
-
1
+ <script setup lang="ts">
2
+ /**
3
+ * 关于页面
4
+ */
5
+ </script>
6
+
7
+ <template>
8
+ <div class="about-page">
9
+ <h1>关于</h1>
10
+ <p>这是关于页面</p>
11
+ </div>
12
+ </template>
13
+
14
+ <style scoped lang="scss">
15
+ .about-page {
16
+ padding: 24px;
17
+ text-align: center;
18
+
19
+ h1 {
20
+ font-size: 32px;
21
+ margin-bottom: 16px;
22
+ color: #333;
23
+ }
24
+
25
+ p {
26
+ font-size: 16px;
27
+ color: #666;
28
+ }
29
+ }
30
+ </style>
31
+
@@ -1,31 +1,31 @@
1
- <script setup lang="ts">
2
- /**
3
- * 首页
4
- */
5
- </script>
6
-
7
- <template>
8
- <div class="home-page">
9
- <h1>欢迎使用 Vue Template</h1>
10
- <p>这是一个基于 Vue 3 + Vite + TypeScript 的项目模板</p>
11
- </div>
12
- </template>
13
-
14
- <style scoped lang="scss">
15
- .home-page {
16
- padding: 24px;
17
- text-align: center;
18
-
19
- h1 {
20
- font-size: 32px;
21
- margin-bottom: 16px;
22
- color: #333;
23
- }
24
-
25
- p {
26
- font-size: 16px;
27
- color: #666;
28
- }
29
- }
30
- </style>
31
-
1
+ <script setup lang="ts">
2
+ /**
3
+ * 首页
4
+ */
5
+ </script>
6
+
7
+ <template>
8
+ <div class="home-page">
9
+ <h1>欢迎使用 Vue Template</h1>
10
+ <p>这是一个基于 Vue 3 + Vite + TypeScript 的项目模板</p>
11
+ </div>
12
+ </template>
13
+
14
+ <style scoped lang="scss">
15
+ .home-page {
16
+ padding: 24px;
17
+ text-align: center;
18
+
19
+ h1 {
20
+ font-size: 32px;
21
+ margin-bottom: 16px;
22
+ color: #333;
23
+ }
24
+
25
+ p {
26
+ font-size: 16px;
27
+ color: #666;
28
+ }
29
+ }
30
+ </style>
31
+
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  <% if (qiankun) { -%>
6
- import type { QiankunProps } from 'vite-plugin-qiankun/dist/helper'
7
6
  import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'
8
7
  <% } -%>
9
8
  import { createRouter, createWebHistory } from 'vue-router'
@@ -13,27 +12,25 @@ import routes from '~pages'
13
12
  import { routes } from './routes'
14
13
  <% } -%>
15
14
 
16
- <% if (qiankun) { -%>
17
- export default function getRouter(props: QiankunProps = {}) {
15
+ /**
16
+ * 获取路由实例
17
+ * @param props 路由属性
18
+ * @returns 路由实例
19
+ */
20
+ export default function getRouter(props: Record<string, unknown> = {}) {
18
21
  const router = createRouter({
19
22
  history: createWebHistory(
23
+ <% if (qiankun) { -%>
20
24
  qiankunWindow.__POWERED_BY_QIANKUN__
21
25
  ? '/sub-app/'
22
26
  : import.meta.env.BASE_URL,
23
- ),
24
- routes,
25
- })
26
-
27
- return router
28
- }
29
27
  <% } else { -%>
30
- export default function getRouter(_props: Record<string, unknown> = {}) {
31
- const router = createRouter({
32
- history: createWebHistory(import.meta.env.BASE_URL),
28
+ import.meta.env.BASE_URL,
29
+ <% } -%>
30
+ ),
33
31
  routes,
34
32
  })
35
33
 
36
34
  return router
37
35
  }
38
- <% } -%>
39
36
 
@@ -1,17 +1,17 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
6
- "baseUrl": ".",
7
- "paths": {
8
- "@/*": ["./src/*"]
9
- }
10
- },
11
- "include": [
12
- "env.d.ts",
13
- "src/**/*",
14
- "src/**/*.vue"
15
- ]
16
- }
17
-
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
6
+ "baseUrl": ".",
7
+ "paths": {
8
+ "@/*": ["./src/*"]
9
+ }
10
+ },
11
+ "include": [
12
+ "env.d.ts",
13
+ "src/**/*",
14
+ "src/**/*.vue"
15
+ ]
16
+ }
17
+
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "useDefineForClassFields": true,
5
- "module": "ESNext",
6
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
- "skipLibCheck": true,
8
- "moduleResolution": "bundler",
9
- "allowImportingTsExtensions": true,
10
- "isolatedModules": true,
11
- "moduleDetection": "force",
12
- "noEmit": true,
13
- "jsx": "preserve",
14
- "strict": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "noUncheckedSideEffectImports": true,
19
- "resolveJsonModule": true,
20
- "esModuleInterop": true
21
- }
22
- }
23
-
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "isolatedModules": true,
11
+ "moduleDetection": "force",
12
+ "noEmit": true,
13
+ "jsx": "preserve",
14
+ "strict": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUncheckedSideEffectImports": true,
19
+ "resolveJsonModule": true,
20
+ "esModuleInterop": true
21
+ }
22
+ }
23
+
@@ -1,12 +1,12 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.app.json"
6
- },
7
- {
8
- "path": "./tsconfig.node.json"
9
- }
10
- ]
11
- }
12
-
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ]
11
+ }
12
+
@@ -1,15 +1,15 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
6
- "types": ["node"]
7
- },
8
- "include": [
9
- "vite.config.*",
10
- "eslint.config.*",
11
- "commitlint.config.*",
12
- "scripts/**/*"
13
- ]
14
- }
15
-
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
6
+ "types": ["node"]
7
+ },
8
+ "include": [
9
+ "vite.config.*",
10
+ "eslint.config.*",
11
+ "commitlint.config.*",
12
+ "scripts/**/*"
13
+ ]
14
+ }
15
+
@@ -1,7 +1,6 @@
1
- {
2
- "dependencies": {
3
- "@ant-design/icons-vue": "catalog:build",
4
- "ant-design-vue": "catalog:build"
5
- }
6
- }
7
-
1
+ {
2
+ "dependencies": {
3
+ "@ant-design/icons-vue": "^7.0.1",
4
+ "ant-design-vue": "^4.2.1"
5
+ }
6
+ }
@@ -1,86 +1,86 @@
1
- <script setup lang="ts">
2
- /**
3
- * Ant Design Vue 布局组件
4
- */
5
- import { ref } from 'vue';
6
-
7
- const sidebarCollapsed = ref(false);
8
-
9
- function toggleSidebar(): void {
10
- sidebarCollapsed.value = !sidebarCollapsed.value;
11
- }
12
- </script>
13
-
14
- <template>
15
- <a-layout class="layout-container">
16
- <a-layout-sider
17
- v-model:collapsed="sidebarCollapsed"
18
- collapsible
19
- :trigger="null"
20
- class="layout-sider"
21
- >
22
- <div class="logo">
23
- <span v-if="!sidebarCollapsed">Logo</span>
24
- </div>
25
- <a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
26
- <a-menu-item key="1">
27
- <span>首页</span>
28
- </a-menu-item>
29
- <a-menu-item key="2">
30
- <span>关于</span>
31
- </a-menu-item>
32
- </a-menu>
33
- </a-layout-sider>
34
- <a-layout>
35
- <a-layout-header class="layout-header">
36
- <a-button @click="toggleSidebar">
37
- {{ sidebarCollapsed ? '展开' : '折叠' }}
38
- </a-button>
39
- </a-layout-header>
40
- <a-layout-content class="layout-content">
41
- <slot />
42
- </a-layout-content>
43
- </a-layout>
44
- </a-layout>
45
- </template>
46
-
47
- <style scoped lang="scss">
48
- .layout-container {
49
- height: 100vh;
50
- }
51
-
52
- .layout-sider {
53
- overflow: auto;
54
- height: 100vh;
55
- position: fixed;
56
- left: 0;
57
- top: 0;
58
- bottom: 0;
59
- }
60
-
61
- .logo {
62
- height: 32px;
63
- margin: 16px;
64
- display: flex;
65
- align-items: center;
66
- justify-content: center;
67
- color: #fff;
68
- font-size: 18px;
69
- font-weight: bold;
70
- }
71
-
72
- .layout-header {
73
- background: #fff;
74
- padding: 0 16px;
75
- display: flex;
76
- align-items: center;
77
- }
78
-
79
- .layout-content {
80
- margin: 24px 16px;
81
- padding: 24px;
82
- background: #fff;
83
- min-height: 280px;
84
- }
85
- </style>
86
-
1
+ <script setup lang="ts">
2
+ /**
3
+ * Ant Design Vue 布局组件
4
+ */
5
+ import { ref } from 'vue';
6
+
7
+ const sidebarCollapsed = ref(false);
8
+
9
+ function toggleSidebar(): void {
10
+ sidebarCollapsed.value = !sidebarCollapsed.value;
11
+ }
12
+ </script>
13
+
14
+ <template>
15
+ <a-layout class="layout-container">
16
+ <a-layout-sider
17
+ v-model:collapsed="sidebarCollapsed"
18
+ collapsible
19
+ :trigger="null"
20
+ class="layout-sider"
21
+ >
22
+ <div class="logo">
23
+ <span v-if="!sidebarCollapsed">Logo</span>
24
+ </div>
25
+ <a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
26
+ <a-menu-item key="1">
27
+ <span>首页</span>
28
+ </a-menu-item>
29
+ <a-menu-item key="2">
30
+ <span>关于</span>
31
+ </a-menu-item>
32
+ </a-menu>
33
+ </a-layout-sider>
34
+ <a-layout>
35
+ <a-layout-header class="layout-header">
36
+ <a-button @click="toggleSidebar">
37
+ {{ sidebarCollapsed ? '展开' : '折叠' }}
38
+ </a-button>
39
+ </a-layout-header>
40
+ <a-layout-content class="layout-content">
41
+ <slot />
42
+ </a-layout-content>
43
+ </a-layout>
44
+ </a-layout>
45
+ </template>
46
+
47
+ <style scoped lang="scss">
48
+ .layout-container {
49
+ height: 100vh;
50
+ }
51
+
52
+ .layout-sider {
53
+ overflow: auto;
54
+ height: 100vh;
55
+ position: fixed;
56
+ left: 0;
57
+ top: 0;
58
+ bottom: 0;
59
+ }
60
+
61
+ .logo {
62
+ height: 32px;
63
+ margin: 16px;
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: center;
67
+ color: #fff;
68
+ font-size: 18px;
69
+ font-weight: bold;
70
+ }
71
+
72
+ .layout-header {
73
+ background: #fff;
74
+ padding: 0 16px;
75
+ display: flex;
76
+ align-items: center;
77
+ }
78
+
79
+ .layout-content {
80
+ margin: 24px 16px;
81
+ padding: 24px;
82
+ background: #fff;
83
+ min-height: 280px;
84
+ }
85
+ </style>
86
+
@@ -1,7 +1,6 @@
1
- {
2
- "dependencies": {
3
- "@element-plus/icons-vue": "catalog:build",
4
- "element-plus": "catalog:build"
5
- }
6
- }
7
-
1
+ {
2
+ "dependencies": {
3
+ "@element-plus/icons-vue": "^2.3.1",
4
+ "element-plus": "^2.11.3"
5
+ }
6
+ }
@@ -1,27 +1,27 @@
1
- /**
2
- * Element Plus 样式定制
3
- * 自定义 Element Plus 主题
4
- */
5
-
6
- @forward 'element-plus/theme-chalk/src/common/var.scss' with (
7
- $colors: (
8
- 'primary': (
9
- 'base': #409eff,
10
- ),
11
- 'success': (
12
- 'base': #67c23a,
13
- ),
14
- 'warning': (
15
- 'base': #e6a23c,
16
- ),
17
- 'danger': (
18
- 'base': #f56c6c,
19
- ),
20
- 'info': (
21
- 'base': #909399,
22
- ),
23
- ),
24
- );
25
-
26
- @use 'element-plus/theme-chalk/src/index.scss' as *;
27
-
1
+ /**
2
+ * Element Plus 样式定制
3
+ * 自定义 Element Plus 主题
4
+ */
5
+
6
+ @forward 'element-plus/theme-chalk/src/common/var.scss' with (
7
+ $colors: (
8
+ 'primary': (
9
+ 'base': #409eff,
10
+ ),
11
+ 'success': (
12
+ 'base': #67c23a,
13
+ ),
14
+ 'warning': (
15
+ 'base': #e6a23c,
16
+ ),
17
+ 'danger': (
18
+ 'base': #f56c6c,
19
+ ),
20
+ 'info': (
21
+ 'base': #909399,
22
+ ),
23
+ ),
24
+ );
25
+
26
+ @use 'element-plus/theme-chalk/src/index.scss' as *;
27
+
@@ -0,0 +1,9 @@
1
+ /**
2
+ * SubMenu 组件导出
3
+ */
4
+
5
+ import SubMenu from './src/index.vue'
6
+
7
+ export { SubMenu }
8
+ export default SubMenu
9
+
@@ -1,6 +1,6 @@
1
- /**
2
- * SubMenu 类型导出
3
- */
4
-
5
- export * from './props';
6
-
1
+ /**
2
+ * SubMenu 类型导出
3
+ */
4
+
5
+ export * from './props'
6
+