@bragduck/cli 2.15.0 → 2.16.0
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/bin/bragduck.js +33 -16
- package/dist/bin/bragduck.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/bragduck.js
CHANGED
|
@@ -4449,6 +4449,7 @@ async function promptConfirm(message, defaultValue = true) {
|
|
|
4449
4449
|
}
|
|
4450
4450
|
async function promptDaysToScan(defaultDays = 30) {
|
|
4451
4451
|
const choices = [
|
|
4452
|
+
{ name: "1 day", value: "1", description: "Last 24 hours" },
|
|
4452
4453
|
{ name: "7 days", value: "7", description: "Last week" },
|
|
4453
4454
|
{ name: "30 days (Recommended)", value: "30", description: "Last month" },
|
|
4454
4455
|
{ name: "60 days", value: "60", description: "Last 2 months" },
|
|
@@ -4777,7 +4778,7 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4777
4778
|
logger.log(formatCommitStats(workItems));
|
|
4778
4779
|
logger.log("");
|
|
4779
4780
|
let sortedCommits = [...workItems];
|
|
4780
|
-
if (workItems.length > 1) {
|
|
4781
|
+
if (workItems.length > 1 && !options.turbo) {
|
|
4781
4782
|
const sortOption = await promptSortOption();
|
|
4782
4783
|
logger.log("");
|
|
4783
4784
|
if (sortOption === "date") {
|
|
@@ -4795,13 +4796,22 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4795
4796
|
return filesB - filesA;
|
|
4796
4797
|
});
|
|
4797
4798
|
}
|
|
4799
|
+
} else if (workItems.length > 1 && options.turbo) {
|
|
4800
|
+
sortedCommits.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
|
4801
|
+
logger.debug("Turbo mode: sorted by date (most recent first)");
|
|
4798
4802
|
}
|
|
4799
|
-
|
|
4800
|
-
if (
|
|
4801
|
-
|
|
4802
|
-
logger.
|
|
4803
|
-
|
|
4804
|
-
|
|
4803
|
+
let selectedShas;
|
|
4804
|
+
if (options.turbo) {
|
|
4805
|
+
selectedShas = sortedCommits.map((c) => c.sha);
|
|
4806
|
+
logger.debug(`Turbo mode: auto-selected all ${selectedShas.length} items`);
|
|
4807
|
+
} else {
|
|
4808
|
+
selectedShas = await promptSelectCommits(sortedCommits);
|
|
4809
|
+
if (selectedShas.length === 0) {
|
|
4810
|
+
logger.log("");
|
|
4811
|
+
logger.info(theme.secondary("No work items selected. Sync cancelled."));
|
|
4812
|
+
logger.log("");
|
|
4813
|
+
return { created: 0, skipped: 0 };
|
|
4814
|
+
}
|
|
4805
4815
|
}
|
|
4806
4816
|
const selectedCommits = sortedCommits.filter((c) => selectedShas.includes(c.sha));
|
|
4807
4817
|
logger.log(formatSelectionSummary(selectedCommits.length, selectedCommits));
|
|
@@ -4847,16 +4857,23 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4847
4857
|
let refinedBrags = refineResponse.refined_brags;
|
|
4848
4858
|
succeedStepSpinner(refineSpinner, 4, TOTAL_STEPS, "Work items refined successfully");
|
|
4849
4859
|
logger.log("");
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
const acceptedBrags = await promptReviewBrags(refinedBrags, newCommits);
|
|
4855
|
-
if (acceptedBrags.length === 0) {
|
|
4860
|
+
let acceptedBrags;
|
|
4861
|
+
if (options.turbo) {
|
|
4862
|
+
acceptedBrags = refinedBrags;
|
|
4863
|
+
logger.debug(`Turbo mode: auto-accepted all ${acceptedBrags.length} refined brags`);
|
|
4856
4864
|
logger.log("");
|
|
4857
|
-
|
|
4865
|
+
} else {
|
|
4866
|
+
logger.info("Preview of refined brags:");
|
|
4858
4867
|
logger.log("");
|
|
4859
|
-
|
|
4868
|
+
logger.log(formatRefinedCommitsTable(refinedBrags, newCommits));
|
|
4869
|
+
logger.log("");
|
|
4870
|
+
acceptedBrags = await promptReviewBrags(refinedBrags, newCommits);
|
|
4871
|
+
if (acceptedBrags.length === 0) {
|
|
4872
|
+
logger.log("");
|
|
4873
|
+
logger.info(theme.secondary("No brags selected for creation. Sync cancelled."));
|
|
4874
|
+
logger.log("");
|
|
4875
|
+
return { created: 0, skipped: duplicates.length };
|
|
4876
|
+
}
|
|
4860
4877
|
}
|
|
4861
4878
|
logger.log("");
|
|
4862
4879
|
let selectedOrgId = null;
|
|
@@ -5846,7 +5863,7 @@ program.command("auth [subcommand]").description("Manage authentication (subcomm
|
|
|
5846
5863
|
process.exit(1);
|
|
5847
5864
|
}
|
|
5848
5865
|
});
|
|
5849
|
-
program.command("sync").description("Sync work items and create brags").option("-d, --days <number>", "Number of days to scan", (val) => parseInt(val, 10)).option("-t, --today", "Scan the last 24 hours (shorthand for --days 1)").option("-a, --all", "Include all items (not just current user)").option("-s, --source <type>", "Explicit source type (github)").action(async (options) => {
|
|
5866
|
+
program.command("sync").description("Sync work items and create brags").option("-d, --days <number>", "Number of days to scan", (val) => parseInt(val, 10)).option("-t, --today", "Scan the last 24 hours (shorthand for --days 1)").option("--turbo", "Turbo mode: skip all prompts, auto-select all items, auto-accept refinements").option("-a, --all", "Include all items (not just current user)").option("-s, --source <type>", "Explicit source type (github)").action(async (options) => {
|
|
5850
5867
|
try {
|
|
5851
5868
|
await syncCommand(options);
|
|
5852
5869
|
} catch (error) {
|