git-stack-cli 2.2.7 → 2.2.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/dist/js/index.js +376 -375
- package/package.json +1 -1
- package/scripts/release-brew.ts +2 -0
- package/src/command.ts +1 -0
- package/src/commands/Rebase.tsx +6 -2
package/dist/js/index.js
CHANGED
|
@@ -38896,12 +38896,261 @@ async function run3() {
|
|
|
38896
38896
|
var React45 = __toESM(require_react(), 1);
|
|
38897
38897
|
|
|
38898
38898
|
// src/app/LocalMergeRebase.tsx
|
|
38899
|
-
var
|
|
38899
|
+
var React35 = __toESM(require_react(), 1);
|
|
38900
38900
|
|
|
38901
38901
|
// src/commands/Rebase.tsx
|
|
38902
|
-
var
|
|
38902
|
+
var React34 = __toESM(require_react(), 1);
|
|
38903
38903
|
import fs11 from "node:fs";
|
|
38904
38904
|
|
|
38905
|
+
// src/app/Status.tsx
|
|
38906
|
+
var React33 = __toESM(require_react(), 1);
|
|
38907
|
+
|
|
38908
|
+
// src/app/StatusTable.tsx
|
|
38909
|
+
var React32 = __toESM(require_react(), 1);
|
|
38910
|
+
|
|
38911
|
+
// src/app/Table.tsx
|
|
38912
|
+
var React31 = __toESM(require_react(), 1);
|
|
38913
|
+
function Table(props) {
|
|
38914
|
+
if (!props.data.length) {
|
|
38915
|
+
return /* @__PURE__ */ React31.createElement(Container, null, /* @__PURE__ */ React31.createElement(Text, {
|
|
38916
|
+
dimColor: true
|
|
38917
|
+
}, "No data found."));
|
|
38918
|
+
}
|
|
38919
|
+
const RowColumnList = Object.keys(props.columns);
|
|
38920
|
+
const max_col_width = {};
|
|
38921
|
+
for (const col of RowColumnList) {
|
|
38922
|
+
max_col_width[col] = 0;
|
|
38923
|
+
}
|
|
38924
|
+
for (const row of props.data) {
|
|
38925
|
+
for (const col of RowColumnList) {
|
|
38926
|
+
const row_col = row[col];
|
|
38927
|
+
max_col_width[col] = Math.max(String(row_col).length, max_col_width[col]);
|
|
38928
|
+
}
|
|
38929
|
+
}
|
|
38930
|
+
for (const col of RowColumnList) {
|
|
38931
|
+
const maxWidth = props.maxWidth?.[col];
|
|
38932
|
+
if (maxWidth) {
|
|
38933
|
+
max_col_width[col] = maxWidth(max_col_width[col]);
|
|
38934
|
+
}
|
|
38935
|
+
}
|
|
38936
|
+
const { stdout } = use_stdout_default();
|
|
38937
|
+
const available_width = stdout.columns;
|
|
38938
|
+
const columnGap = is_finite_value(props.columnGap) ? props.columnGap : 2;
|
|
38939
|
+
const breathing_room = 1;
|
|
38940
|
+
if (props.fillColumn) {
|
|
38941
|
+
let remaining_space = available_width;
|
|
38942
|
+
for (const col of RowColumnList) {
|
|
38943
|
+
if (props.fillColumn === col) {
|
|
38944
|
+
continue;
|
|
38945
|
+
}
|
|
38946
|
+
remaining_space -= max_col_width[col];
|
|
38947
|
+
}
|
|
38948
|
+
remaining_space -= columnGap * (RowColumnList.length - 1);
|
|
38949
|
+
remaining_space -= breathing_room;
|
|
38950
|
+
if (props.fillColumn) {
|
|
38951
|
+
max_col_width[props.fillColumn] = Math.min(max_col_width[props.fillColumn], remaining_space);
|
|
38952
|
+
}
|
|
38953
|
+
}
|
|
38954
|
+
return /* @__PURE__ */ React31.createElement(Container, null, props.data.map((row, i2) => {
|
|
38955
|
+
return /* @__PURE__ */ React31.createElement(Box_default, {
|
|
38956
|
+
key: i2,
|
|
38957
|
+
flexDirection: "row",
|
|
38958
|
+
columnGap,
|
|
38959
|
+
width: available_width
|
|
38960
|
+
}, RowColumnList.map((column) => {
|
|
38961
|
+
const ColumnComponent = props.columns[column];
|
|
38962
|
+
return /* @__PURE__ */ React31.createElement(Box_default, {
|
|
38963
|
+
key: String(column),
|
|
38964
|
+
width: max_col_width[column]
|
|
38965
|
+
}, /* @__PURE__ */ React31.createElement(ColumnComponent, {
|
|
38966
|
+
row,
|
|
38967
|
+
column
|
|
38968
|
+
}));
|
|
38969
|
+
}));
|
|
38970
|
+
}));
|
|
38971
|
+
}
|
|
38972
|
+
function Container(props) {
|
|
38973
|
+
return /* @__PURE__ */ React31.createElement(Box_default, {
|
|
38974
|
+
flexDirection: "column"
|
|
38975
|
+
}, /* @__PURE__ */ React31.createElement(Box_default, {
|
|
38976
|
+
height: 1
|
|
38977
|
+
}), props.children, /* @__PURE__ */ React31.createElement(Box_default, {
|
|
38978
|
+
height: 1
|
|
38979
|
+
}));
|
|
38980
|
+
}
|
|
38981
|
+
|
|
38982
|
+
// src/core/assertNever.ts
|
|
38983
|
+
function assertNever(value) {
|
|
38984
|
+
console.error("[assertNever]", { value });
|
|
38985
|
+
}
|
|
38986
|
+
|
|
38987
|
+
// src/app/StatusTable.tsx
|
|
38988
|
+
function StatusTable() {
|
|
38989
|
+
const commit_range = Store.useState((state) => state.commit_range);
|
|
38990
|
+
invariant(commit_range, "commit_range must exist");
|
|
38991
|
+
const row_list = [];
|
|
38992
|
+
for (const group of commit_range.group_list) {
|
|
38993
|
+
const row = {
|
|
38994
|
+
count: "",
|
|
38995
|
+
status: "NEW",
|
|
38996
|
+
title: "",
|
|
38997
|
+
url: ""
|
|
38998
|
+
};
|
|
38999
|
+
if (group.id === commit_range.UNASSIGNED) {
|
|
39000
|
+
row.status = "NEW";
|
|
39001
|
+
row.title = "Unassigned";
|
|
39002
|
+
row.count = `0/${group.commits.length}`;
|
|
39003
|
+
row.url = "";
|
|
39004
|
+
} else {
|
|
39005
|
+
if (group.dirty) {
|
|
39006
|
+
row.status = "OUTDATED";
|
|
39007
|
+
} else {
|
|
39008
|
+
row.status = "SYNCED";
|
|
39009
|
+
}
|
|
39010
|
+
if (group.pr) {
|
|
39011
|
+
if (group.pr.state === "MERGED") {
|
|
39012
|
+
row.status = "MERGED";
|
|
39013
|
+
}
|
|
39014
|
+
row.title = group.pr.title;
|
|
39015
|
+
row.count = `${group.pr.commits.length}/${group.commits.length}`;
|
|
39016
|
+
row.url = group.pr.url;
|
|
39017
|
+
} else {
|
|
39018
|
+
row.title = group.title || group.id;
|
|
39019
|
+
row.count = `0/${group.commits.length}`;
|
|
39020
|
+
}
|
|
39021
|
+
}
|
|
39022
|
+
row_list.push(row);
|
|
39023
|
+
}
|
|
39024
|
+
return /* @__PURE__ */ React32.createElement(Table, {
|
|
39025
|
+
data: row_list,
|
|
39026
|
+
fillColumn: "title",
|
|
39027
|
+
maxWidth: {
|
|
39028
|
+
status: (v3) => v3 + 2
|
|
39029
|
+
},
|
|
39030
|
+
columnGap: 3,
|
|
39031
|
+
columns: {
|
|
39032
|
+
status: StatusColumn,
|
|
39033
|
+
count: CountColumn,
|
|
39034
|
+
title: TitleColumn,
|
|
39035
|
+
url: UrlColumn
|
|
39036
|
+
}
|
|
39037
|
+
});
|
|
39038
|
+
}
|
|
39039
|
+
function StatusColumn(props) {
|
|
39040
|
+
const value = props.row[props.column];
|
|
39041
|
+
return /* @__PURE__ */ React32.createElement(Text, {
|
|
39042
|
+
color: get_status_color(props.row),
|
|
39043
|
+
bold: get_status_bold(props.row)
|
|
39044
|
+
}, get_status_icon(props.row), " ", value);
|
|
39045
|
+
}
|
|
39046
|
+
function CountColumn(props) {
|
|
39047
|
+
const value = props.row[props.column];
|
|
39048
|
+
return /* @__PURE__ */ React32.createElement(Text, {
|
|
39049
|
+
dimColor: true
|
|
39050
|
+
}, value);
|
|
39051
|
+
}
|
|
39052
|
+
function TitleColumn(props) {
|
|
39053
|
+
const value = props.row[props.column];
|
|
39054
|
+
return /* @__PURE__ */ React32.createElement(Text, {
|
|
39055
|
+
wrap: "truncate-end"
|
|
39056
|
+
}, value);
|
|
39057
|
+
}
|
|
39058
|
+
function UrlColumn(props) {
|
|
39059
|
+
const value = props.row[props.column];
|
|
39060
|
+
return /* @__PURE__ */ React32.createElement(Url, {
|
|
39061
|
+
dimColor: true
|
|
39062
|
+
}, value);
|
|
39063
|
+
}
|
|
39064
|
+
function get_status_icon(row) {
|
|
39065
|
+
switch (row.status) {
|
|
39066
|
+
case "NEW":
|
|
39067
|
+
return "⭑";
|
|
39068
|
+
case "OUTDATED":
|
|
39069
|
+
return "!";
|
|
39070
|
+
case "MERGED":
|
|
39071
|
+
return "↗";
|
|
39072
|
+
case "SYNCED":
|
|
39073
|
+
return "✔";
|
|
39074
|
+
default:
|
|
39075
|
+
assertNever(row.status);
|
|
39076
|
+
return "?";
|
|
39077
|
+
}
|
|
39078
|
+
}
|
|
39079
|
+
function get_status_color(row) {
|
|
39080
|
+
switch (row.status) {
|
|
39081
|
+
case "NEW":
|
|
39082
|
+
return colors.yellow;
|
|
39083
|
+
case "OUTDATED":
|
|
39084
|
+
return colors.red;
|
|
39085
|
+
case "MERGED":
|
|
39086
|
+
return colors.purple;
|
|
39087
|
+
case "SYNCED":
|
|
39088
|
+
return colors.green;
|
|
39089
|
+
default:
|
|
39090
|
+
assertNever(row.status);
|
|
39091
|
+
return colors.gray;
|
|
39092
|
+
}
|
|
39093
|
+
}
|
|
39094
|
+
function get_status_bold(row) {
|
|
39095
|
+
switch (row.status) {
|
|
39096
|
+
case "NEW":
|
|
39097
|
+
case "OUTDATED":
|
|
39098
|
+
return true;
|
|
39099
|
+
default:
|
|
39100
|
+
return false;
|
|
39101
|
+
}
|
|
39102
|
+
}
|
|
39103
|
+
|
|
39104
|
+
// src/app/Status.tsx
|
|
39105
|
+
function Status() {
|
|
39106
|
+
return /* @__PURE__ */ React33.createElement(Await, {
|
|
39107
|
+
fallback: null,
|
|
39108
|
+
function: run4
|
|
39109
|
+
});
|
|
39110
|
+
}
|
|
39111
|
+
async function run4() {
|
|
39112
|
+
const state = Store.getState();
|
|
39113
|
+
const actions = state.actions;
|
|
39114
|
+
const argv = state.argv;
|
|
39115
|
+
const commit_range = Store.getState().commit_range;
|
|
39116
|
+
invariant(commit_range, "commit_range must exist");
|
|
39117
|
+
actions.output(/* @__PURE__ */ React33.createElement(StatusTable, null));
|
|
39118
|
+
let needs_rebase = false;
|
|
39119
|
+
let needs_update = false;
|
|
39120
|
+
for (const group of commit_range.group_list) {
|
|
39121
|
+
if (group.dirty) {
|
|
39122
|
+
needs_update = true;
|
|
39123
|
+
}
|
|
39124
|
+
if (group.pr?.state === "MERGED") {
|
|
39125
|
+
needs_rebase = true;
|
|
39126
|
+
}
|
|
39127
|
+
}
|
|
39128
|
+
if (argv.check) {
|
|
39129
|
+
actions.exit(0);
|
|
39130
|
+
} else if (needs_rebase) {
|
|
39131
|
+
Store.setState((state2) => {
|
|
39132
|
+
state2.step = "pre-local-merge-rebase";
|
|
39133
|
+
});
|
|
39134
|
+
} else if (needs_update) {
|
|
39135
|
+
Store.setState((state2) => {
|
|
39136
|
+
state2.step = "pre-select-commit-ranges";
|
|
39137
|
+
});
|
|
39138
|
+
} else if (argv.force) {
|
|
39139
|
+
Store.setState((state2) => {
|
|
39140
|
+
state2.step = "select-commit-ranges";
|
|
39141
|
+
});
|
|
39142
|
+
} else {
|
|
39143
|
+
actions.output(/* @__PURE__ */ React33.createElement(Text, null, "✅ Everything up to date."));
|
|
39144
|
+
actions.output(/* @__PURE__ */ React33.createElement(Text, {
|
|
39145
|
+
color: colors.gray
|
|
39146
|
+
}, /* @__PURE__ */ React33.createElement(Text, null, "Run with"), /* @__PURE__ */ React33.createElement(Text, {
|
|
39147
|
+
bold: true,
|
|
39148
|
+
color: colors.yellow
|
|
39149
|
+
}, ` --force `), /* @__PURE__ */ React33.createElement(Text, null, "to force update all pull requests.")));
|
|
39150
|
+
actions.exit(0);
|
|
39151
|
+
}
|
|
39152
|
+
}
|
|
39153
|
+
|
|
38905
39154
|
// src/core/short_id.ts
|
|
38906
39155
|
import crypto2 from "node:crypto";
|
|
38907
39156
|
function short_id() {
|
|
@@ -38946,14 +39195,14 @@ function encode(value) {
|
|
|
38946
39195
|
|
|
38947
39196
|
// src/commands/Rebase.tsx
|
|
38948
39197
|
function Rebase() {
|
|
38949
|
-
return /* @__PURE__ */
|
|
38950
|
-
fallback: /* @__PURE__ */
|
|
39198
|
+
return /* @__PURE__ */ React34.createElement(Await, {
|
|
39199
|
+
fallback: /* @__PURE__ */ React34.createElement(Text, {
|
|
38951
39200
|
color: colors.yellow
|
|
38952
39201
|
}, "Rebasing commits…"),
|
|
38953
39202
|
function: Rebase.run
|
|
38954
39203
|
});
|
|
38955
39204
|
}
|
|
38956
|
-
Rebase.run = async function
|
|
39205
|
+
Rebase.run = async function run5() {
|
|
38957
39206
|
const state = Store.getState();
|
|
38958
39207
|
const actions = state.actions;
|
|
38959
39208
|
const branch_name = state.branch_name;
|
|
@@ -38965,7 +39214,7 @@ Rebase.run = async function run4() {
|
|
|
38965
39214
|
invariant(commit_range, "commit_range must exist");
|
|
38966
39215
|
invariant(repo_root, "repo_root must exist");
|
|
38967
39216
|
actions.register_abort_handler(async function abort_rebase() {
|
|
38968
|
-
actions.output(/* @__PURE__ */
|
|
39217
|
+
actions.output(/* @__PURE__ */ React34.createElement(Text, {
|
|
38969
39218
|
color: colors.red
|
|
38970
39219
|
}, "\uD83D\uDEA8 Abort"));
|
|
38971
39220
|
handle_exit();
|
|
@@ -38987,29 +39236,29 @@ Rebase.run = async function run4() {
|
|
|
38987
39236
|
const merged_pr = commit_pr?.state === "MERGED";
|
|
38988
39237
|
if (merged_pr) {
|
|
38989
39238
|
if (actions.isDebug()) {
|
|
38990
|
-
actions.output(/* @__PURE__ */
|
|
38991
|
-
wrapper: /* @__PURE__ */
|
|
39239
|
+
actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
|
|
39240
|
+
wrapper: /* @__PURE__ */ React34.createElement(Text, {
|
|
38992
39241
|
color: colors.yellow,
|
|
38993
39242
|
wrap: "truncate-end"
|
|
38994
39243
|
}),
|
|
38995
39244
|
message: "Dropping {commit_message} {pr_status}",
|
|
38996
39245
|
values: {
|
|
38997
|
-
commit_message: /* @__PURE__ */
|
|
38998
|
-
pr_status: /* @__PURE__ */
|
|
39246
|
+
commit_message: /* @__PURE__ */ React34.createElement(Brackets, null, commit2.subject_line),
|
|
39247
|
+
pr_status: /* @__PURE__ */ React34.createElement(Parens, null, "MERGED")
|
|
38999
39248
|
}
|
|
39000
39249
|
}));
|
|
39001
39250
|
}
|
|
39002
39251
|
continue;
|
|
39003
39252
|
}
|
|
39004
39253
|
if (actions.isDebug()) {
|
|
39005
|
-
actions.output(/* @__PURE__ */
|
|
39006
|
-
wrapper: /* @__PURE__ */
|
|
39254
|
+
actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
|
|
39255
|
+
wrapper: /* @__PURE__ */ React34.createElement(Text, {
|
|
39007
39256
|
color: colors.yellow,
|
|
39008
39257
|
wrap: "truncate-end"
|
|
39009
39258
|
}),
|
|
39010
39259
|
message: "Picking {commit_message}",
|
|
39011
39260
|
values: {
|
|
39012
|
-
commit_message: /* @__PURE__ */
|
|
39261
|
+
commit_message: /* @__PURE__ */ React34.createElement(Brackets, null, commit2.subject_line)
|
|
39013
39262
|
}
|
|
39014
39263
|
}));
|
|
39015
39264
|
}
|
|
@@ -39023,21 +39272,22 @@ Rebase.run = async function run4() {
|
|
|
39023
39272
|
await cli(`git branch -f ${branch_name} ${temp_branch_name}`);
|
|
39024
39273
|
restore_git();
|
|
39025
39274
|
const next_commit_range = await range();
|
|
39026
|
-
actions.output(/* @__PURE__ */
|
|
39027
|
-
wrapper: /* @__PURE__ */
|
|
39275
|
+
actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
|
|
39276
|
+
wrapper: /* @__PURE__ */ React34.createElement(Text, {
|
|
39028
39277
|
color: colors.green
|
|
39029
39278
|
}),
|
|
39030
39279
|
message: "✅ {branch_name} in sync with {origin_branch}",
|
|
39031
39280
|
values: {
|
|
39032
|
-
branch_name: /* @__PURE__ */
|
|
39033
|
-
origin_branch: /* @__PURE__ */
|
|
39281
|
+
branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
|
|
39282
|
+
origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
|
|
39034
39283
|
}
|
|
39035
39284
|
}));
|
|
39036
39285
|
actions.unregister_abort_handler();
|
|
39037
39286
|
actions.set((state2) => {
|
|
39038
39287
|
state2.commit_range = next_commit_range;
|
|
39039
|
-
state2.step = "status";
|
|
39040
39288
|
});
|
|
39289
|
+
actions.output(/* @__PURE__ */ React34.createElement(Status, null));
|
|
39290
|
+
actions.exit(0);
|
|
39041
39291
|
} catch (err) {
|
|
39042
39292
|
actions.error("Unable to rebase.");
|
|
39043
39293
|
if (err instanceof Error) {
|
|
@@ -39060,33 +39310,33 @@ Rebase.run = async function run4() {
|
|
|
39060
39310
|
cli.sync(`pwd`, spawn_options);
|
|
39061
39311
|
}
|
|
39062
39312
|
function handle_exit() {
|
|
39063
|
-
actions.output(/* @__PURE__ */
|
|
39313
|
+
actions.output(/* @__PURE__ */ React34.createElement(Text, {
|
|
39064
39314
|
color: colors.yellow
|
|
39065
|
-
}, "Restoring ", /* @__PURE__ */
|
|
39315
|
+
}, "Restoring ", /* @__PURE__ */ React34.createElement(Brackets, null, branch_name), "…"));
|
|
39066
39316
|
restore_git();
|
|
39067
|
-
actions.output(/* @__PURE__ */
|
|
39317
|
+
actions.output(/* @__PURE__ */ React34.createElement(Text, {
|
|
39068
39318
|
color: colors.yellow
|
|
39069
|
-
}, "Restored ", /* @__PURE__ */
|
|
39319
|
+
}, "Restored ", /* @__PURE__ */ React34.createElement(Brackets, null, branch_name), "."));
|
|
39070
39320
|
}
|
|
39071
39321
|
};
|
|
39072
39322
|
|
|
39073
39323
|
// src/app/LocalMergeRebase.tsx
|
|
39074
39324
|
function LocalMergeRebase() {
|
|
39075
|
-
return /* @__PURE__ */
|
|
39325
|
+
return /* @__PURE__ */ React35.createElement(Rebase, null);
|
|
39076
39326
|
}
|
|
39077
39327
|
|
|
39078
39328
|
// src/app/ManualRebase.tsx
|
|
39079
|
-
var
|
|
39329
|
+
var React36 = __toESM(require_react(), 1);
|
|
39080
39330
|
import fs12 from "node:fs";
|
|
39081
39331
|
function ManualRebase() {
|
|
39082
|
-
return /* @__PURE__ */
|
|
39083
|
-
fallback: /* @__PURE__ */
|
|
39332
|
+
return /* @__PURE__ */ React36.createElement(Await, {
|
|
39333
|
+
fallback: /* @__PURE__ */ React36.createElement(Text, {
|
|
39084
39334
|
color: colors.yellow
|
|
39085
39335
|
}, "Rebasing commits…"),
|
|
39086
|
-
function:
|
|
39336
|
+
function: run6
|
|
39087
39337
|
});
|
|
39088
39338
|
}
|
|
39089
|
-
async function
|
|
39339
|
+
async function run6() {
|
|
39090
39340
|
const state = Store.getState();
|
|
39091
39341
|
const actions = state.actions;
|
|
39092
39342
|
const argv = state.argv;
|
|
@@ -39099,7 +39349,7 @@ async function run5() {
|
|
|
39099
39349
|
invariant(commit_map, "commit_map must exist");
|
|
39100
39350
|
invariant(repo_root, "repo_root must exist");
|
|
39101
39351
|
actions.register_abort_handler(async function abort_manual_rebase() {
|
|
39102
|
-
actions.output(/* @__PURE__ */
|
|
39352
|
+
actions.output(/* @__PURE__ */ React36.createElement(Text, {
|
|
39103
39353
|
color: colors.red
|
|
39104
39354
|
}, "\uD83D\uDEA8 Abort"));
|
|
39105
39355
|
handle_exit();
|
|
@@ -39183,247 +39433,49 @@ async function run5() {
|
|
|
39183
39433
|
cli.sync(`pwd`, spawn_options);
|
|
39184
39434
|
}
|
|
39185
39435
|
function handle_exit() {
|
|
39186
|
-
actions.output(/* @__PURE__ */
|
|
39436
|
+
actions.output(/* @__PURE__ */ React36.createElement(Text, {
|
|
39187
39437
|
color: colors.yellow
|
|
39188
|
-
}, "Restoring ", /* @__PURE__ */
|
|
39438
|
+
}, "Restoring ", /* @__PURE__ */ React36.createElement(Brackets, null, branch_name), "…"));
|
|
39189
39439
|
restore_git();
|
|
39190
|
-
actions.output(/* @__PURE__ */
|
|
39440
|
+
actions.output(/* @__PURE__ */ React36.createElement(Text, {
|
|
39191
39441
|
color: colors.yellow
|
|
39192
|
-
}, "Restored ", /* @__PURE__ */
|
|
39193
|
-
}
|
|
39194
|
-
}
|
|
39195
|
-
|
|
39196
|
-
// src/app/PostRebaseStatus.tsx
|
|
39197
|
-
var React36 = __toESM(require_react(), 1);
|
|
39198
|
-
|
|
39199
|
-
// src/app/StatusTable.tsx
|
|
39200
|
-
var React35 = __toESM(require_react(), 1);
|
|
39201
|
-
|
|
39202
|
-
// src/app/Table.tsx
|
|
39203
|
-
var React34 = __toESM(require_react(), 1);
|
|
39204
|
-
function Table(props) {
|
|
39205
|
-
if (!props.data.length) {
|
|
39206
|
-
return /* @__PURE__ */ React34.createElement(Container, null, /* @__PURE__ */ React34.createElement(Text, {
|
|
39207
|
-
dimColor: true
|
|
39208
|
-
}, "No data found."));
|
|
39209
|
-
}
|
|
39210
|
-
const RowColumnList = Object.keys(props.columns);
|
|
39211
|
-
const max_col_width = {};
|
|
39212
|
-
for (const col of RowColumnList) {
|
|
39213
|
-
max_col_width[col] = 0;
|
|
39214
|
-
}
|
|
39215
|
-
for (const row of props.data) {
|
|
39216
|
-
for (const col of RowColumnList) {
|
|
39217
|
-
const row_col = row[col];
|
|
39218
|
-
max_col_width[col] = Math.max(String(row_col).length, max_col_width[col]);
|
|
39219
|
-
}
|
|
39220
|
-
}
|
|
39221
|
-
for (const col of RowColumnList) {
|
|
39222
|
-
const maxWidth = props.maxWidth?.[col];
|
|
39223
|
-
if (maxWidth) {
|
|
39224
|
-
max_col_width[col] = maxWidth(max_col_width[col]);
|
|
39225
|
-
}
|
|
39226
|
-
}
|
|
39227
|
-
const { stdout } = use_stdout_default();
|
|
39228
|
-
const available_width = stdout.columns;
|
|
39229
|
-
const columnGap = is_finite_value(props.columnGap) ? props.columnGap : 2;
|
|
39230
|
-
const breathing_room = 1;
|
|
39231
|
-
if (props.fillColumn) {
|
|
39232
|
-
let remaining_space = available_width;
|
|
39233
|
-
for (const col of RowColumnList) {
|
|
39234
|
-
if (props.fillColumn === col) {
|
|
39235
|
-
continue;
|
|
39236
|
-
}
|
|
39237
|
-
remaining_space -= max_col_width[col];
|
|
39238
|
-
}
|
|
39239
|
-
remaining_space -= columnGap * (RowColumnList.length - 1);
|
|
39240
|
-
remaining_space -= breathing_room;
|
|
39241
|
-
if (props.fillColumn) {
|
|
39242
|
-
max_col_width[props.fillColumn] = Math.min(max_col_width[props.fillColumn], remaining_space);
|
|
39243
|
-
}
|
|
39244
|
-
}
|
|
39245
|
-
return /* @__PURE__ */ React34.createElement(Container, null, props.data.map((row, i2) => {
|
|
39246
|
-
return /* @__PURE__ */ React34.createElement(Box_default, {
|
|
39247
|
-
key: i2,
|
|
39248
|
-
flexDirection: "row",
|
|
39249
|
-
columnGap,
|
|
39250
|
-
width: available_width
|
|
39251
|
-
}, RowColumnList.map((column) => {
|
|
39252
|
-
const ColumnComponent = props.columns[column];
|
|
39253
|
-
return /* @__PURE__ */ React34.createElement(Box_default, {
|
|
39254
|
-
key: String(column),
|
|
39255
|
-
width: max_col_width[column]
|
|
39256
|
-
}, /* @__PURE__ */ React34.createElement(ColumnComponent, {
|
|
39257
|
-
row,
|
|
39258
|
-
column
|
|
39259
|
-
}));
|
|
39260
|
-
}));
|
|
39261
|
-
}));
|
|
39262
|
-
}
|
|
39263
|
-
function Container(props) {
|
|
39264
|
-
return /* @__PURE__ */ React34.createElement(Box_default, {
|
|
39265
|
-
flexDirection: "column"
|
|
39266
|
-
}, /* @__PURE__ */ React34.createElement(Box_default, {
|
|
39267
|
-
height: 1
|
|
39268
|
-
}), props.children, /* @__PURE__ */ React34.createElement(Box_default, {
|
|
39269
|
-
height: 1
|
|
39270
|
-
}));
|
|
39271
|
-
}
|
|
39272
|
-
|
|
39273
|
-
// src/core/assertNever.ts
|
|
39274
|
-
function assertNever(value) {
|
|
39275
|
-
console.error("[assertNever]", { value });
|
|
39276
|
-
}
|
|
39277
|
-
|
|
39278
|
-
// src/app/StatusTable.tsx
|
|
39279
|
-
function StatusTable() {
|
|
39280
|
-
const commit_range = Store.useState((state) => state.commit_range);
|
|
39281
|
-
invariant(commit_range, "commit_range must exist");
|
|
39282
|
-
const row_list = [];
|
|
39283
|
-
for (const group of commit_range.group_list) {
|
|
39284
|
-
const row = {
|
|
39285
|
-
count: "",
|
|
39286
|
-
status: "NEW",
|
|
39287
|
-
title: "",
|
|
39288
|
-
url: ""
|
|
39289
|
-
};
|
|
39290
|
-
if (group.id === commit_range.UNASSIGNED) {
|
|
39291
|
-
row.status = "NEW";
|
|
39292
|
-
row.title = "Unassigned";
|
|
39293
|
-
row.count = `0/${group.commits.length}`;
|
|
39294
|
-
row.url = "";
|
|
39295
|
-
} else {
|
|
39296
|
-
if (group.dirty) {
|
|
39297
|
-
row.status = "OUTDATED";
|
|
39298
|
-
} else {
|
|
39299
|
-
row.status = "SYNCED";
|
|
39300
|
-
}
|
|
39301
|
-
if (group.pr) {
|
|
39302
|
-
if (group.pr.state === "MERGED") {
|
|
39303
|
-
row.status = "MERGED";
|
|
39304
|
-
}
|
|
39305
|
-
row.title = group.pr.title;
|
|
39306
|
-
row.count = `${group.pr.commits.length}/${group.commits.length}`;
|
|
39307
|
-
row.url = group.pr.url;
|
|
39308
|
-
} else {
|
|
39309
|
-
row.title = group.title || group.id;
|
|
39310
|
-
row.count = `0/${group.commits.length}`;
|
|
39311
|
-
}
|
|
39312
|
-
}
|
|
39313
|
-
row_list.push(row);
|
|
39314
|
-
}
|
|
39315
|
-
return /* @__PURE__ */ React35.createElement(Table, {
|
|
39316
|
-
data: row_list,
|
|
39317
|
-
fillColumn: "title",
|
|
39318
|
-
maxWidth: {
|
|
39319
|
-
status: (v3) => v3 + 2
|
|
39320
|
-
},
|
|
39321
|
-
columnGap: 3,
|
|
39322
|
-
columns: {
|
|
39323
|
-
status: StatusColumn,
|
|
39324
|
-
count: CountColumn,
|
|
39325
|
-
title: TitleColumn,
|
|
39326
|
-
url: UrlColumn
|
|
39327
|
-
}
|
|
39328
|
-
});
|
|
39329
|
-
}
|
|
39330
|
-
function StatusColumn(props) {
|
|
39331
|
-
const value = props.row[props.column];
|
|
39332
|
-
return /* @__PURE__ */ React35.createElement(Text, {
|
|
39333
|
-
color: get_status_color(props.row),
|
|
39334
|
-
bold: get_status_bold(props.row)
|
|
39335
|
-
}, get_status_icon(props.row), " ", value);
|
|
39336
|
-
}
|
|
39337
|
-
function CountColumn(props) {
|
|
39338
|
-
const value = props.row[props.column];
|
|
39339
|
-
return /* @__PURE__ */ React35.createElement(Text, {
|
|
39340
|
-
dimColor: true
|
|
39341
|
-
}, value);
|
|
39342
|
-
}
|
|
39343
|
-
function TitleColumn(props) {
|
|
39344
|
-
const value = props.row[props.column];
|
|
39345
|
-
return /* @__PURE__ */ React35.createElement(Text, {
|
|
39346
|
-
wrap: "truncate-end"
|
|
39347
|
-
}, value);
|
|
39348
|
-
}
|
|
39349
|
-
function UrlColumn(props) {
|
|
39350
|
-
const value = props.row[props.column];
|
|
39351
|
-
return /* @__PURE__ */ React35.createElement(Url, {
|
|
39352
|
-
dimColor: true
|
|
39353
|
-
}, value);
|
|
39354
|
-
}
|
|
39355
|
-
function get_status_icon(row) {
|
|
39356
|
-
switch (row.status) {
|
|
39357
|
-
case "NEW":
|
|
39358
|
-
return "⭑";
|
|
39359
|
-
case "OUTDATED":
|
|
39360
|
-
return "!";
|
|
39361
|
-
case "MERGED":
|
|
39362
|
-
return "↗";
|
|
39363
|
-
case "SYNCED":
|
|
39364
|
-
return "✔";
|
|
39365
|
-
default:
|
|
39366
|
-
assertNever(row.status);
|
|
39367
|
-
return "?";
|
|
39368
|
-
}
|
|
39369
|
-
}
|
|
39370
|
-
function get_status_color(row) {
|
|
39371
|
-
switch (row.status) {
|
|
39372
|
-
case "NEW":
|
|
39373
|
-
return colors.yellow;
|
|
39374
|
-
case "OUTDATED":
|
|
39375
|
-
return colors.red;
|
|
39376
|
-
case "MERGED":
|
|
39377
|
-
return colors.purple;
|
|
39378
|
-
case "SYNCED":
|
|
39379
|
-
return colors.green;
|
|
39380
|
-
default:
|
|
39381
|
-
assertNever(row.status);
|
|
39382
|
-
return colors.gray;
|
|
39383
|
-
}
|
|
39384
|
-
}
|
|
39385
|
-
function get_status_bold(row) {
|
|
39386
|
-
switch (row.status) {
|
|
39387
|
-
case "NEW":
|
|
39388
|
-
case "OUTDATED":
|
|
39389
|
-
return true;
|
|
39390
|
-
default:
|
|
39391
|
-
return false;
|
|
39442
|
+
}, "Restored ", /* @__PURE__ */ React36.createElement(Brackets, null, branch_name), "."));
|
|
39392
39443
|
}
|
|
39393
39444
|
}
|
|
39394
39445
|
|
|
39395
39446
|
// src/app/PostRebaseStatus.tsx
|
|
39447
|
+
var React37 = __toESM(require_react(), 1);
|
|
39396
39448
|
function PostRebaseStatus() {
|
|
39397
|
-
return /* @__PURE__ */
|
|
39449
|
+
return /* @__PURE__ */ React37.createElement(Await, {
|
|
39398
39450
|
fallback: null,
|
|
39399
|
-
function:
|
|
39451
|
+
function: run7
|
|
39400
39452
|
});
|
|
39401
39453
|
}
|
|
39402
|
-
async function
|
|
39454
|
+
async function run7() {
|
|
39403
39455
|
const actions = Store.getState().actions;
|
|
39404
39456
|
actions.reset_pr();
|
|
39405
39457
|
const commit_range = await range();
|
|
39406
39458
|
actions.set((state) => {
|
|
39407
39459
|
state.commit_range = commit_range;
|
|
39408
39460
|
});
|
|
39409
|
-
actions.output(/* @__PURE__ */
|
|
39410
|
-
actions.output(/* @__PURE__ */
|
|
39461
|
+
actions.output(/* @__PURE__ */ React37.createElement(StatusTable, null));
|
|
39462
|
+
actions.output(/* @__PURE__ */ React37.createElement(Text, null, "✅ Everything up to date."));
|
|
39411
39463
|
actions.exit(0);
|
|
39412
39464
|
}
|
|
39413
39465
|
|
|
39414
39466
|
// src/app/PreLocalMergeRebase.tsx
|
|
39415
|
-
var
|
|
39467
|
+
var React38 = __toESM(require_react(), 1);
|
|
39416
39468
|
function PreLocalMergeRebase() {
|
|
39417
39469
|
const actions = Store.useActions();
|
|
39418
39470
|
const argv = Store.useState((state) => state.argv);
|
|
39419
|
-
|
|
39471
|
+
React38.useEffect(() => {
|
|
39420
39472
|
if (argv.force) {
|
|
39421
39473
|
Store.setState((state) => {
|
|
39422
39474
|
state.step = "local-merge-rebase";
|
|
39423
39475
|
});
|
|
39424
39476
|
}
|
|
39425
39477
|
}, [argv]);
|
|
39426
|
-
return /* @__PURE__ */
|
|
39478
|
+
return /* @__PURE__ */ React38.createElement(YesNoPrompt, {
|
|
39427
39479
|
message: "Local branch needs to be rebased, would you like to rebase to update your local branch?",
|
|
39428
39480
|
onYes: () => {
|
|
39429
39481
|
actions.set((state) => {
|
|
@@ -39435,16 +39487,16 @@ function PreLocalMergeRebase() {
|
|
|
39435
39487
|
}
|
|
39436
39488
|
|
|
39437
39489
|
// src/app/PreManualRebase.tsx
|
|
39438
|
-
var
|
|
39490
|
+
var React39 = __toESM(require_react(), 1);
|
|
39439
39491
|
import fs13 from "node:fs/promises";
|
|
39440
39492
|
import path8 from "node:path";
|
|
39441
39493
|
function PreManualRebase() {
|
|
39442
|
-
return /* @__PURE__ */
|
|
39494
|
+
return /* @__PURE__ */ React39.createElement(Await, {
|
|
39443
39495
|
fallback: null,
|
|
39444
|
-
function:
|
|
39496
|
+
function: run8
|
|
39445
39497
|
});
|
|
39446
39498
|
}
|
|
39447
|
-
async function
|
|
39499
|
+
async function run8() {
|
|
39448
39500
|
const state = Store.getState();
|
|
39449
39501
|
const actions = state.actions;
|
|
39450
39502
|
const repo_root = state.repo_root;
|
|
@@ -39460,13 +39512,13 @@ async function run7() {
|
|
|
39460
39512
|
const pr_template_fn = PR_TEMPLATE[key];
|
|
39461
39513
|
if (await safe_exists(pr_template_fn(repo_root))) {
|
|
39462
39514
|
pr_template_body = await fs13.readFile(pr_template_fn(repo_root), "utf-8");
|
|
39463
|
-
actions.output(/* @__PURE__ */
|
|
39464
|
-
wrapper: /* @__PURE__ */
|
|
39515
|
+
actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
|
|
39516
|
+
wrapper: /* @__PURE__ */ React39.createElement(Text, {
|
|
39465
39517
|
color: colors.yellow
|
|
39466
39518
|
}),
|
|
39467
39519
|
message: "Using PR template {pr_filepath}",
|
|
39468
39520
|
values: {
|
|
39469
|
-
pr_filepath: /* @__PURE__ */
|
|
39521
|
+
pr_filepath: /* @__PURE__ */ React39.createElement(Brackets, null, pr_template_fn(""))
|
|
39470
39522
|
}
|
|
39471
39523
|
}));
|
|
39472
39524
|
break;
|
|
@@ -39480,16 +39532,16 @@ async function run7() {
|
|
|
39480
39532
|
state2.pr_template_body = pr_template_body;
|
|
39481
39533
|
state2.pr_templates = pr_templates;
|
|
39482
39534
|
if (pr_templates.length > 0) {
|
|
39483
|
-
actions.output(/* @__PURE__ */
|
|
39484
|
-
wrapper: /* @__PURE__ */
|
|
39535
|
+
actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
|
|
39536
|
+
wrapper: /* @__PURE__ */ React39.createElement(Text, {
|
|
39485
39537
|
color: colors.yellow
|
|
39486
39538
|
}),
|
|
39487
39539
|
message: "{count} queryable templates found under {dir}, but not supported.",
|
|
39488
39540
|
values: {
|
|
39489
|
-
count: /* @__PURE__ */
|
|
39541
|
+
count: /* @__PURE__ */ React39.createElement(Text, {
|
|
39490
39542
|
color: colors.blue
|
|
39491
39543
|
}, pr_templates.length),
|
|
39492
|
-
dir: /* @__PURE__ */
|
|
39544
|
+
dir: /* @__PURE__ */ React39.createElement(Brackets, null, PR_TEMPLATE.TemplateDir(""))
|
|
39493
39545
|
}
|
|
39494
39546
|
}));
|
|
39495
39547
|
}
|
|
@@ -39505,18 +39557,18 @@ var PR_TEMPLATE = Object.freeze({
|
|
|
39505
39557
|
var PR_TEMPLATE_KEY_LIST = Object.keys(PR_TEMPLATE);
|
|
39506
39558
|
|
|
39507
39559
|
// src/app/PreSelectCommitRanges.tsx
|
|
39508
|
-
var
|
|
39560
|
+
var React40 = __toESM(require_react(), 1);
|
|
39509
39561
|
function PreSelectCommitRanges() {
|
|
39510
39562
|
const actions = Store.useActions();
|
|
39511
39563
|
const argv = Store.useState((state) => state.argv);
|
|
39512
|
-
|
|
39564
|
+
React40.useEffect(() => {
|
|
39513
39565
|
if (argv.force) {
|
|
39514
39566
|
Store.setState((state) => {
|
|
39515
39567
|
state.step = "select-commit-ranges";
|
|
39516
39568
|
});
|
|
39517
39569
|
}
|
|
39518
39570
|
}, [argv]);
|
|
39519
|
-
return /* @__PURE__ */
|
|
39571
|
+
return /* @__PURE__ */ React40.createElement(YesNoPrompt, {
|
|
39520
39572
|
message: "Some commits are new or outdated, would you like to select new commit ranges?",
|
|
39521
39573
|
onYes: () => {
|
|
39522
39574
|
actions.set((state) => {
|
|
@@ -39528,10 +39580,10 @@ function PreSelectCommitRanges() {
|
|
|
39528
39580
|
}
|
|
39529
39581
|
|
|
39530
39582
|
// src/app/SelectCommitRanges.tsx
|
|
39531
|
-
var
|
|
39583
|
+
var React43 = __toESM(require_react(), 1);
|
|
39532
39584
|
|
|
39533
39585
|
// src/app/MultiSelect.tsx
|
|
39534
|
-
var
|
|
39586
|
+
var React41 = __toESM(require_react(), 1);
|
|
39535
39587
|
|
|
39536
39588
|
// src/core/clamp.ts
|
|
39537
39589
|
function clamp(value, min, max) {
|
|
@@ -39554,7 +39606,7 @@ function wrap_index(value, list) {
|
|
|
39554
39606
|
|
|
39555
39607
|
// src/app/MultiSelect.tsx
|
|
39556
39608
|
function MultiSelect(props) {
|
|
39557
|
-
const [selected_set, select] =
|
|
39609
|
+
const [selected_set, select] = React41.useReducer((state, value) => {
|
|
39558
39610
|
const next = new Set(state);
|
|
39559
39611
|
if (next.has(value)) {
|
|
39560
39612
|
next.delete(value);
|
|
@@ -39570,7 +39622,7 @@ function MultiSelect(props) {
|
|
|
39570
39622
|
});
|
|
39571
39623
|
return set2;
|
|
39572
39624
|
});
|
|
39573
|
-
const [index, set_index] =
|
|
39625
|
+
const [index, set_index] = React41.useReducer((_, value) => {
|
|
39574
39626
|
const next_index = clamp(value, 0, props.items.length - 1);
|
|
39575
39627
|
return next_index;
|
|
39576
39628
|
}, 0, function find_initial_index() {
|
|
@@ -39589,8 +39641,8 @@ function MultiSelect(props) {
|
|
|
39589
39641
|
}
|
|
39590
39642
|
return 0;
|
|
39591
39643
|
});
|
|
39592
|
-
const selectRef =
|
|
39593
|
-
|
|
39644
|
+
const selectRef = React41.useRef(false);
|
|
39645
|
+
React41.useEffect(() => {
|
|
39594
39646
|
if (!selectRef.current) {
|
|
39595
39647
|
return;
|
|
39596
39648
|
}
|
|
@@ -39600,7 +39652,7 @@ function MultiSelect(props) {
|
|
|
39600
39652
|
const state = selected_list.map((index2) => props.items[index2].value);
|
|
39601
39653
|
props.onSelect({ item, selected, state });
|
|
39602
39654
|
}, [selected_set]);
|
|
39603
|
-
|
|
39655
|
+
React41.useEffect(() => {
|
|
39604
39656
|
const item = props.items[index].value;
|
|
39605
39657
|
const selected_list = Array.from(selected_set);
|
|
39606
39658
|
const selected = selected_set.has(index);
|
|
@@ -39642,13 +39694,13 @@ function MultiSelect(props) {
|
|
|
39642
39694
|
}
|
|
39643
39695
|
}
|
|
39644
39696
|
});
|
|
39645
|
-
return /* @__PURE__ */
|
|
39697
|
+
return /* @__PURE__ */ React41.createElement(Box_default, {
|
|
39646
39698
|
flexDirection: "column"
|
|
39647
39699
|
}, props.items.map((item, i2) => {
|
|
39648
39700
|
const active = i2 === index;
|
|
39649
39701
|
const selected = selected_set.has(i2);
|
|
39650
39702
|
const disabled = item.disabled || false;
|
|
39651
|
-
return /* @__PURE__ */
|
|
39703
|
+
return /* @__PURE__ */ React41.createElement(ItemRow, {
|
|
39652
39704
|
key: i2,
|
|
39653
39705
|
label: item.label,
|
|
39654
39706
|
active,
|
|
@@ -39676,15 +39728,15 @@ function ItemRow(props) {
|
|
|
39676
39728
|
underline = false;
|
|
39677
39729
|
dimColor = true;
|
|
39678
39730
|
}
|
|
39679
|
-
return /* @__PURE__ */
|
|
39731
|
+
return /* @__PURE__ */ React41.createElement(Box_default, {
|
|
39680
39732
|
flexDirection: "row",
|
|
39681
39733
|
gap: 1
|
|
39682
|
-
}, /* @__PURE__ */
|
|
39734
|
+
}, /* @__PURE__ */ React41.createElement(Radio, {
|
|
39683
39735
|
selected: props.selected,
|
|
39684
39736
|
disabled: props.disabled
|
|
39685
|
-
}), /* @__PURE__ */
|
|
39737
|
+
}), /* @__PURE__ */ React41.createElement(Box_default, {
|
|
39686
39738
|
width: props.maxWidth
|
|
39687
|
-
}, /* @__PURE__ */
|
|
39739
|
+
}, /* @__PURE__ */ React41.createElement(Text, {
|
|
39688
39740
|
bold,
|
|
39689
39741
|
underline,
|
|
39690
39742
|
color,
|
|
@@ -39707,7 +39759,7 @@ function Radio(props) {
|
|
|
39707
39759
|
color = colors.gray;
|
|
39708
39760
|
dimColor = true;
|
|
39709
39761
|
}
|
|
39710
|
-
return /* @__PURE__ */
|
|
39762
|
+
return /* @__PURE__ */ React41.createElement(Text, {
|
|
39711
39763
|
bold: props.selected,
|
|
39712
39764
|
color,
|
|
39713
39765
|
dimColor
|
|
@@ -39715,14 +39767,14 @@ function Radio(props) {
|
|
|
39715
39767
|
}
|
|
39716
39768
|
|
|
39717
39769
|
// src/app/TextInput.tsx
|
|
39718
|
-
var
|
|
39770
|
+
var React42 = __toESM(require_react(), 1);
|
|
39719
39771
|
function TextInput(props) {
|
|
39720
|
-
const [value, set_value] =
|
|
39721
|
-
|
|
39772
|
+
const [value, set_value] = React42.useState(get_value(props));
|
|
39773
|
+
React42.useEffect(function sync_value_prop() {
|
|
39722
39774
|
set_value(get_value(props));
|
|
39723
39775
|
}, [props.value]);
|
|
39724
|
-
const [caret_visible, set_caret_visible] =
|
|
39725
|
-
|
|
39776
|
+
const [caret_visible, set_caret_visible] = React42.useState(false);
|
|
39777
|
+
React42.useEffect(function blink_caret() {
|
|
39726
39778
|
const interval_ms = 500;
|
|
39727
39779
|
let timeoutId = setTimeout(tick, interval_ms);
|
|
39728
39780
|
function tick() {
|
|
@@ -39754,12 +39806,12 @@ function TextInput(props) {
|
|
|
39754
39806
|
set_value(next_value);
|
|
39755
39807
|
props.onChange?.(next_value);
|
|
39756
39808
|
});
|
|
39757
|
-
return /* @__PURE__ */
|
|
39809
|
+
return /* @__PURE__ */ React42.createElement(Box_default, {
|
|
39758
39810
|
borderStyle: "single",
|
|
39759
39811
|
minHeight: 1,
|
|
39760
39812
|
borderColor: colors.yellow,
|
|
39761
39813
|
borderDimColor: true
|
|
39762
|
-
}, /* @__PURE__ */
|
|
39814
|
+
}, /* @__PURE__ */ React42.createElement(Text, null, value || ""), /* @__PURE__ */ React42.createElement(Text, {
|
|
39763
39815
|
color: colors.yellow,
|
|
39764
39816
|
dimColor: true,
|
|
39765
39817
|
inverse: caret_visible
|
|
@@ -39778,26 +39830,26 @@ function gs_short_id() {
|
|
|
39778
39830
|
function SelectCommitRanges() {
|
|
39779
39831
|
const commit_range = Store.useState((state) => state.commit_range);
|
|
39780
39832
|
invariant(commit_range, "commit_range must exist");
|
|
39781
|
-
return /* @__PURE__ */
|
|
39833
|
+
return /* @__PURE__ */ React43.createElement(SelectCommitRangesInternal, {
|
|
39782
39834
|
commit_range
|
|
39783
39835
|
});
|
|
39784
39836
|
}
|
|
39785
39837
|
function SelectCommitRangesInternal(props) {
|
|
39786
39838
|
const actions = Store.useActions();
|
|
39787
39839
|
const argv = Store.useState((state) => state.argv);
|
|
39788
|
-
const [selected_group_id, set_selected_group_id] =
|
|
39840
|
+
const [selected_group_id, set_selected_group_id] = React43.useState(() => {
|
|
39789
39841
|
const first_group = props.commit_range.group_list.find((g2) => g2.id !== props.commit_range.UNASSIGNED);
|
|
39790
39842
|
if (first_group) {
|
|
39791
39843
|
return first_group.id;
|
|
39792
39844
|
}
|
|
39793
39845
|
return props.commit_range.UNASSIGNED;
|
|
39794
39846
|
});
|
|
39795
|
-
const [group_input, set_group_input] =
|
|
39796
|
-
const [new_group_list, create_group] =
|
|
39847
|
+
const [group_input, set_group_input] = React43.useState(false);
|
|
39848
|
+
const [new_group_list, create_group] = React43.useReducer((group_list2, group2) => {
|
|
39797
39849
|
const next_group_list = group_list2.concat(group2);
|
|
39798
39850
|
return next_group_list;
|
|
39799
39851
|
}, []);
|
|
39800
|
-
const [commit_map, update_commit_map] =
|
|
39852
|
+
const [commit_map, update_commit_map] = React43.useReducer((map, args) => {
|
|
39801
39853
|
map.set(args.key, args.value);
|
|
39802
39854
|
return new Map(map);
|
|
39803
39855
|
}, new Map, (map) => {
|
|
@@ -39905,12 +39957,12 @@ function SelectCommitRangesInternal(props) {
|
|
|
39905
39957
|
group_title_width = Math.min(group.title.length, group_title_width);
|
|
39906
39958
|
let max_item_width = max_group_label_width;
|
|
39907
39959
|
max_item_width -= left_arrow.length + right_arrow.length;
|
|
39908
|
-
const [focused, set_focused] =
|
|
39909
|
-
return /* @__PURE__ */
|
|
39960
|
+
const [focused, set_focused] = React43.useState("");
|
|
39961
|
+
return /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39910
39962
|
flexDirection: "column"
|
|
39911
|
-
}, /* @__PURE__ */
|
|
39963
|
+
}, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39912
39964
|
height: 1
|
|
39913
|
-
}), /* @__PURE__ */
|
|
39965
|
+
}), /* @__PURE__ */ React43.createElement(MultiSelect, {
|
|
39914
39966
|
items,
|
|
39915
39967
|
maxWidth: max_item_width,
|
|
39916
39968
|
disabled: multiselect_disabled,
|
|
@@ -39928,108 +39980,108 @@ function SelectCommitRangesInternal(props) {
|
|
|
39928
39980
|
}
|
|
39929
39981
|
update_commit_map({ key, value });
|
|
39930
39982
|
}
|
|
39931
|
-
}), /* @__PURE__ */
|
|
39983
|
+
}), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39932
39984
|
height: 1
|
|
39933
|
-
}), /* @__PURE__ */
|
|
39985
|
+
}), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39934
39986
|
width: max_group_label_width,
|
|
39935
39987
|
flexDirection: "row"
|
|
39936
|
-
}, /* @__PURE__ */
|
|
39988
|
+
}, /* @__PURE__ */ React43.createElement(Text, null, left_arrow), /* @__PURE__ */ React43.createElement(Text, null, group_position), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39937
39989
|
width: group_title_width,
|
|
39938
39990
|
justifyContent: "center"
|
|
39939
|
-
}, /* @__PURE__ */
|
|
39991
|
+
}, /* @__PURE__ */ React43.createElement(Text, {
|
|
39940
39992
|
wrap: "truncate-end"
|
|
39941
|
-
}, group.title)), /* @__PURE__ */
|
|
39993
|
+
}, group.title)), /* @__PURE__ */ React43.createElement(Text, null, right_arrow)), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39942
39994
|
height: 1
|
|
39943
|
-
}), unassigned_count > 0 ? /* @__PURE__ */
|
|
39944
|
-
wrapper: /* @__PURE__ */
|
|
39995
|
+
}), unassigned_count > 0 ? /* @__PURE__ */ React43.createElement(FormatText, {
|
|
39996
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
39945
39997
|
color: colors.gray
|
|
39946
39998
|
}),
|
|
39947
39999
|
message: "{count} unassigned commits, press {c} to {create} a new group",
|
|
39948
40000
|
values: {
|
|
39949
|
-
count: /* @__PURE__ */
|
|
40001
|
+
count: /* @__PURE__ */ React43.createElement(Text, {
|
|
39950
40002
|
color: colors.yellow,
|
|
39951
40003
|
bold: true
|
|
39952
40004
|
}, unassigned_count),
|
|
39953
|
-
c: /* @__PURE__ */
|
|
40005
|
+
c: /* @__PURE__ */ React43.createElement(Text, {
|
|
39954
40006
|
bold: true,
|
|
39955
40007
|
color: colors.green
|
|
39956
40008
|
}, "c"),
|
|
39957
|
-
create: /* @__PURE__ */
|
|
40009
|
+
create: /* @__PURE__ */ React43.createElement(Text, {
|
|
39958
40010
|
bold: true,
|
|
39959
40011
|
color: colors.green
|
|
39960
|
-
}, /* @__PURE__ */
|
|
40012
|
+
}, /* @__PURE__ */ React43.createElement(Parens, null, "c"), "reate")
|
|
39961
40013
|
}
|
|
39962
|
-
}) : /* @__PURE__ */
|
|
39963
|
-
wrapper: /* @__PURE__ */
|
|
40014
|
+
}) : /* @__PURE__ */ React43.createElement(React43.Fragment, null, argv.sync ? /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40015
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
39964
40016
|
message: "\uD83C\uDF89 Done! Press {s} to {sync} the commits to Github",
|
|
39965
40017
|
values: {
|
|
39966
|
-
s: /* @__PURE__ */
|
|
40018
|
+
s: /* @__PURE__ */ React43.createElement(Text, {
|
|
39967
40019
|
bold: true,
|
|
39968
40020
|
color: colors.green
|
|
39969
40021
|
}, "s"),
|
|
39970
|
-
sync: /* @__PURE__ */
|
|
40022
|
+
sync: /* @__PURE__ */ React43.createElement(Text, {
|
|
39971
40023
|
bold: true,
|
|
39972
40024
|
color: colors.green
|
|
39973
|
-
}, /* @__PURE__ */
|
|
40025
|
+
}, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "ync")
|
|
39974
40026
|
}
|
|
39975
|
-
}) : /* @__PURE__ */
|
|
39976
|
-
wrapper: /* @__PURE__ */
|
|
40027
|
+
}) : /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40028
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
39977
40029
|
message: "\uD83C\uDF89 Done! Press {s} to {save} the commits locally",
|
|
39978
40030
|
values: {
|
|
39979
|
-
s: /* @__PURE__ */
|
|
40031
|
+
s: /* @__PURE__ */ React43.createElement(Text, {
|
|
39980
40032
|
bold: true,
|
|
39981
40033
|
color: colors.green
|
|
39982
40034
|
}, "s"),
|
|
39983
|
-
save: /* @__PURE__ */
|
|
40035
|
+
save: /* @__PURE__ */ React43.createElement(Text, {
|
|
39984
40036
|
bold: true,
|
|
39985
40037
|
color: colors.green
|
|
39986
|
-
}, /* @__PURE__ */
|
|
40038
|
+
}, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "save")
|
|
39987
40039
|
}
|
|
39988
|
-
})), !group_input ? null : /* @__PURE__ */
|
|
40040
|
+
})), !group_input ? null : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
39989
40041
|
height: 1
|
|
39990
|
-
}), /* @__PURE__ */
|
|
39991
|
-
wrapper: /* @__PURE__ */
|
|
40042
|
+
}), /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40043
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
39992
40044
|
color: colors.gray
|
|
39993
40045
|
}),
|
|
39994
40046
|
message: "Enter a title for the PR {note}",
|
|
39995
40047
|
values: {
|
|
39996
|
-
note: /* @__PURE__ */
|
|
40048
|
+
note: /* @__PURE__ */ React43.createElement(Parens, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
39997
40049
|
message: "press {enter} to submit",
|
|
39998
40050
|
values: {
|
|
39999
|
-
enter: /* @__PURE__ */
|
|
40051
|
+
enter: /* @__PURE__ */ React43.createElement(Text, {
|
|
40000
40052
|
bold: true,
|
|
40001
40053
|
color: colors.green
|
|
40002
40054
|
}, SYMBOL.enter)
|
|
40003
40055
|
}
|
|
40004
40056
|
}))
|
|
40005
40057
|
}
|
|
40006
|
-
}), /* @__PURE__ */
|
|
40058
|
+
}), /* @__PURE__ */ React43.createElement(TextInput, {
|
|
40007
40059
|
defaultValue: focused,
|
|
40008
40060
|
onSubmit: submit_group_input
|
|
40009
|
-
}), /* @__PURE__ */
|
|
40061
|
+
}), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40010
40062
|
height: 1
|
|
40011
|
-
})), /* @__PURE__ */
|
|
40012
|
-
wrapper: /* @__PURE__ */
|
|
40063
|
+
})), /* @__PURE__ */ React43.createElement(Box_default, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40064
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40013
40065
|
color: colors.gray
|
|
40014
40066
|
}),
|
|
40015
40067
|
message: "Press {left} and {right} to view PR groups",
|
|
40016
40068
|
values: {
|
|
40017
|
-
left: /* @__PURE__ */
|
|
40069
|
+
left: /* @__PURE__ */ React43.createElement(Text, {
|
|
40018
40070
|
bold: true,
|
|
40019
40071
|
color: colors.green
|
|
40020
40072
|
}, SYMBOL.left),
|
|
40021
|
-
right: /* @__PURE__ */
|
|
40073
|
+
right: /* @__PURE__ */ React43.createElement(Text, {
|
|
40022
40074
|
bold: true,
|
|
40023
40075
|
color: colors.green
|
|
40024
40076
|
}, SYMBOL.right)
|
|
40025
40077
|
}
|
|
40026
|
-
})), /* @__PURE__ */
|
|
40027
|
-
wrapper: /* @__PURE__ */
|
|
40078
|
+
})), /* @__PURE__ */ React43.createElement(Box_default, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40079
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40028
40080
|
color: colors.gray
|
|
40029
40081
|
}),
|
|
40030
40082
|
message: "Press {enter} to toggle commit selection",
|
|
40031
40083
|
values: {
|
|
40032
|
-
enter: /* @__PURE__ */
|
|
40084
|
+
enter: /* @__PURE__ */ React43.createElement(Text, {
|
|
40033
40085
|
bold: true,
|
|
40034
40086
|
color: colors.green
|
|
40035
40087
|
}, SYMBOL.enter)
|
|
@@ -40046,14 +40098,14 @@ function SelectCommitRangesInternal(props) {
|
|
|
40046
40098
|
}
|
|
40047
40099
|
function submit_group_input(title) {
|
|
40048
40100
|
const id = get_group_id();
|
|
40049
|
-
actions.output(/* @__PURE__ */
|
|
40050
|
-
wrapper: /* @__PURE__ */
|
|
40101
|
+
actions.output(/* @__PURE__ */ React43.createElement(FormatText, {
|
|
40102
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40051
40103
|
dimColor: true
|
|
40052
40104
|
}),
|
|
40053
40105
|
message: "Created new group {group} {note}",
|
|
40054
40106
|
values: {
|
|
40055
|
-
group: /* @__PURE__ */
|
|
40056
|
-
note: /* @__PURE__ */
|
|
40107
|
+
group: /* @__PURE__ */ React43.createElement(Brackets, null, title),
|
|
40108
|
+
note: /* @__PURE__ */ React43.createElement(Parens, null, id)
|
|
40057
40109
|
}
|
|
40058
40110
|
}));
|
|
40059
40111
|
create_group({ id, title });
|
|
@@ -40067,57 +40119,6 @@ var SYMBOL = {
|
|
|
40067
40119
|
enter: "Enter"
|
|
40068
40120
|
};
|
|
40069
40121
|
|
|
40070
|
-
// src/app/Status.tsx
|
|
40071
|
-
var React43 = __toESM(require_react(), 1);
|
|
40072
|
-
function Status() {
|
|
40073
|
-
return /* @__PURE__ */ React43.createElement(Await, {
|
|
40074
|
-
fallback: null,
|
|
40075
|
-
function: run8
|
|
40076
|
-
});
|
|
40077
|
-
}
|
|
40078
|
-
async function run8() {
|
|
40079
|
-
const state = Store.getState();
|
|
40080
|
-
const actions = state.actions;
|
|
40081
|
-
const argv = state.argv;
|
|
40082
|
-
const commit_range = Store.getState().commit_range;
|
|
40083
|
-
invariant(commit_range, "commit_range must exist");
|
|
40084
|
-
actions.output(/* @__PURE__ */ React43.createElement(StatusTable, null));
|
|
40085
|
-
let needs_rebase = false;
|
|
40086
|
-
let needs_update = false;
|
|
40087
|
-
for (const group of commit_range.group_list) {
|
|
40088
|
-
if (group.dirty) {
|
|
40089
|
-
needs_update = true;
|
|
40090
|
-
}
|
|
40091
|
-
if (group.pr?.state === "MERGED") {
|
|
40092
|
-
needs_rebase = true;
|
|
40093
|
-
}
|
|
40094
|
-
}
|
|
40095
|
-
if (argv.check) {
|
|
40096
|
-
actions.exit(0);
|
|
40097
|
-
} else if (needs_rebase) {
|
|
40098
|
-
Store.setState((state2) => {
|
|
40099
|
-
state2.step = "pre-local-merge-rebase";
|
|
40100
|
-
});
|
|
40101
|
-
} else if (needs_update) {
|
|
40102
|
-
Store.setState((state2) => {
|
|
40103
|
-
state2.step = "pre-select-commit-ranges";
|
|
40104
|
-
});
|
|
40105
|
-
} else if (argv.force) {
|
|
40106
|
-
Store.setState((state2) => {
|
|
40107
|
-
state2.step = "select-commit-ranges";
|
|
40108
|
-
});
|
|
40109
|
-
} else {
|
|
40110
|
-
actions.output(/* @__PURE__ */ React43.createElement(Text, null, "✅ Everything up to date."));
|
|
40111
|
-
actions.output(/* @__PURE__ */ React43.createElement(Text, {
|
|
40112
|
-
color: colors.gray
|
|
40113
|
-
}, /* @__PURE__ */ React43.createElement(Text, null, "Run with"), /* @__PURE__ */ React43.createElement(Text, {
|
|
40114
|
-
bold: true,
|
|
40115
|
-
color: colors.yellow
|
|
40116
|
-
}, ` --force `), /* @__PURE__ */ React43.createElement(Text, null, "to force update all pull requests.")));
|
|
40117
|
-
actions.exit(0);
|
|
40118
|
-
}
|
|
40119
|
-
}
|
|
40120
|
-
|
|
40121
40122
|
// src/app/SyncGithub.tsx
|
|
40122
40123
|
var React44 = __toESM(require_react(), 1);
|
|
40123
40124
|
var import_last = __toESM(require_last(), 1);
|
|
@@ -45662,7 +45663,7 @@ var yargs_default = Yargs;
|
|
|
45662
45663
|
|
|
45663
45664
|
// src/command.ts
|
|
45664
45665
|
async function command2() {
|
|
45665
|
-
return yargs_default(hideBin(process.argv)).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).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.2.
|
|
45666
|
+
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).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.2.8").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
|
|
45666
45667
|
}
|
|
45667
45668
|
var GlobalOptions = {
|
|
45668
45669
|
verbose: {
|
package/package.json
CHANGED
package/scripts/release-brew.ts
CHANGED
|
@@ -66,6 +66,8 @@ const re_token = (name: string) => new RegExp(`{{ ${name} }}`, "g");
|
|
|
66
66
|
process.chdir(HOMEBREW_DIR);
|
|
67
67
|
await spawn.sync(`git reset --hard`);
|
|
68
68
|
await spawn.sync(`git checkout master`);
|
|
69
|
+
await spawn.sync("git fetch --prune");
|
|
70
|
+
await spawn.sync("git reset --hard origin/master");
|
|
69
71
|
|
|
70
72
|
// homebrew tap formula (binaries)
|
|
71
73
|
|
package/src/command.ts
CHANGED
|
@@ -9,6 +9,7 @@ export async function command() {
|
|
|
9
9
|
// https://yargs.js.org/docs/#api-reference-optionkey-opt
|
|
10
10
|
return (
|
|
11
11
|
yargs(hideBin(process.argv))
|
|
12
|
+
.scriptName("git stack")
|
|
12
13
|
.usage("Usage: git stack [command] [options]")
|
|
13
14
|
|
|
14
15
|
.command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions))
|
package/src/commands/Rebase.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { Await } from "~/app/Await";
|
|
|
8
8
|
import { Brackets } from "~/app/Brackets";
|
|
9
9
|
import { FormatText } from "~/app/FormatText";
|
|
10
10
|
import { Parens } from "~/app/Parens";
|
|
11
|
+
import { Status } from "~/app/Status";
|
|
11
12
|
import { Store } from "~/app/Store";
|
|
12
13
|
import * as CommitMetadata from "~/core/CommitMetadata";
|
|
13
14
|
import { cli } from "~/core/cli";
|
|
@@ -128,7 +129,7 @@ Rebase.run = async function run() {
|
|
|
128
129
|
message="✅ {branch_name} in sync with {origin_branch}"
|
|
129
130
|
values={{
|
|
130
131
|
branch_name: <Brackets>{branch_name}</Brackets>,
|
|
131
|
-
origin_branch: <Brackets>{
|
|
132
|
+
origin_branch: <Brackets>{master_branch}</Brackets>,
|
|
132
133
|
}}
|
|
133
134
|
/>,
|
|
134
135
|
);
|
|
@@ -137,8 +138,11 @@ Rebase.run = async function run() {
|
|
|
137
138
|
|
|
138
139
|
actions.set((state) => {
|
|
139
140
|
state.commit_range = next_commit_range;
|
|
140
|
-
state.step = "status";
|
|
141
141
|
});
|
|
142
|
+
|
|
143
|
+
actions.output(<Status />);
|
|
144
|
+
|
|
145
|
+
actions.exit(0);
|
|
142
146
|
} catch (err) {
|
|
143
147
|
actions.error("Unable to rebase.");
|
|
144
148
|
|