@moluoxixi/create-app 2.0.408 → 2.0.411
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.
- package/dist/test.js +168 -87
- package/dist/types/features.d.ts +7 -9
- package/dist/types/features.js +6 -25
- package/dist/types/index.d.ts +20 -13
- package/dist/utils/featureMapping.d.ts +5 -26
- package/dist/utils/featureMapping.js +24 -68
- package/dist/utils/generateFrameworkProject.d.ts +2 -0
- package/dist/utils/generateFrameworkProject.js +136 -21
- package/dist/utils/prompts.js +37 -7
- package/dist/utils/renderFeatures.d.ts +38 -1
- package/dist/utils/renderFeatures.js +121 -37
- package/dist/utils/routeModeMapping.d.ts +14 -0
- package/dist/utils/routeModeMapping.js +15 -0
- package/package.json +2 -3
- package/templates/common/base/package.json +1 -1
- package/templates/common/base/vite.config.ts.ejs +1 -1
- package/templates/react/base/package.json +1 -3
- package/templates/react/base/src/main.tsx.ejs +16 -43
- package/templates/react/features/pageRoutes/package.json +1 -0
- package/templates/react/micro-frontends/qiankun/base/package.json +6 -0
- package/templates/react/micro-frontends/qiankun/base/src/main.tsx.ejs +83 -0
- package/templates/react/micro-frontends/qiankun/base/vite.config.ts.ejs +89 -0
- package/templates/vue/base/package.json +1 -5
- package/templates/vue/base/src/main.ts.ejs +18 -41
- package/templates/vue/features/element-plus/src/layouts/element.vue +1 -4
- package/templates/vue/features/manualRoutes/package.json +0 -1
- package/templates/vue/features/manualRoutes/src/router/index.ts +11 -12
- package/templates/vue/features/manualRoutes/src/router/routes.ts +14 -23
- package/templates/vue/features/pageRoutes/package.json +0 -1
- package/templates/vue/features/pageRoutes/src/router/index.ts +11 -12
- package/templates/vue/features/pinia/node_modules/.bin/tsc +17 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver +17 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/features/pinia/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/features/pinia/package.json +6 -0
- package/templates/vue/micro-frontends/qiankun/base/package.json +6 -0
- package/templates/vue/micro-frontends/qiankun/base/src/main.ts.ejs +87 -0
- package/templates/vue/micro-frontends/qiankun/base/vite.config.ts.ejs +89 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/src/layouts/element.vue +120 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/jiti.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/tsx.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml +17 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/yaml.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/package.json +5 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/router/index.ts +56 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/jiti.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsc.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsserver.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/tsx.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml.CMD +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/yaml.ps1 +41 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/package.json +5 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/src/router/index.ts +57 -0
- package/templates/react/base/src/qiankun/index.ts +0 -83
- package/templates/react/base/src/stores/user.ts +0 -55
- package/templates/vue/base/src/router/layout.vue +0 -15
- package/templates/vue/features/manualRoutes/src/stores/index.ts +0 -6
- package/templates/vue/features/manualRoutes/src/stores/modules/system.ts +0 -51
- package/templates/vue/features/manualRoutes/src/stores/modules/user.ts +0 -41
- package/templates/vue/features/pageRoutes/src/stores/index.ts +0 -6
- package/templates/vue/features/pageRoutes/src/stores/modules/system.ts +0 -51
- package/templates/vue/features/pageRoutes/src/stores/modules/user.ts +0 -41
- /package/templates/react/features/{router → manualRoutes}/package.json +0 -0
- /package/templates/react/{base → features/zustand}/src/stores/index.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/index.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/modules/system.ts +0 -0
- /package/templates/vue/{base → features/pinia}/src/stores/modules/user.ts +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { store } from '../index.ts'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 系统对象
|
|
6
|
-
* @returns {object} 系统存储对象
|
|
7
|
-
*/
|
|
8
|
-
const systemStore = defineStore('system', {
|
|
9
|
-
state: () => ({
|
|
10
|
-
/**
|
|
11
|
-
* 主题颜色
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
themeColor: '#3a77ff',
|
|
15
|
-
/**
|
|
16
|
-
* 布局
|
|
17
|
-
* @type {string}
|
|
18
|
-
*/
|
|
19
|
-
layout: 'element',
|
|
20
|
-
/**
|
|
21
|
-
* 系统编码
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
systemCode: import.meta.env.VITE_APP_CODE || '',
|
|
25
|
-
}),
|
|
26
|
-
actions: {
|
|
27
|
-
setSystemCode(systemCode: string) {
|
|
28
|
-
// 将当前的主题颜色设置为传入的颜色
|
|
29
|
-
this.systemCode = systemCode
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* 设置布局
|
|
33
|
-
* @param {string} layout - 新的布局
|
|
34
|
-
*/
|
|
35
|
-
setLayout(layout: string) {
|
|
36
|
-
this.layout = layout
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* 设置主题颜色
|
|
40
|
-
* @param {string} color - 新的主题颜色
|
|
41
|
-
*/
|
|
42
|
-
setTheme(color: string) {
|
|
43
|
-
// 将当前的主题颜色设置为传入的颜色
|
|
44
|
-
this.themeColor = color
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
export function useSystemStore() {
|
|
50
|
-
return systemStore(store)
|
|
51
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import { store } from '@/stores'
|
|
4
|
-
|
|
5
|
-
export const userStore = defineStore(
|
|
6
|
-
'user',
|
|
7
|
-
() => {
|
|
8
|
-
// 定义token
|
|
9
|
-
const token = ref('')
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 用户登录
|
|
13
|
-
* @param userInfo 用户信息(可选,qiankun 环境下可能从主应用传递)
|
|
14
|
-
*/
|
|
15
|
-
const userLogin = async (userInfo?: any) => {
|
|
16
|
-
// 如果传递了用户信息,可以在这里处理登录逻辑
|
|
17
|
-
// 例如:设置 token、保存用户信息等
|
|
18
|
-
if (userInfo) {
|
|
19
|
-
// 可以根据实际需求处理用户信息
|
|
20
|
-
console.log('User login with info:', userInfo)
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 获取 token
|
|
26
|
-
* @returns token 值
|
|
27
|
-
*/
|
|
28
|
-
const getToken = () => {
|
|
29
|
-
return token.value
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return { getToken, userLogin, token }
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
persist: true,
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
export function useUserStore() {
|
|
40
|
-
return userStore(store)
|
|
41
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { store } from '../index.ts'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 系统对象
|
|
6
|
-
* @returns {object} 系统存储对象
|
|
7
|
-
*/
|
|
8
|
-
const systemStore = defineStore('system', {
|
|
9
|
-
state: () => ({
|
|
10
|
-
/**
|
|
11
|
-
* 主题颜色
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
themeColor: '#3a77ff',
|
|
15
|
-
/**
|
|
16
|
-
* 布局
|
|
17
|
-
* @type {string}
|
|
18
|
-
*/
|
|
19
|
-
layout: 'element',
|
|
20
|
-
/**
|
|
21
|
-
* 系统编码
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
systemCode: import.meta.env.VITE_APP_CODE || '',
|
|
25
|
-
}),
|
|
26
|
-
actions: {
|
|
27
|
-
setSystemCode(systemCode: string) {
|
|
28
|
-
// 将当前的主题颜色设置为传入的颜色
|
|
29
|
-
this.systemCode = systemCode
|
|
30
|
-
},
|
|
31
|
-
/**
|
|
32
|
-
* 设置布局
|
|
33
|
-
* @param {string} layout - 新的布局
|
|
34
|
-
*/
|
|
35
|
-
setLayout(layout: string) {
|
|
36
|
-
this.layout = layout
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* 设置主题颜色
|
|
40
|
-
* @param {string} color - 新的主题颜色
|
|
41
|
-
*/
|
|
42
|
-
setTheme(color: string) {
|
|
43
|
-
// 将当前的主题颜色设置为传入的颜色
|
|
44
|
-
this.themeColor = color
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
export function useSystemStore() {
|
|
50
|
-
return systemStore(store)
|
|
51
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import { store } from '@/stores'
|
|
4
|
-
|
|
5
|
-
export const userStore = defineStore(
|
|
6
|
-
'user',
|
|
7
|
-
() => {
|
|
8
|
-
// 定义token
|
|
9
|
-
const token = ref('')
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 用户登录
|
|
13
|
-
* @param userInfo 用户信息(可选,qiankun 环境下可能从主应用传递)
|
|
14
|
-
*/
|
|
15
|
-
const userLogin = async (userInfo?: any) => {
|
|
16
|
-
// 如果传递了用户信息,可以在这里处理登录逻辑
|
|
17
|
-
// 例如:设置 token、保存用户信息等
|
|
18
|
-
if (userInfo) {
|
|
19
|
-
// 可以根据实际需求处理用户信息
|
|
20
|
-
console.log('User login with info:', userInfo)
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 获取 token
|
|
26
|
-
* @returns token 值
|
|
27
|
-
*/
|
|
28
|
-
const getToken = () => {
|
|
29
|
-
return token.value
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return { getToken, userLogin, token }
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
persist: true,
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
export function useUserStore() {
|
|
40
|
-
return userStore(store)
|
|
41
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|