@czxingyu/xycomponents 0.1.1 → 0.1.3
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/README.md +22 -29
- package/README.zh-CN.md +15 -12
- package/dist/anchor/anchor.js +1 -1
- package/dist/anchor/anchor.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/descriptions/descriptions.js +1 -1
- package/dist/descriptions/descriptions.vue_vue_type_script_setup_true_lang.js +69 -65
- package/dist/index.esm.js +105 -94
- package/dist/index.lite.esm.js +95 -90
- package/dist/index.umd.js +3 -3
- package/dist/package.js +1 -1
- package/dist/steps/steps.js +1 -1
- package/dist/steps/steps.vue_vue_type_script_setup_true_lang.js +22 -18
- package/dist/table/table.js +1 -1
- package/dist/table/table.vue_vue_type_script_setup_true_lang.js +32 -26
- package/dist/xycomponents-lite.css +1 -1
- package/dist/xycomponents.css +1 -1
- package/package.json +3 -2
- package/skills/README.md +64 -0
- package/skills/xycomponents-cli/SKILL.md +101 -0
- package/skills/xycomponents-contribute/SKILL.md +109 -0
- package/skills/xycomponents-maintainer/SKILL.md +118 -0
- package/skills/xycomponents-shared/SKILL.md +100 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@czxingyu/xycomponents",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xycomponents": "dist/cli.js"
|
|
6
6
|
},
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"dist",
|
|
9
9
|
"components/style/*.css",
|
|
10
10
|
"docs/maintenance/migrations/*.md",
|
|
11
|
-
"global.d.ts"
|
|
11
|
+
"global.d.ts",
|
|
12
|
+
"skills"
|
|
12
13
|
],
|
|
13
14
|
"type": "module",
|
|
14
15
|
"sideEffects": [
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# xycomponents AI Skills
|
|
2
|
+
|
|
3
|
+
面向 Cursor 等 AI Agent 的 Skill,配合项目内安装的 `@czxingyu/xycomponents` 使用。
|
|
4
|
+
|
|
5
|
+
## 原则
|
|
6
|
+
|
|
7
|
+
- **CLI 与组件库版本一致**:在业务项目中 `pnpm add @czxingyu/xycomponents`,用 `pnpm exec xycomponents` 查询;升级库时重新 `pnpm add`,CLI 随包更新。
|
|
8
|
+
- **不要全局安装** CLI,避免 AI 查到与项目不一致的 API。
|
|
9
|
+
- **Bug / 新组件**:业务项目 AI 用 `xycomponents-contribute` 提交 GitHub Issue;组件库维护者用 `xycomponents-maintainer` 集中分诊与修复。
|
|
10
|
+
|
|
11
|
+
## 完整闭环
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
业务项目 组件库仓库 (vue3components)
|
|
15
|
+
──────── ──────────────────────────
|
|
16
|
+
pnpm add @czxingyu/xycomponents
|
|
17
|
+
pnpm exec xycomponents ... ──► 查用法 / API
|
|
18
|
+
│
|
|
19
|
+
▼ Bug 或 Feature
|
|
20
|
+
gh issue create (contribute) ──► needs-triage 队列
|
|
21
|
+
maintainer skill 拉取 Issue
|
|
22
|
+
修复 / 新增组件 / 发版
|
|
23
|
+
▲
|
|
24
|
+
pnpm add @新版本 ◄─────────────── 关闭 Issue,注明版本
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 安装 Skill 到业务项目
|
|
28
|
+
|
|
29
|
+
复制 **`xycomponents-shared`**、**`xycomponents-cli`**、**`xycomponents-contribute`** 到 `.cursor/skills/`。
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add @czxingyu/xycomponents
|
|
33
|
+
cp -r node_modules/@czxingyu/xycomponents/skills/xycomponents-shared .cursor/skills/
|
|
34
|
+
cp -r node_modules/@czxingyu/xycomponents/skills/xycomponents-cli .cursor/skills/
|
|
35
|
+
cp -r node_modules/@czxingyu/xycomponents/skills/xycomponents-contribute .cursor/skills/
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
本仓库维护者额外启用 **`xycomponents-maintainer`**(已在 `.cursor/skills/`)。
|
|
39
|
+
|
|
40
|
+
提交 Issue 需本机安装 [GitHub CLI](https://cli.github.com/) 并 `gh auth login`。
|
|
41
|
+
|
|
42
|
+
## Skill 列表
|
|
43
|
+
|
|
44
|
+
| Skill | 谁用 | 用途 |
|
|
45
|
+
| ------------------------------------------------------------- | ------------ | ---------------------------- |
|
|
46
|
+
| [xycomponents-shared](./xycomponents-shared/SKILL.md) | 业务项目 | 安装、版本策略、Vue 接入 |
|
|
47
|
+
| [xycomponents-cli](./xycomponents-cli/SKILL.md) | 业务项目 | CLI 查询 Props / 示例 |
|
|
48
|
+
| [xycomponents-contribute](./xycomponents-contribute/SKILL.md) | 业务项目 | 提交 Bug / Feature Issue |
|
|
49
|
+
| [xycomponents-maintainer](./xycomponents-maintainer/SKILL.md) | 组件库维护者 | 拉取 Issue、分诊、修复、发版 |
|
|
50
|
+
|
|
51
|
+
## GitHub Issue 模板
|
|
52
|
+
|
|
53
|
+
| 模板 | 标签 | 场景 |
|
|
54
|
+
| ---------------------------------------------------- | ----------------------------- | ----------------- |
|
|
55
|
+
| [bug.yml](../.github/ISSUE_TEMPLATE/bug.yml) | `bug`, `needs-triage` | 可复现缺陷 |
|
|
56
|
+
| [feature.yml](../.github/ISSUE_TEMPLATE/feature.yml) | `enhancement`, `needs-triage` | 新组件或 API 增强 |
|
|
57
|
+
|
|
58
|
+
用法问题优先 [Discussions](https://github.com/czhang31795/vue3components/discussions)。
|
|
59
|
+
|
|
60
|
+
## 验证 CLI
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm exec xycomponents doctor --json
|
|
64
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xycomponents-cli
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: >-
|
|
5
|
+
通过项目内 xycomponents CLI 查询 @czxingyu/xycomponents 组件目录、Props、Events、
|
|
6
|
+
Slots、示例代码、包入口与迁移说明。在编写或修改 xy- 组件用法、脚手架、
|
|
7
|
+
或需要结构化组件元数据时使用。执行前确认已读本 skill 与 xycomponents-shared。
|
|
8
|
+
metadata:
|
|
9
|
+
requires:
|
|
10
|
+
bins: ["xycomponents"]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# xycomponents CLI
|
|
14
|
+
|
|
15
|
+
**CRITICAL — 执行查询前 MUST 先读 [`../xycomponents-shared/SKILL.md`](../xycomponents-shared/SKILL.md) 的版本策略。**
|
|
16
|
+
|
|
17
|
+
所有命令在**业务项目根目录**执行,且必须带 `--json`(机器可读):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm exec xycomponents <command> --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
npm / yarn:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm exec xycomponents <command> --json
|
|
27
|
+
yarn xycomponents <command> --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**禁止**使用全局安装的 `xycomponents`;版本必须与 `package.json` 中的 `@czxingyu/xycomponents` 一致。
|
|
31
|
+
|
|
32
|
+
## 推荐工作流
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
1. pnpm exec xycomponents doctor --json # 确认 CLI 可用、目录完整
|
|
36
|
+
2. pnpm exec xycomponents components --json # 列出全部组件(或按 category 过滤结果)
|
|
37
|
+
3. pnpm exec xycomponents component <name> --json # 单个组件完整 API
|
|
38
|
+
4. pnpm exec xycomponents snippet <name> --example <id> # 可复制示例(可加 --json)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 命令速查
|
|
42
|
+
|
|
43
|
+
| 命令 | 用途 |
|
|
44
|
+
| ------------------------------------- | ---------------------------------------------------- |
|
|
45
|
+
| `doctor --json` | 目录覆盖率、schema 版本、健康状态 |
|
|
46
|
+
| `components --json` | 全部组件摘要(name、tag、category、lifecycle、docs) |
|
|
47
|
+
| `components --include-retired --json` | 含已退役 tombstone |
|
|
48
|
+
| `component <name> --json` | Props、Events、Slots、examples、import 信息 |
|
|
49
|
+
| `snippet <name> --example <id>` | 示例 SFC 代码;加 `--json` 得结构化结果 |
|
|
50
|
+
| `migrate <name> --json` | stable / deprecated / retired 及迁移步骤 |
|
|
51
|
+
| `package --json` | default / lite 入口、样式路径、lite 排除清单 |
|
|
52
|
+
| `help` | 命令列表 |
|
|
53
|
+
|
|
54
|
+
组件 `<name>` 使用 CLI 名(kebab-case),如 `button`、`form`、`date-picker`、`config-provider`。
|
|
55
|
+
|
|
56
|
+
## 分类过滤
|
|
57
|
+
|
|
58
|
+
`components` 返回的 `category` 字段示例:`General`、`Layout`、`Navigation`、`Data Entry`、`Data Display`、`Feedback`。可在 JSON 结果中按 category 过滤;CLI 的 `--category` 需与元数据中的 category 字符串完全一致。
|
|
59
|
+
|
|
60
|
+
## JSON 使用规则
|
|
61
|
+
|
|
62
|
+
- 以 CLI 输出的 JSON 为**唯一 API 真相**;不要臆造 prop 名、event 名或 slot 名。
|
|
63
|
+
- `component` 响应中的 `examples[].id` 用于 `snippet --example`。
|
|
64
|
+
- `lifecycle.status` 为 `deprecated` 或 `retired` 时,必须先跑 `migrate` 再改代码。
|
|
65
|
+
- 解析失败或 `exitCode !== 0` 时,检查是否已 `pnpm add @czxingyu/xycomponents` 并 `pnpm install`。
|
|
66
|
+
|
|
67
|
+
## 常见场景
|
|
68
|
+
|
|
69
|
+
**不知道有没有某个组件**
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pnpm exec xycomponents components --json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**实现一个表单页**
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pnpm exec xycomponents component form --json
|
|
79
|
+
pnpm exec xycomponents snippet form --example basic
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**用户提到旧组件名或 API 报错**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm exec xycomponents migrate <name> --json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**选择 full 还是 lite 入口**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pnpm exec xycomponents package --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 维护者(vue3components 源码仓库)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pnpm run build:cli
|
|
98
|
+
pnpm xycomponents component <name> --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
未 `build:cli` 时 `dist/cli.js` 可能落后于源码元数据。
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xycomponents-contribute
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: >-
|
|
5
|
+
在业务项目中向 xycomponents 反馈 Bug、功能建议或新组件需求。当组件行为异常、
|
|
6
|
+
文档与 CLI 不一致、需要库侧新增能力,或用户要求提交 GitHub Issue 时使用。
|
|
7
|
+
先读 xycomponents-shared 与 xycomponents-cli,再按本 skill 创建 Issue。
|
|
8
|
+
metadata:
|
|
9
|
+
requires:
|
|
10
|
+
packages: ["@czxingyu/xycomponents"]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# xycomponents 反馈与 Issue
|
|
14
|
+
|
|
15
|
+
**前置**:已读 [`xycomponents-shared`](../xycomponents-shared/SKILL.md) 与 [`xycomponents-cli`](../xycomponents-cli/SKILL.md)。
|
|
16
|
+
|
|
17
|
+
**仓库**:`czhang31795/vue3components`(npm 包 `@czxingyu/xycomponents`)
|
|
18
|
+
|
|
19
|
+
## 先判断走哪条路
|
|
20
|
+
|
|
21
|
+
| 情况 | 动作 |
|
|
22
|
+
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| 用法不确定、可能是误用 | 先 `pnpm exec xycomponents component <name> --json`;仍不清楚 → [Discussions](https://github.com/czhang31795/vue3components/discussions) |
|
|
24
|
+
| 确认是组件库 Bug(复现稳定) | 创建 **Bug Issue**(见下) |
|
|
25
|
+
| 需要新组件或增强现有 API | 创建 **Feature Issue**(见下) |
|
|
26
|
+
| 含密钥、内网地址、用户数据 | **不要**写入 Issue;脱敏后再提交 |
|
|
27
|
+
|
|
28
|
+
## 提交 Bug 前(必须)
|
|
29
|
+
|
|
30
|
+
1. 用 CLI 核对公开 API,确认不是文档误读:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm exec xycomponents component <name> --json
|
|
34
|
+
pnpm exec xycomponents doctor --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. 整理**最小 Vue 复现**(单文件 SFC 或 StackBlitz/CodeSandbox 链接),去掉业务无关代码。
|
|
38
|
+
3. 记录:`@czxingyu/xycomponents` 版本、Vue 版本、浏览器/Node 环境。
|
|
39
|
+
4. 明确:期望行为、实际行为、控制台/无障碍相关日志。
|
|
40
|
+
5. 标注是否为回归(之前版本是否正常)。
|
|
41
|
+
|
|
42
|
+
## 用 GitHub CLI 创建 Bug Issue
|
|
43
|
+
|
|
44
|
+
需已安装并登录 [`gh`](https://cli.github.com/)(`gh auth status`)。
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
gh issue create \
|
|
48
|
+
--repo czhang31795/vue3components \
|
|
49
|
+
--template bug \
|
|
50
|
+
--title "[Bug] <组件> <一句话摘要>" \
|
|
51
|
+
--field component="<name>" \
|
|
52
|
+
--field version="@czxingyu/xycomponents <版本>, Vue <版本>, <浏览器>" \
|
|
53
|
+
--field reproduction="<最小复现 SFC 或链接>" \
|
|
54
|
+
--field steps="1. ...\n2. ...\n3. ..." \
|
|
55
|
+
--field expected="<期望行为>" \
|
|
56
|
+
--field actual="<实际行为与错误日志>" \
|
|
57
|
+
--field regression="不确定|是,之前版本正常|否,从未正常"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
创建成功后把 Issue URL 返回给用户。自动带上标签 `bug`、`needs-triage`。
|
|
61
|
+
|
|
62
|
+
若 `gh` 不可用,给出 Web 链接让用户确认后提交:
|
|
63
|
+
|
|
64
|
+
`https://github.com/czhang31795/vue3components/issues/new?template=bug`
|
|
65
|
+
|
|
66
|
+
Issue 正文请按模板字段自行填写(与上面 `--field` 内容一致)。
|
|
67
|
+
|
|
68
|
+
## 用 GitHub CLI 创建 Feature / 新组件 Issue
|
|
69
|
+
|
|
70
|
+
新增组件或增强 API 前,先证明现有目录无法满足:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm exec xycomponents components --json
|
|
74
|
+
pnpm exec xycomponents component <相近组件> --json
|
|
75
|
+
pnpm exec xycomponents package --json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
gh issue create \
|
|
80
|
+
--repo czhang31795/vue3components \
|
|
81
|
+
--template feature \
|
|
82
|
+
--title "[Feature] <组件或能力> <一句话摘要>" \
|
|
83
|
+
--field component="<name>" \
|
|
84
|
+
--field version="@czxingyu/xycomponents <版本>" \
|
|
85
|
+
--field request_type="新增组件|增强现有组件|文档 / Demo / CLI 元数据|其他" \
|
|
86
|
+
--field scenario="<业务场景>" \
|
|
87
|
+
--field alternatives="<已尝试的组件组合或方案>" \
|
|
88
|
+
--field proposal="<期望 API / 交互草案,可留空>"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Web 备选:`https://github.com/czhang31795/vue3components/issues/new?template=feature`
|
|
92
|
+
|
|
93
|
+
## AI 不应做的事
|
|
94
|
+
|
|
95
|
+
- 不要在未用 CLI 核对 API 的情况下断定是 Bug。
|
|
96
|
+
- 不要提交无法复现的 Issue(缺少步骤、版本或最小复现)。
|
|
97
|
+
- 不要替维护者直接改组件库源码(业务项目 AI 只反馈 Issue,除非用户明确要求 fork/PR)。
|
|
98
|
+
- 不要把 `pnpm exec xycomponents` 换成全局 `xycomponents`(版本必须与项目一致)。
|
|
99
|
+
|
|
100
|
+
## 提交后
|
|
101
|
+
|
|
102
|
+
告知用户 Issue 编号与链接;修复由维护者在组件库仓库集中处理。用户升级修复版本:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pnpm add @czxingyu/xycomponents@<新版本>
|
|
106
|
+
pnpm exec xycomponents doctor --json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
维护者处理流程见 [`xycomponents-maintainer`](../xycomponents-maintainer/SKILL.md)(仅组件库仓库维护者)。
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xycomponents-maintainer
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: >-
|
|
5
|
+
在 vue3components 源码仓库中集中拉取 GitHub Bug/Feature Issue、分诊、修复回归、
|
|
6
|
+
或按规范新增组件。维护者处理 needs-triage 队列、跑 CI、发版时使用。
|
|
7
|
+
业务项目 AI 不要应用本 skill。
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# xycomponents 维护者工作流
|
|
11
|
+
|
|
12
|
+
**适用范围**:`czhang31795/vue3components` 源码仓库。业务项目请用 `xycomponents-contribute` 提交 Issue。
|
|
13
|
+
|
|
14
|
+
## 开始工作
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm run build:cli
|
|
19
|
+
pnpm xycomponents doctor --json
|
|
20
|
+
pnpm run audit:components
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
先读 `AGENTS.md`、`docs/maintenance/ai-bugfix.md`、`docs/maintenance/component-development.md`。
|
|
24
|
+
|
|
25
|
+
## 集中拉取待处理 Issue
|
|
26
|
+
|
|
27
|
+
需 `gh` 已登录且有仓库权限。
|
|
28
|
+
|
|
29
|
+
**待分诊 Bug**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
gh issue list --repo czhang31795/vue3components --label "needs-triage,bug" --state open --json number,title,labels,createdAt,url
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**待分诊 Feature / 新组件**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
gh issue list --repo czhang31795/vue3components --label "needs-triage,enhancement" --state open --json number,title,labels,createdAt,url
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**某组件相关 Issue(标题或正文搜索)**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gh search issues --repo czhang31795/vue3components "table label:bug" --json number,title,state,url
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**查看单个 Issue 全文**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
gh issue view <number> --repo czhang31795/vue3components
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 分诊规则
|
|
54
|
+
|
|
55
|
+
| 结论 | 动作 |
|
|
56
|
+
| ------------ | --------------------------------------------------------------------- |
|
|
57
|
+
| 信息不足 | 评论索要最小复现 / 版本;保持 `needs-triage` |
|
|
58
|
+
| 用法问题 | 指向 CLI 与文档;关闭或转 Discussions |
|
|
59
|
+
| 确认 Bug | 去掉 `needs-triage`,保留 `bug`;可选加 `component:<name>` 自定义标签 |
|
|
60
|
+
| 确认 Feature | 评估是否与 `docs/maintenance/component-library-status.md` 路线一致 |
|
|
61
|
+
| 重复 | 关闭并链接已有 Issue |
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
gh issue edit <number> --repo czhang31795/vue3components --remove-label needs-triage
|
|
65
|
+
gh issue comment <number> --repo czhang31795/vue3components --body "..."
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 修复 Bug(与 ai-bugfix.md 一致)
|
|
69
|
+
|
|
70
|
+
1. 读 Issue + `pnpm xycomponents component <name> --json` 定位源码与文档。
|
|
71
|
+
2. GitNexus:`query` → `context` → **`impact`**(HIGH/CRITICAL 须警告用户)。
|
|
72
|
+
3. 先写**失败回归测试**,再最小修复。
|
|
73
|
+
4. `pnpm test`(目标文件)→ `pnpm run ci`。
|
|
74
|
+
5. `detect_changes({ scope: "compare", base_ref: "main" })`。
|
|
75
|
+
6. 公开行为变化:`pnpm changeset`。
|
|
76
|
+
7. PR 描述关联 `Fixes #<number>`,附修复前后证据。
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
gh pr create --title "fix(<component>): ..." --body "Fixes #123\n\n..."
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 新增组件(来自 Feature Issue)
|
|
83
|
+
|
|
84
|
+
仅当有明确业务证据且现有组件 + core 原语无法组合时进行:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pnpm generate:component -- <Name> --title <中文名> --group <group> --description <description>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
分组:`general` | `navigation` | `layout` | `data-entry` | `data-display` | `feedback`
|
|
91
|
+
|
|
92
|
+
逐项替换 `@xy-component-placeholder`,同步文档 API、Demo、CLI 详细元数据,直至 `pnpm run audit:components` 与 `pnpm run ci` 通过。
|
|
93
|
+
|
|
94
|
+
## 批量修复同一组件的多条 Bug
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
gh search issues --repo czhang31795/vue3components "label:bug label:needs-triage table"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
按 Issue 优先级合并根因;同一 PR 可 `Fixes #1, Fixes #2`(仅当同一修复确实解决多个 Issue)。
|
|
101
|
+
|
|
102
|
+
## 发版后通知
|
|
103
|
+
|
|
104
|
+
合并并发布后,在相关 Issue 评论修复版本,例如 `@czxingyu/xycomponents@0.1.3`,并关闭 Issue。
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
gh issue close <number> --repo czhang31795/vue3components --comment "Fixed in @czxingyu/xycomponents@0.1.3"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 权威文档
|
|
111
|
+
|
|
112
|
+
| 主题 | 路径 |
|
|
113
|
+
| --------------- | ---------------------------------------------- |
|
|
114
|
+
| Bug 闭环 | `docs/maintenance/ai-bugfix.md` |
|
|
115
|
+
| 组件完成定义 | `docs/maintenance/component-development.md` |
|
|
116
|
+
| 生命周期 / 迁移 | `docs/maintenance/component-lifecycle.md` |
|
|
117
|
+
| 发布 | `docs/maintenance/release.md` |
|
|
118
|
+
| 能力路线图 | `docs/maintenance/component-library-status.md` |
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xycomponents-shared
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: >-
|
|
5
|
+
@czxingyu/xycomponents 安装、版本对齐与 Vue 应用接入。在业务项目中使用 xy- 组件、
|
|
6
|
+
引入样式与类型、升级组件库,或需要确认 CLI 与 npm 包版本一致时使用。
|
|
7
|
+
查询 Props/Events/Slots 前请先读本 skill,再读 xycomponents-cli skill。
|
|
8
|
+
metadata:
|
|
9
|
+
requires:
|
|
10
|
+
packages: ["@czxingyu/xycomponents"]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# xycomponents 共享规则
|
|
14
|
+
|
|
15
|
+
## 版本与 CLI 策略(必须遵守)
|
|
16
|
+
|
|
17
|
+
- **只在当前项目内**安装 `@czxingyu/xycomponents`;**不要**全局安装 CLI,也不要用与项目 `package.json` 版本不一致的全局命令。
|
|
18
|
+
- CLI 元数据随 npm 包一起发布;**CLI 版本 = 已安装的包版本**。
|
|
19
|
+
- 升级组件库时重新安装,CLI 会同步更新:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @czxingyu/xycomponents@latest
|
|
23
|
+
# 或锁定版本:pnpm add @czxingyu/xycomponents@0.1.2
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- 安装或升级后验证:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm exec xycomponents doctor --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
期望 `status` 为 `"pass"`。若命令不存在,说明依赖未安装或未执行 `pnpm install`。
|
|
33
|
+
|
|
34
|
+
## 应用接入
|
|
35
|
+
|
|
36
|
+
完整入口(默认推荐):
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createApp } from "vue";
|
|
40
|
+
import XyComponents from "@czxingyu/xycomponents";
|
|
41
|
+
import "@czxingyu/xycomponents/style";
|
|
42
|
+
|
|
43
|
+
createApp(App).use(XyComponents).mount("#app");
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
轻量入口(排除 Empty / List / Result / Table / Transfer 等大资源组件族):
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import XyComponentsLite from "@czxingyu/xycomponents/lite";
|
|
50
|
+
import "@czxingyu/xycomponents/lite/style";
|
|
51
|
+
|
|
52
|
+
app.use(XyComponentsLite);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
全局模板类型(使用 `app.use(XyComponents)` 时推荐):
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
/// <reference types="@czxingyu/xycomponents/global" />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 命名约定
|
|
62
|
+
|
|
63
|
+
| 场景 | 形式 | 示例 |
|
|
64
|
+
| ---------- | ------------------ | ----------------------- |
|
|
65
|
+
| Vue 组件名 | `Xy` + PascalCase | `XyButton` |
|
|
66
|
+
| 模板标签 | `xy-` + kebab-case | `<xy-button>` |
|
|
67
|
+
| CLI 组件名 | kebab-case | `button`、`date-picker` |
|
|
68
|
+
|
|
69
|
+
## 写组件代码前
|
|
70
|
+
|
|
71
|
+
1. 确认项目已安装 `@czxingyu/xycomponents`。
|
|
72
|
+
2. 读取 [xycomponents-cli](../xycomponents-cli/SKILL.md)。
|
|
73
|
+
3. 用 `pnpm exec xycomponents component <name> --json` 查 API,**禁止凭记忆猜测** Props / Events / Slots。
|
|
74
|
+
4. 需要示例时用 `pnpm exec xycomponents snippet <name> --example <id>`。
|
|
75
|
+
5. 遇到弃用或已删除组件,先 `pnpm exec xycomponents migrate <name> --json`。
|
|
76
|
+
6. 确认是库 Bug 或需要新能力时,读 [xycomponents-contribute](../xycomponents-contribute/SKILL.md) 提交 GitHub Issue。
|
|
77
|
+
|
|
78
|
+
## 入口选择
|
|
79
|
+
|
|
80
|
+
不确定用 default 还是 lite 时:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pnpm exec xycomponents package --json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 样式与主题
|
|
87
|
+
|
|
88
|
+
- 必须引入对应 style 入口(`style` 或 `lite/style`)。
|
|
89
|
+
- 组件内不要硬编码 `font-size: Npx`;扩展尺寸请用 `components/style/vars.css` 中的 design token(`--xy-font-size-*`、`--xy-control-font-size-*` 等)。
|
|
90
|
+
|
|
91
|
+
## 本仓库(vue3components)维护者例外
|
|
92
|
+
|
|
93
|
+
在组件库源码仓库内开发时,先构建 CLI 再查询:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pnpm run build:cli
|
|
97
|
+
pnpm xycomponents component <name> --json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
维护流程另见仓库根目录 `AGENTS.md`。
|