git-stack-cli 2.6.0 → 2.6.1
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/js/index.js +281 -260
- package/package.json +1 -1
- package/scripts/bun-build.ts +5 -0
- package/src/app/App.tsx +8 -5
- package/src/app/AutoUpdate.tsx +72 -54
- package/src/app/GatherMetadata.tsx +2 -24
- package/src/app/Main.tsx +0 -4
- package/src/app/MultiSelect.tsx +1 -8
- package/src/app/RequireBranch.tsx +67 -0
- package/src/app/SelectCommitRanges.tsx +5 -5
- package/src/app/Status.tsx +1 -5
- package/src/app/Store.tsx +2 -1
- package/src/commands/Rebase.tsx +50 -36
- package/src/components/ColorTest.tsx +49 -0
- package/src/core/cli.ts +2 -0
- package/src/core/colors.ts +4 -2
- package/src/app/PreSelectCommitRanges.tsx +0 -29
package/dist/js/index.js
CHANGED
|
@@ -31944,7 +31944,7 @@ var React18 = __toESM(require_react(), 1);
|
|
|
31944
31944
|
var React10 = __toESM(require_react(), 1);
|
|
31945
31945
|
|
|
31946
31946
|
// src/core/colors.ts
|
|
31947
|
-
var colors = {
|
|
31947
|
+
var colors = Object.freeze({
|
|
31948
31948
|
red: "rgb(248, 81, 73)",
|
|
31949
31949
|
green: "rgb(63, 185, 80)",
|
|
31950
31950
|
purple: "rgb(163, 113, 247)",
|
|
@@ -31952,8 +31952,9 @@ var colors = {
|
|
|
31952
31952
|
orange: "rgb(255, 166, 87)",
|
|
31953
31953
|
yellow: "rgb(234, 179, 8)",
|
|
31954
31954
|
gray: "rgb(110, 118, 129)",
|
|
31955
|
-
lightGray: "rgb(125, 133, 144)"
|
|
31956
|
-
|
|
31955
|
+
lightGray: "rgb(125, 133, 144)",
|
|
31956
|
+
white: "whiteBright"
|
|
31957
|
+
});
|
|
31957
31958
|
|
|
31958
31959
|
// src/app/Brackets.tsx
|
|
31959
31960
|
function Brackets(props) {
|
|
@@ -32061,6 +32062,11 @@ function YesNoPrompt(props) {
|
|
|
32061
32062
|
}, choices))));
|
|
32062
32063
|
}
|
|
32063
32064
|
|
|
32065
|
+
// src/core/assertNever.ts
|
|
32066
|
+
function assertNever(value) {
|
|
32067
|
+
console.error("[assertNever]", { value });
|
|
32068
|
+
}
|
|
32069
|
+
|
|
32064
32070
|
// src/core/cli.ts
|
|
32065
32071
|
import * as child from "node:child_process";
|
|
32066
32072
|
|
|
@@ -37053,6 +37059,7 @@ var BaseStore = createStore()(immer2((set2, get) => ({
|
|
|
37053
37059
|
master_branch: "origin/master",
|
|
37054
37060
|
head: null,
|
|
37055
37061
|
branch_name: null,
|
|
37062
|
+
merge_base: null,
|
|
37056
37063
|
commit_range: null,
|
|
37057
37064
|
commit_map: null,
|
|
37058
37065
|
pr_templates: [],
|
|
@@ -37279,6 +37286,7 @@ async function cli(unsafe_command, unsafe_options) {
|
|
|
37279
37286
|
function write_output(value) {
|
|
37280
37287
|
output += value;
|
|
37281
37288
|
state.actions.debug(value, id);
|
|
37289
|
+
options.onOutput?.(value);
|
|
37282
37290
|
}
|
|
37283
37291
|
childProcess.stdout?.on("data", (data) => {
|
|
37284
37292
|
const value = String(data);
|
|
@@ -37442,25 +37450,34 @@ function AutoUpdate(props) {
|
|
|
37442
37450
|
}
|
|
37443
37451
|
}
|
|
37444
37452
|
React18.useEffect(() => {
|
|
37445
|
-
|
|
37453
|
+
switch (state.status) {
|
|
37454
|
+
case "init":
|
|
37455
|
+
case "prompt":
|
|
37456
|
+
case "install":
|
|
37457
|
+
break;
|
|
37458
|
+
case "done": {
|
|
37459
|
+
props.onDone?.();
|
|
37460
|
+
break;
|
|
37461
|
+
}
|
|
37462
|
+
default:
|
|
37463
|
+
assertNever(state.status);
|
|
37464
|
+
}
|
|
37465
|
+
}, [state.status]);
|
|
37466
|
+
React18.useEffect(() => {
|
|
37467
|
+
let status2 = "init";
|
|
37446
37468
|
let latest_version = null;
|
|
37447
37469
|
let is_brew_bun_standalone = false;
|
|
37448
|
-
const local_version = "2.6.
|
|
37470
|
+
const local_version = "2.6.1";
|
|
37449
37471
|
const is_output = props_ref.current.verbose || props_ref.current.force;
|
|
37450
37472
|
async function auto_update() {
|
|
37451
37473
|
if (!local_version) {
|
|
37452
37474
|
throw new Error("Auto update requires process.env.CLI_VERSION to be set");
|
|
37453
37475
|
}
|
|
37454
|
-
if (is_output) {
|
|
37455
|
-
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37456
|
-
key: "init"
|
|
37457
|
-
}, "Checking for latest version..."));
|
|
37458
|
-
}
|
|
37459
37476
|
const timeout_ms = is_finite_value(props.timeoutMs) ? props.timeoutMs : 2 * 1000;
|
|
37460
37477
|
const npm_json = await Promise.race([
|
|
37461
37478
|
fetch_json(`https://registry.npmjs.org/${props.name}`),
|
|
37462
37479
|
sleep(timeout_ms).then(() => {
|
|
37463
|
-
throw new Error("
|
|
37480
|
+
throw new Error("AutoUpdate timeout");
|
|
37464
37481
|
})
|
|
37465
37482
|
]);
|
|
37466
37483
|
latest_version = npm_json?.["dist-tags"]?.latest;
|
|
@@ -37497,32 +37514,37 @@ function AutoUpdate(props) {
|
|
|
37497
37514
|
}));
|
|
37498
37515
|
}
|
|
37499
37516
|
const semver_result = semver_compare(latest_version, local_version);
|
|
37517
|
+
if (props_ref.current.verbose) {
|
|
37518
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37519
|
+
dimColor: true
|
|
37520
|
+
}, JSON.stringify({ semver_result })));
|
|
37521
|
+
}
|
|
37500
37522
|
if (semver_result === 0) {
|
|
37523
|
+
status2 = "done";
|
|
37501
37524
|
if (is_output) {
|
|
37502
37525
|
handle_output(/* @__PURE__ */ React18.createElement(Text, null, "✅ Everything up to date. ", /* @__PURE__ */ React18.createElement(Brackets, null, latest_version)));
|
|
37503
37526
|
}
|
|
37504
37527
|
return;
|
|
37505
37528
|
}
|
|
37506
|
-
if (semver_result ===
|
|
37507
|
-
|
|
37529
|
+
if (semver_result === 1) {
|
|
37530
|
+
status2 = "prompt";
|
|
37508
37531
|
}
|
|
37509
|
-
|
|
37532
|
+
throw new Error("AutoUpdate failed");
|
|
37510
37533
|
}
|
|
37511
37534
|
const onError = props_ref.current.onError || (() => {
|
|
37512
37535
|
});
|
|
37513
37536
|
auto_update().then(() => {
|
|
37514
37537
|
patch({ status: status2, local_version, latest_version, is_brew_bun_standalone });
|
|
37515
37538
|
}).catch((error) => {
|
|
37516
|
-
patch({ status: status2, error, local_version, latest_version, is_brew_bun_standalone });
|
|
37517
|
-
onError(error);
|
|
37518
37539
|
if (props_ref.current.verbose) {
|
|
37519
37540
|
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37520
37541
|
key: "error",
|
|
37521
37542
|
color: colors.red
|
|
37522
37543
|
}, error?.message));
|
|
37523
37544
|
}
|
|
37524
|
-
|
|
37525
|
-
|
|
37545
|
+
status2 = "done";
|
|
37546
|
+
patch({ status: status2, error, local_version, latest_version, is_brew_bun_standalone });
|
|
37547
|
+
onError(error);
|
|
37526
37548
|
});
|
|
37527
37549
|
}, []);
|
|
37528
37550
|
const status = function render_status() {
|
|
@@ -37532,47 +37554,45 @@ function AutoUpdate(props) {
|
|
|
37532
37554
|
case "prompt": {
|
|
37533
37555
|
let install_command = "";
|
|
37534
37556
|
if (state.is_brew_bun_standalone) {
|
|
37535
|
-
install_command =
|
|
37557
|
+
install_command = "brew install magus/git-stack/git-stack";
|
|
37536
37558
|
} else {
|
|
37537
|
-
install_command =
|
|
37559
|
+
install_command = `npm install -g ${props.name}@latest`;
|
|
37538
37560
|
}
|
|
37539
37561
|
return /* @__PURE__ */ React18.createElement(YesNoPrompt, {
|
|
37540
37562
|
message: /* @__PURE__ */ React18.createElement(Box_default, {
|
|
37541
37563
|
flexDirection: "column"
|
|
37564
|
+
}, /* @__PURE__ */ React18.createElement(Box_default, {
|
|
37565
|
+
flexDirection: "column"
|
|
37542
37566
|
}, /* @__PURE__ */ React18.createElement(Text, {
|
|
37543
37567
|
color: colors.yellow
|
|
37544
37568
|
}, /* @__PURE__ */ React18.createElement(FormatText, {
|
|
37545
37569
|
wrapper: /* @__PURE__ */ React18.createElement(Text, null),
|
|
37546
|
-
message: "New version available {latest_version}
|
|
37570
|
+
message: "New version available {latest_version}",
|
|
37547
37571
|
values: {
|
|
37548
37572
|
latest_version: /* @__PURE__ */ React18.createElement(Brackets, null, state.latest_version)
|
|
37549
37573
|
}
|
|
37550
|
-
}), ","), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(Command, null, install_command), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(FormatText, {
|
|
37574
|
+
}), ","), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(Command, null, install_command), /* @__PURE__ */ React18.createElement(Text, null, " ")), /* @__PURE__ */ React18.createElement(Box_default, null, /* @__PURE__ */ React18.createElement(FormatText, {
|
|
37551
37575
|
wrapper: /* @__PURE__ */ React18.createElement(Text, {
|
|
37552
37576
|
color: colors.yellow
|
|
37553
37577
|
}),
|
|
37554
37578
|
message: "Would you like to run the above command to update?"
|
|
37555
|
-
})),
|
|
37579
|
+
}))),
|
|
37556
37580
|
onYes: async () => {
|
|
37557
|
-
handle_output(/* @__PURE__ */ React18.createElement(
|
|
37558
|
-
key: "install",
|
|
37559
|
-
wrapper: /* @__PURE__ */ React18.createElement(Text, null),
|
|
37560
|
-
message: "Installing {name}@{version}...",
|
|
37561
|
-
values: {
|
|
37562
|
-
name: /* @__PURE__ */ React18.createElement(Text, {
|
|
37563
|
-
color: colors.yellow
|
|
37564
|
-
}, props.name),
|
|
37565
|
-
version: /* @__PURE__ */ React18.createElement(Text, {
|
|
37566
|
-
color: colors.blue
|
|
37567
|
-
}, state.latest_version)
|
|
37568
|
-
}
|
|
37569
|
-
}));
|
|
37581
|
+
handle_output(/* @__PURE__ */ React18.createElement(Command, null, install_command));
|
|
37570
37582
|
patch({ status: "install" });
|
|
37571
|
-
await cli(install_command
|
|
37572
|
-
|
|
37583
|
+
await cli(install_command, {
|
|
37584
|
+
env: {
|
|
37585
|
+
...process.env,
|
|
37586
|
+
HOMEBREW_COLOR: "1"
|
|
37587
|
+
},
|
|
37588
|
+
onOutput: (data) => {
|
|
37589
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, null, data));
|
|
37590
|
+
}
|
|
37591
|
+
});
|
|
37573
37592
|
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37574
37593
|
key: "done"
|
|
37575
|
-
}, "
|
|
37594
|
+
}, "✅ Installed ", /* @__PURE__ */ React18.createElement(Brackets, null, state.latest_version)));
|
|
37595
|
+
patch({ status: "done" });
|
|
37576
37596
|
},
|
|
37577
37597
|
onNo: () => {
|
|
37578
37598
|
patch({ status: "done" });
|
|
@@ -37581,8 +37601,6 @@ function AutoUpdate(props) {
|
|
|
37581
37601
|
}
|
|
37582
37602
|
case "install":
|
|
37583
37603
|
return null;
|
|
37584
|
-
case "exit":
|
|
37585
|
-
return null;
|
|
37586
37604
|
case "done":
|
|
37587
37605
|
return props.children;
|
|
37588
37606
|
}
|
|
@@ -38765,27 +38783,9 @@ async function run() {
|
|
|
38765
38783
|
}
|
|
38766
38784
|
}
|
|
38767
38785
|
actions.debug(`master_branch = ${master_branch}`);
|
|
38768
|
-
const branch_name = (await cli("git rev-parse --abbrev-ref HEAD")).stdout;
|
|
38769
|
-
if (branch_name === "HEAD") {
|
|
38770
|
-
actions.error("Must run within a branch.");
|
|
38771
|
-
actions.exit(0);
|
|
38772
|
-
return;
|
|
38773
|
-
}
|
|
38774
|
-
if (`origin/${branch_name}` === master_branch) {
|
|
38775
|
-
actions.error("Must run within a branch.");
|
|
38776
|
-
actions.exit(0);
|
|
38777
|
-
return;
|
|
38778
|
-
}
|
|
38779
38786
|
const head = (await cli("git rev-parse HEAD")).stdout;
|
|
38787
|
+
const branch_name = (await cli("git rev-parse --abbrev-ref HEAD")).stdout;
|
|
38780
38788
|
const merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
|
|
38781
|
-
if (head === merge_base) {
|
|
38782
|
-
actions.newline();
|
|
38783
|
-
actions.output(/* @__PURE__ */ React27.createElement(Text, {
|
|
38784
|
-
color: colors.gray
|
|
38785
|
-
}, "No changes detected."));
|
|
38786
|
-
actions.exit(0);
|
|
38787
|
-
return;
|
|
38788
|
-
}
|
|
38789
38789
|
const origin_url = (await cli(`git config --get remote.origin.url`)).stdout;
|
|
38790
38790
|
const repo_path = match_group(origin_url, RE5.repo_path, "repo_path");
|
|
38791
38791
|
const repo_root = (await cli(`git rev-parse --show-toplevel`)).stdout;
|
|
@@ -38795,6 +38795,7 @@ async function run() {
|
|
|
38795
38795
|
state.master_branch = master_branch;
|
|
38796
38796
|
state.head = head;
|
|
38797
38797
|
state.branch_name = branch_name;
|
|
38798
|
+
state.merge_base = merge_base;
|
|
38798
38799
|
});
|
|
38799
38800
|
} catch (err) {
|
|
38800
38801
|
actions.error("Unable to gather git metadata.");
|
|
@@ -38931,7 +38932,7 @@ async function run3() {
|
|
|
38931
38932
|
}
|
|
38932
38933
|
|
|
38933
38934
|
// src/app/Main.tsx
|
|
38934
|
-
var
|
|
38935
|
+
var React44 = __toESM(require_react(), 1);
|
|
38935
38936
|
|
|
38936
38937
|
// src/app/LocalMergeRebase.tsx
|
|
38937
38938
|
var React35 = __toESM(require_react(), 1);
|
|
@@ -39017,11 +39018,6 @@ function Container(props) {
|
|
|
39017
39018
|
}));
|
|
39018
39019
|
}
|
|
39019
39020
|
|
|
39020
|
-
// src/core/assertNever.ts
|
|
39021
|
-
function assertNever(value) {
|
|
39022
|
-
console.error("[assertNever]", { value });
|
|
39023
|
-
}
|
|
39024
|
-
|
|
39025
39021
|
// src/app/StatusTable.tsx
|
|
39026
39022
|
function StatusTable() {
|
|
39027
39023
|
const commit_range = Store.useState((state) => state.commit_range);
|
|
@@ -39169,11 +39165,7 @@ async function run4() {
|
|
|
39169
39165
|
Store.setState((state2) => {
|
|
39170
39166
|
state2.step = "pre-local-merge-rebase";
|
|
39171
39167
|
});
|
|
39172
|
-
} else if (needs_update) {
|
|
39173
|
-
Store.setState((state2) => {
|
|
39174
|
-
state2.step = "pre-select-commit-ranges";
|
|
39175
|
-
});
|
|
39176
|
-
} else if (argv.force) {
|
|
39168
|
+
} else if (needs_update || argv.force) {
|
|
39177
39169
|
Store.setState((state2) => {
|
|
39178
39170
|
state2.step = "select-commit-ranges";
|
|
39179
39171
|
});
|
|
@@ -39232,7 +39224,7 @@ function Rebase(props) {
|
|
|
39232
39224
|
return /* @__PURE__ */ React34.createElement(Await, {
|
|
39233
39225
|
fallback: /* @__PURE__ */ React34.createElement(Text, {
|
|
39234
39226
|
color: colors.yellow
|
|
39235
|
-
}, "Rebasing
|
|
39227
|
+
}, "Rebasing…"),
|
|
39236
39228
|
function: () => Rebase.run(props)
|
|
39237
39229
|
});
|
|
39238
39230
|
}
|
|
@@ -39254,12 +39246,50 @@ Rebase.run = async function run5(props) {
|
|
|
39254
39246
|
handle_exit2();
|
|
39255
39247
|
return 19;
|
|
39256
39248
|
});
|
|
39249
|
+
const master_branch_name = master_branch.replace(/^origin\//, "");
|
|
39257
39250
|
const temp_branch_name = `${branch_name}_${short_id()}`;
|
|
39258
39251
|
try {
|
|
39259
39252
|
process.chdir(repo_root);
|
|
39260
39253
|
await cli(`pwd`);
|
|
39261
|
-
const master_branch_name = master_branch.replace(/^origin\//, "");
|
|
39262
39254
|
await cli(`git fetch --no-tags -v origin ${master_branch_name}`);
|
|
39255
|
+
if (branch_name === master_branch_name) {
|
|
39256
|
+
await rebase_master();
|
|
39257
|
+
} else {
|
|
39258
|
+
await rebase_branch();
|
|
39259
|
+
}
|
|
39260
|
+
actions.unregister_abort_handler();
|
|
39261
|
+
} catch (err) {
|
|
39262
|
+
actions.error("Unable to rebase.");
|
|
39263
|
+
if (err instanceof Error) {
|
|
39264
|
+
actions.error(err.message);
|
|
39265
|
+
}
|
|
39266
|
+
actions.exit(20);
|
|
39267
|
+
}
|
|
39268
|
+
const next_commit_range = await range();
|
|
39269
|
+
actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
|
|
39270
|
+
wrapper: /* @__PURE__ */ React34.createElement(Text, {
|
|
39271
|
+
color: colors.green
|
|
39272
|
+
}),
|
|
39273
|
+
message: "✅ {branch_name} in sync with {origin_branch}",
|
|
39274
|
+
values: {
|
|
39275
|
+
branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
|
|
39276
|
+
origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
|
|
39277
|
+
}
|
|
39278
|
+
}));
|
|
39279
|
+
actions.set((state2) => {
|
|
39280
|
+
state2.commit_range = next_commit_range;
|
|
39281
|
+
});
|
|
39282
|
+
if (props.onComplete) {
|
|
39283
|
+
props.onComplete();
|
|
39284
|
+
} else {
|
|
39285
|
+
actions.output(/* @__PURE__ */ React34.createElement(Status, null));
|
|
39286
|
+
actions.exit(0);
|
|
39287
|
+
}
|
|
39288
|
+
async function rebase_master() {
|
|
39289
|
+
await cli(`git switch -C "${master_branch_name}" "${master_branch}"`);
|
|
39290
|
+
}
|
|
39291
|
+
async function rebase_branch() {
|
|
39292
|
+
invariant(commit_range, "commit_range must exist");
|
|
39263
39293
|
const master_sha = (await cli(`git rev-parse ${master_branch}`)).stdout;
|
|
39264
39294
|
const rebase_merge_base = master_sha;
|
|
39265
39295
|
await cli(`git checkout -b ${temp_branch_name} ${rebase_merge_base}`);
|
|
@@ -39306,33 +39336,6 @@ Rebase.run = async function run5(props) {
|
|
|
39306
39336
|
}
|
|
39307
39337
|
await cli(`git branch -f ${branch_name} ${temp_branch_name}`);
|
|
39308
39338
|
restore_git();
|
|
39309
|
-
actions.unregister_abort_handler();
|
|
39310
|
-
} catch (err) {
|
|
39311
|
-
actions.error("Unable to rebase.");
|
|
39312
|
-
if (err instanceof Error) {
|
|
39313
|
-
actions.error(err.message);
|
|
39314
|
-
}
|
|
39315
|
-
actions.exit(20);
|
|
39316
|
-
}
|
|
39317
|
-
const next_commit_range = await range();
|
|
39318
|
-
actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
|
|
39319
|
-
wrapper: /* @__PURE__ */ React34.createElement(Text, {
|
|
39320
|
-
color: colors.green
|
|
39321
|
-
}),
|
|
39322
|
-
message: "✅ {branch_name} in sync with {origin_branch}",
|
|
39323
|
-
values: {
|
|
39324
|
-
branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
|
|
39325
|
-
origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
|
|
39326
|
-
}
|
|
39327
|
-
}));
|
|
39328
|
-
actions.set((state2) => {
|
|
39329
|
-
state2.commit_range = next_commit_range;
|
|
39330
|
-
});
|
|
39331
|
-
if (props.onComplete) {
|
|
39332
|
-
props.onComplete();
|
|
39333
|
-
} else {
|
|
39334
|
-
actions.output(/* @__PURE__ */ React34.createElement(Status, null));
|
|
39335
|
-
actions.exit(0);
|
|
39336
39339
|
}
|
|
39337
39340
|
function restore_git() {
|
|
39338
39341
|
const spawn_options = { ignoreExitCode: true };
|
|
@@ -39598,34 +39601,11 @@ var PR_TEMPLATE = Object.freeze({
|
|
|
39598
39601
|
});
|
|
39599
39602
|
var PR_TEMPLATE_KEY_LIST = Object.keys(PR_TEMPLATE);
|
|
39600
39603
|
|
|
39601
|
-
// src/app/PreSelectCommitRanges.tsx
|
|
39602
|
-
var React40 = __toESM(require_react(), 1);
|
|
39603
|
-
function PreSelectCommitRanges() {
|
|
39604
|
-
const actions = Store.useActions();
|
|
39605
|
-
const argv = Store.useState((state) => state.argv);
|
|
39606
|
-
React40.useEffect(() => {
|
|
39607
|
-
if (argv.force) {
|
|
39608
|
-
Store.setState((state) => {
|
|
39609
|
-
state.step = "select-commit-ranges";
|
|
39610
|
-
});
|
|
39611
|
-
}
|
|
39612
|
-
}, [argv]);
|
|
39613
|
-
return /* @__PURE__ */ React40.createElement(YesNoPrompt, {
|
|
39614
|
-
message: "Some commits are new or outdated, would you like to select new commit ranges?",
|
|
39615
|
-
onYes: () => {
|
|
39616
|
-
actions.set((state) => {
|
|
39617
|
-
state.step = "select-commit-ranges";
|
|
39618
|
-
});
|
|
39619
|
-
},
|
|
39620
|
-
onNo: () => actions.exit(0)
|
|
39621
|
-
});
|
|
39622
|
-
}
|
|
39623
|
-
|
|
39624
39604
|
// src/app/SelectCommitRanges.tsx
|
|
39625
|
-
var
|
|
39605
|
+
var React42 = __toESM(require_react(), 1);
|
|
39626
39606
|
|
|
39627
39607
|
// src/app/MultiSelect.tsx
|
|
39628
|
-
var
|
|
39608
|
+
var React40 = __toESM(require_react(), 1);
|
|
39629
39609
|
|
|
39630
39610
|
// src/core/clamp.ts
|
|
39631
39611
|
function clamp(value, min, max) {
|
|
@@ -39648,7 +39628,7 @@ function wrap_index(value, list) {
|
|
|
39648
39628
|
|
|
39649
39629
|
// src/app/MultiSelect.tsx
|
|
39650
39630
|
function MultiSelect(props) {
|
|
39651
|
-
const [selected_set, select] =
|
|
39631
|
+
const [selected_set, select] = React40.useReducer((state, value) => {
|
|
39652
39632
|
const next = new Set(state);
|
|
39653
39633
|
if (next.has(value)) {
|
|
39654
39634
|
next.delete(value);
|
|
@@ -39664,7 +39644,7 @@ function MultiSelect(props) {
|
|
|
39664
39644
|
});
|
|
39665
39645
|
return set2;
|
|
39666
39646
|
});
|
|
39667
|
-
const [index, set_index] =
|
|
39647
|
+
const [index, set_index] = React40.useReducer((_, value) => {
|
|
39668
39648
|
const next_index = clamp(value, 0, props.items.length - 1);
|
|
39669
39649
|
return next_index;
|
|
39670
39650
|
}, 0, function find_initial_index() {
|
|
@@ -39684,8 +39664,8 @@ function MultiSelect(props) {
|
|
|
39684
39664
|
}
|
|
39685
39665
|
return props.startIndex || 0;
|
|
39686
39666
|
});
|
|
39687
|
-
const selectRef =
|
|
39688
|
-
|
|
39667
|
+
const selectRef = React40.useRef(false);
|
|
39668
|
+
React40.useEffect(() => {
|
|
39689
39669
|
if (!selectRef.current) {
|
|
39690
39670
|
return;
|
|
39691
39671
|
}
|
|
@@ -39695,7 +39675,7 @@ function MultiSelect(props) {
|
|
|
39695
39675
|
const state = selected_list.map((index2) => props.items[index2].value);
|
|
39696
39676
|
props.onSelect({ item, selected, state });
|
|
39697
39677
|
}, [selected_set]);
|
|
39698
|
-
|
|
39678
|
+
React40.useEffect(() => {
|
|
39699
39679
|
const item = props.items[index].value;
|
|
39700
39680
|
const selected_list = Array.from(selected_set);
|
|
39701
39681
|
const selected = selected_set.has(index);
|
|
@@ -39737,13 +39717,13 @@ function MultiSelect(props) {
|
|
|
39737
39717
|
}
|
|
39738
39718
|
}
|
|
39739
39719
|
});
|
|
39740
|
-
return /* @__PURE__ */
|
|
39720
|
+
return /* @__PURE__ */ React40.createElement(Box_default, {
|
|
39741
39721
|
flexDirection: "column"
|
|
39742
39722
|
}, props.items.map((item, i2) => {
|
|
39743
39723
|
const active = i2 === index;
|
|
39744
39724
|
const selected = selected_set.has(i2);
|
|
39745
39725
|
const disabled = item.disabled || false;
|
|
39746
|
-
return /* @__PURE__ */
|
|
39726
|
+
return /* @__PURE__ */ React40.createElement(ItemRow, {
|
|
39747
39727
|
key: i2,
|
|
39748
39728
|
label: item.label,
|
|
39749
39729
|
active,
|
|
@@ -39755,32 +39735,26 @@ function MultiSelect(props) {
|
|
|
39755
39735
|
}
|
|
39756
39736
|
function ItemRow(props) {
|
|
39757
39737
|
let color;
|
|
39758
|
-
let bold;
|
|
39759
39738
|
let underline;
|
|
39760
39739
|
let dimColor;
|
|
39761
39740
|
if (props.active) {
|
|
39762
39741
|
color = colors.blue;
|
|
39763
39742
|
underline = true;
|
|
39764
39743
|
}
|
|
39765
|
-
if (props.selected) {
|
|
39766
|
-
bold = true;
|
|
39767
|
-
}
|
|
39768
39744
|
if (props.disabled) {
|
|
39769
39745
|
color = "";
|
|
39770
|
-
bold = false;
|
|
39771
39746
|
underline = false;
|
|
39772
39747
|
dimColor = true;
|
|
39773
39748
|
}
|
|
39774
|
-
return /* @__PURE__ */
|
|
39749
|
+
return /* @__PURE__ */ React40.createElement(Box_default, {
|
|
39775
39750
|
flexDirection: "row",
|
|
39776
39751
|
gap: 1
|
|
39777
|
-
}, /* @__PURE__ */
|
|
39752
|
+
}, /* @__PURE__ */ React40.createElement(Radio, {
|
|
39778
39753
|
selected: props.selected,
|
|
39779
39754
|
disabled: props.disabled
|
|
39780
|
-
}), /* @__PURE__ */
|
|
39755
|
+
}), /* @__PURE__ */ React40.createElement(Box_default, {
|
|
39781
39756
|
width: props.maxWidth
|
|
39782
|
-
}, /* @__PURE__ */
|
|
39783
|
-
bold,
|
|
39757
|
+
}, /* @__PURE__ */ React40.createElement(Text, {
|
|
39784
39758
|
underline,
|
|
39785
39759
|
color,
|
|
39786
39760
|
dimColor,
|
|
@@ -39802,7 +39776,7 @@ function Radio(props) {
|
|
|
39802
39776
|
color = colors.gray;
|
|
39803
39777
|
dimColor = true;
|
|
39804
39778
|
}
|
|
39805
|
-
return /* @__PURE__ */
|
|
39779
|
+
return /* @__PURE__ */ React40.createElement(Text, {
|
|
39806
39780
|
bold: props.selected,
|
|
39807
39781
|
color,
|
|
39808
39782
|
dimColor
|
|
@@ -39810,14 +39784,14 @@ function Radio(props) {
|
|
|
39810
39784
|
}
|
|
39811
39785
|
|
|
39812
39786
|
// src/app/TextInput.tsx
|
|
39813
|
-
var
|
|
39787
|
+
var React41 = __toESM(require_react(), 1);
|
|
39814
39788
|
function TextInput(props) {
|
|
39815
|
-
const [value, set_value] =
|
|
39816
|
-
|
|
39789
|
+
const [value, set_value] = React41.useState(get_value(props));
|
|
39790
|
+
React41.useEffect(function sync_value_prop() {
|
|
39817
39791
|
set_value(get_value(props));
|
|
39818
39792
|
}, [props.value]);
|
|
39819
|
-
const [caret_visible, set_caret_visible] =
|
|
39820
|
-
|
|
39793
|
+
const [caret_visible, set_caret_visible] = React41.useState(false);
|
|
39794
|
+
React41.useEffect(function blink_caret() {
|
|
39821
39795
|
const interval_ms = 500;
|
|
39822
39796
|
let timeoutId = setTimeout(tick, interval_ms);
|
|
39823
39797
|
function tick() {
|
|
@@ -39855,12 +39829,12 @@ function TextInput(props) {
|
|
|
39855
39829
|
set_value(next_value);
|
|
39856
39830
|
props.onChange?.(next_value);
|
|
39857
39831
|
});
|
|
39858
|
-
return /* @__PURE__ */
|
|
39832
|
+
return /* @__PURE__ */ React41.createElement(Box_default, {
|
|
39859
39833
|
borderStyle: "single",
|
|
39860
39834
|
minHeight: 1,
|
|
39861
39835
|
borderColor: colors.yellow,
|
|
39862
39836
|
borderDimColor: true
|
|
39863
|
-
}, /* @__PURE__ */
|
|
39837
|
+
}, /* @__PURE__ */ React41.createElement(Text, null, value || ""), /* @__PURE__ */ React41.createElement(Text, {
|
|
39864
39838
|
color: colors.yellow,
|
|
39865
39839
|
dimColor: true,
|
|
39866
39840
|
inverse: caret_visible
|
|
@@ -39879,26 +39853,26 @@ function gs_short_id() {
|
|
|
39879
39853
|
function SelectCommitRanges() {
|
|
39880
39854
|
const commit_range = Store.useState((state) => state.commit_range);
|
|
39881
39855
|
invariant(commit_range, "commit_range must exist");
|
|
39882
|
-
return /* @__PURE__ */
|
|
39856
|
+
return /* @__PURE__ */ React42.createElement(SelectCommitRangesInternal, {
|
|
39883
39857
|
commit_range
|
|
39884
39858
|
});
|
|
39885
39859
|
}
|
|
39886
39860
|
function SelectCommitRangesInternal(props) {
|
|
39887
39861
|
const actions = Store.useActions();
|
|
39888
39862
|
const argv = Store.useState((state) => state.argv);
|
|
39889
|
-
const [selected_group_id, set_selected_group_id] =
|
|
39863
|
+
const [selected_group_id, set_selected_group_id] = React42.useState(() => {
|
|
39890
39864
|
const first_group = props.commit_range.group_list.find((g2) => g2.id !== props.commit_range.UNASSIGNED);
|
|
39891
39865
|
if (first_group) {
|
|
39892
39866
|
return first_group.id;
|
|
39893
39867
|
}
|
|
39894
39868
|
return props.commit_range.UNASSIGNED;
|
|
39895
39869
|
});
|
|
39896
|
-
const [group_input, set_group_input] =
|
|
39897
|
-
const [new_group_list, create_group] =
|
|
39870
|
+
const [group_input, set_group_input] = React42.useState(false);
|
|
39871
|
+
const [new_group_list, create_group] = React42.useReducer((group_list2, group2) => {
|
|
39898
39872
|
const next_group_list = group_list2.concat(group2);
|
|
39899
39873
|
return next_group_list;
|
|
39900
39874
|
}, []);
|
|
39901
|
-
const [commit_map, update_commit_map] =
|
|
39875
|
+
const [commit_map, update_commit_map] = React42.useReducer((map, args) => {
|
|
39902
39876
|
map.set(args.key, args.value);
|
|
39903
39877
|
return new Map(map);
|
|
39904
39878
|
}, new Map, (map) => {
|
|
@@ -39991,7 +39965,7 @@ function SelectCommitRangesInternal(props) {
|
|
|
39991
39965
|
const multiselect_disabled = group_input;
|
|
39992
39966
|
const multiselect_disableSelect = group.id === props.commit_range.UNASSIGNED;
|
|
39993
39967
|
const max_width = 80;
|
|
39994
|
-
const [focused, set_focused] =
|
|
39968
|
+
const [focused, set_focused] = React42.useState("");
|
|
39995
39969
|
const has_groups = group.id !== props.commit_range.UNASSIGNED;
|
|
39996
39970
|
const items = props.commit_range.commit_list.map((commit2) => {
|
|
39997
39971
|
const commit_metadata_id = commit_map.get(commit2.sha);
|
|
@@ -40012,81 +39986,81 @@ function SelectCommitRangesInternal(props) {
|
|
|
40012
39986
|
};
|
|
40013
39987
|
});
|
|
40014
39988
|
items.reverse();
|
|
40015
|
-
return /* @__PURE__ */
|
|
39989
|
+
return /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40016
39990
|
flexDirection: "column"
|
|
40017
|
-
}, /* @__PURE__ */
|
|
39991
|
+
}, /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40018
39992
|
height: 1
|
|
40019
|
-
}), has_groups || group_input ? null : /* @__PURE__ */
|
|
39993
|
+
}), has_groups || group_input ? null : /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40020
39994
|
flexDirection: "column"
|
|
40021
|
-
}, /* @__PURE__ */
|
|
39995
|
+
}, /* @__PURE__ */ React42.createElement(Text, {
|
|
40022
39996
|
bold: true,
|
|
40023
39997
|
color: colors.blue
|
|
40024
|
-
}, "\uD83D\uDC4B Welcome to ", /* @__PURE__ */
|
|
39998
|
+
}, "\uD83D\uDC4B Welcome to ", /* @__PURE__ */ React42.createElement(Command, null, "git stack"), "!"), /* @__PURE__ */ React42.createElement(Text, {
|
|
40025
39999
|
color: colors.blue
|
|
40026
|
-
}, /* @__PURE__ */
|
|
40027
|
-
message: "Press {c} to {create} a new PR
|
|
40000
|
+
}, /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40001
|
+
message: "Press {c} to {create} a new PR",
|
|
40028
40002
|
values: {
|
|
40029
|
-
c: /* @__PURE__ */
|
|
40003
|
+
c: /* @__PURE__ */ React42.createElement(Text, {
|
|
40030
40004
|
bold: true,
|
|
40031
40005
|
color: colors.green
|
|
40032
40006
|
}, "c"),
|
|
40033
|
-
create: /* @__PURE__ */
|
|
40007
|
+
create: /* @__PURE__ */ React42.createElement(Text, {
|
|
40034
40008
|
bold: true,
|
|
40035
40009
|
color: colors.green
|
|
40036
|
-
}, /* @__PURE__ */
|
|
40010
|
+
}, /* @__PURE__ */ React42.createElement(Parens, null, "c"), "reate")
|
|
40037
40011
|
}
|
|
40038
|
-
}))), !has_groups || group_input ? null : /* @__PURE__ */
|
|
40012
|
+
}))), !has_groups || group_input ? null : /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40039
40013
|
width: max_width,
|
|
40040
40014
|
flexDirection: "row"
|
|
40041
|
-
}, /* @__PURE__ */
|
|
40015
|
+
}, /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40042
40016
|
flexDirection: "row"
|
|
40043
|
-
}, /* @__PURE__ */
|
|
40017
|
+
}, /* @__PURE__ */ React42.createElement(Text, {
|
|
40044
40018
|
bold: true,
|
|
40045
40019
|
color: colors.green
|
|
40046
|
-
}, SYMBOL.left), /* @__PURE__ */
|
|
40020
|
+
}, SYMBOL.left), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40047
40021
|
width: 1
|
|
40048
|
-
}), /* @__PURE__ */
|
|
40022
|
+
}), /* @__PURE__ */ React42.createElement(Text, {
|
|
40049
40023
|
color: colors.gray
|
|
40050
|
-
}, "Pull request"), /* @__PURE__ */
|
|
40024
|
+
}, "Pull request"), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40051
40025
|
width: 1
|
|
40052
|
-
}), /* @__PURE__ */
|
|
40026
|
+
}), /* @__PURE__ */ React42.createElement(Text, {
|
|
40053
40027
|
color: colors.gray
|
|
40054
|
-
}, `(${current_index + 1}/${group_list.length})`), /* @__PURE__ */
|
|
40028
|
+
}, `(${current_index + 1}/${group_list.length})`), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40055
40029
|
width: 1
|
|
40056
|
-
}), /* @__PURE__ */
|
|
40030
|
+
}), /* @__PURE__ */ React42.createElement(Text, {
|
|
40057
40031
|
bold: true,
|
|
40058
40032
|
color: colors.green
|
|
40059
|
-
}, SYMBOL.right))), /* @__PURE__ */
|
|
40033
|
+
}, SYMBOL.right))), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40060
40034
|
width: max_width
|
|
40061
|
-
}, /* @__PURE__ */
|
|
40035
|
+
}, /* @__PURE__ */ React42.createElement(Text, {
|
|
40062
40036
|
wrap: "truncate-end",
|
|
40063
40037
|
bold: true,
|
|
40064
|
-
color: colors.
|
|
40065
|
-
}, group.title))), !group_input ? null : /* @__PURE__ */
|
|
40038
|
+
color: colors.white
|
|
40039
|
+
}, group.title))), !group_input ? null : /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40066
40040
|
height: 1
|
|
40067
|
-
}), /* @__PURE__ */
|
|
40068
|
-
wrapper: /* @__PURE__ */
|
|
40041
|
+
}), /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40042
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40069
40043
|
color: colors.gray
|
|
40070
40044
|
}),
|
|
40071
40045
|
message: "Enter a title for the PR {note}",
|
|
40072
40046
|
values: {
|
|
40073
|
-
note: /* @__PURE__ */
|
|
40047
|
+
note: /* @__PURE__ */ React42.createElement(Parens, null, /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40074
40048
|
message: "press {enter} to submit",
|
|
40075
40049
|
values: {
|
|
40076
|
-
enter: /* @__PURE__ */
|
|
40050
|
+
enter: /* @__PURE__ */ React42.createElement(Text, {
|
|
40077
40051
|
bold: true,
|
|
40078
40052
|
color: colors.green
|
|
40079
40053
|
}, SYMBOL.enter)
|
|
40080
40054
|
}
|
|
40081
40055
|
}))
|
|
40082
40056
|
}
|
|
40083
|
-
}), /* @__PURE__ */
|
|
40057
|
+
}), /* @__PURE__ */ React42.createElement(TextInput, {
|
|
40084
40058
|
defaultValue: focused,
|
|
40085
40059
|
onSubmit: submit_group_input,
|
|
40086
40060
|
onCancel: () => set_group_input(false)
|
|
40087
|
-
})), /* @__PURE__ */
|
|
40061
|
+
})), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40088
40062
|
height: 1
|
|
40089
|
-
}), /* @__PURE__ */
|
|
40063
|
+
}), /* @__PURE__ */ React42.createElement(MultiSelect, {
|
|
40090
40064
|
startIndex: items.length - 1,
|
|
40091
40065
|
items,
|
|
40092
40066
|
maxWidth: max_width,
|
|
@@ -40105,76 +40079,76 @@ function SelectCommitRangesInternal(props) {
|
|
|
40105
40079
|
}
|
|
40106
40080
|
update_commit_map({ key, value });
|
|
40107
40081
|
}
|
|
40108
|
-
}), /* @__PURE__ */
|
|
40082
|
+
}), /* @__PURE__ */ React42.createElement(Box_default, {
|
|
40109
40083
|
height: 1
|
|
40110
|
-
}), has_unassigned_commits ? /* @__PURE__ */
|
|
40111
|
-
wrapper: /* @__PURE__ */
|
|
40084
|
+
}), has_unassigned_commits ? /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40085
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40112
40086
|
color: colors.gray
|
|
40113
40087
|
}),
|
|
40114
40088
|
message: "{count} unassigned commits",
|
|
40115
40089
|
values: {
|
|
40116
|
-
count: /* @__PURE__ */
|
|
40090
|
+
count: /* @__PURE__ */ React42.createElement(Text, {
|
|
40117
40091
|
color: colors.yellow,
|
|
40118
40092
|
bold: true
|
|
40119
40093
|
}, unassigned_count)
|
|
40120
40094
|
}
|
|
40121
|
-
}), group_input ? null : /* @__PURE__ */
|
|
40122
|
-
wrapper: /* @__PURE__ */
|
|
40095
|
+
}), group_input ? null : /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40096
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40123
40097
|
color: colors.gray
|
|
40124
40098
|
}),
|
|
40125
|
-
message: "Press {c} to {create} a new PR
|
|
40099
|
+
message: "Press {c} to {create} a new PR",
|
|
40126
40100
|
values: {
|
|
40127
|
-
c: /* @__PURE__ */
|
|
40101
|
+
c: /* @__PURE__ */ React42.createElement(Text, {
|
|
40128
40102
|
bold: true,
|
|
40129
40103
|
color: colors.green
|
|
40130
40104
|
}, "c"),
|
|
40131
|
-
create: /* @__PURE__ */
|
|
40105
|
+
create: /* @__PURE__ */ React42.createElement(Text, {
|
|
40132
40106
|
bold: true,
|
|
40133
40107
|
color: colors.green
|
|
40134
|
-
}, /* @__PURE__ */
|
|
40108
|
+
}, /* @__PURE__ */ React42.createElement(Parens, null, "c"), "reate")
|
|
40135
40109
|
}
|
|
40136
|
-
}), sync_status !== "allow_unassigned" ? null : /* @__PURE__ */
|
|
40137
|
-
wrapper: /* @__PURE__ */
|
|
40110
|
+
}), sync_status !== "allow_unassigned" ? null : /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40111
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40138
40112
|
color: colors.gray
|
|
40139
40113
|
}),
|
|
40140
40114
|
message: "Press {s} to {sync} the {count} assigned commits to Github",
|
|
40141
40115
|
values: {
|
|
40142
40116
|
...S_TO_SYNC_VALUES,
|
|
40143
|
-
count: /* @__PURE__ */
|
|
40117
|
+
count: /* @__PURE__ */ React42.createElement(Text, {
|
|
40144
40118
|
color: colors.yellow,
|
|
40145
40119
|
bold: true
|
|
40146
40120
|
}, assigned_count)
|
|
40147
40121
|
}
|
|
40148
|
-
})) : /* @__PURE__ */
|
|
40149
|
-
wrapper: /* @__PURE__ */
|
|
40122
|
+
})) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, argv.sync ? /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40123
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, null),
|
|
40150
40124
|
message: "\uD83C\uDF89 Done! Press {s} to {sync} the commits to Github",
|
|
40151
40125
|
values: S_TO_SYNC_VALUES
|
|
40152
|
-
}) : /* @__PURE__ */
|
|
40153
|
-
wrapper: /* @__PURE__ */
|
|
40126
|
+
}) : /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40127
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, null),
|
|
40154
40128
|
message: "\uD83C\uDF89 Done! Press {s} to {save} the commits locally",
|
|
40155
40129
|
values: S_TO_SYNC_VALUES
|
|
40156
|
-
})), /* @__PURE__ */
|
|
40157
|
-
wrapper: /* @__PURE__ */
|
|
40130
|
+
})), /* @__PURE__ */ React42.createElement(Box_default, null, /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40131
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40158
40132
|
color: colors.gray
|
|
40159
40133
|
}),
|
|
40160
|
-
message: "Press {left} and {right} to view
|
|
40134
|
+
message: "Press {left} and {right} to view PRs",
|
|
40161
40135
|
values: {
|
|
40162
|
-
left: /* @__PURE__ */
|
|
40136
|
+
left: /* @__PURE__ */ React42.createElement(Text, {
|
|
40163
40137
|
bold: true,
|
|
40164
40138
|
color: colors.green
|
|
40165
40139
|
}, SYMBOL.left),
|
|
40166
|
-
right: /* @__PURE__ */
|
|
40140
|
+
right: /* @__PURE__ */ React42.createElement(Text, {
|
|
40167
40141
|
bold: true,
|
|
40168
40142
|
color: colors.green
|
|
40169
40143
|
}, SYMBOL.right)
|
|
40170
40144
|
}
|
|
40171
|
-
})), /* @__PURE__ */
|
|
40172
|
-
wrapper: /* @__PURE__ */
|
|
40145
|
+
})), /* @__PURE__ */ React42.createElement(Box_default, null, /* @__PURE__ */ React42.createElement(FormatText, {
|
|
40146
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40173
40147
|
color: colors.gray
|
|
40174
40148
|
}),
|
|
40175
40149
|
message: "Press {enter} to toggle commit selection",
|
|
40176
40150
|
values: {
|
|
40177
|
-
enter: /* @__PURE__ */
|
|
40151
|
+
enter: /* @__PURE__ */ React42.createElement(Text, {
|
|
40178
40152
|
bold: true,
|
|
40179
40153
|
color: colors.green
|
|
40180
40154
|
}, SYMBOL.enter)
|
|
@@ -40191,14 +40165,14 @@ function SelectCommitRangesInternal(props) {
|
|
|
40191
40165
|
}
|
|
40192
40166
|
function submit_group_input(title) {
|
|
40193
40167
|
const id = get_group_id();
|
|
40194
|
-
actions.output(/* @__PURE__ */
|
|
40195
|
-
wrapper: /* @__PURE__ */
|
|
40168
|
+
actions.output(/* @__PURE__ */ React42.createElement(FormatText, {
|
|
40169
|
+
wrapper: /* @__PURE__ */ React42.createElement(Text, {
|
|
40196
40170
|
dimColor: true
|
|
40197
40171
|
}),
|
|
40198
|
-
message: "Created new PR
|
|
40172
|
+
message: "Created new PR {group} {note}",
|
|
40199
40173
|
values: {
|
|
40200
|
-
group: /* @__PURE__ */
|
|
40201
|
-
note: /* @__PURE__ */
|
|
40174
|
+
group: /* @__PURE__ */ React42.createElement(Brackets, null, title),
|
|
40175
|
+
note: /* @__PURE__ */ React42.createElement(Parens, null, id)
|
|
40202
40176
|
}
|
|
40203
40177
|
}));
|
|
40204
40178
|
create_group({ id, title });
|
|
@@ -40240,18 +40214,18 @@ var SYMBOL = {
|
|
|
40240
40214
|
s: "s"
|
|
40241
40215
|
};
|
|
40242
40216
|
var S_TO_SYNC_VALUES = {
|
|
40243
|
-
s: /* @__PURE__ */
|
|
40217
|
+
s: /* @__PURE__ */ React42.createElement(Text, {
|
|
40244
40218
|
bold: true,
|
|
40245
40219
|
color: colors.green
|
|
40246
40220
|
}, "s"),
|
|
40247
|
-
sync: /* @__PURE__ */
|
|
40221
|
+
sync: /* @__PURE__ */ React42.createElement(Text, {
|
|
40248
40222
|
bold: true,
|
|
40249
40223
|
color: colors.green
|
|
40250
|
-
}, /* @__PURE__ */
|
|
40224
|
+
}, /* @__PURE__ */ React42.createElement(Parens, null, "s"), "ync")
|
|
40251
40225
|
};
|
|
40252
40226
|
|
|
40253
40227
|
// src/app/SyncGithub.tsx
|
|
40254
|
-
var
|
|
40228
|
+
var React43 = __toESM(require_react(), 1);
|
|
40255
40229
|
var import_last = __toESM(require_last(), 1);
|
|
40256
40230
|
|
|
40257
40231
|
// src/core/StackSummaryTable.ts
|
|
@@ -40356,8 +40330,8 @@ var RE6 = {
|
|
|
40356
40330
|
|
|
40357
40331
|
// src/app/SyncGithub.tsx
|
|
40358
40332
|
function SyncGithub() {
|
|
40359
|
-
return /* @__PURE__ */
|
|
40360
|
-
fallback: /* @__PURE__ */
|
|
40333
|
+
return /* @__PURE__ */ React43.createElement(Await, {
|
|
40334
|
+
fallback: /* @__PURE__ */ React43.createElement(Text, {
|
|
40361
40335
|
color: colors.yellow
|
|
40362
40336
|
}, "Syncing…"),
|
|
40363
40337
|
function: run9
|
|
@@ -40515,25 +40489,23 @@ function Main() {
|
|
|
40515
40489
|
case "loading":
|
|
40516
40490
|
return null;
|
|
40517
40491
|
case "github-api-error":
|
|
40518
|
-
return /* @__PURE__ */
|
|
40492
|
+
return /* @__PURE__ */ React44.createElement(GithubApiError, null);
|
|
40519
40493
|
case "status":
|
|
40520
|
-
return /* @__PURE__ */
|
|
40494
|
+
return /* @__PURE__ */ React44.createElement(Status, null);
|
|
40521
40495
|
case "local-merge-rebase":
|
|
40522
|
-
return /* @__PURE__ */
|
|
40496
|
+
return /* @__PURE__ */ React44.createElement(LocalMergeRebase, null);
|
|
40523
40497
|
case "pre-local-merge-rebase":
|
|
40524
|
-
return /* @__PURE__ */
|
|
40525
|
-
case "pre-select-commit-ranges":
|
|
40526
|
-
return /* @__PURE__ */ React45.createElement(PreSelectCommitRanges, null);
|
|
40498
|
+
return /* @__PURE__ */ React44.createElement(PreLocalMergeRebase, null);
|
|
40527
40499
|
case "select-commit-ranges":
|
|
40528
|
-
return /* @__PURE__ */
|
|
40500
|
+
return /* @__PURE__ */ React44.createElement(SelectCommitRanges, null);
|
|
40529
40501
|
case "pre-manual-rebase":
|
|
40530
|
-
return /* @__PURE__ */
|
|
40502
|
+
return /* @__PURE__ */ React44.createElement(PreManualRebase, null);
|
|
40531
40503
|
case "manual-rebase":
|
|
40532
|
-
return /* @__PURE__ */
|
|
40504
|
+
return /* @__PURE__ */ React44.createElement(ManualRebase, null);
|
|
40533
40505
|
case "sync-github":
|
|
40534
|
-
return /* @__PURE__ */
|
|
40506
|
+
return /* @__PURE__ */ React44.createElement(SyncGithub, null);
|
|
40535
40507
|
case "post-rebase-status":
|
|
40536
|
-
return /* @__PURE__ */
|
|
40508
|
+
return /* @__PURE__ */ React44.createElement(PostRebaseStatus, null);
|
|
40537
40509
|
default:
|
|
40538
40510
|
assertNever(step);
|
|
40539
40511
|
return null;
|
|
@@ -40541,56 +40513,56 @@ function Main() {
|
|
|
40541
40513
|
}
|
|
40542
40514
|
|
|
40543
40515
|
// src/app/Output.tsx
|
|
40544
|
-
var
|
|
40516
|
+
var React45 = __toESM(require_react(), 1);
|
|
40545
40517
|
function Output2() {
|
|
40546
40518
|
const output = Store.useState((state) => state.output);
|
|
40547
40519
|
const pending_output = Store.useState((state) => state.pending_output);
|
|
40548
40520
|
const pending_output_items = Object.values(pending_output);
|
|
40549
|
-
return /* @__PURE__ */
|
|
40521
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(Static, {
|
|
40550
40522
|
items: output
|
|
40551
40523
|
}, (node, i2) => {
|
|
40552
|
-
return /* @__PURE__ */
|
|
40524
|
+
return /* @__PURE__ */ React45.createElement(Box_default, {
|
|
40553
40525
|
key: i2
|
|
40554
40526
|
}, node);
|
|
40555
40527
|
}), pending_output_items.map((node_list, i2) => {
|
|
40556
|
-
return /* @__PURE__ */
|
|
40528
|
+
return /* @__PURE__ */ React45.createElement(Box_default, {
|
|
40557
40529
|
key: i2
|
|
40558
|
-
}, /* @__PURE__ */
|
|
40559
|
-
return /* @__PURE__ */
|
|
40530
|
+
}, /* @__PURE__ */ React45.createElement(Text, null, node_list.map((text, j) => {
|
|
40531
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, {
|
|
40560
40532
|
key: j
|
|
40561
|
-
}, /* @__PURE__ */
|
|
40533
|
+
}, /* @__PURE__ */ React45.createElement(Text, null, text));
|
|
40562
40534
|
})));
|
|
40563
40535
|
}));
|
|
40564
40536
|
}
|
|
40565
40537
|
|
|
40566
40538
|
// src/app/Providers.tsx
|
|
40567
|
-
var
|
|
40539
|
+
var React46 = __toESM(require_react(), 1);
|
|
40568
40540
|
var import_react_intl2 = __toESM(require_react_intl(), 1);
|
|
40569
40541
|
function Providers(props) {
|
|
40570
|
-
return /* @__PURE__ */
|
|
40542
|
+
return /* @__PURE__ */ React46.createElement(import_react_intl2.IntlProvider, {
|
|
40571
40543
|
locale: "en"
|
|
40572
40544
|
}, props.children);
|
|
40573
40545
|
}
|
|
40574
40546
|
|
|
40575
40547
|
// src/app/RebaseCheck.tsx
|
|
40576
|
-
var
|
|
40548
|
+
var React47 = __toESM(require_react(), 1);
|
|
40577
40549
|
import path8 from "node:path";
|
|
40578
40550
|
function reducer5(state, patch) {
|
|
40579
40551
|
return { ...state, ...patch };
|
|
40580
40552
|
}
|
|
40581
40553
|
function RebaseCheck(props) {
|
|
40582
40554
|
const actions = Store.useActions();
|
|
40583
|
-
const [state, patch] =
|
|
40555
|
+
const [state, patch] = React47.useReducer(reducer5, {
|
|
40584
40556
|
status: "init"
|
|
40585
40557
|
});
|
|
40586
40558
|
switch (state.status) {
|
|
40587
40559
|
case "done":
|
|
40588
40560
|
return props.children;
|
|
40589
40561
|
case "prompt":
|
|
40590
|
-
return /* @__PURE__ */
|
|
40591
|
-
message: /* @__PURE__ */
|
|
40562
|
+
return /* @__PURE__ */ React47.createElement(YesNoPrompt, {
|
|
40563
|
+
message: /* @__PURE__ */ React47.createElement(Text, {
|
|
40592
40564
|
color: colors.yellow
|
|
40593
|
-
}, /* @__PURE__ */
|
|
40565
|
+
}, /* @__PURE__ */ React47.createElement(Command, null, "git rebase"), " detected, would you like to abort it?"),
|
|
40594
40566
|
onYes: async () => {
|
|
40595
40567
|
await cli(`git rebase --abort`);
|
|
40596
40568
|
patch({ status: "done" });
|
|
@@ -40600,11 +40572,11 @@ function RebaseCheck(props) {
|
|
|
40600
40572
|
}
|
|
40601
40573
|
});
|
|
40602
40574
|
default:
|
|
40603
|
-
return /* @__PURE__ */
|
|
40575
|
+
return /* @__PURE__ */ React47.createElement(Await, {
|
|
40604
40576
|
function: run10,
|
|
40605
|
-
fallback: /* @__PURE__ */
|
|
40577
|
+
fallback: /* @__PURE__ */ React47.createElement(Text, {
|
|
40606
40578
|
color: colors.yellow
|
|
40607
|
-
}, "Checking for ", /* @__PURE__ */
|
|
40579
|
+
}, "Checking for ", /* @__PURE__ */ React47.createElement(Command, null, "git rebase"), "…")
|
|
40608
40580
|
});
|
|
40609
40581
|
}
|
|
40610
40582
|
async function run10() {
|
|
@@ -40625,6 +40597,55 @@ function RebaseCheck(props) {
|
|
|
40625
40597
|
}
|
|
40626
40598
|
}
|
|
40627
40599
|
|
|
40600
|
+
// src/app/RequireBranch.tsx
|
|
40601
|
+
var React48 = __toESM(require_react(), 1);
|
|
40602
|
+
function RequireBranch(props) {
|
|
40603
|
+
const fallback = /* @__PURE__ */ React48.createElement(Text, {
|
|
40604
|
+
color: colors.yellow
|
|
40605
|
+
}, "Gathering local git information…");
|
|
40606
|
+
return /* @__PURE__ */ React48.createElement(Await, {
|
|
40607
|
+
fallback,
|
|
40608
|
+
function: run10
|
|
40609
|
+
}, props.children);
|
|
40610
|
+
}
|
|
40611
|
+
async function run10() {
|
|
40612
|
+
const state = Store.getState();
|
|
40613
|
+
const actions = Store.getState().actions;
|
|
40614
|
+
const master_branch = state.master_branch;
|
|
40615
|
+
const head = state.head;
|
|
40616
|
+
const branch_name = state.branch_name;
|
|
40617
|
+
const merge_base = state.merge_base;
|
|
40618
|
+
invariant(head, "head must exist");
|
|
40619
|
+
invariant(branch_name, "branch_name must exist");
|
|
40620
|
+
invariant(merge_base, "merge_base must exist");
|
|
40621
|
+
try {
|
|
40622
|
+
if (branch_name === "HEAD") {
|
|
40623
|
+
actions.error("Must run within a branch.");
|
|
40624
|
+
actions.exit(0);
|
|
40625
|
+
return;
|
|
40626
|
+
}
|
|
40627
|
+
if (`origin/${branch_name}` === master_branch) {
|
|
40628
|
+
actions.error("Must run within a branch.");
|
|
40629
|
+
actions.exit(0);
|
|
40630
|
+
return;
|
|
40631
|
+
}
|
|
40632
|
+
if (head === merge_base) {
|
|
40633
|
+
actions.newline();
|
|
40634
|
+
actions.output(/* @__PURE__ */ React48.createElement(Text, {
|
|
40635
|
+
color: colors.gray
|
|
40636
|
+
}, "No changes detected."));
|
|
40637
|
+
actions.exit(0);
|
|
40638
|
+
return;
|
|
40639
|
+
}
|
|
40640
|
+
} catch (err) {
|
|
40641
|
+
actions.error("Unable to detect branch changes.");
|
|
40642
|
+
if (err instanceof Error) {
|
|
40643
|
+
actions.error(err.message);
|
|
40644
|
+
}
|
|
40645
|
+
actions.exit(17);
|
|
40646
|
+
}
|
|
40647
|
+
}
|
|
40648
|
+
|
|
40628
40649
|
// src/app/VerboseDebugInfo.tsx
|
|
40629
40650
|
var React49 = __toESM(require_react(), 1);
|
|
40630
40651
|
function VerboseDebugInfo(props) {
|
|
@@ -40633,10 +40654,10 @@ function VerboseDebugInfo(props) {
|
|
|
40633
40654
|
}, "Logging verbose debug information…");
|
|
40634
40655
|
return /* @__PURE__ */ React49.createElement(Await, {
|
|
40635
40656
|
fallback,
|
|
40636
|
-
function:
|
|
40657
|
+
function: run11
|
|
40637
40658
|
}, props.children);
|
|
40638
40659
|
}
|
|
40639
|
-
async function
|
|
40660
|
+
async function run11() {
|
|
40640
40661
|
const actions = Store.getState().actions;
|
|
40641
40662
|
try {
|
|
40642
40663
|
await cli(`echo HOME=$HOME`);
|
|
@@ -40658,10 +40679,10 @@ var React50 = __toESM(require_react(), 1);
|
|
|
40658
40679
|
function Fixup() {
|
|
40659
40680
|
return /* @__PURE__ */ React50.createElement(Await, {
|
|
40660
40681
|
fallback: null,
|
|
40661
|
-
function:
|
|
40682
|
+
function: run12
|
|
40662
40683
|
});
|
|
40663
40684
|
}
|
|
40664
|
-
async function
|
|
40685
|
+
async function run12() {
|
|
40665
40686
|
const state = Store.getState();
|
|
40666
40687
|
const actions = state.actions;
|
|
40667
40688
|
const argv = state.argv;
|
|
@@ -40746,10 +40767,10 @@ function Log() {
|
|
|
40746
40767
|
const available_width = stdout.columns || 80;
|
|
40747
40768
|
return /* @__PURE__ */ React51.createElement(Await, {
|
|
40748
40769
|
fallback: null,
|
|
40749
|
-
function: () =>
|
|
40770
|
+
function: () => run13({ available_width })
|
|
40750
40771
|
});
|
|
40751
40772
|
}
|
|
40752
|
-
async function
|
|
40773
|
+
async function run13(args) {
|
|
40753
40774
|
const state = Store.getState();
|
|
40754
40775
|
const actions = state.actions;
|
|
40755
40776
|
const process_argv = state.process_argv;
|
|
@@ -40780,10 +40801,10 @@ var React52 = __toESM(require_react(), 1);
|
|
|
40780
40801
|
function Update() {
|
|
40781
40802
|
return /* @__PURE__ */ React52.createElement(Await, {
|
|
40782
40803
|
fallback: null,
|
|
40783
|
-
function:
|
|
40804
|
+
function: run14
|
|
40784
40805
|
});
|
|
40785
40806
|
}
|
|
40786
|
-
async function
|
|
40807
|
+
async function run14() {
|
|
40787
40808
|
const state = Store.getState();
|
|
40788
40809
|
const actions = state.actions;
|
|
40789
40810
|
actions.exit(0);
|
|
@@ -40905,7 +40926,7 @@ function MaybeMain() {
|
|
|
40905
40926
|
} else if (positional_list.has("rebase")) {
|
|
40906
40927
|
return /* @__PURE__ */ React55.createElement(DependencyCheck, null, /* @__PURE__ */ React55.createElement(DirtyCheck, null, /* @__PURE__ */ React55.createElement(GatherMetadata, null, /* @__PURE__ */ React55.createElement(LocalCommitStatus, null, /* @__PURE__ */ React55.createElement(Rebase, null)))));
|
|
40907
40928
|
}
|
|
40908
|
-
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, !argv.verbose ? null : /* @__PURE__ */ React55.createElement(GithubApiError, null), /* @__PURE__ */ React55.createElement(DependencyCheck, null, /* @__PURE__ */ React55.createElement(DirtyCheck, null, /* @__PURE__ */ React55.createElement(GatherMetadata, null, /* @__PURE__ */ React55.createElement(LocalCommitStatus, null, /* @__PURE__ */ React55.createElement(DetectInitialPR, null, /* @__PURE__ */ React55.createElement(Main, null)))))));
|
|
40929
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, !argv.verbose ? null : /* @__PURE__ */ React55.createElement(GithubApiError, null), /* @__PURE__ */ React55.createElement(DependencyCheck, null, /* @__PURE__ */ React55.createElement(DirtyCheck, null, /* @__PURE__ */ React55.createElement(GatherMetadata, null, /* @__PURE__ */ React55.createElement(RequireBranch, null, /* @__PURE__ */ React55.createElement(LocalCommitStatus, null, /* @__PURE__ */ React55.createElement(DetectInitialPR, null, /* @__PURE__ */ React55.createElement(Main, null))))))));
|
|
40909
40930
|
}
|
|
40910
40931
|
|
|
40911
40932
|
// node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
@@ -45770,7 +45791,7 @@ var yargs_default = Yargs;
|
|
|
45770
45791
|
|
|
45771
45792
|
// src/command.ts
|
|
45772
45793
|
async function command2() {
|
|
45773
|
-
return yargs_default(hideBin(process.argv)).scriptName("git stack").usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).command(["update", "upgrade"], "Check and install the latest version of git stack", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.6.
|
|
45794
|
+
return yargs_default(hideBin(process.argv)).scriptName("git stack").usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).command(["update", "upgrade"], "Check and install the latest version of git stack", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.6.1").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
|
|
45774
45795
|
}
|
|
45775
45796
|
var GlobalOptions = {
|
|
45776
45797
|
verbose: {
|