@agile-team/wl-skills-ui 1.6.13 → 1.7.0
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/CHANGELOG.md +24 -0
- package/README.md +22 -1
- package/docs/compat-matrix.md +47 -0
- package/docs/team-intro.md +168 -0
- package/mcp/server.js +23 -0
- package/package.json +2 -1
- package/scanner/integration.mjs +40 -0
- package/scripts/check-docs.mjs +22 -0
- package/skills/_flows/legacy-skin-align.md +14 -0
- package/skills/_meta/_compat/vendors.json +10 -2
- package/skills/vendors/jh-components/SKILL.md +20 -0
- package/styles/vendors/_jh-ui.scss +102 -0
- package/styles/vendors/index.scss +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All notable changes to **@agile-team/wl-skills-ui** will be documented in this f
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [1.7.0] - 2026-05-12
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- 新增 `docs/compat-matrix.md`:项目集群推荐版本与 wl-skills-ui 的适配矩阵单一事实源(`element-plus@2.2.6-prod.3` + `@jhlc/jh-ui@3.1.0`)。
|
|
12
|
+
- `skills/_meta/_compat/vendors.json` 在 `jh.compat` 字段钉死推荐 EP/jh-ui 版本与 EP 2.2 vs 2.3 DOM 差异说明。
|
|
13
|
+
- scanner 接入完整性新增 `I005`:从 `vendors.json` 读取推荐版本,校验消费方 `package.json` 是否命中推荐组合。
|
|
14
|
+
- MCP 新增 `wl_ui_detect_skin` 工具:读取项目 `package.json` 返回 `verdict (match / mismatch / no-jh-ui)` 与推荐 SCSS 列表。
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `legacy-skin-align` flow 增加 Phase 0.5 强约束:写样式前必须先识别 jh-ui ↔ EP 版本配对。
|
|
19
|
+
- `skills/vendors/jh-components/SKILL.md` 补全反例(`.el-input__wrapper.is-focus` 在 EP 2.2 永远命中不到等),并显式钉死推荐组合。
|
|
20
|
+
- `scripts/check-docs.mjs` 扩展:`docs/compat-matrix.md` 的 EP/jh-ui 版本必须与 `vendors.json` 一致。
|
|
21
|
+
- README 新增「项目-依赖适配矩阵速查」章节,引导消费方一键判断推荐组合是否命中。
|
|
22
|
+
|
|
23
|
+
## [1.6.14] - 2026-05-12
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- 新增 `styles/vendors/_jh-ui.scss` 专项承接 `@jhlc/jh-ui` SCSS 皮肤包,覆盖 `.com-text` label 包裹、`.has-colon` 冒号注入、`.com-input` / `.com-textarea` 控件 wrapper 等 jh-ui 特有 DOM 模式。
|
|
28
|
+
- 新增 Element Plus 2.2.x(`.el-input__inner` 直挂结构、无 `.el-input__wrapper`)下输入、选择、日期控件的圆角 / focus / error 三态规则,jh-select 与 jh-date-picker focus 表现稳定。
|
|
29
|
+
- `skills/_meta/_compat/vendors.json` 在 jh vendor 下登记 `@jhlc/jh-ui` baseline 与 `_jh-ui.scss` 样式来源;`skills/vendors/jh-components/SKILL.md` 补齐识别表与全局样式来源。
|
|
30
|
+
|
|
7
31
|
## [1.6.13] - 2026-05-12
|
|
8
32
|
|
|
9
33
|
### Fixed
|
package/README.md
CHANGED
|
@@ -191,10 +191,31 @@ yarn add @agile-team/wl-skills-ui
|
|
|
191
191
|
|
|
192
192
|
---
|
|
193
193
|
|
|
194
|
+
## 项目-依赖适配矩阵速查
|
|
195
|
+
|
|
196
|
+
集团项目集群推荐组合(**单一事实源**:`docs/compat-matrix.md` + `skills/_meta/_compat/vendors.json` 的 `jh.compat`):
|
|
197
|
+
|
|
198
|
+
| 依赖 | 推荐版本 | 备注 |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| `element-plus` | **`2.2.6-prod.3`** | 集团 jh- 定制版;EP 2.3.0 起引入 `.el-input__wrapper`,与 jh-ui 3.x 不兼容 |
|
|
201
|
+
| `@jhlc/jh-ui` | **`3.1.0`** | SCSS 皮肤包,`.com-text` label 包裹 + `.has-colon` 冒号注入 |
|
|
202
|
+
| `@agile-team/wl-skills-ui` | `^1.7.0` | 已对齐上述组合的 DOM 假设 |
|
|
203
|
+
|
|
204
|
+
新接入项目可执行 `npx wl-ui check --project .`(看 `I005`)或 MCP 工具 `wl_ui_detect_skin` 自动判断当前组合是否命中推荐。完整版本-项目实测表见 `docs/compat-matrix.md`。
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
194
208
|
## 版本亮点
|
|
195
209
|
|
|
196
|
-
当前 v1.
|
|
210
|
+
当前 v1.7.0 版本聚焦“**项目集群依赖配对单一事实源 + AI/Skill 强约束识别**”:
|
|
197
211
|
|
|
212
|
+
- 新增 `docs/compat-matrix.md` 作为项目集群推荐版本与 wl-skills-ui 的适配矩阵单一事实源;`skills/_meta/_compat/vendors.json` 在 `jh.compat` 字段钉死 `element-plus@2.2.6-prod.3` + `@jhlc/jh-ui@3.1.0`
|
|
213
|
+
- scanner 接入完整性新增 `I005`:基于 `vendors.json` 校验消费方 `package.json` 是否锚定推荐组合,偏离时给出明确建议
|
|
214
|
+
- MCP 新增 `wl_ui_detect_skin` 工具,AI 写样式前可一键拿到 `verdict: match | mismatch | no-jh-ui` 与推荐 SCSS 列表
|
|
215
|
+
- `legacy-skin-align` flow 增加 Phase 0.5 强约束:写样式前必须先识别版本配对;`jh-components` SKILL 补全反例(`.el-input__wrapper.is-focus` 在 EP 2.2 永远命中不到等)
|
|
216
|
+
- `docs:check` 扩展校验:`docs/compat-matrix.md` 中的版本号必须与 `vendors.json` 同步,避免事实源漂移
|
|
217
|
+
- 沿用 v1.6.14 的 `_jh-ui.scss` 适配层(`.com-text` label / EP 2.2.x `.el-input__inner` focus + error / 必填星号)
|
|
218
|
+
- 兼容 Element Plus 2.2.x(`.el-input__inner` 直挂结构)下输入、选择、日期控件的圆角 / focus / error 三态,jh-select 与 jh-date-picker focus 行为稳定
|
|
198
219
|
- 补强输入、选择、日期、文本域 focus 品牌色边框和必填星号红色显示规则,兼容 Element Plus 定制版本差异
|
|
199
220
|
- 修复表单必填星号、错误 label、错误提示和错误边框红色态,避免校验反馈被通用 label/input 样式覆盖
|
|
200
221
|
- 优化 BaseToolbar 下拉/分裂按钮组,让“主动作 + 下拉动作”按一个动作组展示,避免视觉割裂
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 项目-依赖适配矩阵
|
|
2
|
+
|
|
3
|
+
> 单一事实源,集团项目集群推荐版本与 wl-skills-ui 适配关系。
|
|
4
|
+
> scanner / MCP / Skill 文档统一从本表派生。
|
|
5
|
+
|
|
6
|
+
## 推荐版本(集团内推荐组合)
|
|
7
|
+
|
|
8
|
+
| 依赖 | 推荐版本 | 说明 |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| `vue` | `~3.2.25` 或 `^3.2.25` | 与项目集群保持一致 |
|
|
11
|
+
| `element-plus` | **`2.2.6-prod.3`** | 集团 jh- 定制版,搭配 `@jhlc/jh-ui` 使用,DOM 仍为 `.el-input > .el-input__inner` 直挂结构(**EP 2.3.0 起才引入 `.el-input__wrapper`**) |
|
|
12
|
+
| `@jhlc/jh-ui` | **`3.1.0`** | SCSS 皮肤包,`.com-text` label 包裹、`.has-colon ::after` 冒号注入、`.el-form-item--default { margin-bottom: 24px }` 等强约束 |
|
|
13
|
+
| `@jhlc/common-core` | `3.1.0` 或 `3.1.0-prod.x` | 基础 util/types,`@jhlc/jh-ui` 间接依赖 |
|
|
14
|
+
| `@agile-team/wl-skills-ui` | `^1.7.0` | 已对齐 jh-ui 3.1.0 + EP 2.2.6-prod.3 的 DOM 假设 |
|
|
15
|
+
|
|
16
|
+
## 项目集群当前实测
|
|
17
|
+
|
|
18
|
+
| 项目 | element-plus | @jhlc/jh-ui | 适配状态 |
|
|
19
|
+
|---|---|---|---|
|
|
20
|
+
| `wl-ui-sale` | `2.2.6-prod.3` | `3.1.0` | ✅ 推荐组合 |
|
|
21
|
+
| `wl-ui-public` | `2.2.6-prod.3` | `3.1.0` | ✅ 推荐组合 |
|
|
22
|
+
| `wl-ui-safe` | `2.2.6-prod.3` | `3.1.0` | ✅ 推荐组合 |
|
|
23
|
+
| `wl-ui-security` | `2.2.6-prod.3` | `3.1.0` | ✅ 推荐组合 |
|
|
24
|
+
| `wl-mdata` | `2.2.6-prod.3` | — | ⚠️ 仅 `@jhlc/common-core`,未装 jh-ui,本表 jh-ui 相关规则不生效 |
|
|
25
|
+
|
|
26
|
+
## EP 2.2.x vs EP 2.3+ DOM 差异(适配关键依据)
|
|
27
|
+
|
|
28
|
+
| 维度 | EP 2.2.x(jh-ui 配套) | EP 2.3+(社区主流) |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| 输入控件 | `.el-input > .el-input__inner` | `.el-input > .el-input__wrapper > .el-input__inner` |
|
|
31
|
+
| focus 标志 | `.el-input.is-focus` / `.el-input__inner:focus` | `.el-input__wrapper.is-focus` / `:focus-within` |
|
|
32
|
+
| select | `.el-select .el-input > .el-input__inner` | `.el-select__wrapper` |
|
|
33
|
+
| 错误态 | `.el-form-item.is-error .el-input__inner` | `.el-form-item.is-error .el-input__wrapper` |
|
|
34
|
+
| 表单 label | jh-ui 注入 `<span class="com-text">` 包裹文本 | EP 默认直接渲染文本节点 |
|
|
35
|
+
|
|
36
|
+
## 适配建议
|
|
37
|
+
|
|
38
|
+
- 集团内项目:**统一锚定 `element-plus@2.2.6-prod.3` + `@jhlc/jh-ui@3.1.0`**,与 wl-skills-ui v1.7.0 三方对齐。
|
|
39
|
+
- 升级 `element-plus` 到 2.3+ 前,必须同步升级 `@jhlc/jh-ui` 到对应支持版本,否则 `.com-text` / `.el-input__inner` DOM 与 EP `__wrapper` 体系不兼容。
|
|
40
|
+
- 新项目接入:见 README 「快速接入」章节,默认会按本表声明 peerDependency 范围。
|
|
41
|
+
|
|
42
|
+
## 维护流程
|
|
43
|
+
|
|
44
|
+
- 推荐版本字段统一在 `skills/_meta/_compat/vendors.json` 的 `vendors[id=jh].compat` 字段。
|
|
45
|
+
- 本文档由 `scripts/check-docs.mjs` 校验:版本号必须与 `vendors.json` 一致,避免漂移。
|
|
46
|
+
- scanner `I005` 接入完整性检查会按本表校验消费方项目是否使用推荐组合。
|
|
47
|
+
- MCP 工具 `wl_ui_detect_skin` 直接读取消费方 `package.json` 给 AI 返回结构化结果。
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# @agile-team/wl-skills-ui — 团队接入指南
|
|
2
|
+
|
|
3
|
+
> 版本:v1.6.0 · 适用:所有基于 Vue 3 + Element Plus 的业务子应用
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 我们现在有什么问题?
|
|
8
|
+
|
|
9
|
+
各个子系统独自维护样式,导致:
|
|
10
|
+
|
|
11
|
+
- 同一个按钮,各系统颜色/大小/间距都不一样
|
|
12
|
+
- 弹窗、表格、分页、标签——每个系统长一个样
|
|
13
|
+
- 模块联邦把各系统挂在同一个平台,视觉割裂感很强
|
|
14
|
+
- 改一处要在多个仓库重复改,越改越乱
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 这个包解决什么?
|
|
19
|
+
|
|
20
|
+
**一套 CSS + 一行导入,所有子系统统一视觉。**
|
|
21
|
+
|
|
22
|
+
核心做三件事:
|
|
23
|
+
|
|
24
|
+
| 能力 | 说明 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| **设计令牌** | 统一定义颜色、按钮尺寸、间距、圆角、阴影。改一个变量,全系统生效 |
|
|
27
|
+
| **样式化妆层** | 不改业务代码,直接覆盖 Element Plus 原生控件 + 内部封装组件(`Base*` / `jh-*` / `C_*` / `c_*` / AG Grid) |
|
|
28
|
+
| **扫描 & 修复** | 自动扫描项目里哪些地方写死了颜色、不合规范,一键 dry-run 预览修复内容,确认后批量修复 |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 两种接入方式,选一种就行
|
|
33
|
+
|
|
34
|
+
### 方式 A — 化妆模式(推荐老项目,不动业务代码)
|
|
35
|
+
|
|
36
|
+
适合:**项目已有大量业务代码,不想动**。一行样式导入,立刻对齐视觉。
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm add @agile-team/wl-skills-ui
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```scss
|
|
43
|
+
// src/styles/index.scss(或项目全局样式入口)
|
|
44
|
+
@use "@agile-team/wl-skills-ui/styles/presets/skin" as *;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
完成。刷新页面,按钮、表格、分页、弹窗、标签全部对齐统一风格。
|
|
48
|
+
|
|
49
|
+
> **可以回退**:把这一行 `@use` 删掉,样式立刻恢复原状,零风险。
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### 方式 B — 原生模式(推荐新项目 / 可以重构的项目)
|
|
54
|
+
|
|
55
|
+
适合:**新项目,或者想进一步把业务写法也规范化**。
|
|
56
|
+
|
|
57
|
+
```scss
|
|
58
|
+
// src/styles/index.scss
|
|
59
|
+
@use "@agile-team/wl-skills-ui/styles" as *;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// src/main.ts
|
|
64
|
+
import { installCommonPreset } from "@agile-team/wl-skills-ui/runtime/common-preset";
|
|
65
|
+
installCommonPreset();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
额外获得:
|
|
69
|
+
- 状态字段(启用/禁用/审核/已验证)自动渲染为 Tag,不用手写模板
|
|
70
|
+
- 操作列(查看/编辑/删除)按统一规范生成,不用每个页面重复写
|
|
71
|
+
- 页面骨架(列表页/左树右表/弹窗表单/详情页)有现成模板
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 现在就能看效果吗?
|
|
76
|
+
|
|
77
|
+
可以,3 分钟验证:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# 1. 安装
|
|
81
|
+
pnpm add @agile-team/wl-skills-ui
|
|
82
|
+
|
|
83
|
+
# 2. 在全局样式入口加一行
|
|
84
|
+
# @use "@agile-team/wl-skills-ui/styles/presets/skin" as *;
|
|
85
|
+
|
|
86
|
+
# 3. 启动项目,浏览器看效果
|
|
87
|
+
pnpm dev
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
如果效果不对 / 有冲突,删掉那一行即可完全还原。
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 想知道项目哪里不符合规范?先扫描
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# 扫描 src 目录,输出报告
|
|
98
|
+
npx wl-ui scan --target src --outFile ui-audit.md
|
|
99
|
+
|
|
100
|
+
# 预览修复内容(不实际写入)
|
|
101
|
+
npx wl-ui fix --target src --dry-run
|
|
102
|
+
|
|
103
|
+
# 确认没问题,执行修复
|
|
104
|
+
npx wl-ui fix --target src
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
扫描报告会告诉你:哪些文件写死了颜色、哪些按钮不合尺寸规范、哪些封装组件需要覆盖样式。
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 能回退吗?
|
|
112
|
+
|
|
113
|
+
**完全可以,三个层面都支持回退:**
|
|
114
|
+
|
|
115
|
+
| 操作 | 回退方式 |
|
|
116
|
+
|------|----------|
|
|
117
|
+
| 样式导入 | 删除 `@use` 那一行,立即恢复 |
|
|
118
|
+
| 扫描修复 | 修复前有 `--dry-run` 预览;git 可随时 `revert` |
|
|
119
|
+
| CLI 工具安装 | `npx wl-ui clean --project .` 一键卸载所有注入文件 |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 各系统哪些组件会被统一?
|
|
124
|
+
|
|
125
|
+
接入后,以下内容会自动对齐视觉(无需任何额外配置):
|
|
126
|
+
|
|
127
|
+
**Element Plus 原生控件**
|
|
128
|
+
- 按钮颜色、尺寸、间距
|
|
129
|
+
- 表格(行高、边框、斑马纹、操作列)
|
|
130
|
+
- 表单(Label 宽度、输入框尺寸)
|
|
131
|
+
- 弹窗(标题栏、底部按钮位置)
|
|
132
|
+
- 分页(对齐方式、按钮样式)
|
|
133
|
+
- Tag(颜色语义:成功/警告/危险/信息)
|
|
134
|
+
- Card、Tabs、Tree、Drawer、Upload、Steps、Tooltip、Dropdown...
|
|
135
|
+
|
|
136
|
+
**内部封装组件(有源码没源码都能覆盖)**
|
|
137
|
+
- `BaseTable` / `BaseQuery` / `BaseToolbar` / `BaseDialog`
|
|
138
|
+
- `jh-tree` / `jh-pagination` / `jh-drag-col`
|
|
139
|
+
- `C_*` / `c_*` 前缀组件
|
|
140
|
+
- AG Grid 表格主题
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 如果用了 AI 编辑器(Copilot / Cursor / Cline 等)
|
|
145
|
+
|
|
146
|
+
可以一句话触发 AI 自动帮你把整个项目的样式对齐:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
用 wl-ui 的 legacy-skin-align 流程对当前项目做老项目化妆对齐
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
AI 会按照 6 个阶段依次执行:接入 tokens → 引入 skin preset → 修复各类封装组件样式 → 修复 Element Plus 控件 → 修复硬编码颜色 → 全程不动业务逻辑。
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 安装一览
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pnpm add @agile-team/wl-skills-ui
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
要求:Node ≥ 18,Vue ≥ 3.2,Element Plus ≥ 2.2
|
|
163
|
+
|
|
164
|
+
NPM:[@agile-team/wl-skills-ui](https://www.npmjs.com/package/@agile-team/wl-skills-ui)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
*有问题找杨晨誉,或直接群里说。*
|
package/mcp/server.js
CHANGED
|
@@ -83,6 +83,21 @@ const TOOLS = [
|
|
|
83
83
|
required: ["text"],
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
|
+
{
|
|
87
|
+
name: "wl_ui_detect_skin",
|
|
88
|
+
description:
|
|
89
|
+
"读取目标项目 package.json,识别 @jhlc/jh-ui 与 element-plus 版本配对,返回适配矩阵建议。",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
project: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "项目根目录,默认 WL_PROJECT_ROOT 或当前目录",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
required: [],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
86
101
|
{
|
|
87
102
|
name: "wl_ui_recommend_flow",
|
|
88
103
|
description:
|
|
@@ -333,6 +348,14 @@ async function dispatchTool(id, name, args) {
|
|
|
333
348
|
});
|
|
334
349
|
return;
|
|
335
350
|
}
|
|
351
|
+
if (name === "wl_ui_detect_skin") {
|
|
352
|
+
sendResult(id, {
|
|
353
|
+
content: [
|
|
354
|
+
{ type: "text", text: JSON.stringify(detectSkin(args), null, 2) },
|
|
355
|
+
],
|
|
356
|
+
});
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
336
359
|
if (name === "wl_ui_recommend_flow") {
|
|
337
360
|
sendResult(id, {
|
|
338
361
|
content: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agile-team/wl-skills-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
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",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"standards",
|
|
57
57
|
"styles",
|
|
58
58
|
"design",
|
|
59
|
+
"docs",
|
|
59
60
|
"skills",
|
|
60
61
|
"templates",
|
|
61
62
|
"bin",
|
package/scanner/integration.mjs
CHANGED
|
@@ -7,9 +7,21 @@
|
|
|
7
7
|
* I002 — main.scss / 全局入口是否引入 @agile-team/wl-skills-ui/styles 或 shared/index.scss
|
|
8
8
|
* I003 — src/util/ 是否有 ag-cell-renders.ts 或者 main.ts 中安装了 runtime
|
|
9
9
|
* I004 — element-plus 是否在 dependencies 中(peer 兼容)
|
|
10
|
+
* I005 — @jhlc/jh-ui ↔ element-plus 版本配对是否符合推荐组合(vendors.json 单一事实源)
|
|
10
11
|
*/
|
|
11
12
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
12
13
|
import { join, dirname } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const VENDORS_JSON = JSON.parse(
|
|
19
|
+
readFileSync(
|
|
20
|
+
join(__dirname, "..", "skills", "_meta", "_compat", "vendors.json"),
|
|
21
|
+
"utf8",
|
|
22
|
+
),
|
|
23
|
+
);
|
|
24
|
+
const JH_COMPAT = VENDORS_JSON.vendors.find((v) => v.id === "jh")?.compat || {};
|
|
13
25
|
|
|
14
26
|
/**
|
|
15
27
|
* @param {string} projectRoot — 项目根目录(包含 index.html / src / package.json)
|
|
@@ -140,6 +152,34 @@ export function checkIntegration(projectRoot) {
|
|
|
140
152
|
: `peer 依赖缺失:${!hasVue ? "vue " : ""}${!hasEp ? "element-plus" : ""}`,
|
|
141
153
|
suggestion: hasEp && hasVue ? "" : "pnpm add vue element-plus",
|
|
142
154
|
});
|
|
155
|
+
|
|
156
|
+
// ── I005: jh-ui ↔ element-plus 版本配对 ──────────────────────────
|
|
157
|
+
const jhUi = deps["@jhlc/jh-ui"];
|
|
158
|
+
const ep = deps["element-plus"];
|
|
159
|
+
if (jhUi) {
|
|
160
|
+
const epOk = ep && ep.includes(JH_COMPAT.elementPlus || "2.2.6-prod.3");
|
|
161
|
+
const jhOk = jhUi.includes(JH_COMPAT.jhUi || "3.1.0");
|
|
162
|
+
const ok = epOk && jhOk;
|
|
163
|
+
checks.push({
|
|
164
|
+
id: "I005",
|
|
165
|
+
severity: ok ? "info" : "warning",
|
|
166
|
+
ok,
|
|
167
|
+
description: ok
|
|
168
|
+
? `jh-ui 推荐组合命中(@jhlc/jh-ui ${jhUi} + element-plus ${ep})`
|
|
169
|
+
: `jh-ui 版本配对偏离推荐(实际 @jhlc/jh-ui ${jhUi} + element-plus ${ep || "未安装"})`,
|
|
170
|
+
suggestion: ok
|
|
171
|
+
? ""
|
|
172
|
+
: `推荐组合:@jhlc/jh-ui@${JH_COMPAT.jhUi} + element-plus@${JH_COMPAT.elementPlus}(详见 docs/compat-matrix.md)`,
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
checks.push({
|
|
176
|
+
id: "I005",
|
|
177
|
+
severity: "info",
|
|
178
|
+
ok: true,
|
|
179
|
+
description: "未检测到 @jhlc/jh-ui,跳过 jh-ui 配对校验",
|
|
180
|
+
suggestion: "",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
143
183
|
} catch {
|
|
144
184
|
checks.push({
|
|
145
185
|
id: "I004",
|
package/scripts/check-docs.mjs
CHANGED
|
@@ -97,6 +97,28 @@ if (existsSync(jhSkill)) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
// compat-matrix.md ↔ vendors.json 一致性
|
|
101
|
+
const vendorsJson = JSON.parse(
|
|
102
|
+
readFileSync(join(root, "skills", "_meta", "_compat", "vendors.json"), "utf8"),
|
|
103
|
+
);
|
|
104
|
+
const jhCompat = vendorsJson.vendors.find((v) => v.id === "jh")?.compat || {};
|
|
105
|
+
const compatMatrixPath = join(root, "docs", "compat-matrix.md");
|
|
106
|
+
if (existsSync(compatMatrixPath)) {
|
|
107
|
+
const matrix = readFileSync(compatMatrixPath, "utf8");
|
|
108
|
+
if (jhCompat.elementPlus && !matrix.includes(jhCompat.elementPlus)) {
|
|
109
|
+
errors.push(
|
|
110
|
+
`docs/compat-matrix.md: 缺少推荐 element-plus 版本 ${jhCompat.elementPlus}(与 vendors.json jh.compat 不一致)`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if (jhCompat.jhUi && !matrix.includes(jhCompat.jhUi)) {
|
|
114
|
+
errors.push(
|
|
115
|
+
`docs/compat-matrix.md: 缺少推荐 @jhlc/jh-ui 版本 ${jhCompat.jhUi}(与 vendors.json jh.compat 不一致)`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
errors.push("docs/compat-matrix.md: 文件不存在,无法校验适配矩阵");
|
|
120
|
+
}
|
|
121
|
+
|
|
100
122
|
if (!readme.includes(`当前 v${pkg.version}`)) {
|
|
101
123
|
errors.push(
|
|
102
124
|
`README.md: 当前版本文案未同步 package.json version ${pkg.version}`,
|
|
@@ -27,6 +27,20 @@ npx wl-ui doctor --project .
|
|
|
27
27
|
|
|
28
28
|
(AI 严格按序)
|
|
29
29
|
|
|
30
|
+
### Phase 0.5 — 识别 jh-ui ↔ Element Plus 版本配对(强约束)
|
|
31
|
+
|
|
32
|
+
在写任何样式前,**必须先**通过下列任一方式确认推荐组合命中情况:
|
|
33
|
+
|
|
34
|
+
- MCP:调用 `wl_ui_detect_skin`,读取项目 `package.json` 返回 `verdict`(`match` / `mismatch` / `no-jh-ui`)。
|
|
35
|
+
- CLI:执行 `npx wl-ui check --project .`,关注 `I005` 项。
|
|
36
|
+
- 文档:对照 `docs/compat-matrix.md` 的「推荐版本」表。
|
|
37
|
+
|
|
38
|
+
判定规则:
|
|
39
|
+
|
|
40
|
+
- `verdict === "match"`(推荐组合):`_jh-ui.scss` 等 EP 2.2.x 适配规则可全量启用。
|
|
41
|
+
- `verdict === "mismatch"`(版本偏离):禁止套用 EP 2.6+ `.el-input__wrapper` 规则;先与项目方对齐版本再继续 Phase 1。
|
|
42
|
+
- `verdict === "no-jh-ui"`:无需启用 `_jh-ui.scss`,按 EP 默认 DOM 处理。
|
|
43
|
+
|
|
30
44
|
### Phase 1 — 接入 tokens
|
|
31
45
|
1. 检查 `index.html`,在 `<head>` 内追加:
|
|
32
46
|
```html
|
|
@@ -31,13 +31,21 @@
|
|
|
31
31
|
"jh-form",
|
|
32
32
|
"jh-tree",
|
|
33
33
|
"jh-pagination",
|
|
34
|
-
"jh-drag-col"
|
|
34
|
+
"jh-drag-col",
|
|
35
|
+
"@jhlc/jh-ui"
|
|
35
36
|
],
|
|
36
37
|
"styles": [
|
|
38
|
+
"_jh-ui.scss",
|
|
37
39
|
"_jh-tree.scss",
|
|
38
40
|
"_jh-pagination.scss",
|
|
39
41
|
"_jh-drag-col.scss"
|
|
40
|
-
]
|
|
42
|
+
],
|
|
43
|
+
"compat": {
|
|
44
|
+
"elementPlus": "2.2.6-prod.3",
|
|
45
|
+
"elementPlusRange": "<2.3.0",
|
|
46
|
+
"jhUi": "3.1.0",
|
|
47
|
+
"note": "jh-ui 3.x 假设 EP 2.2.x DOM (.el-input>.el-input__inner),EP 2.3 起引入 .el-input__wrapper 后不再兼容"
|
|
48
|
+
}
|
|
41
49
|
},
|
|
42
50
|
{
|
|
43
51
|
"id": "c",
|
|
@@ -15,6 +15,7 @@ applyTo: "**/*.vue"
|
|
|
15
15
|
|
|
16
16
|
| 类型 | 子组件 | 标签 | 关键类名 | 治理方式 |
|
|
17
17
|
|---|---|---|---|---|
|
|
18
|
+
| SCSS 皮肤适配 | `@jhlc/jh-ui` | — | `.com-text` / `.com-input` / `.com-textarea` / `.com-input-tip` | `styles/vendors/_jh-ui.scss` |
|
|
18
19
|
| 专项样式覆盖 | jh-tree | `<jh-tree>` | `.jh-tree` / `.base-tree` | `styles/vendors/_jh-tree.scss` |
|
|
19
20
|
| 专项样式覆盖 | jh-pagination | `<jh-pagination>` | `.jh-pagination` | `styles/vendors/_jh-pagination.scss` |
|
|
20
21
|
| 专项样式覆盖 | jh-drag-col | `<jh-drag-col>` | `.drag-col-container` / `.drag-left` / `.slider-col` | `styles/vendors/_jh-drag-col.scss` |
|
|
@@ -22,6 +23,24 @@ applyTo: "**/*.vue"
|
|
|
22
23
|
| 通用规则治理 | jh-form | `<jh-form>` | `.jh-form` | 继承 L0 tokens + L1 form 视觉原则 |
|
|
23
24
|
| 通用规则治理 | 其它 jh-* | `<jh-*>` | `.jh-*` / 组件内部 Element Plus 类 | 先按 jh 通用规则治理,复杂结构再升级专项样式 |
|
|
24
25
|
|
|
26
|
+
### `@jhlc/jh-ui` SCSS 皮肤包识别
|
|
27
|
+
|
|
28
|
+
**推荐组合(钉死版本)**:`@jhlc/jh-ui@3.1.0` + `element-plus@2.2.6-prod.3`。详见 `docs/compat-matrix.md` 与 `skills/_meta/_compat/vendors.json` 的 `jh.compat` 字段。
|
|
29
|
+
|
|
30
|
+
项目同时安装 `@jhlc/jh-ui` 与 `element-plus@2.2.x` 时,输入控件 DOM 为 `.el-input > .el-input__inner`(**无 `.el-input__wrapper`**,EP 2.3.0 起才引入),表单 label 文本被包成 `<span class="com-text">`,并由 `.has-colon .com-text::after` 注入冒号。`_jh-ui.scss` 已精准覆盖:
|
|
31
|
+
|
|
32
|
+
- label `.com-text` 单行省略 + has-colon 冒号保留
|
|
33
|
+
- EP 2.2.x `.el-input__inner` 圆角 / focus / error 三态
|
|
34
|
+
- jh-select / jh-date-picker 的 `.el-select.is-focus` / `.el-input.is-focus` 兼容
|
|
35
|
+
- 必填星号在 inline-flex label 下显式声明颜色
|
|
36
|
+
|
|
37
|
+
**反例**(常见错误覆盖姿势):
|
|
38
|
+
|
|
39
|
+
- ❌ 在 jh-ui 项目里用 `.el-input__wrapper.is-focus` —— EP 2.2.x 没有 `__wrapper`,规则永不生效。
|
|
40
|
+
- ❌ 直接给 `.el-form-item__label` 写 `text-overflow: ellipsis` —— jh-ui 把它设为 `inline-flex`,文本在 `.com-text` 里,省略不会触发。
|
|
41
|
+
- ❌ 给 `.el-form-item__label` 加 `padding-right` 期望腾出冒号位 —— 冒号是 `.com-text::after`,应在 `.com-text` 上加 padding。
|
|
42
|
+
- ❌ 在不确定 EP 版本的情况下下笔修复 —— 必须先跑 `wl_ui_detect_skin` 或 `wl-ui check` 看 I005 结果。
|
|
43
|
+
|
|
25
44
|
## Diagnose
|
|
26
45
|
|
|
27
46
|
- ❌ 自行给 `.jh-tree` 写颜色覆盖(应用全局 `vendors/_jh-tree.scss`)
|
|
@@ -42,6 +61,7 @@ applyTo: "**/*.vue"
|
|
|
42
61
|
|
|
43
62
|
## 全局样式来源
|
|
44
63
|
|
|
64
|
+
- `styles/vendors/_jh-ui.scss`
|
|
45
65
|
- `styles/vendors/_jh-tree.scss`
|
|
46
66
|
- `styles/vendors/_jh-pagination.scss`
|
|
47
67
|
- `styles/vendors/_jh-drag-col.scss`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2
|
+
// @jhlc/jh-ui adapter — L2 vendor 化妆层(项目集群专用)
|
|
3
|
+
//
|
|
4
|
+
// 背景
|
|
5
|
+
// `@jhlc/jh-ui@3.x` 是项目集群在用的 Element Plus SCSS 皮肤包,
|
|
6
|
+
// 常与 Element Plus 2.2.x(如 `element-plus@2.2.6-prod.3`)配套使用。
|
|
7
|
+
// 它对 Element Plus 的 DOM/选择器约定与社区版(2.6+)不一致:
|
|
8
|
+
//
|
|
9
|
+
// 1. 表单 label 文本被包成 `<span class="com-text">`,
|
|
10
|
+
// `.el-form-item__label` 自身是 `display: inline-flex`。
|
|
11
|
+
// → 直接在 label 上写 ellipsis 不生效,必须落到 `.com-text`。
|
|
12
|
+
// 2. `.has-colon .el-form-item__label .com-text::after` 注入冒号。
|
|
13
|
+
// → ellipsis 容器必须给 `::after` 预留空间。
|
|
14
|
+
// 3. 输入控件 DOM 为 `.el-input > .el-input__inner`(无 `.el-input__wrapper`)。
|
|
15
|
+
// → focus / error 必须命中 `.el-input__inner`,
|
|
16
|
+
// `.el-input__wrapper.is-focus` 这类 EP 2.6+ 规则在这里不生效。
|
|
17
|
+
// 4. select 用 `.el-select .el-input > .el-input__inner`,
|
|
18
|
+
// focus 标志位为 `.el-select.is-focus` 或 `.el-input.is-focus`。
|
|
19
|
+
// 5. `.com-input` / `.com-textarea` / `.com-input-tip` 是 jh-ui 的控件
|
|
20
|
+
// 外层 wrapper,承载 form-item 的 has-tip / is-error 形态。
|
|
21
|
+
//
|
|
22
|
+
// 边界
|
|
23
|
+
// - 本文件只负责修复 jh-ui DOM 与 wl-skills-ui 统一规则的对接差异。
|
|
24
|
+
// - 不重复 jh-ui 已经设好的视觉(如下拉项 padding/radius、表单 margin-bottom)。
|
|
25
|
+
// - Element Plus 2.6+ 项目的 `.el-input__wrapper` 规则继续由
|
|
26
|
+
// `_base-components.scss` 统一处理。
|
|
27
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
28
|
+
|
|
29
|
+
// 1) label 文本容器(.com-text) — 单行省略,允许收缩
|
|
30
|
+
// .el-form-item__label 在 jh-ui 中是 inline-flex,
|
|
31
|
+
// 必须放开 min-width 才能让内部 .com-text 真的 shrink。
|
|
32
|
+
.el-form-item__label {
|
|
33
|
+
min-width: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.el-form-item__label > .com-text,
|
|
37
|
+
.el-form-item__label .com-text {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
min-width: 0;
|
|
40
|
+
max-width: 100%;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// has-colon 模式下,.com-text::after 注入冒号,
|
|
48
|
+
// 给一点 padding 避免冒号被 ellipsis 裁掉
|
|
49
|
+
.has-colon .el-form-item__label > .com-text,
|
|
50
|
+
.has-colon .el-form-item__label .com-text {
|
|
51
|
+
padding-right: 6px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 2) Element Plus 2.2.x 输入控件统一圆角(无 .el-input__wrapper)
|
|
55
|
+
.el-input > .el-input__inner,
|
|
56
|
+
.el-textarea > .el-textarea__inner,
|
|
57
|
+
.el-date-editor > .el-input__inner {
|
|
58
|
+
border-radius: 6px;
|
|
59
|
+
transition: box-shadow 0.15s ease, border-color 0.15s ease;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 3) focus 品牌色边框(兼容 EP 2.2.x DOM 与 jh-select / jh-date-picker)
|
|
63
|
+
.el-input.is-focus > .el-input__inner,
|
|
64
|
+
.el-input > .el-input__inner:focus,
|
|
65
|
+
.el-textarea.is-focus > .el-textarea__inner,
|
|
66
|
+
.el-textarea > .el-textarea__inner:focus,
|
|
67
|
+
.el-select.is-focus .el-input > .el-input__inner,
|
|
68
|
+
.el-select .el-input.is-focus > .el-input__inner,
|
|
69
|
+
.el-date-editor.is-focus > .el-input__inner,
|
|
70
|
+
.el-date-editor .el-input.is-focus > .el-input__inner {
|
|
71
|
+
border-color: var(--el-color-primary, #2254f4) !important;
|
|
72
|
+
box-shadow: 0 0 0 1px var(--el-color-primary, #2254f4) inset;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 4) error 红色边框(兼容 EP 2.2.x DOM;
|
|
76
|
+
// error label / message 颜色由 _base-components.scss 已统一处理)
|
|
77
|
+
.el-form-item.is-error .el-input > .el-input__inner,
|
|
78
|
+
.el-form-item.is-error .el-textarea > .el-textarea__inner,
|
|
79
|
+
.el-form-item.is-error .el-date-editor > .el-input__inner {
|
|
80
|
+
border-color: var(--el-color-danger, #f56c6c) !important;
|
|
81
|
+
box-shadow: 0 0 0 1px var(--el-color-danger, #f56c6c) inset !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 5) com-input / com-textarea / com-input-tip — jh-ui form-item wrapper
|
|
85
|
+
// 保留 jh-ui 自身 margin-bottom、has-tip 间距,不覆盖;
|
|
86
|
+
// 仅对齐内部输入控件圆角,避免在 wrapper 内 fallback 成方角。
|
|
87
|
+
.com-input > .el-input > .el-input__inner,
|
|
88
|
+
.com-input > .el-textarea > .el-textarea__inner,
|
|
89
|
+
.com-textarea > .el-textarea > .el-textarea__inner {
|
|
90
|
+
border-radius: 6px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 6) 必填星号兼容 jh-ui label 结构
|
|
94
|
+
// Element Plus 把 `::before` 放在 `.el-form-item__label` 上,
|
|
95
|
+
// jh-ui 没改这一点;但 label 自身是 inline-flex,部分浏览器下
|
|
96
|
+
// `::before` 会作为 flex 项参与排版,必须显式声明颜色/显示。
|
|
97
|
+
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before,
|
|
98
|
+
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::after,
|
|
99
|
+
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label > .com-text::before,
|
|
100
|
+
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label > .com-text::after {
|
|
101
|
+
color: var(--el-color-danger, #f56c6c) !important;
|
|
102
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
@forward './_ag-grid'; // AG Grid 完整主题
|
|
10
10
|
@forward './_custom-wrappers'; // 兜底:野路子自封装
|
|
11
11
|
@forward './_c-components'; // C_/c_ 前缀
|
|
12
|
+
@forward './_jh-ui'; // @jhlc/jh-ui SCSS 皮肤包(EP 2.2.x + .com-text label)
|
|
12
13
|
@forward './_jh-tree'; // jh-tree
|
|
13
14
|
@forward './_jh-pagination'; // jh-pagination
|
|
14
15
|
@forward './_jh-drag-col'; // jh-drag-col(含左树右表骨架)
|