yg-team-cli 2.4.1 → 2.4.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/dist/cli.js +8 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2522,20 +2522,20 @@ var breakdownCommand = new Command2("breakdown").argument("[spec-file]", "Spec \
|
|
|
2522
2522
|
const tasks = new Listr2([
|
|
2523
2523
|
{
|
|
2524
2524
|
title: "\u626B\u63CF spec \u6587\u4EF6",
|
|
2525
|
-
task: async () => {
|
|
2525
|
+
task: async (ctx) => {
|
|
2526
2526
|
const specDir = "docs/specs";
|
|
2527
2527
|
const exists = await FileUtils.exists(specDir);
|
|
2528
2528
|
if (!exists) {
|
|
2529
2529
|
throw new Error(`specs \u76EE\u5F55\u4E0D\u5B58\u5728: ${specDir}`);
|
|
2530
2530
|
}
|
|
2531
2531
|
const files = await FileUtils.findFiles("*.md", specDir);
|
|
2532
|
-
|
|
2532
|
+
ctx.specs = files.filter((f) => !f.includes("template"));
|
|
2533
2533
|
}
|
|
2534
2534
|
},
|
|
2535
2535
|
{
|
|
2536
2536
|
title: "\u9009\u62E9 spec \u6587\u4EF6",
|
|
2537
2537
|
task: async (ctx) => {
|
|
2538
|
-
if (ctx.specs.length === 0) {
|
|
2538
|
+
if (!ctx.specs || ctx.specs.length === 0) {
|
|
2539
2539
|
throw new Error("\u672A\u627E\u5230 spec \u6587\u4EF6");
|
|
2540
2540
|
}
|
|
2541
2541
|
if (!specFile) {
|
|
@@ -2547,14 +2547,15 @@ var breakdownCommand = new Command2("breakdown").argument("[spec-file]", "Spec \
|
|
|
2547
2547
|
choices: ctx.specs
|
|
2548
2548
|
}
|
|
2549
2549
|
]);
|
|
2550
|
-
|
|
2550
|
+
ctx.selectedFile = path8.join("docs/specs", selectedFile);
|
|
2551
|
+
return;
|
|
2551
2552
|
}
|
|
2552
2553
|
const fullPath = specFile.startsWith("docs/specs/") ? specFile : path8.join("docs/specs", specFile);
|
|
2553
2554
|
const exists = await FileUtils.exists(fullPath);
|
|
2554
2555
|
if (!exists) {
|
|
2555
2556
|
throw new Error(`Spec \u6587\u4EF6\u4E0D\u5B58\u5728: ${specFile}`);
|
|
2556
2557
|
}
|
|
2557
|
-
|
|
2558
|
+
ctx.selectedFile = fullPath;
|
|
2558
2559
|
}
|
|
2559
2560
|
},
|
|
2560
2561
|
{
|
|
@@ -3263,7 +3264,7 @@ async function addFeatureFromPrd(featureName, featureSlug, specFile) {
|
|
|
3263
3264
|
logger.newLine();
|
|
3264
3265
|
logger.separator("\u2500", 60);
|
|
3265
3266
|
logger.newLine();
|
|
3266
|
-
|
|
3267
|
+
ctx2.generatedSpec = result;
|
|
3267
3268
|
}
|
|
3268
3269
|
},
|
|
3269
3270
|
{
|
|
@@ -3353,7 +3354,7 @@ async function addFeatureSimple(featureName, featureSlug, specFile) {
|
|
|
3353
3354
|
logger.newLine();
|
|
3354
3355
|
logger.separator("\u2500", 60);
|
|
3355
3356
|
logger.newLine();
|
|
3356
|
-
|
|
3357
|
+
ctx2.generatedSpec = result;
|
|
3357
3358
|
}
|
|
3358
3359
|
},
|
|
3359
3360
|
{
|