@origen-ui/admin-cli 3.0.5 → 3.0.7
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/package.json +15 -15
- package/templates/current/clean/.claude/rules/05-style.md +7 -1
- package/templates/current/clean/.codebuddy/rules/05-style.md +7 -1
- package/templates/current/clean/.codex/rules/05-style.md +7 -1
- package/templates/current/clean/.cursor/rules/05-style.mdc +7 -1
- package/templates/current/clean/.qoder/rules/05-style.md +7 -1
- package/templates/current/clean/CHANGELOG.md +22 -0
- package/templates/current/clean/component-catalog.v2.json +15 -15
- package/templates/current/clean/docs/components/index.md +19 -19
- package/templates/current/clean/element-plus-plugin.ts +29 -0
- package/templates/current/clean/package.json +7 -7
- package/templates/current/clean/pnpm-workspace.yaml +3 -12
- package/templates/current/clean/scaffold.lock.json +25 -25
- package/templates/current/clean/src/app/ui/createAdminUi.ts +1 -0
- package/templates/current/clean/src/app/ui/elementPlusApiStyles.ts +3 -0
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +1 -0
- package/templates/current/clean/src/layouts/SideMenu.vue +1 -0
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +1 -1
- package/templates/current/clean/src/main.ts +1 -0
- package/templates/current/clean/tests/e2e/fixtures/adminMockBackend.ts +4 -0
- package/templates/current/clean/vite.config.ts +34 -21
- package/templates/current/examples/.claude/rules/05-style.md +7 -1
- package/templates/current/examples/.codebuddy/rules/05-style.md +7 -1
- package/templates/current/examples/.codex/rules/05-style.md +7 -1
- package/templates/current/examples/.cursor/rules/05-style.mdc +7 -1
- package/templates/current/examples/.qoder/rules/05-style.md +7 -1
- package/templates/current/examples/CHANGELOG.md +22 -0
- package/templates/current/examples/component-catalog.v2.json +15 -15
- package/templates/current/examples/docs/components/index.md +19 -19
- package/templates/current/examples/element-plus-plugin.ts +29 -0
- package/templates/current/examples/package.json +7 -7
- package/templates/current/examples/pnpm-workspace.yaml +3 -12
- package/templates/current/examples/scaffold.lock.json +25 -25
- package/templates/current/examples/src/app/ui/createAdminUi.ts +1 -0
- package/templates/current/examples/src/app/ui/elementPlusApiStyles.ts +3 -0
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +1 -0
- package/templates/current/examples/src/layouts/SideMenu.vue +1 -0
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +1 -1
- package/templates/current/examples/src/main.ts +1 -0
- package/templates/current/examples/tests/e2e/fixtures/adminMockBackend.ts +4 -0
- package/templates/current/examples/vite.config.ts +34 -21
|
@@ -5,12 +5,14 @@ import { fileURLToPath } from 'node:url'
|
|
|
5
5
|
import { createSvgIconsPlugin } from '@origen-ui/icons/vite'
|
|
6
6
|
import vue from '@vitejs/plugin-vue'
|
|
7
7
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
8
|
-
import ElementPlus from 'unplugin-element-plus/vite'
|
|
9
8
|
import { loadEnv } from 'vite'
|
|
10
9
|
import { defineConfig } from 'vitest/config'
|
|
10
|
+
import {
|
|
11
|
+
createAdminElementPlusPlugin,
|
|
12
|
+
createAdminElementPlusRolldownPlugin,
|
|
13
|
+
} from './element-plus-plugin.js'
|
|
11
14
|
import { createMockApiPlugin } from './scripts/mock-api.js'
|
|
12
|
-
//
|
|
13
|
-
// with the application source as ./vite.build-policy.ts.
|
|
15
|
+
// 此文件会复制到脚手架项目根目录;构建策略会随应用源码复制为 ./vite.build-policy.ts。
|
|
14
16
|
import {
|
|
15
17
|
createAdminBuildOptions,
|
|
16
18
|
createAdminBuildPlugins,
|
|
@@ -18,6 +20,20 @@ import {
|
|
|
18
20
|
} from './vite.build-policy.js'
|
|
19
21
|
|
|
20
22
|
const elementPlusPackageRoot = dirname(dirname(fileURLToPath(import.meta.resolve('element-plus'))))
|
|
23
|
+
const origenUiSubpathIncludes = [
|
|
24
|
+
'@origen-ui/dialog/locale',
|
|
25
|
+
'@origen-ui/editor/locale',
|
|
26
|
+
'@origen-ui/form-table/locale',
|
|
27
|
+
'@origen-ui/form/core',
|
|
28
|
+
'@origen-ui/form/locale',
|
|
29
|
+
'@origen-ui/permission/codes',
|
|
30
|
+
'@origen-ui/router/element-plus',
|
|
31
|
+
'@origen-ui/router/tabs',
|
|
32
|
+
'@origen-ui/search/locale',
|
|
33
|
+
'@origen-ui/table/locale',
|
|
34
|
+
'@origen-ui/tabs/locale',
|
|
35
|
+
'@origen-ui/upload/locale',
|
|
36
|
+
]
|
|
21
37
|
const elementPlusStyleIncludes = readdirSync(join(elementPlusPackageRoot, 'es/components'), {
|
|
22
38
|
withFileTypes: true,
|
|
23
39
|
})
|
|
@@ -27,6 +43,11 @@ const elementPlusStyleIncludes = readdirSync(join(elementPlusPackageRoot, 'es/co
|
|
|
27
43
|
existsSync(join(elementPlusPackageRoot, 'es/components', entry.name, 'style/index.mjs')),
|
|
28
44
|
)
|
|
29
45
|
.map((entry) => `element-plus/es/components/${entry.name}/style/index`)
|
|
46
|
+
// 显式补充子路径和插件生成的样式入口。
|
|
47
|
+
const optimizeDepsIncludes = [
|
|
48
|
+
...origenUiSubpathIncludes,
|
|
49
|
+
...elementPlusStyleIncludes,
|
|
50
|
+
]
|
|
30
51
|
|
|
31
52
|
export default defineConfig(({ command, mode }) => {
|
|
32
53
|
const loadedEnv = loadEnv(mode, process.cwd(), '')
|
|
@@ -50,7 +71,7 @@ export default defineConfig(({ command, mode }) => {
|
|
|
50
71
|
}),
|
|
51
72
|
...createAdminBuildPlugins(),
|
|
52
73
|
...mockPlugins,
|
|
53
|
-
|
|
74
|
+
createAdminElementPlusPlugin(),
|
|
54
75
|
],
|
|
55
76
|
resolve: {
|
|
56
77
|
alias: {
|
|
@@ -58,22 +79,14 @@ export default defineConfig(({ command, mode }) => {
|
|
|
58
79
|
},
|
|
59
80
|
},
|
|
60
81
|
optimizeDeps: {
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'element-plus',
|
|
70
|
-
'pinia',
|
|
71
|
-
'sortablejs',
|
|
72
|
-
'vue',
|
|
73
|
-
'vue-i18n',
|
|
74
|
-
'vue-router',
|
|
75
|
-
...elementPlusStyleIncludes,
|
|
76
|
-
],
|
|
82
|
+
// 保留自动发现;include 会与扫描结果合并,补齐插件注入和样式入口。
|
|
83
|
+
noDiscovery: false,
|
|
84
|
+
include: optimizeDepsIncludes,
|
|
85
|
+
rolldownOptions: {
|
|
86
|
+
plugins: [
|
|
87
|
+
createAdminElementPlusRolldownPlugin(),
|
|
88
|
+
],
|
|
89
|
+
},
|
|
77
90
|
},
|
|
78
91
|
oxc: {
|
|
79
92
|
jsx: { runtime: 'automatic', importSource: 'vue' },
|
|
@@ -94,7 +107,7 @@ export default defineConfig(({ command, mode }) => {
|
|
|
94
107
|
build: createAdminBuildOptions(isDebugBuild),
|
|
95
108
|
test: {
|
|
96
109
|
environment: 'jsdom',
|
|
97
|
-
//
|
|
110
|
+
// 限制冷启动时的并行转换量,不调整单项测试的超时时间。
|
|
98
111
|
maxWorkers: 2,
|
|
99
112
|
include: ['tests/unit/**/*.spec.ts'],
|
|
100
113
|
exclude: ['tests/e2e/**', 'node_modules/**'],
|