adspecs 0.1.40 → 0.1.41
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/bin/adspecs.js +2 -2
- package/hooks/commit-queue.js +2 -1
- package/hooks/hooks.json +11 -11
- package/hooks/platform.js +6 -2
- package/hooks/session-logger.js +2 -1
- package/hooks/wiki-queue.js +2 -1
- package/package.json +65 -65
- package/references/vue3-front-standard/INDEX.md +54 -0
- package/references/vue3-front-standard/api-i18n-rules.md +65 -0
- package/references/vue3-front-standard/gushen-components.md +174 -0
- package/references/vue3-front-standard/page-development-rules.md +262 -0
- package/references/vue3-front-standard/page-template-index.md +374 -0
- package/references/vue3-front-standard/project-overview.md +48 -0
- package/skills/project-init/SKILL.md +21 -17
- package/src/lib/scaffolder.js +43 -4
|
@@ -407,7 +407,7 @@ questions: [
|
|
|
407
407
|
|
|
408
408
|
- **补充检查(模式升级检测)**:当 `docs/` 已存在且 `docs` 决策为 `skip` 时,如果当前模式为**经典模式**、**完整模式**或**轻量模式**,需额外检查 `docs/40-project_conventions/` 的内容状态:
|
|
409
409
|
- 检查 `docs/40-project_conventions/` 下是否存在实际文件(非空目录)
|
|
410
|
-
- 如果 `40-project_conventions/` 仅包含空子目录(简易模式的产物:`end-integration/` + `frontend-integration/`,或仅 `frontend-standard/` 为空目录)→ 根据前端技术栈选择自动从 references 补充复制 `frontend-standard/` 的文件内容(Vue → `
|
|
410
|
+
- 如果 `40-project_conventions/` 仅包含空子目录(简易模式的产物:`end-integration/` + `frontend-integration/`,或仅 `frontend-standard/` 为空目录)→ 根据前端技术栈选择自动从 references 补充复制 `frontend-standard/` 的文件内容(Vue → `vue3-front-standard/`,Ant Design React → `ant6-front-standard/`),同时补充复制后端规范 `ecp-end-standard/` 到 `end-standard/`,并输出:`📦 补充:检测到 40-project_conventions/ 为空目录(简易模式产物),已按技术栈补充 frontend-standard/ 和 end-standard/`
|
|
411
411
|
- 如果 `40-project_conventions/` 已包含文件 → 不做额外处理
|
|
412
412
|
|
|
413
413
|
- **子目录更新检查(40-project_conventions/)**:当 `docs/` 已存在且 `docs` 决策为 `skip`,且 `docs/40-project_conventions/` 下已包含实际文件时,需额外询问用户是否更新此子目录:
|
|
@@ -513,13 +513,13 @@ questions: [
|
|
|
513
513
|
根据区域决策执行:
|
|
514
514
|
|
|
515
515
|
- `docs` 决策为 `skip` → 输出 `⏭ 阶段 1 跳过:docs/ 已存在,保留现有内容`,但需检查 `conventions_decision` 子决策:
|
|
516
|
-
- 如果 `conventions_decision` = `"update"` → 根据前端技术栈选择从 `references/
|
|
516
|
+
- 如果 `conventions_decision` = `"update"` → 根据前端技术栈选择从 `references/vue3-front-standard/`(Vue)或 `references/ant6-front-standard/`(Ant Design React)复制到 `$TARGET/docs/40-project_conventions/frontend-standard/`,覆盖更新前端规范文件;经典/完整模式下同时从 `references/ecp-end-standard/` 复制到 `$TARGET/docs/40-project_conventions/end-standard/` 更新后端规范文件,输出:`🔄 阶段 1 补充更新:docs/40-project_conventions/ 已按技术栈更新前后端规范`
|
|
517
517
|
- 如果 `conventions_decision` = `"skip"` → 不做额外处理
|
|
518
518
|
- 处理完子决策后进入阶段 2
|
|
519
519
|
- `docs` 决策为 `recreate` → 执行 `rm -rf "$TARGET/docs"`,然后按下方步骤完整重建
|
|
520
520
|
- `docs` 决策为 `create` → 直接按下方步骤创建
|
|
521
521
|
|
|
522
|
-
创建以下完整目录树。大部分目录使用 `mkdir -p` 创建并写入 `README.md`;其中 `40-project_conventions/` 在经典/完整模式下根据前端技术栈选择复制 `
|
|
522
|
+
创建以下完整目录树。大部分目录使用 `mkdir -p` 创建并写入 `README.md`;其中 `40-project_conventions/` 在经典/完整模式下根据前端技术栈选择复制 `vue3-front-standard/`(Vue)或 `ant6-front-standard/`(Ant Design React)到 `frontend-standard/` 子目录,并复制 `ecp-end-standard/` 到 `end-standard/` 子目录(后端 Java 规范);轻量模式下复制 `ant6-front-standard/` 到 `frontend-standard/` 和 `python-end-standard/` 到 `end-standard/`;在简易模式下仅创建空子目录结构。模板文件(原 `50-templates/`)已迁移至 `.adspecs/templates/`,随阶段 6 的 `.adspecs/` 复制一并完成。
|
|
523
523
|
|
|
524
524
|
#### 目录结构
|
|
525
525
|
|
|
@@ -531,8 +531,8 @@ docs/
|
|
|
531
531
|
├── 20-prd/
|
|
532
532
|
├── 30-system-design/
|
|
533
533
|
├── 40-project_conventions/
|
|
534
|
-
│ ├── frontend-standard/ # 经典/完整模式按前端技术栈复制(Vue→
|
|
535
|
-
│ └── end-standard/ #
|
|
534
|
+
│ ├── frontend-standard/ # 经典/完整模式按前端技术栈复制(Vue→vue3-front-standard,AntD→ant6-front-standard);轻量模式固定 ant6-front-standard;简易模式为空
|
|
535
|
+
│ └── end-standard/ # 经典/完整模式复制 ecp-end-standard(Java);轻量模式固定 python-end-standard;简易模式为空
|
|
536
536
|
├── 70-scripts/
|
|
537
537
|
│ └── depoly/
|
|
538
538
|
├── 80-development/
|
|
@@ -603,14 +603,15 @@ docs/
|
|
|
603
603
|
- 用途: 项目约定,前后端集成开发规范和接口约定
|
|
604
604
|
- 子目录:
|
|
605
605
|
- `frontend-standard/` — 前端约定(按技术栈来源不同)
|
|
606
|
-
- `end-standard/` —
|
|
606
|
+
- `end-standard/` — 后端约定(按模式来源不同)
|
|
607
607
|
- 来源规则(经典/完整模式):
|
|
608
|
-
- 前端演示技术栈选择 **Vue(默认)** → 复制 `$PLUGIN_DIR/references/
|
|
608
|
+
- 前端演示技术栈选择 **Vue(默认)** → 复制 `$PLUGIN_DIR/references/vue3-front-standard/` 到 `$TARGET/docs/40-project_conventions/frontend-standard/`
|
|
609
609
|
- 前端演示技术栈选择 **Ant Design React** → 复制 `$PLUGIN_DIR/references/ant6-front-standard/` 到 `$TARGET/docs/40-project_conventions/frontend-standard/`
|
|
610
|
+
- 后端规范(所有经典/完整模式)→ 复制 `$PLUGIN_DIR/references/ecp-end-standard/` 到 `$TARGET/docs/40-project_conventions/end-standard/`
|
|
610
611
|
- 来源规则(轻量模式):
|
|
611
612
|
- 前端规范:复制 `$PLUGIN_DIR/references/ant6-front-standard/` 到 `$TARGET/docs/40-project_conventions/frontend-standard/`
|
|
612
613
|
- 后端规范:复制 `$PLUGIN_DIR/references/python-end-standard/` 到 `$TARGET/docs/40-project_conventions/end-standard/`
|
|
613
|
-
- 来源规则(简易模式): 仅创建空目录结构 `frontend-standard/`,不复制文件
|
|
614
|
+
- 来源规则(简易模式): 仅创建空目录结构 `frontend-standard/` + `end-standard/`,不复制文件
|
|
614
615
|
|
|
615
616
|
**70-scripts/**:
|
|
616
617
|
|
|
@@ -665,6 +666,7 @@ mkdir -p "$TARGET/docs/300-specs"
|
|
|
665
666
|
if [ "{mode}" = "simple" ]; then
|
|
666
667
|
# 简易模式:仅创建空子目录结构,不复制 references 文件
|
|
667
668
|
mkdir -p "$TARGET/docs/40-project_conventions/frontend-standard"
|
|
669
|
+
mkdir -p "$TARGET/docs/40-project_conventions/end-standard"
|
|
668
670
|
elif [ "{mode}" = "demo" ]; then
|
|
669
671
|
# 轻量模式:固定技术栈 Python + SQLite + React + AntD6,前后端规范都复制
|
|
670
672
|
mkdir -p "$TARGET/docs/40-project_conventions/frontend-standard"
|
|
@@ -672,16 +674,18 @@ elif [ "{mode}" = "demo" ]; then
|
|
|
672
674
|
cp -r "$PLUGIN_DIR/references/ant6-front-standard/." "$TARGET/docs/40-project_conventions/frontend-standard/"
|
|
673
675
|
cp -r "$PLUGIN_DIR/references/python-end-standard/." "$TARGET/docs/40-project_conventions/end-standard/"
|
|
674
676
|
else
|
|
675
|
-
# 经典/完整模式:按前端技术栈选择复制前端规范到 frontend-standard
|
|
677
|
+
# 经典/完整模式:按前端技术栈选择复制前端规范到 frontend-standard/,后端统一复制 ecp-end-standard
|
|
676
678
|
if [ "$FRONT_DEMO_SOURCE" = "antd-front-demo" ]; then
|
|
677
679
|
# Ant Design React 技术栈
|
|
678
680
|
FRONTEND_STANDARD_SOURCE="ant6-front-standard"
|
|
679
681
|
else
|
|
680
682
|
# Vue 技术栈(默认)
|
|
681
|
-
FRONTEND_STANDARD_SOURCE="
|
|
683
|
+
FRONTEND_STANDARD_SOURCE="vue3-front-standard"
|
|
682
684
|
fi
|
|
683
685
|
mkdir -p "$TARGET/docs/40-project_conventions/frontend-standard"
|
|
686
|
+
mkdir -p "$TARGET/docs/40-project_conventions/end-standard"
|
|
684
687
|
cp -r "$PLUGIN_DIR/references/$FRONTEND_STANDARD_SOURCE/." "$TARGET/docs/40-project_conventions/frontend-standard/"
|
|
688
|
+
cp -r "$PLUGIN_DIR/references/ecp-end-standard/." "$TARGET/docs/40-project_conventions/end-standard/"
|
|
685
689
|
fi
|
|
686
690
|
|
|
687
691
|
# 注意:模板文件已迁移至 .adspecs/templates/,随阶段 6 的 .adspecs/ 复制一并完成,无需单独复制
|
|
@@ -694,7 +698,7 @@ fi
|
|
|
694
698
|
完成后输出:
|
|
695
699
|
|
|
696
700
|
- 新建时(简易模式):`✅ 阶段 1 完成:docs/ 目录结构已创建(11 个一级子目录,40 仅创建空目录;模板在 .adspecs/templates/ 随阶段 6 复制)`
|
|
697
|
-
- 新建时(经典/完整模式):`✅ 阶段 1 完成:docs/ 目录结构已创建(11 个一级子目录,其中 40 从 references
|
|
701
|
+
- 新建时(经典/完整模式):`✅ 阶段 1 完成:docs/ 目录结构已创建(11 个一级子目录,其中 40 从 references 复制前后端规范;模板在 .adspecs/templates/ 随阶段 6 复制)`
|
|
698
702
|
- 新建时(轻量模式):`✅ 阶段 1 完成:docs/ 目录结构已创建(11 个一级子目录,40 按 Python+React 技术栈复制前后端规范;模板在 .adspecs/templates/ 随阶段 6 复制)`
|
|
699
703
|
- 重建时:`🔄 阶段 1 完成:docs/ 目录结构已重新创建(删除旧目录后重建)`
|
|
700
704
|
- 跳过时:`⏭ 阶段 1 跳过:docs/ 已存在,保留现有内容`
|
|
@@ -1245,7 +1249,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1245
1249
|
| .adspecs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 插件配置、脚本、模板(extensions.yml、feature.json、templates/、scripts/) |
|
|
1246
1250
|
| └ templates/ | 🔄 部分更新 / ⏭ 全部跳过 | .adspecs/ 跳过时,逐文件确认结果({N} 个替换,{M} 个保留) |
|
|
1247
1251
|
| └ feature.json | 🔧 已补全 / ✅ 已完整 / ✅ 已创建 | 属性补全检查(已有属性保留,缺失属性补充) |
|
|
1248
|
-
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录,40
|
|
1252
|
+
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录,40 仅创建空目录(含 frontend-standard/ + end-standard/) |
|
|
1249
1253
|
| └ 40-project_conventions/ | 🔄 已更新 / ⏭ 已跳过 | docs/ 跳过时,40 子目录的更新决策 |
|
|
1250
1254
|
| wiki/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 基线文件目录 + README.md |
|
|
1251
1255
|
| hooks/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | Hook 脚本(hooks.json + platform.js + 4 个事件脚本) |
|
|
@@ -1259,7 +1263,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1259
1263
|
| .adspecs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 插件配置、脚本、模板(extensions.yml、feature.json、templates/、scripts/) |
|
|
1260
1264
|
| └ templates/ | 🔄 部分更新 / ⏭ 全部跳过 | .adspecs/ 跳过时,逐文件确认结果({N} 个替换,{M} 个保留) |
|
|
1261
1265
|
| └ feature.json | 🔧 已补全 / ✅ 已完整 / ✅ 已创建 | 属性补全检查(已有属性保留,缺失属性补充) |
|
|
1262
|
-
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录 + 40 从 references
|
|
1266
|
+
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录 + 40 从 references 复制前后端规范 |
|
|
1263
1267
|
| └ 40-project_conventions/ | 🔄 已更新 / ⏭ 已跳过 | docs/ 跳过时,40 子目录的更新决策 |
|
|
1264
1268
|
| wiki/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 基线文件目录 + README.md |
|
|
1265
1269
|
| front-demo/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | {技术栈名},{N} 个文件 |
|
|
@@ -1274,7 +1278,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1274
1278
|
| .adspecs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 插件配置、脚本、模板(extensions.yml、feature.json、templates/、scripts/) |
|
|
1275
1279
|
| └ templates/ | 🔄 部分更新 / ⏭ 全部跳过 | .adspecs/ 跳过时,逐文件确认结果({N} 个替换,{M} 个保留) |
|
|
1276
1280
|
| └ feature.json | 🔧 已补全 / ✅ 已完整 / ✅ 已创建 | 属性补全检查(已有属性保留,缺失属性补充) |
|
|
1277
|
-
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录 + 40 从 references
|
|
1281
|
+
| docs/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 11 个骨架目录 + 40 从 references 复制前后端规范 |
|
|
1278
1282
|
| └ 40-project_conventions/ | 🔄 已更新 / ⏭ 已跳过 | docs/ 跳过时,40 子目录的更新决策 |
|
|
1279
1283
|
| wiki/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | 基线文件目录 + README.md |
|
|
1280
1284
|
| web-ui/ | ✅ 已创建 / 🔄 已重建 / ⏭ 已跳过 | {N} 个文件 |
|
|
@@ -1321,7 +1325,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1321
1325
|
**经典模式:**
|
|
1322
1326
|
{pwd}/{PROJECT_DIR}/(或直接 {pwd}/)
|
|
1323
1327
|
├── .adspecs/ (插件配置、脚本、模板 + project.json)
|
|
1324
|
-
├── docs/ (11 个子目录)
|
|
1328
|
+
├── docs/ (11 个子目录 + 40-project_conventions/ 含前端规范 + Java 后端规范)
|
|
1325
1329
|
├── hooks/ (Hook 脚本:SessionStart/Stop/PostToolUse 等)
|
|
1326
1330
|
├── wiki/ (基线文件目录)
|
|
1327
1331
|
└── front-demo/ ({技术栈名}前端演示项目)
|
|
@@ -1329,7 +1333,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1329
1333
|
**完整模式:**
|
|
1330
1334
|
{pwd}/{PROJECT_DIR}/(或直接 {pwd}/)
|
|
1331
1335
|
├── .adspecs/ (插件配置、脚本、模板 + project.json)
|
|
1332
|
-
├── docs/ (11 个子目录)
|
|
1336
|
+
├── docs/ (11 个子目录 + 40-project_conventions/ 含前端规范 + Java 后端规范)
|
|
1333
1337
|
├── hooks/ (Hook 脚本:SessionStart/Stop/PostToolUse 等)
|
|
1334
1338
|
├── wiki/ (基线文件目录)
|
|
1335
1339
|
├── web-ui/ (Vue3 壳工程)
|
|
@@ -1420,7 +1424,7 @@ mkdir -p "$TARGET/.adspecs"
|
|
|
1420
1424
|
- [ ] 已选择前端演示技术栈(经典/完整模式:Vue / Ant Design React;轻量模式固定 Ant Design React)
|
|
1421
1425
|
- [ ] 已按模式检查目标路径下对应区域的存在情况
|
|
1422
1426
|
- [ ] 对已存在的区域已通过 AskUserQuestion 获取用户选择(重新创建 / 跳过)
|
|
1423
|
-
- [ ] docs/ 目录结构已创建/重建/跳过(按用户决策执行;简易模式下 40-project_conventions/ 仅创建空目录,经典/完整模式从 references
|
|
1427
|
+
- [ ] docs/ 目录结构已创建/重建/跳过(按用户决策执行;简易模式下 40-project_conventions/ 仅创建空目录,经典/完整模式从 references 复制前后端规范(前端按技术栈 + ecp-end-standard),轻量模式复制 ant6-front-standard + python-end-standard)
|
|
1424
1428
|
- [ ] 模式升级补充检查已完成(docs/ 跳过时,经典/完整/轻量模式自动检测并补充空的 40-project_conventions/)
|
|
1425
1429
|
- [ ] 40-project_conventions/ 子目录更新检查已完成(docs/ 跳过且目录已包含文件时,已通过 AskUserQuestion 获取更新/跳过决策并按决策执行)
|
|
1426
1430
|
- [ ] wiki/ 基线文件目录已创建/重建/跳过
|
package/src/lib/scaffolder.js
CHANGED
|
@@ -190,7 +190,15 @@ async function scaffoldDocs(targetDir, pluginDir, mode, frontDemoSource, decisio
|
|
|
190
190
|
path.join(pluginDir, 'references', frontendStandard),
|
|
191
191
|
path.join(docsDir, '40-project_conventions/frontend-standard')
|
|
192
192
|
);
|
|
193
|
-
|
|
193
|
+
// 经典/完整模式同时更新后端规范
|
|
194
|
+
if (mode === 'classic' || mode === 'full') {
|
|
195
|
+
fs.mkdirSync(path.join(docsDir, '40-project_conventions/end-standard'), { recursive: true });
|
|
196
|
+
copyDirFiltered(
|
|
197
|
+
path.join(pluginDir, 'references/ecp-end-standard'),
|
|
198
|
+
path.join(docsDir, '40-project_conventions/end-standard')
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
logger(`🔄 阶段 1 补充更新:docs/40-project_conventions/ 已按技术栈更新前后端规范`);
|
|
194
202
|
stage.subDecisions = { conventions: 'update' };
|
|
195
203
|
}
|
|
196
204
|
|
|
@@ -198,11 +206,19 @@ async function scaffoldDocs(targetDir, pluginDir, mode, frontDemoSource, decisio
|
|
|
198
206
|
if (modeUpgrade.detected) {
|
|
199
207
|
const frontendStandard = resolveFrontendStandard(frontDemoSource);
|
|
200
208
|
fs.mkdirSync(path.join(docsDir, '40-project_conventions/frontend-standard'), { recursive: true });
|
|
209
|
+
fs.mkdirSync(path.join(docsDir, '40-project_conventions/end-standard'), { recursive: true });
|
|
201
210
|
copyDirFiltered(
|
|
202
211
|
path.join(pluginDir, 'references', frontendStandard),
|
|
203
212
|
path.join(docsDir, '40-project_conventions/frontend-standard')
|
|
204
213
|
);
|
|
205
|
-
|
|
214
|
+
// 经典/完整模式同时补充后端规范
|
|
215
|
+
if (mode === 'classic' || mode === 'full') {
|
|
216
|
+
copyDirFiltered(
|
|
217
|
+
path.join(pluginDir, 'references/ecp-end-standard'),
|
|
218
|
+
path.join(docsDir, '40-project_conventions/end-standard')
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
logger(`📦 补充:检测到 40-project_conventions/ 为空目录(简易模式产物),已按技术栈补充 frontend-standard/ 和 end-standard/`);
|
|
206
222
|
stage.modeUpgrade = modeUpgrade;
|
|
207
223
|
}
|
|
208
224
|
|
|
@@ -252,6 +268,11 @@ async function scaffoldDocs(targetDir, pluginDir, mode, frontDemoSource, decisio
|
|
|
252
268
|
path.join(pluginDir, 'references', frontendStandard),
|
|
253
269
|
path.join(convDir, 'frontend-standard')
|
|
254
270
|
);
|
|
271
|
+
// 后端规范:经典/完整模式统一复制 ecp-end-standard(Java)
|
|
272
|
+
copyDirFiltered(
|
|
273
|
+
path.join(pluginDir, 'references/ecp-end-standard'),
|
|
274
|
+
path.join(convDir, 'end-standard')
|
|
275
|
+
);
|
|
255
276
|
}
|
|
256
277
|
|
|
257
278
|
// 生成各子目录的 README.md(create/recreate/update 都重新生成)
|
|
@@ -272,7 +293,7 @@ async function scaffoldDocs(targetDir, pluginDir, mode, frontDemoSource, decisio
|
|
|
272
293
|
? ',40 按 Python+React 技术栈复制前后端规范'
|
|
273
294
|
: mode === 'simple'
|
|
274
295
|
? ',40 仅创建空目录'
|
|
275
|
-
: ',其中 40 从 references
|
|
296
|
+
: ',其中 40 从 references 复制前后端规范';
|
|
276
297
|
logger(`✅ 阶段 1 完成:docs/ 目录结构已${verb}(11 个一级子目录${convNote})`);
|
|
277
298
|
|
|
278
299
|
return stage;
|
|
@@ -532,6 +553,24 @@ function scaffoldHooks(targetDir, pluginDir, decision, logger) {
|
|
|
532
553
|
// 从插件根目录复制 hooks/
|
|
533
554
|
const result = copyDirFiltered(path.join(pluginDir, 'hooks'), hooksDir);
|
|
534
555
|
|
|
556
|
+
// 重写项目级 hooks/hooks.json 命令:源插件版本用 ${CLAUDE_PLUGIN_ROOT} 锚定,
|
|
557
|
+
// 但该项目根副本供 Qoder/WorkBuddy 加载(它们不做该占位符替换),且相对路径命令
|
|
558
|
+
// 在会话 cwd 切换到子目录时会解析失败(MODULE_NOT_FOUND)。脚本随目录已复制到
|
|
559
|
+
// {targetDir}/hooks/,故把占位符替换为项目 hooks 目录绝对路径(正斜杠,JSON 安全)。
|
|
560
|
+
const copiedJson = path.join(hooksDir, 'hooks.json');
|
|
561
|
+
if (fs.existsSync(copiedJson)) {
|
|
562
|
+
try {
|
|
563
|
+
const absHooksDir = hooksDir.split(path.sep).join('/');
|
|
564
|
+
const raw = fs.readFileSync(copiedJson, 'utf8');
|
|
565
|
+
const rewritten = raw.split('${CLAUDE_PLUGIN_ROOT}').join(absHooksDir);
|
|
566
|
+
if (rewritten !== raw) {
|
|
567
|
+
fs.writeFileSync(copiedJson, rewritten, 'utf8');
|
|
568
|
+
}
|
|
569
|
+
} catch (e) {
|
|
570
|
+
logger(`⚠ 阶段 6.8:hooks/hooks.json 路径重写失败(${e.message}),请手工将命令改为绝对路径`);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
535
574
|
stage.fileCount = result.fileCount;
|
|
536
575
|
stage.status = action === 'recreate' ? 'recreated' : 'created';
|
|
537
576
|
|
|
@@ -582,7 +621,7 @@ function resolveFrontendStandard(frontDemoSource) {
|
|
|
582
621
|
if (frontDemoSource === 'antd-front-demo') {
|
|
583
622
|
nowFrontendStantard = 'ant6-front-standard'
|
|
584
623
|
} else if (frontDemoSource === 'front-demo') {
|
|
585
|
-
nowFrontendStantard = '
|
|
624
|
+
nowFrontendStantard = 'vue3-front-standard'
|
|
586
625
|
} else if (frontDemoSource === 'vue3-front-standard') {
|
|
587
626
|
nowFrontendStantard = 'vue3-front-standard'
|
|
588
627
|
}
|