@qin-ui/element-plus-pro 1.1.2 → 1.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/AI-CONTEXT.md +266 -162
- package/README.md +303 -84
- package/api.json +95 -1
- package/bin/init-ai.mjs +118 -99
- package/package.json +4 -4
package/api.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-07-
|
|
2
|
+
"generatedAt": "2026-07-15T06:31:48.872Z",
|
|
3
3
|
"name": "@qin-ui/element-plus-pro",
|
|
4
4
|
"api": [
|
|
5
5
|
{
|
|
@@ -8,6 +8,20 @@
|
|
|
8
8
|
"package": "@qin-ui/element-plus-pro",
|
|
9
9
|
"signature": "<ProComponentProvider>",
|
|
10
10
|
"description": "@qin-ui/element-plus-pro 全局配置提供者组件\n用于在组件树的顶层配置所有子组件的全局默认属性。",
|
|
11
|
+
"params": [
|
|
12
|
+
{
|
|
13
|
+
"name": "componentVars",
|
|
14
|
+
"type": "ComponentVars",
|
|
15
|
+
"optional": true,
|
|
16
|
+
"description": "组件全局配置变量"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "componentMap",
|
|
20
|
+
"type": "Record<ComponentName, any>",
|
|
21
|
+
"optional": true,
|
|
22
|
+
"description": "自定义组件映射"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
11
25
|
"examples": [
|
|
12
26
|
"```vue\n<ProComponentProvider\n:componentVars=\"{ 'input': { placeholder: '请输入' } }\"\n>\n<ProForm :form=\"form\" />\n</ProComponentProvider>\n```"
|
|
13
27
|
]
|
|
@@ -25,6 +39,20 @@
|
|
|
25
39
|
"package": "@qin-ui/element-plus-pro",
|
|
26
40
|
"signature": "<ProForm>",
|
|
27
41
|
"description": "@qin-ui/element-plus-pro 配置驱动表单组件\n架构设计说明 (Architecture Overview)\n[ 数据层 (Core) ] => [ 绑定层 (ProForm) ] => [ 渲染层 (BaseFormItem / BaseField) ]\n1. 数据隔离:ProForm 本身不负责存储和管理表单状态,所有核心状态(formData, fields, 校验规则)\n均交由底层的 `useForm`(@qin-ui/pro-components-core)驱动。\n2. 上下文透传:通过 `provide` 将核心状态下发给子组件,避免了深层嵌套的 Props 传递。\n3. 递归渲染:网格布局和具体字段的解析交由 `<BaseFormItem>` 递归完成,实现了 UI 布局与表单逻辑的解耦。\n通过配置驱动的方式快速构建表单,支持:\n- 字段联动、嵌套字段、自定义组件、网格布局",
|
|
42
|
+
"params": [
|
|
43
|
+
{
|
|
44
|
+
"name": "form",
|
|
45
|
+
"type": "F",
|
|
46
|
+
"optional": true,
|
|
47
|
+
"description": "useForm 返回的表单实例"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "grid",
|
|
51
|
+
"type": "boolean | GridProps",
|
|
52
|
+
"optional": true,
|
|
53
|
+
"description": "是否启用网格布局 (默认 false)"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
28
56
|
"typeParams": [
|
|
29
57
|
{
|
|
30
58
|
"name": "F"
|
|
@@ -61,6 +89,14 @@
|
|
|
61
89
|
"package": "@qin-ui/element-plus-pro",
|
|
62
90
|
"signature": "export const useFormData = <D extends Data = Data>(\n initFormData?: ExtendWithAny<DeepPartial<D>>\n): UseFormDataReturn<D> =>",
|
|
63
91
|
"description": "表单数据处理 Hook\n提供响应式表单数据的管理能力,支持:\n- 响应式数据存储(基于 Vue reactive)\n- 深层路径读写(支持点号分隔,如 'address.city')\n- 类型安全的路径提示(传入泛型 D 后,path 参数可获得类型推导)\n- 父子表单自动注入(非根表单会从注入中获取数据)",
|
|
92
|
+
"params": [
|
|
93
|
+
{
|
|
94
|
+
"name": "initFormData",
|
|
95
|
+
"type": "ExtendWithAny<DeepPartial<D>>",
|
|
96
|
+
"optional": true,
|
|
97
|
+
"description": "初始表单数据"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
64
100
|
"returns": "{UseFormDataReturn<D>} 表单数据操作对象",
|
|
65
101
|
"typeParams": [
|
|
66
102
|
{
|
|
@@ -77,6 +113,14 @@
|
|
|
77
113
|
"package": "@qin-ui/element-plus-pro",
|
|
78
114
|
"signature": "export function useFields<D extends Data = Data>(\n initFields?: Fields<D>\n): UseFieldsReturn<D, Field<ComponentName, D>, FormItemInstance>;",
|
|
79
115
|
"description": "字段配置管理 Hook\n基于 `@qin-ui/pro-components-core` 的 `useFields`,将泛型参数绑定为 Element Plus 的本地类型:\n- 字段类型 F -> `Field<ComponentName, D>`(支持 Element Plus 组件类型推导)\n- FormItem 实例 -> Element Plus 的 `FormItemInstance`\n提供对字段配置数组的增删改查操作,支持:\n- 通过路径字符串或查找函数定位字段\n- 深层嵌套字段的遍历和匹配\n- 字段配置的合并/覆盖更新\n- 字段的添加、插入、删除\n- 父级字段查找\n- `fields` - 字段配置数组(响应式 Ref\\<F[]\\>)\n- `getField(path)` - 获取字段配置,支持路径字符串或查找函数\n- `setField(path, field, options?)` - 更新字段配置,默认合并模式\n- `deleteField(path, options?)` - 删除字段配置\n- `appendField(path, field, options?)` - 在指定字段后追加\n- `prependField(path, field, options?)` - 在指定字段前插入\n- `getParentField(path, options?)` - 获取父级字段配置",
|
|
116
|
+
"params": [
|
|
117
|
+
{
|
|
118
|
+
"name": "initFields",
|
|
119
|
+
"type": "Fields<D>",
|
|
120
|
+
"optional": true,
|
|
121
|
+
"description": "初始字段配置数组"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
80
124
|
"returns": "字段操作对象,包含以下属性:",
|
|
81
125
|
"typeParams": [
|
|
82
126
|
{
|
|
@@ -118,6 +162,26 @@
|
|
|
118
162
|
"package": "@qin-ui/element-plus-pro",
|
|
119
163
|
"signature": "export function useForm<D extends Data = Data>(\n initFormData?: ExtendWithAny<DeepPartial<D>>,\n initFields?: Field<ComponentName, D>[],\n root?: boolean\n): Form<D, Field<ComponentName, D>>;",
|
|
120
164
|
"description": "创建表单实例的 Hook\n基于 `@qin-ui/pro-components-core` 的 `useForm`,将泛型参数绑定为 Element Plus 的本地类型:\n- 字段类型 F -> `Field<ComponentName, D>`(支持 Element Plus 所有内置组件类型推导)\n- 表单实例 -> Element Plus 的 `FormInstance`(使 formRef 获得完整的类型提示)\n表单实例组合了三个子模块的能力:\n- **useFormData**:表单数据管理(响应式数据、读写、批量更新)\n- **useFields**:字段配置管理(增删改查字段配置,支持嵌套)\n- **useFormRef**:底层 Form 组件实例引用",
|
|
165
|
+
"params": [
|
|
166
|
+
{
|
|
167
|
+
"name": "initFormData",
|
|
168
|
+
"type": "ExtendWithAny<DeepPartial<D>>",
|
|
169
|
+
"optional": true,
|
|
170
|
+
"description": "初始表单数据"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "initFields",
|
|
174
|
+
"type": "Field<ComponentName, D>[]",
|
|
175
|
+
"optional": true,
|
|
176
|
+
"description": "初始字段配置数组"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "root",
|
|
180
|
+
"type": "boolean",
|
|
181
|
+
"optional": true,
|
|
182
|
+
"description": "是否为根表单。设为 `false` 时尝试从父组件注入获取表单实例 (默认 true)"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
121
185
|
"returns": "{Form<D>} 表单实例,包含数据操作、字段操作和 ref 操作",
|
|
122
186
|
"typeParams": [
|
|
123
187
|
{
|
|
@@ -220,6 +284,36 @@
|
|
|
220
284
|
"type": "object",
|
|
221
285
|
"optional": false,
|
|
222
286
|
"description": "表格配置参数"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "params.columns",
|
|
290
|
+
"type": "Columns<T>",
|
|
291
|
+
"optional": true,
|
|
292
|
+
"description": "初始列配置数组"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "params.data",
|
|
296
|
+
"type": "T[]",
|
|
297
|
+
"optional": true,
|
|
298
|
+
"description": "初始数据源(Element Plus 风格)"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "params.pageParam",
|
|
302
|
+
"type": "PageParam",
|
|
303
|
+
"optional": true,
|
|
304
|
+
"description": "初始分页参数,默认 `{ current: 1, pageSize: 10, total: 0 }`"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "params.searchParam",
|
|
308
|
+
"type": "ExtendWithAny<DeepPartial<D>>",
|
|
309
|
+
"optional": true,
|
|
310
|
+
"description": "初始搜索参数"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "params.searchFields",
|
|
314
|
+
"type": "Fields<D>",
|
|
315
|
+
"optional": true,
|
|
316
|
+
"description": "搜索表单字段配置"
|
|
223
317
|
}
|
|
224
318
|
],
|
|
225
319
|
"returns": "{Table<D, T>} 表格实例",
|
package/bin/init-ai.mjs
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @qin-ui/element-plus-pro AI 上下文初始化 CLI 工具
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1.
|
|
8
|
-
* 2.
|
|
9
|
-
* 3. 快速获取完整 API 参考
|
|
6
|
+
* 在消费方项目中生成双载体 AI 上下文:
|
|
7
|
+
* 1. 根目录 AGENTS.md -- 核心使用规则,跨工具自动注入(主载体)
|
|
8
|
+
* 2. .agents/skills/{pkg}.md -- 完整 API 参考,支持 skills 发现的工具按需调取(参考载体)
|
|
10
9
|
*
|
|
11
10
|
* 用法:
|
|
12
11
|
* npx @qin-ui/element-plus-pro init-ai
|
|
@@ -28,6 +27,10 @@ const PKG_JSON = JSON.parse(
|
|
|
28
27
|
const PKG_NAME = PKG_JSON.name;
|
|
29
28
|
const PKG_SHORT = PKG_NAME.replace(/^@qin-ui\//, '');
|
|
30
29
|
|
|
30
|
+
// AGENTS.md 智能合并区块标记(支持多库共存,幂等更新)
|
|
31
|
+
const BEGIN_MARKER = `<!-- BEGIN ${PKG_NAME} -->`;
|
|
32
|
+
const END_MARKER = `<!-- END ${PKG_NAME} -->`;
|
|
33
|
+
|
|
31
34
|
// ==================== 终端颜色 ====================
|
|
32
35
|
|
|
33
36
|
const green = s => `\x1b[32m${s}\x1b[0m`;
|
|
@@ -64,59 +67,103 @@ function getApiJsonContent() {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
// ====================
|
|
70
|
+
// ==================== 工具函数 ====================
|
|
71
|
+
|
|
72
|
+
function escapeRegExp(s) {
|
|
73
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function ensureDir(dirPath) {
|
|
77
|
+
if (!fs.existsSync(dirPath)) {
|
|
78
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function writeFileWithLog(filePath, content, label) {
|
|
83
|
+
const dir = path.dirname(filePath);
|
|
84
|
+
ensureDir(dir);
|
|
85
|
+
const existed = fs.existsSync(filePath);
|
|
86
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
87
|
+
const status = existed ? yellow('[更新]') : green('[创建]');
|
|
88
|
+
console.log(` ${status} ${cyan(label)}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ==================== AGENTS.md(主载体,自动注入)====================
|
|
68
92
|
|
|
69
93
|
/**
|
|
70
|
-
* 生成
|
|
71
|
-
*
|
|
94
|
+
* 生成 AGENTS.md 区块内容
|
|
95
|
+
* = AI-CONTEXT.md 全文(核心使用规则,AI 必然读到)
|
|
72
96
|
*/
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return [
|
|
77
|
-
'---',
|
|
78
|
-
`description: "${PKG_NAME} 组件库使用规范 — Schema 驱动、属性透传规则"`,
|
|
79
|
-
'globs: ["**/*.vue", "**/*.ts", "**/*.tsx"]',
|
|
80
|
-
'alwaysApply: false',
|
|
81
|
-
'---',
|
|
82
|
-
'',
|
|
83
|
-
aiContext,
|
|
84
|
-
'',
|
|
85
|
-
'---',
|
|
86
|
-
'',
|
|
87
|
-
'## 本地参考文件',
|
|
88
|
-
'',
|
|
89
|
-
'本规则文件提供了核心架构和用法指南。需要完整 API 参考时,请阅读以下文件:',
|
|
90
|
-
'',
|
|
91
|
-
`- **\`.agents/docs/${PKG_SHORT}-api.md\`** — 完整 API 文档(组件、Hooks、类型、Field 配置参考)`,
|
|
92
|
-
`- **\`node_modules/${PKG_NAME}/api.json\`** — 结构化 API 元数据(函数签名、类型定义)`,
|
|
93
|
-
'',
|
|
94
|
-
'## element-plus 文档资源',
|
|
95
|
-
'',
|
|
96
|
-
'所有在 Field 配置中编写的非保留属性,最终会透传给 element-plus 组件。编写前务必查阅文档确认属性名:',
|
|
97
|
-
'',
|
|
98
|
-
'| 资源 | URL | 说明 |',
|
|
99
|
-
'|:--|:--|:--|',
|
|
100
|
-
'| element-plus 官网 | https://element-plus.org/ | 官方文档首页(中文/英文) |',
|
|
101
|
-
'| 组件文档 | https://element-plus.org/zh-CN/component/button | 组件 API 参考入口(中文) |',
|
|
102
|
-
'',
|
|
103
|
-
].join('\n');
|
|
97
|
+
function getAgentsBlock() {
|
|
98
|
+
return getAiContextContent();
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
102
|
+
* 智能合并 AGENTS.md:
|
|
103
|
+
* - 文件不存在 -> 创建,内容 = 标记区块
|
|
104
|
+
* - 已有本库区块 -> 幂等替换区块内容(支持升级后更新)
|
|
105
|
+
* - 已有其他内容但无本库区块 -> 末尾追加区块(多库共存不冲突)
|
|
109
106
|
*/
|
|
110
|
-
function
|
|
107
|
+
function writeAgentsMd(cwd) {
|
|
108
|
+
const agentsPath = path.join(cwd, 'AGENTS.md');
|
|
109
|
+
const blockContent = getAgentsBlock();
|
|
110
|
+
const newBlock = `${BEGIN_MARKER}\n${blockContent}\n${END_MARKER}`;
|
|
111
|
+
|
|
112
|
+
let existing = '';
|
|
113
|
+
if (fs.existsSync(agentsPath)) {
|
|
114
|
+
existing = fs.readFileSync(agentsPath, 'utf-8');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let result;
|
|
118
|
+
const hasBlock =
|
|
119
|
+
existing.includes(BEGIN_MARKER) && existing.includes(END_MARKER);
|
|
120
|
+
|
|
121
|
+
if (hasBlock) {
|
|
122
|
+
// 幂等替换已有区块
|
|
123
|
+
const blockRegex = new RegExp(
|
|
124
|
+
`${escapeRegExp(BEGIN_MARKER)}[\\s\\S]*?${escapeRegExp(END_MARKER)}`,
|
|
125
|
+
'g'
|
|
126
|
+
);
|
|
127
|
+
result = existing.replace(blockRegex, newBlock);
|
|
128
|
+
} else if (existing.trim()) {
|
|
129
|
+
// 已有其他内容,追加区块
|
|
130
|
+
result = `${existing.trimEnd()}\n\n${newBlock}\n`;
|
|
131
|
+
} else {
|
|
132
|
+
// 文件不存在或空
|
|
133
|
+
result = `${newBlock}\n`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const existed = fs.existsSync(agentsPath);
|
|
137
|
+
fs.writeFileSync(agentsPath, result, 'utf-8');
|
|
138
|
+
const status = existed ? yellow('[更新]') : green('[创建]');
|
|
139
|
+
console.log(` ${status} ${cyan('AGENTS.md')}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ==================== Skills(参考载体,按需调取)====================
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 生成 skill 文件内容(完整 API 参考 + skill frontmatter)
|
|
146
|
+
* 供支持 skills 发现的工具按需调取,避免全量注入占 token
|
|
147
|
+
*/
|
|
148
|
+
function getSkillContent() {
|
|
111
149
|
const readme = getReadmeContent();
|
|
112
150
|
const apiJson = getApiJsonContent();
|
|
113
151
|
|
|
114
152
|
const sections = [];
|
|
115
153
|
|
|
116
|
-
|
|
154
|
+
// skill frontmatter
|
|
155
|
+
sections.push('---');
|
|
156
|
+
sections.push(`name: ${PKG_SHORT}`);
|
|
157
|
+
sections.push(
|
|
158
|
+
`description: ${PKG_NAME} 完整 API 参考 - 组件、Hooks、类型、Field/Column 配置。当需要精确的函数签名、参数类型或完整用法示例时调用。`
|
|
159
|
+
);
|
|
160
|
+
sections.push('---');
|
|
161
|
+
sections.push('');
|
|
162
|
+
|
|
163
|
+
sections.push(`# ${PKG_NAME} - 完整 API 参考`, '');
|
|
117
164
|
sections.push(`> 自动生成自 README.md 和 api.json。版本: ${PKG_JSON.version}`, '');
|
|
118
165
|
|
|
119
|
-
// README
|
|
166
|
+
// README 内容(完整使用文档)
|
|
120
167
|
if (readme) {
|
|
121
168
|
sections.push(readme);
|
|
122
169
|
sections.push('');
|
|
@@ -124,10 +171,8 @@ function getApiDocContent() {
|
|
|
124
171
|
|
|
125
172
|
// 结构化 API 元数据
|
|
126
173
|
if (apiJson && apiJson.api && apiJson.api.length > 0) {
|
|
127
|
-
sections.push('---');
|
|
128
|
-
sections.push('');
|
|
129
|
-
sections.push('## 结构化 API 元数据(自动提取自源码 JSDoc)');
|
|
130
|
-
sections.push('');
|
|
174
|
+
sections.push('---', '');
|
|
175
|
+
sections.push('## 结构化 API 元数据(自动提取自源码 JSDoc)', '');
|
|
131
176
|
|
|
132
177
|
for (const item of apiJson.api) {
|
|
133
178
|
const typeLabel = {
|
|
@@ -198,41 +243,26 @@ function getApiDocContent() {
|
|
|
198
243
|
return sections.join('\n');
|
|
199
244
|
}
|
|
200
245
|
|
|
201
|
-
// ==================== 文件写入 ====================
|
|
202
|
-
|
|
203
|
-
function ensureDir(dirPath) {
|
|
204
|
-
if (!fs.existsSync(dirPath)) {
|
|
205
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function writeFileWithLog(filePath, content, label) {
|
|
210
|
-
const dir = path.dirname(filePath);
|
|
211
|
-
ensureDir(dir);
|
|
212
|
-
const existed = fs.existsSync(filePath);
|
|
213
|
-
fs.writeFileSync(filePath, content, 'utf-8');
|
|
214
|
-
const status = existed ? yellow('[更新]') : green('[创建]');
|
|
215
|
-
console.log(` ${status} ${cyan(label)}`);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
246
|
// ==================== CLI 入口 ====================
|
|
219
247
|
|
|
220
248
|
function printHelp() {
|
|
221
249
|
console.log(`
|
|
222
|
-
${bold(`${PKG_NAME} CLI
|
|
250
|
+
${bold(`${PKG_NAME} CLI - AI 上下文初始化`)}
|
|
223
251
|
|
|
224
252
|
${bold('用法:')}
|
|
225
253
|
npx ${PKG_NAME} init-ai
|
|
226
254
|
|
|
227
255
|
${bold('说明:')}
|
|
228
|
-
|
|
256
|
+
在项目中生成双载体 AI 上下文,使 AI 工具能够深度理解和规范使用 ${PKG_NAME}。
|
|
229
257
|
|
|
230
258
|
生成的文件结构:
|
|
259
|
+
AGENTS.md 核心使用规则(跨工具自动注入)
|
|
231
260
|
.agents/
|
|
232
|
-
|
|
233
|
-
${PKG_SHORT}.md
|
|
234
|
-
|
|
235
|
-
|
|
261
|
+
skills/
|
|
262
|
+
${PKG_SHORT}.md 完整 API 参考(按需调取)
|
|
263
|
+
|
|
264
|
+
${dim('AGENTS.md 是跨工具开放约定,Codex / Claude Code / Cursor 等会话时自动注入。')}
|
|
265
|
+
${dim('.agents/skills/ 供支持 skills 发现的工具按需调取完整 API。')}
|
|
236
266
|
|
|
237
267
|
${bold('选项:')}
|
|
238
268
|
--help 显示帮助信息
|
|
@@ -256,48 +286,37 @@ function main() {
|
|
|
256
286
|
}
|
|
257
287
|
|
|
258
288
|
console.log('');
|
|
259
|
-
console.log(bold(`📦 ${PKG_NAME}
|
|
289
|
+
console.log(bold(`📦 ${PKG_NAME} - AI 上下文初始化 v${PKG_JSON.version}`));
|
|
260
290
|
console.log(dim(` 基于 element-plus 的 Schema 驱动组件库`));
|
|
261
291
|
console.log('');
|
|
262
292
|
|
|
263
|
-
// 1. 生成
|
|
264
|
-
console.log(bold('📋
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
path.join(process.cwd(), '.agents/rules', `${PKG_SHORT}.md`),
|
|
268
|
-
rulesContent,
|
|
269
|
-
`.agents/rules/${PKG_SHORT}.md`
|
|
270
|
-
);
|
|
271
|
-
console.log(dim(' → 架构概览、属性透传决策树、渐进用法、反模式'));
|
|
293
|
+
// 1. 生成 AGENTS.md(主载体)
|
|
294
|
+
console.log(bold('📋 主载体:AGENTS.md(自动注入)'));
|
|
295
|
+
writeAgentsMd(process.cwd());
|
|
296
|
+
console.log(dim(' -> 核心使用规则,Codex/Claude Code/Cursor 等会话自动加载'));
|
|
272
297
|
console.log('');
|
|
273
298
|
|
|
274
|
-
// 2. 生成
|
|
275
|
-
console.log(bold('📖
|
|
276
|
-
const apiDocContent = getApiDocContent();
|
|
299
|
+
// 2. 生成 Skills 参考(按需调取)
|
|
300
|
+
console.log(bold('📖 参考载体:.agents/skills/(按需调取)'));
|
|
277
301
|
writeFileWithLog(
|
|
278
|
-
path.join(process.cwd(), '.agents/
|
|
279
|
-
|
|
280
|
-
`.agents/
|
|
302
|
+
path.join(process.cwd(), '.agents/skills', `${PKG_SHORT}.md`),
|
|
303
|
+
getSkillContent(),
|
|
304
|
+
`.agents/skills/${PKG_SHORT}.md`
|
|
281
305
|
);
|
|
282
|
-
console.log(dim('
|
|
306
|
+
console.log(dim(' -> 完整 README + 结构化 API 元数据,skills 工具按需调取'));
|
|
283
307
|
console.log('');
|
|
284
308
|
|
|
285
309
|
// 3. 完成提示
|
|
286
|
-
console.log(green('✅
|
|
310
|
+
console.log(green('✅ 完成!已生成双载体 AI 上下文文件。'));
|
|
287
311
|
console.log('');
|
|
288
312
|
console.log(`${bold('📂 生成的文件:')}`);
|
|
289
|
-
console.log(` ${cyan('.
|
|
290
|
-
console.log(`
|
|
291
|
-
console.log(`
|
|
292
|
-
console.log(` └── ${cyan('docs/')}`);
|
|
293
|
-
console.log(` └── ${cyan(PKG_SHORT + '-api.md')} ${dim('← 完整 API 参考')}`);
|
|
313
|
+
console.log(` ${cyan('AGENTS.md')} ${dim('← 核心规则(AI 自动读取)')}`);
|
|
314
|
+
console.log(` ${cyan('.agents/skills/')}`);
|
|
315
|
+
console.log(` └── ${cyan(PKG_SHORT + '.md')} ${dim('← 完整 API 参考(按需调取)')}`);
|
|
294
316
|
console.log('');
|
|
295
|
-
|
|
296
|
-
console.log(
|
|
297
|
-
console.log(`
|
|
298
|
-
console.log(` 2. 查阅 element-plus 官方文档确认组件属性:`);
|
|
299
|
-
console.log(` ${cyan('https://element-plus.org/')}`);
|
|
300
|
-
console.log(` 3. ${dim('(可选)将 element-plus 常用组件 API 速查加入项目文档')}`);
|
|
317
|
+
console.log(`${bold('🔄 说明:')}`);
|
|
318
|
+
console.log(` - AGENTS.md 已用标记区块写入,重复执行 init-ai 可安全更新(不破坏其他库的指令)`);
|
|
319
|
+
console.log(` - 编写 Field 中输入控件属性前,查阅 element-plus 官方文档:${cyan('https://element-plus.org')}`);
|
|
301
320
|
console.log('');
|
|
302
321
|
}
|
|
303
322
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qin-ui/element-plus-pro",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "基于 element-plus 的二次封装组件",
|
|
5
5
|
"bin": {
|
|
6
6
|
"element-plus-pro": "./bin/init-ai.mjs"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"vue": "^3.5.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"
|
|
41
|
+
"vue-component-type-helpers": "^3.2.5",
|
|
42
|
+
"@qin-ui/pro-components-core": "^1.0.3"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"element-plus": "^2.13.6"
|
|
45
|
-
"vue-component-type-helpers": "^3.2.5"
|
|
45
|
+
"element-plus": "^2.13.6"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": [
|
|
48
48
|
"**/*.css",
|