yg-team-cli 2.3.7 → 2.3.9

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/dist/cli.js CHANGED
@@ -958,18 +958,21 @@ var init_module_registry = __esm({
958
958
  return this.MODULES.find((m) => m.id === id);
959
959
  }
960
960
  /**
961
- * 注入模块到项目
961
+ * 注入模块到项目,返回新增文件列表
962
962
  */
963
963
  static async injectModule(projectPath, moduleId, templatesDir) {
964
964
  const module = this.getModuleById(moduleId);
965
- if (!module) return;
965
+ if (!module) return [];
966
+ const addedFiles = [];
966
967
  for (const specRelPath of module.specs) {
967
968
  const sourcePath = path5.join(templatesDir, "modules", specRelPath);
968
969
  const targetPath = path5.join(projectPath, "docs/specs", path5.basename(specRelPath));
969
970
  if (await FileUtils.exists(sourcePath)) {
970
971
  await FileUtils.copy(sourcePath, targetPath);
972
+ addedFiles.push(path5.relative(projectPath, targetPath));
971
973
  } else if (module.type === "remote") {
972
974
  await this.generateRemoteSpecPlaceholder(targetPath, module);
975
+ addedFiles.push(path5.relative(projectPath, targetPath));
973
976
  }
974
977
  }
975
978
  if (module.type === "local" && module.backendFragments) {
@@ -982,11 +985,13 @@ var init_module_registry = __esm({
982
985
  if (await FileUtils.exists(sourcePath)) {
983
986
  await FileUtils.ensureDir(path5.dirname(targetPath));
984
987
  await FileUtils.copy(sourcePath, targetPath);
988
+ addedFiles.push(path5.relative(projectPath, targetPath));
985
989
  }
986
990
  }
987
991
  }
988
992
  } else if (module.type === "remote") {
989
993
  }
994
+ return addedFiles;
990
995
  }
991
996
  /**
992
997
  * 生成远程模块的 Spec 占位符
@@ -2263,11 +2268,13 @@ var init_init = __esm({
2263
2268
  },
2264
2269
  {
2265
2270
  title: "\u6CE8\u5165\u9009\u5B9A\u7684\u901A\u7528\u6A21\u5757",
2266
- task: async () => {
2271
+ task: async (ctx) => {
2267
2272
  if (selectedModules.length === 0) return;
2268
2273
  const templatesDir = path7.resolve(FileUtils.getDirName(import.meta.url), "../templates");
2274
+ ctx.addedFiles = [];
2269
2275
  for (const moduleId of selectedModules) {
2270
- await ModuleManager.injectModule(projectPath, moduleId, templatesDir);
2276
+ const files = await ModuleManager.injectModule(projectPath, moduleId, templatesDir);
2277
+ ctx.addedFiles.push(...files);
2271
2278
  }
2272
2279
  }
2273
2280
  },
@@ -2282,7 +2289,7 @@ var init_init = __esm({
2282
2289
  ],
2283
2290
  { concurrent: false, exitOnError: true }
2284
2291
  );
2285
- await tasks.run();
2292
+ const taskContext = await tasks.run();
2286
2293
  const remoteModules = selectedModules.map((id) => ModuleManager.getModuleById(id)).filter((m) => m?.type === "remote");
2287
2294
  if (remoteModules.length > 0) {
2288
2295
  logger.newLine();
@@ -2314,7 +2321,13 @@ var init_init = __esm({
2314
2321
  \u8BF7\u786E\u4FDD\u4EE3\u7801\u7B26\u5408 \`CONVENTIONS.md\` \u4E2D\u7684\u89C4\u8303\u3002
2315
2322
  \u751F\u6210\u5B8C\u6210\u540E\uFF0C\u68C0\u67E5\u5E76\u4FEE\u590D\u4EFB\u4F55\u7F16\u8BD1\u9519\u8BEF\uFF0C\u6700\u540E\u7B80\u8981\u5217\u51FA\u751F\u6210\u7684\u6587\u4EF6\u3002`;
2316
2323
  try {
2317
- await e("claude", ["-p", prompt, "--add-dir", projectPath], {
2324
+ await e("claude", [
2325
+ "-p",
2326
+ prompt,
2327
+ "--add-dir",
2328
+ projectPath,
2329
+ "--dangerously-skip-permissions"
2330
+ ], {
2318
2331
  stdio: "inherit",
2319
2332
  timeout: 6e5
2320
2333
  });
@@ -2331,6 +2344,15 @@ var init_init = __esm({
2331
2344
  logger.newLine();
2332
2345
  logger.success(`\u9879\u76EE ${projectName} \u521D\u59CB\u5316\u6210\u529F\uFF01`);
2333
2346
  logger.newLine();
2347
+ const addedFiles = taskContext?.addedFiles || [];
2348
+ if (addedFiles.length > 0) {
2349
+ logger.newLine();
2350
+ logger.header("\u6A21\u5757\u65B0\u589E\u6587\u4EF6\u6C47\u603B");
2351
+ for (const file of addedFiles) {
2352
+ logger.step(file);
2353
+ }
2354
+ }
2355
+ logger.newLine();
2334
2356
  logger.info("\u4E0B\u4E00\u6B65:");
2335
2357
  logger.step(`cd ${projectName}`);
2336
2358
  logger.step("team-cli add-feature <feature-name>");