@gadmin2n/schematics 0.0.153 → 0.0.154
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/lib/application/files/gadmin2-game-angle-demo/.git-blame-ignore-revs +5 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/.nvmrc +1 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/CODEBUDDY.md +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/Dockerfile.codegen +16 -9
- package/dist/lib/application/files/gadmin2-game-angle-demo/Dockerfile.server +21 -13
- package/dist/lib/application/files/gadmin2-game-angle-demo/Dockerfile.web +11 -11
- package/dist/lib/application/files/gadmin2-game-angle-demo/Jenkinsfile +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/PRODUCT.md +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/compose-ctl.sh +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/docker-compose.yml +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/readme.md +22 -22
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.oxfmtrc.json +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.oxlintrc.json +17 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/package.json +14 -13
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/pnpm-workspace.yaml +23 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/auth.guard.ts +4 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/structured-all-exceptions.filter.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/lib/tracing.ts +4 -6
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/agenda/agenda.service.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/audit/audit.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/codeRuntime/code-runtime.controller.ts +6 -6
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/game/game.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/httpRequest/http-request-runtime.controller.ts +6 -6
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/httpRequest/http-request-runtime.util.ts +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/humanApproval/approval-subject-source.util.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/humanApproval/human-approval.service.ts +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/humanApproval/runtime/human-approval-runtime.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/integrationConnection/integration-connection.service.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/pageResource/pageResource.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/permTransfer/page-transfer.service.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/resource/resource.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/rolePages/rolePages.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/roleResource/roleResource.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/staffDirectory/staff-directory.service.spec.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/subjectProvider/subject-provider.errors.ts +4 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/subjectProvider/subject-provider.registry.ts +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/subjectProvider/subject-provider.types.ts +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/user/user.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/user/user.service.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/parameter-binding.ts +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-data-edge.util.ts +5 -5
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-handle-validator.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.service.ts +11 -11
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowConfig/subject-config-validator.service.ts +3 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeInstance/workflowNodeInstance.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflowNodeType/workflowNodeType.controller.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/start-prod.sh +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/.oxfmtrc.json +12 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/.oxlintrc.json +24 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/README.MD +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/nginx.conf +0 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/package.json +17 -17
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/pnpm-workspace.yaml +13 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/VanillaJSONEditor/index.jsx +4 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/agentPanel/propPatcher.ts +36 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/dev-shell/style.css +24 -7
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/plugins/devShellPlugin.ts +2 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/audit/components/action-cell.css +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/styles/index.css +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/test/setup.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/vite.config.ts +53 -41
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/vitest.config.ts +8 -2
- package/package.json +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.eslintrc.js +0 -28
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.prettierignore +0 -7
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/.prettierrc +0 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/.eslintrc.json +0 -38
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/.prettierignore +0 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/.prettierrc +0 -4
|
@@ -13,16 +13,26 @@
|
|
|
13
13
|
* propName={'value'}
|
|
14
14
|
* 如果 prop 不存在,在 /> 前追加。
|
|
15
15
|
*/
|
|
16
|
-
export function patchStringProp(
|
|
16
|
+
export function patchStringProp(
|
|
17
|
+
code: string,
|
|
18
|
+
propName: string,
|
|
19
|
+
newValue: string,
|
|
20
|
+
): string {
|
|
17
21
|
// 替换双引号格式: propName="old"
|
|
18
22
|
const dqRegex = new RegExp(`(${propName}=)"([^"]*)"`, 'g');
|
|
19
23
|
if (dqRegex.test(code)) {
|
|
20
|
-
return code.replace(
|
|
24
|
+
return code.replace(
|
|
25
|
+
new RegExp(`(${propName}=)"([^"]*)"`, 'g'),
|
|
26
|
+
`$1"${newValue}"`,
|
|
27
|
+
);
|
|
21
28
|
}
|
|
22
29
|
// 替换单引号花括号格式: propName={'old'}
|
|
23
30
|
const sqRegex = new RegExp(`(${propName}=)\\{'([^']*)'\\}`, 'g');
|
|
24
31
|
if (sqRegex.test(code)) {
|
|
25
|
-
return code.replace(
|
|
32
|
+
return code.replace(
|
|
33
|
+
new RegExp(`(${propName}=)\\{'([^']*)'\\}`, 'g'),
|
|
34
|
+
`$1"${newValue}"`,
|
|
35
|
+
);
|
|
26
36
|
}
|
|
27
37
|
// prop 不存在:在 /> 前追加
|
|
28
38
|
if (code.includes('/>')) {
|
|
@@ -36,7 +46,11 @@ export function patchStringProp(code: string, propName: string, newValue: string
|
|
|
36
46
|
* 替换 JSX code 字符串中某个枚举类型 prop 的值(字符串格式)。
|
|
37
47
|
* 与 patchStringProp 相同逻辑,单独命名便于语义区分。
|
|
38
48
|
*/
|
|
39
|
-
export function patchEnumProp(
|
|
49
|
+
export function patchEnumProp(
|
|
50
|
+
code: string,
|
|
51
|
+
propName: string,
|
|
52
|
+
newValue: string,
|
|
53
|
+
): string {
|
|
40
54
|
return patchStringProp(code, propName, newValue);
|
|
41
55
|
}
|
|
42
56
|
|
|
@@ -48,7 +62,11 @@ export function patchEnumProp(code: string, propName: string, newValue: string):
|
|
|
48
62
|
* legendShow → true(裸属性)
|
|
49
63
|
* 不存在 → defaultValue
|
|
50
64
|
*/
|
|
51
|
-
export function readBooleanProp(
|
|
65
|
+
export function readBooleanProp(
|
|
66
|
+
code: string,
|
|
67
|
+
propName: string,
|
|
68
|
+
defaultValue: boolean,
|
|
69
|
+
): boolean {
|
|
52
70
|
const falseRegex = new RegExp(`${propName}=\\{false\\}`);
|
|
53
71
|
if (falseRegex.test(code)) return false;
|
|
54
72
|
const trueRegex = new RegExp(`${propName}=\\{true\\}|\\b${propName}\\b`);
|
|
@@ -64,17 +82,27 @@ export function readBooleanProp(code: string, propName: string, defaultValue: bo
|
|
|
64
82
|
* legendShow(裸) → legendShow={false}
|
|
65
83
|
* 不存在 → 追加 legendShow={true/false}
|
|
66
84
|
*/
|
|
67
|
-
export function patchBooleanProp(
|
|
85
|
+
export function patchBooleanProp(
|
|
86
|
+
code: string,
|
|
87
|
+
propName: string,
|
|
88
|
+
newValue: boolean,
|
|
89
|
+
): string {
|
|
68
90
|
const valueStr = `{${newValue}}`;
|
|
69
91
|
// 替换 {true} 或 {false}
|
|
70
92
|
const boolRegex = new RegExp(`(${propName})=\\{(true|false)\\}`, 'g');
|
|
71
93
|
if (boolRegex.test(code)) {
|
|
72
|
-
return code.replace(
|
|
94
|
+
return code.replace(
|
|
95
|
+
new RegExp(`(${propName})=\\{(true|false)\\}`, 'g'),
|
|
96
|
+
`$1=${valueStr}`,
|
|
97
|
+
);
|
|
73
98
|
}
|
|
74
99
|
// 替换裸属性(propName 无值)
|
|
75
100
|
const bareRegex = new RegExp(`\\b(${propName})\\b(?!=)`, 'g');
|
|
76
101
|
if (bareRegex.test(code)) {
|
|
77
|
-
return code.replace(
|
|
102
|
+
return code.replace(
|
|
103
|
+
new RegExp(`\\b(${propName})\\b(?!=)`, 'g'),
|
|
104
|
+
`$1=${valueStr}`,
|
|
105
|
+
);
|
|
78
106
|
}
|
|
79
107
|
// prop 不存在:追加
|
|
80
108
|
if (code.includes('/>')) {
|
|
@@ -69,7 +69,10 @@ body {
|
|
|
69
69
|
align-items: center;
|
|
70
70
|
justify-content: center;
|
|
71
71
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
72
|
-
transition:
|
|
72
|
+
transition:
|
|
73
|
+
right 0.3s,
|
|
74
|
+
background 0.2s,
|
|
75
|
+
color 0.2s;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
#toggle-btn:hover {
|
|
@@ -101,7 +104,10 @@ body {
|
|
|
101
104
|
align-items: center;
|
|
102
105
|
justify-content: center;
|
|
103
106
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
104
|
-
transition:
|
|
107
|
+
transition:
|
|
108
|
+
right 0.3s,
|
|
109
|
+
background 0.2s,
|
|
110
|
+
color 0.2s;
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
#inspect-btn:hover {
|
|
@@ -184,7 +190,9 @@ body {
|
|
|
184
190
|
font-size: 13px;
|
|
185
191
|
color: #1a1a1a;
|
|
186
192
|
cursor: pointer;
|
|
187
|
-
transition:
|
|
193
|
+
transition:
|
|
194
|
+
background 0.15s,
|
|
195
|
+
color 0.15s;
|
|
188
196
|
border-radius: 0;
|
|
189
197
|
display: block;
|
|
190
198
|
width: 100%;
|
|
@@ -351,7 +359,9 @@ div.chat-header {
|
|
|
351
359
|
color: #595959;
|
|
352
360
|
border-bottom: 2px solid transparent;
|
|
353
361
|
margin-bottom: -1px;
|
|
354
|
-
transition:
|
|
362
|
+
transition:
|
|
363
|
+
color 0.15s,
|
|
364
|
+
border-color 0.15s;
|
|
355
365
|
}
|
|
356
366
|
|
|
357
367
|
.add-data-modal-tab:hover {
|
|
@@ -604,7 +614,10 @@ div.chat-header {
|
|
|
604
614
|
border-radius: 10px;
|
|
605
615
|
background: #fff;
|
|
606
616
|
cursor: pointer;
|
|
607
|
-
transition:
|
|
617
|
+
transition:
|
|
618
|
+
border-color 0.15s,
|
|
619
|
+
background 0.15s,
|
|
620
|
+
transform 0.1s;
|
|
608
621
|
}
|
|
609
622
|
|
|
610
623
|
.add-page-type-card:hover {
|
|
@@ -681,7 +694,9 @@ div.chat-header {
|
|
|
681
694
|
padding: 4px 10px;
|
|
682
695
|
border: 1px solid #d9d9d9;
|
|
683
696
|
border-radius: 20px;
|
|
684
|
-
transition:
|
|
697
|
+
transition:
|
|
698
|
+
border-color 0.15s,
|
|
699
|
+
background 0.15s;
|
|
685
700
|
}
|
|
686
701
|
|
|
687
702
|
.add-page-role-checkbox:has(input:checked) {
|
|
@@ -890,7 +905,9 @@ div.chat-header {
|
|
|
890
905
|
white-space: nowrap;
|
|
891
906
|
pointer-events: none;
|
|
892
907
|
opacity: 0;
|
|
893
|
-
transition:
|
|
908
|
+
transition:
|
|
909
|
+
opacity 0.15s ease,
|
|
910
|
+
transform 0.15s ease;
|
|
894
911
|
z-index: 10000;
|
|
895
912
|
}
|
|
896
913
|
|
package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/plugins/devShellPlugin.ts
CHANGED
|
@@ -257,7 +257,7 @@ export function devShellPlugin(): Plugin {
|
|
|
257
257
|
? 'index.html'
|
|
258
258
|
: 'dev-shell-entry.html';
|
|
259
259
|
const rawHtml = fs.readFileSync(
|
|
260
|
-
path.resolve(
|
|
260
|
+
path.resolve(import.meta.dirname, '..', '..', entryFile),
|
|
261
261
|
'utf-8',
|
|
262
262
|
);
|
|
263
263
|
const html = await server.transformIndexHtml(url, rawHtml);
|
|
@@ -277,7 +277,7 @@ export function devShellPlugin(): Plugin {
|
|
|
277
277
|
(req.headers.accept ?? '').includes('text/html');
|
|
278
278
|
if (isHtmlNav) {
|
|
279
279
|
const rawHtml = fs.readFileSync(
|
|
280
|
-
path.resolve(
|
|
280
|
+
path.resolve(import.meta.dirname, '..', '..', 'index.html'),
|
|
281
281
|
'utf-8',
|
|
282
282
|
);
|
|
283
283
|
const html = await server.transformIndexHtml(url, rawHtml);
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
background-color: var(--ant-color-warning-bg);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.endpoint-self-select .ant-select-selection-item
|
|
125
|
+
.endpoint-self-select .ant-select-selection-item {
|
|
126
126
|
display: inline-flex !important;
|
|
127
127
|
justify-content: flex-end !important;
|
|
128
128
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import react from '@vitejs/plugin-react';
|
|
3
3
|
import { defineConfig, loadEnv, type Plugin } from 'vite';
|
|
4
|
-
import
|
|
5
|
-
import { devShellPlugin } from './src/plugins/devShellPlugin';
|
|
4
|
+
import { devShellPlugin } from './src/plugins/devShellPlugin.ts';
|
|
6
5
|
|
|
7
6
|
// gadmin g prisma 生成完毕后触发:CLI 会 touch 本文件,
|
|
8
7
|
// 插件监听变更后 invalidate module graph 并广播 full-reload。
|
|
@@ -15,7 +14,7 @@ import { devShellPlugin } from './src/plugins/devShellPlugin';
|
|
|
15
14
|
// - invalidateAll() 只清 transform 结果,不重载 config、不重跑 esbuild
|
|
16
15
|
// - full-reload 让浏览器重新请求,vite 按最新文件重新 transform
|
|
17
16
|
function gadminRestartPlugin(): Plugin {
|
|
18
|
-
const sentinel = path.resolve(
|
|
17
|
+
const sentinel = path.resolve(import.meta.dirname, '.vite-restart');
|
|
19
18
|
return {
|
|
20
19
|
name: 'gadmin-restart-on-generate',
|
|
21
20
|
configureServer(server) {
|
|
@@ -36,8 +35,6 @@ function gadminRestartPlugin(): Plugin {
|
|
|
36
35
|
|
|
37
36
|
export default defineConfig(({ mode }) => {
|
|
38
37
|
const env = loadEnv(mode, process.cwd(), '');
|
|
39
|
-
const isDev = mode !== 'production';
|
|
40
|
-
|
|
41
38
|
const backendUrl = env.VITE_API_PORT
|
|
42
39
|
? `http://localhost:${env.VITE_API_PORT}`
|
|
43
40
|
: env.VITE_BACKEND_URL;
|
|
@@ -52,12 +49,11 @@ export default defineConfig(({ mode }) => {
|
|
|
52
49
|
: undefined;
|
|
53
50
|
|
|
54
51
|
return {
|
|
55
|
-
plugins: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
],
|
|
52
|
+
plugins: [react(), devShellPlugin(), gadminRestartPlugin()],
|
|
53
|
+
resolve: {
|
|
54
|
+
// Vite 8 原生支持,替代 vite-tsconfig-paths 插件
|
|
55
|
+
tsconfigPaths: true,
|
|
56
|
+
},
|
|
61
57
|
define: {
|
|
62
58
|
'process.env': {},
|
|
63
59
|
'process.argv': [],
|
|
@@ -65,9 +61,6 @@ export default defineConfig(({ mode }) => {
|
|
|
65
61
|
'process.platform': JSON.stringify(''),
|
|
66
62
|
},
|
|
67
63
|
css: { devSourcemap: false },
|
|
68
|
-
esbuild: {
|
|
69
|
-
sourcemap: !isDev,
|
|
70
|
-
},
|
|
71
64
|
optimizeDeps: {
|
|
72
65
|
include: [
|
|
73
66
|
'antd',
|
|
@@ -86,11 +79,7 @@ export default defineConfig(({ mode }) => {
|
|
|
86
79
|
'i18next',
|
|
87
80
|
'@monaco-editor/react',
|
|
88
81
|
'vanilla-jsoneditor',
|
|
89
|
-
'json-source-map',
|
|
90
82
|
],
|
|
91
|
-
esbuildOptions: {
|
|
92
|
-
loader: { '.js': 'jsx' },
|
|
93
|
-
},
|
|
94
83
|
},
|
|
95
84
|
server: {
|
|
96
85
|
host: true,
|
|
@@ -118,30 +107,53 @@ export default defineConfig(({ mode }) => {
|
|
|
118
107
|
},
|
|
119
108
|
build: {
|
|
120
109
|
sourcemap: true,
|
|
121
|
-
|
|
110
|
+
// Vite 8(Rolldown):manualChunks 迁移为 codeSplitting.groups。
|
|
111
|
+
// 包名按 node_modules/<pkg>/ 路径前缀匹配(pnpm 的 .pnpm 路径末段仍含标准
|
|
112
|
+
// node_modules/<pkg>/ 结构,子串匹配两种布局均命中)。
|
|
113
|
+
rolldownOptions: {
|
|
122
114
|
output: {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
115
|
+
codeSplitting: {
|
|
116
|
+
groups: [
|
|
117
|
+
{
|
|
118
|
+
name: (id: string) => {
|
|
119
|
+
const groups: Record<string, string[]> = {
|
|
120
|
+
react: ['react', 'react-dom', 'react-router-dom'],
|
|
121
|
+
antd: ['antd', '@ant-design/icons'],
|
|
122
|
+
refine: [
|
|
123
|
+
'@refinedev/core',
|
|
124
|
+
'@refinedev/antd',
|
|
125
|
+
'@refinedev/kbar',
|
|
126
|
+
],
|
|
127
|
+
echarts: ['echarts'],
|
|
128
|
+
flow: ['@xyflow/react'],
|
|
129
|
+
editor: [
|
|
130
|
+
'@monaco-editor/react',
|
|
131
|
+
'vanilla-jsoneditor',
|
|
132
|
+
'@uiw/react-md-editor',
|
|
133
|
+
],
|
|
134
|
+
i18n: [
|
|
135
|
+
'i18next',
|
|
136
|
+
'react-i18next',
|
|
137
|
+
'i18next-browser-languagedetector',
|
|
138
|
+
'i18next-http-backend',
|
|
139
|
+
],
|
|
140
|
+
lodash: [
|
|
141
|
+
'lodash',
|
|
142
|
+
'lodash.foreach',
|
|
143
|
+
'lodash.groupby',
|
|
144
|
+
'lodash.memoize',
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
for (const [chunk, pkgs] of Object.entries(groups)) {
|
|
148
|
+
for (const pkg of pkgs) {
|
|
149
|
+
if (id.includes(`node_modules/${pkg}/`)) {
|
|
150
|
+
return chunk;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
},
|
|
156
|
+
},
|
|
145
157
|
],
|
|
146
158
|
},
|
|
147
159
|
},
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import react from '@vitejs/plugin-react';
|
|
2
2
|
import { defineConfig } from 'vitest/config';
|
|
3
|
-
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
4
3
|
|
|
5
4
|
export default defineConfig({
|
|
6
|
-
plugins: [
|
|
5
|
+
plugins: [react()],
|
|
6
|
+
resolve: {
|
|
7
|
+
// Vite 8 原生支持,替代 vite-tsconfig-paths 插件
|
|
8
|
+
tsconfigPaths: true,
|
|
9
|
+
},
|
|
7
10
|
test: {
|
|
8
11
|
environment: 'jsdom',
|
|
9
12
|
globals: true,
|
|
10
13
|
setupFiles: ['./src/test/setup.ts'],
|
|
14
|
+
// vitest 5 worker 启动开销比 3 高(~1.2s/个),重 UI 测试在并行高负载下
|
|
15
|
+
// 容易踩默认 5s 超时,放宽到 15s
|
|
16
|
+
testTimeout: 15000,
|
|
11
17
|
},
|
|
12
18
|
});
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: 'tsconfig.json',
|
|
5
|
-
tsconfigRootDir : __dirname,
|
|
6
|
-
sourceType: 'module',
|
|
7
|
-
},
|
|
8
|
-
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
9
|
-
extends: [
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:prettier/recommended',
|
|
12
|
-
],
|
|
13
|
-
root: true,
|
|
14
|
-
env: {
|
|
15
|
-
node: true,
|
|
16
|
-
jest: true,
|
|
17
|
-
},
|
|
18
|
-
ignorePatterns: ['.eslintrc.js', 'node_modules/', 'dist/'],
|
|
19
|
-
rules: {
|
|
20
|
-
'@typescript-eslint/interface-name-prefix': 'off',
|
|
21
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
22
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
23
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
24
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
25
|
-
'@typescript-eslint/no-empty-function': 'warn',
|
|
26
|
-
'import/order': 'off',
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"ignorePatterns": ["node_modules/", "dist/"],
|
|
4
|
-
"parser": "@typescript-eslint/parser",
|
|
5
|
-
"parserOptions": {
|
|
6
|
-
"ecmaVersion": "latest",
|
|
7
|
-
"sourceType": "module",
|
|
8
|
-
"ecmaFeatures": { "jsx": true }
|
|
9
|
-
},
|
|
10
|
-
"plugins": ["@typescript-eslint", "react", "react-hooks"],
|
|
11
|
-
"extends": [
|
|
12
|
-
"eslint:recommended",
|
|
13
|
-
"plugin:@typescript-eslint/recommended",
|
|
14
|
-
"plugin:react/recommended",
|
|
15
|
-
"plugin:react-hooks/recommended"
|
|
16
|
-
],
|
|
17
|
-
"settings": {
|
|
18
|
-
"react": { "version": "detect" }
|
|
19
|
-
},
|
|
20
|
-
"rules": {
|
|
21
|
-
"react/react-in-jsx-scope": "off",
|
|
22
|
-
"react/prop-types": "off",
|
|
23
|
-
"react/display-name": "off",
|
|
24
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
25
|
-
"@typescript-eslint/ban-types": "off",
|
|
26
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
|
27
|
-
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
28
|
-
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
29
|
-
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
30
|
-
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
|
|
31
|
-
"@typescript-eslint/no-unused-expressions": "warn",
|
|
32
|
-
"react/no-unescaped-entities": "warn",
|
|
33
|
-
"react/jsx-key": "warn",
|
|
34
|
-
"react-hooks/rules-of-hooks": "warn",
|
|
35
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
36
|
-
"no-prototype-builtins": "warn"
|
|
37
|
-
}
|
|
38
|
-
}
|