@agile-team/wl-skills-ui 1.6.3 → 1.6.5
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/bin/wl-ui.js
CHANGED
|
@@ -55,6 +55,7 @@ const EDITOR_TARGETS = {
|
|
|
55
55
|
"agents-generic": { dir: ".", ext: ".md", singleFile: "AGENTS.md" },
|
|
56
56
|
qoder: { dir: ".qoder/rules", ext: ".md" },
|
|
57
57
|
};
|
|
58
|
+
const EDITOR_IDS = Object.keys(EDITOR_TARGETS);
|
|
58
59
|
|
|
59
60
|
// ── 参数解析 ─────────────────────────────────────────────────────────────────
|
|
60
61
|
const rawArgs = process.argv.slice(2);
|
|
@@ -124,9 +125,10 @@ if (subcommand === "init" || subcommand === "update") {
|
|
|
124
125
|
const skillsOnly = values["skills-only"];
|
|
125
126
|
const mode = values.mode === "skin" ? "skin" : "native";
|
|
126
127
|
|
|
128
|
+
const manifest = readManifest(projectRoot);
|
|
127
129
|
if (
|
|
128
130
|
subcommand === "update" &&
|
|
129
|
-
|
|
131
|
+
manifest?.version === PKG.version &&
|
|
130
132
|
!values.force
|
|
131
133
|
) {
|
|
132
134
|
console.log(
|
|
@@ -144,11 +146,21 @@ if (subcommand === "init" || subcommand === "update") {
|
|
|
144
146
|
console.log(`[wl-ui ${subcommand}] DRY-RUN 模式:不实际写入文件\n`);
|
|
145
147
|
|
|
146
148
|
// 1. 检测编辑器
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
+
const editors = resolveEditorsForInstall({
|
|
150
|
+
projectRoot,
|
|
151
|
+
subcommand,
|
|
152
|
+
requestedEditor: values.editor,
|
|
153
|
+
manifest,
|
|
154
|
+
});
|
|
155
|
+
console.log(`[wl-ui ${subcommand}] 目标编辑器:${editors.join(", ")}\n`);
|
|
149
156
|
|
|
150
157
|
// 2. 安装 skills(按 mode 过滤)
|
|
151
|
-
const installedFiles =
|
|
158
|
+
const installedFiles = [];
|
|
159
|
+
for (const editor of editors) {
|
|
160
|
+
installedFiles.push(
|
|
161
|
+
...installSkills({ projectRoot, editor, mode, dryRun }),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
152
164
|
installedFiles.push(...installSupportFiles({ projectRoot, dryRun }));
|
|
153
165
|
|
|
154
166
|
// 3. 安装接入配置(非 --skills-only 时)
|
|
@@ -159,7 +171,8 @@ if (subcommand === "init" || subcommand === "update") {
|
|
|
159
171
|
if (!dryRun) {
|
|
160
172
|
writeManifest(projectRoot, {
|
|
161
173
|
version: PKG.version,
|
|
162
|
-
editor,
|
|
174
|
+
editor: editors.join(","),
|
|
175
|
+
editors,
|
|
163
176
|
mode,
|
|
164
177
|
installedAt: new Date().toISOString(),
|
|
165
178
|
files: Object.fromEntries(
|
|
@@ -169,7 +182,7 @@ if (subcommand === "init" || subcommand === "update") {
|
|
|
169
182
|
}
|
|
170
183
|
|
|
171
184
|
console.log(`\n✅ wl-ui ${subcommand} 完成!\n`);
|
|
172
|
-
printInstallSummary({ projectRoot, mode, editor });
|
|
185
|
+
printInstallSummary({ projectRoot, mode, editor: editors.join(", ") });
|
|
173
186
|
console.log("下一步:");
|
|
174
187
|
if (mode === "skin") {
|
|
175
188
|
console.log(" npx wl-ui scan --target src --mode skin # 仅化妆层审计");
|
|
@@ -252,6 +265,58 @@ function detectEditor(projectRoot) {
|
|
|
252
265
|
return "github-copilot";
|
|
253
266
|
}
|
|
254
267
|
|
|
268
|
+
function detectInstalledEditors(projectRoot) {
|
|
269
|
+
return EDITOR_IDS.filter((editor) => {
|
|
270
|
+
const target = EDITOR_TARGETS[editor];
|
|
271
|
+
if (target.singleFile)
|
|
272
|
+
return existsSync(join(projectRoot, target.singleFile));
|
|
273
|
+
return existsSync(join(projectRoot, target.dir));
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function normalizeManifestEditors(manifest) {
|
|
278
|
+
if (Array.isArray(manifest?.editors)) return manifest.editors;
|
|
279
|
+
if (typeof manifest?.editor === "string") {
|
|
280
|
+
return manifest.editor
|
|
281
|
+
.split(",")
|
|
282
|
+
.map((editor) => editor.trim())
|
|
283
|
+
.filter(Boolean);
|
|
284
|
+
}
|
|
285
|
+
return [];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function uniqueValidEditors(editors) {
|
|
289
|
+
return [...new Set(editors)].filter((editor) => EDITOR_TARGETS[editor]);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function resolveEditorsForInstall({
|
|
293
|
+
projectRoot,
|
|
294
|
+
subcommand,
|
|
295
|
+
requestedEditor,
|
|
296
|
+
manifest,
|
|
297
|
+
}) {
|
|
298
|
+
if (requestedEditor) {
|
|
299
|
+
if (requestedEditor === "all") return EDITOR_IDS;
|
|
300
|
+
const editors = uniqueValidEditors(
|
|
301
|
+
requestedEditor.split(",").map((editor) => editor.trim()),
|
|
302
|
+
);
|
|
303
|
+
if (editors.length > 0) return editors;
|
|
304
|
+
console.error(`[wl-ui ${subcommand}] 不支持的编辑器:${requestedEditor}`);
|
|
305
|
+
console.error(`支持:${EDITOR_IDS.join(" | ")} | all`);
|
|
306
|
+
process.exit(1);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (subcommand === "update") {
|
|
310
|
+
const editors = uniqueValidEditors([
|
|
311
|
+
...normalizeManifestEditors(manifest),
|
|
312
|
+
...detectInstalledEditors(projectRoot),
|
|
313
|
+
]);
|
|
314
|
+
if (editors.length > 0) return editors;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return [detectEditor(projectRoot)];
|
|
318
|
+
}
|
|
319
|
+
|
|
255
320
|
/** 读取 skills/ 目录下所有 SKILL.md 文件 */
|
|
256
321
|
function collectSkills(skillsDir) {
|
|
257
322
|
const skills = [];
|
|
@@ -738,8 +803,8 @@ wl-ui — @agile-team/wl-skills-ui 统一 CLI v${PKG.version}
|
|
|
738
803
|
wl-ui init [--project <path>] [--editor <editor>] [--mode native|skin]
|
|
739
804
|
[--dry-run] [--skills-only]
|
|
740
805
|
把 skills/ 写入目标项目的 AI 编辑器规则目录
|
|
741
|
-
wl-ui update [--project <path>] [--force] [--dry-run]
|
|
742
|
-
|
|
806
|
+
wl-ui update [--project <path>] [--editor <editor|all>] [--force] [--dry-run]
|
|
807
|
+
更新已安装编辑器 rules / MCP / 触发提示
|
|
743
808
|
wl-ui diff [--project <path>]
|
|
744
809
|
对比已安装文件与 manifest
|
|
745
810
|
wl-ui clean [--project <path>] [--dry-run]
|
|
@@ -765,7 +830,7 @@ wl-ui — @agile-team/wl-skills-ui 统一 CLI v${PKG.version}
|
|
|
765
830
|
|
|
766
831
|
参数:
|
|
767
832
|
--project 项目根目录(默认 .)
|
|
768
|
-
--editor 指定编辑器:github-copilot | cursor | windsurf | kiro | trae | claude-code | cline | agents-generic | qoder
|
|
833
|
+
--editor 指定编辑器:github-copilot | cursor | windsurf | kiro | trae | claude-code | cline | agents-generic | qoder | all
|
|
769
834
|
--mode init: native(默认,完整接入) | skin(化妆,老项目)
|
|
770
835
|
scan: skin(只看L0/L1/L2) | native(全量)
|
|
771
836
|
--layer scan 过滤:L0/L1/L2/L3/L4(逗号分隔)
|
|
@@ -779,6 +844,7 @@ wl-ui — @agile-team/wl-skills-ui 统一 CLI v${PKG.version}
|
|
|
779
844
|
示例:
|
|
780
845
|
npx wl-ui init
|
|
781
846
|
npx wl-ui update --force
|
|
847
|
+
npx wl-ui update --editor all --force
|
|
782
848
|
npx wl-ui doctor
|
|
783
849
|
npx wl-ui prompts
|
|
784
850
|
npx wl-ui init --mode skin --project /path/to/legacy-project
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agile-team/wl-skills-ui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "企业级 UI 风格对齐框架 — Vue + Element Plus 项目通用化妆/原生双模式(tokens / element / vendors / layouts / runtime / scanner / fixer / skills)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./es/index.js",
|
|
@@ -46,6 +46,19 @@ el-date-picker 默认宽度不会自动撑满 el-form-item,必须显式设置
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
+
## 表单控件圆角一致性 【中危】
|
|
50
|
+
|
|
51
|
+
表单里的输入类控件必须按控件家族统一判断,不要只修 `el-input`:
|
|
52
|
+
|
|
53
|
+
- 输入:`el-input` / `el-textarea` / `el-input-number`
|
|
54
|
+
- 选择:`el-select` / `el-cascader` / `el-autocomplete`
|
|
55
|
+
- 日期:`el-date-picker` / `el-time-picker` / range editor
|
|
56
|
+
- 上传:`el-upload-dragger` / upload list item
|
|
57
|
+
|
|
58
|
+
修复时优先使用全局样式 token `--wk-form-control-radius`,不要在业务页面对某几个控件单独写 `border-radius: 0`、`4px`、`10px` 等局部值。若页面需要特殊圆角,应在页面容器上覆盖 token,而不是逐个控件硬编码。
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
49
62
|
## 完整标准表单示例
|
|
50
63
|
|
|
51
64
|
```html
|
|
@@ -87,6 +87,7 @@ npx wk-ui check --project [项目根目录]
|
|
|
87
87
|
- **R006**【中危】el-input / el-select 缺少 `size="small"`
|
|
88
88
|
- **R007**【中危】el-date-picker 缺少 `style="width:100%"`
|
|
89
89
|
- **R008**【低危】el-form labelWidth < 150px
|
|
90
|
+
- **表单圆角一致性**【中危】输入、选择、日期、textarea、上传等控件必须统一使用 `--wk-form-control-radius`,不要局部硬编码不同圆角
|
|
90
91
|
|
|
91
92
|
### 弹窗类 → 详见 [skills/components/dialog/SKILL.md](../../components/dialog/SKILL.md)
|
|
92
93
|
|
package/standards/ui/03-form.md
CHANGED
|
@@ -44,6 +44,18 @@ date-picker 默认宽度固定,在 grid 布局中需撑满列宽:
|
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
|
+
## 规则:表单控件圆角必须统一
|
|
48
|
+
|
|
49
|
+
输入、选择、日期、数字输入、级联、自动完成、textarea、上传拖拽区都属于表单控件家族,圆角必须使用统一 token:
|
|
50
|
+
|
|
51
|
+
```scss
|
|
52
|
+
--wk-form-control-radius
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
业务页面不要给单个控件硬编码不同 `border-radius`。确有特殊场景时,在页面容器覆盖 token,而不是逐个控件写死。
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
47
59
|
## 布局标准
|
|
48
60
|
|
|
49
61
|
### 搜索区(列表页顶部)
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// styles/element/_form.scss — el-form / el-input 覆盖
|
|
2
2
|
|
|
3
|
+
html body {
|
|
4
|
+
--wk-form-control-radius: var(--el-border-radius-base, 6px);
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
.el-form-item--small {
|
|
4
8
|
margin-bottom: 8px;
|
|
5
9
|
}
|
|
@@ -10,13 +14,14 @@
|
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
// ── 全局输入框圆角统一(6px,与搜索区保持一致)──────────────────────────────
|
|
13
|
-
.el-input__wrapper
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.el-select .el-select__wrapper {
|
|
17
|
-
border-radius: 6px;
|
|
18
|
-
}
|
|
17
|
+
.el-input__wrapper,
|
|
18
|
+
.el-select__wrapper,
|
|
19
|
+
.el-select .el-select__wrapper,
|
|
19
20
|
.el-date-editor.el-input__wrapper,
|
|
20
|
-
.el-date-editor .el-input__wrapper
|
|
21
|
-
|
|
21
|
+
.el-date-editor .el-input__wrapper,
|
|
22
|
+
.el-input-number .el-input__wrapper,
|
|
23
|
+
.el-cascader .el-input__wrapper,
|
|
24
|
+
.el-autocomplete .el-input__wrapper,
|
|
25
|
+
.el-textarea__inner {
|
|
26
|
+
border-radius: var(--wk-form-control-radius) !important;
|
|
22
27
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
html body .el-upload {
|
|
2
2
|
.el-upload-dragger {
|
|
3
|
-
border-color: var(--el-border-color);
|
|
4
|
-
border-radius:
|
|
5
|
-
background: var(--el-fill-color-light);
|
|
3
|
+
border-color: var(--el-border-color, #dcdfe6);
|
|
4
|
+
border-radius: var(--wk-form-control-radius, var(--el-border-radius-base, 6px));
|
|
5
|
+
background: var(--el-fill-color-light, #f5f7fa);
|
|
6
6
|
transition: border-color 0.2s, background-color 0.2s;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.el-upload-dragger:hover,
|
|
10
10
|
.el-upload-dragger.is-dragover {
|
|
11
|
-
border-color: var(--el-color-primary);
|
|
12
|
-
background: var(--el-color-primary-light-9);
|
|
11
|
+
border-color: var(--el-color-primary, #2254f4);
|
|
12
|
+
background: var(--el-color-primary-light-9, #f2f5ff);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.el-upload__tip {
|
|
16
|
-
color: var(--el-text-color-secondary);
|
|
17
|
-
font-size: var(--el-font-size-small);
|
|
16
|
+
color: var(--el-text-color-secondary, #909399);
|
|
17
|
+
font-size: var(--el-font-size-small, 12px);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
html body .el-upload-list {
|
|
22
22
|
.el-upload-list__item {
|
|
23
|
-
border-radius: 6px;
|
|
23
|
+
border-radius: var(--wk-form-control-radius, var(--el-border-radius-base, 6px));
|
|
24
24
|
transition: background-color 0.2s;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.el-upload-list__item:hover {
|
|
28
|
-
background: var(--el-fill-color-lighter);
|
|
28
|
+
background: var(--el-fill-color-lighter, #fafafa);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.el-upload-list__item-name {
|
|
32
|
-
color: var(--el-text-color-regular);
|
|
32
|
+
color: var(--el-text-color-regular, #606266);
|
|
33
33
|
}
|
|
34
34
|
}
|