adspecs 0.1.39 → 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.
@@ -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
- logger(`🔄 阶段 1 补充更新:docs/40-project_conventions/frontend-standard/ 已按前端技术栈更新`);
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
- logger(`📦 补充:检测到 40-project_conventions/ 为空目录(简易模式产物),已按前端技术栈补充 frontend-standard/`);
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 = 'ecp-front-standard'
624
+ nowFrontendStantard = 'vue3-front-standard'
586
625
  } else if (frontDemoSource === 'vue3-front-standard') {
587
626
  nowFrontendStantard = 'vue3-front-standard'
588
627
  }