yg-team-cli 2.5.7 → 2.5.8
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/README.md +4 -0
- package/dist/cli.js +18 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2847,11 +2847,17 @@ async function selectMilestone(specFile) {
|
|
|
2847
2847
|
return "\u6574\u4E2A spec";
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
|
-
const choices = milestones.map((m, idx) =>
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2850
|
+
const choices = milestones.map((m, idx) => {
|
|
2851
|
+
const isDone = m.completedCount === m.todos.length && m.todos.length > 0;
|
|
2852
|
+
const statusIcon = isDone ? "\u2713" : m.completedCount > 0 ? "\u27F3" : "\u25CB";
|
|
2853
|
+
const progress = `[${m.completedCount}/${m.todos.length}]`;
|
|
2854
|
+
const label = isDone ? `\u2713 ${m.title}` : `${statusIcon} ${progress} ${m.title}`;
|
|
2855
|
+
return {
|
|
2856
|
+
name: `${idx + 1}. ${label} (${m.todos.length} \u4E2A\u4EFB\u52A1)`,
|
|
2857
|
+
value: m.title,
|
|
2858
|
+
short: m.title
|
|
2859
|
+
};
|
|
2860
|
+
});
|
|
2855
2861
|
choices.push({
|
|
2856
2862
|
name: `${milestones.length + 1}. \u6574\u4E2A spec (\u5168\u90E8 milestones)`,
|
|
2857
2863
|
value: "\u6574\u4E2A spec",
|
|
@@ -2992,7 +2998,7 @@ function parseMilestones(spec) {
|
|
|
2992
2998
|
milestones.push(currentMilestone);
|
|
2993
2999
|
}
|
|
2994
3000
|
const title = line.replace(/^###\s+/, "").trim();
|
|
2995
|
-
currentMilestone = { title, todos: [] };
|
|
3001
|
+
currentMilestone = { title, todos: [], completedCount: 0 };
|
|
2996
3002
|
inMilestone = true;
|
|
2997
3003
|
continue;
|
|
2998
3004
|
}
|
|
@@ -3002,9 +3008,13 @@ function parseMilestones(spec) {
|
|
|
3002
3008
|
currentMilestone = null;
|
|
3003
3009
|
continue;
|
|
3004
3010
|
}
|
|
3005
|
-
const todoMatch = line.match(/^-\s+\[[
|
|
3011
|
+
const todoMatch = line.match(/^-\s+\[([ xX])\]\s*(.+)/);
|
|
3006
3012
|
if (todoMatch) {
|
|
3007
|
-
|
|
3013
|
+
const isCompleted = todoMatch[1].toLowerCase() === "x";
|
|
3014
|
+
if (isCompleted) {
|
|
3015
|
+
currentMilestone.completedCount++;
|
|
3016
|
+
}
|
|
3017
|
+
currentMilestone.todos.push(todoMatch[2].trim());
|
|
3008
3018
|
}
|
|
3009
3019
|
}
|
|
3010
3020
|
}
|