chiefwiggum 1.3.47 → 1.3.48
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.cjs +38 -25
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1435,8 +1435,8 @@ Create 5-15 issues.${projectName ? ` Add each to project "${projectName}".` : ""
|
|
|
1435
1435
|
} catch {
|
|
1436
1436
|
}
|
|
1437
1437
|
console.log(import_picocolors7.default.dim(" Creating epic from PRD..."));
|
|
1438
|
-
const
|
|
1439
|
-
const epicTitle =
|
|
1438
|
+
const planTitleMatch = planContent.match(/^#\s+(.+)$/m);
|
|
1439
|
+
const epicTitle = planTitleMatch ? `Epic: ${planTitleMatch[1]}` : "Epic: Project Implementation";
|
|
1440
1440
|
const epicBodyInitial = `${prdGenerated}
|
|
1441
1441
|
|
|
1442
1442
|
---
|
|
@@ -1549,21 +1549,18 @@ _Creating issues..._
|
|
|
1549
1549
|
let failed = 0;
|
|
1550
1550
|
const failedIssues = [];
|
|
1551
1551
|
const createdIssueNumbers = [];
|
|
1552
|
+
const loggedMilestones = /* @__PURE__ */ new Set();
|
|
1552
1553
|
for (let i = 0; i < issues.length; i++) {
|
|
1553
1554
|
const issue = issues[i];
|
|
1554
1555
|
const progress = Math.round((i + 1) / total * 100);
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1556
|
+
const milestone = Math.floor(progress / 25) * 25;
|
|
1557
|
+
if (milestone > 0 && !loggedMilestones.has(milestone) && milestone < 100) {
|
|
1558
|
+
console.log(import_picocolors7.default.dim(` ${milestone}% complete (${i + 1}/${total})...`));
|
|
1559
|
+
loggedMilestones.add(milestone);
|
|
1560
|
+
}
|
|
1560
1561
|
try {
|
|
1561
1562
|
const validLabels = issue.labels.filter((label) => availableLabels.size === 0 || availableLabels.has(label));
|
|
1562
1563
|
const allLabels = ["chiefwiggum", ...validLabels];
|
|
1563
|
-
const labelsArg = `--label "${allLabels.join(",")}"`;
|
|
1564
|
-
const escapeForShell = (str) => {
|
|
1565
|
-
return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/!/g, "\\!").replace(/\n/g, "\\n");
|
|
1566
|
-
};
|
|
1567
1564
|
let bodyWithEpic = issue.body;
|
|
1568
1565
|
if (epicNumber) {
|
|
1569
1566
|
bodyWithEpic = `Part of #${epicNumber}
|
|
@@ -1572,13 +1569,23 @@ _Creating issues..._
|
|
|
1572
1569
|
|
|
1573
1570
|
${issue.body}`;
|
|
1574
1571
|
}
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1572
|
+
const createResult = (0, import_node_child_process6.spawnSync)("gh", [
|
|
1573
|
+
"issue",
|
|
1574
|
+
"create",
|
|
1575
|
+
"--title",
|
|
1576
|
+
issue.title,
|
|
1577
|
+
"--body",
|
|
1578
|
+
bodyWithEpic,
|
|
1579
|
+
"--label",
|
|
1580
|
+
allLabels.join(",")
|
|
1581
|
+
], {
|
|
1579
1582
|
encoding: "utf-8",
|
|
1580
1583
|
stdio: ["pipe", "pipe", "pipe"]
|
|
1581
|
-
})
|
|
1584
|
+
});
|
|
1585
|
+
if (createResult.status !== 0) {
|
|
1586
|
+
throw new Error(createResult.stderr || "Failed to create issue");
|
|
1587
|
+
}
|
|
1588
|
+
const issueUrl = createResult.stdout.trim();
|
|
1582
1589
|
const issueNumMatch = issueUrl.match(/\/issues\/(\d+)$/);
|
|
1583
1590
|
if (issueNumMatch) {
|
|
1584
1591
|
createdIssueNumbers.push(parseInt(issueNumMatch[1], 10));
|
|
@@ -1612,7 +1619,6 @@ ${issue.body}`;
|
|
|
1612
1619
|
failedIssues.push({ title: issue.title, error: errorMsg });
|
|
1613
1620
|
}
|
|
1614
1621
|
}
|
|
1615
|
-
process.stdout.write("\r" + " ".repeat(100) + "\r");
|
|
1616
1622
|
console.log(import_picocolors7.default.green(` \u2713 Created ${created} GitHub Issues`));
|
|
1617
1623
|
if (failed > 0) {
|
|
1618
1624
|
console.log(import_picocolors7.default.yellow(` \u26A0 ${failed} issues failed to create:`));
|
|
@@ -1632,9 +1638,6 @@ ${issue.body}`;
|
|
|
1632
1638
|
}
|
|
1633
1639
|
}
|
|
1634
1640
|
if (epicNumber && createdIssueNumbers.length > 0) {
|
|
1635
|
-
const escapeForShell = (str) => {
|
|
1636
|
-
return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/!/g, "\\!").replace(/\n/g, "\\n");
|
|
1637
|
-
};
|
|
1638
1641
|
const tasklist = createdIssueNumbers.map((num) => `- [ ] #${num}`).join("\n");
|
|
1639
1642
|
const updatedEpicBody = `${prdGenerated}
|
|
1640
1643
|
|
|
@@ -1644,11 +1647,21 @@ ${issue.body}`;
|
|
|
1644
1647
|
|
|
1645
1648
|
${tasklist}`;
|
|
1646
1649
|
try {
|
|
1647
|
-
(0, import_node_child_process6.
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1650
|
+
const editResult = (0, import_node_child_process6.spawnSync)("gh", [
|
|
1651
|
+
"issue",
|
|
1652
|
+
"edit",
|
|
1653
|
+
String(epicNumber),
|
|
1654
|
+
"--body",
|
|
1655
|
+
updatedEpicBody
|
|
1656
|
+
], {
|
|
1657
|
+
encoding: "utf-8",
|
|
1658
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1659
|
+
});
|
|
1660
|
+
if (editResult.status === 0) {
|
|
1661
|
+
console.log(import_picocolors7.default.green(` \u2713 Updated epic #${epicNumber} with tasklist`));
|
|
1662
|
+
} else {
|
|
1663
|
+
throw new Error(editResult.stderr || "Failed");
|
|
1664
|
+
}
|
|
1652
1665
|
} catch {
|
|
1653
1666
|
console.log(import_picocolors7.default.yellow(` Could not update epic with tasklist`));
|
|
1654
1667
|
}
|