@bragduck/cli 2.14.1 → 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 +37 -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" },
|
|
@@ -4742,6 +4743,10 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4742
4743
|
succeedStepSpinner(repoSpinner, 2, TOTAL_STEPS, `Repository: ${theme.value(repoInfo.fullName)}`);
|
|
4743
4744
|
logger.log("");
|
|
4744
4745
|
let days = options.days;
|
|
4746
|
+
if (!days && options.today) {
|
|
4747
|
+
days = 1;
|
|
4748
|
+
logger.debug("Using --today flag: scanning last 24 hours (1 day)");
|
|
4749
|
+
}
|
|
4745
4750
|
if (!days) {
|
|
4746
4751
|
const defaultDays = storageService.getConfig("defaultCommitDays");
|
|
4747
4752
|
days = await promptDaysToScan(defaultDays);
|
|
@@ -4773,7 +4778,7 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4773
4778
|
logger.log(formatCommitStats(workItems));
|
|
4774
4779
|
logger.log("");
|
|
4775
4780
|
let sortedCommits = [...workItems];
|
|
4776
|
-
if (workItems.length > 1) {
|
|
4781
|
+
if (workItems.length > 1 && !options.turbo) {
|
|
4777
4782
|
const sortOption = await promptSortOption();
|
|
4778
4783
|
logger.log("");
|
|
4779
4784
|
if (sortOption === "date") {
|
|
@@ -4791,13 +4796,22 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4791
4796
|
return filesB - filesA;
|
|
4792
4797
|
});
|
|
4793
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)");
|
|
4794
4802
|
}
|
|
4795
|
-
|
|
4796
|
-
if (
|
|
4797
|
-
|
|
4798
|
-
logger.
|
|
4799
|
-
|
|
4800
|
-
|
|
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
|
+
}
|
|
4801
4815
|
}
|
|
4802
4816
|
const selectedCommits = sortedCommits.filter((c) => selectedShas.includes(c.sha));
|
|
4803
4817
|
logger.log(formatSelectionSummary(selectedCommits.length, selectedCommits));
|
|
@@ -4843,16 +4857,23 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
|
|
|
4843
4857
|
let refinedBrags = refineResponse.refined_brags;
|
|
4844
4858
|
succeedStepSpinner(refineSpinner, 4, TOTAL_STEPS, "Work items refined successfully");
|
|
4845
4859
|
logger.log("");
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
const acceptedBrags = await promptReviewBrags(refinedBrags, newCommits);
|
|
4851
|
-
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`);
|
|
4852
4864
|
logger.log("");
|
|
4853
|
-
|
|
4865
|
+
} else {
|
|
4866
|
+
logger.info("Preview of refined brags:");
|
|
4854
4867
|
logger.log("");
|
|
4855
|
-
|
|
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
|
+
}
|
|
4856
4877
|
}
|
|
4857
4878
|
logger.log("");
|
|
4858
4879
|
let selectedOrgId = null;
|
|
@@ -5842,7 +5863,7 @@ program.command("auth [subcommand]").description("Manage authentication (subcomm
|
|
|
5842
5863
|
process.exit(1);
|
|
5843
5864
|
}
|
|
5844
5865
|
});
|
|
5845
|
-
program.command("sync").description("Sync work items and create brags").option("-d, --days <number>", "Number of days to scan", (val) => parseInt(val, 10)).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) => {
|
|
5846
5867
|
try {
|
|
5847
5868
|
await syncCommand(options);
|
|
5848
5869
|
} catch (error) {
|