git-stack-cli 2.5.1 → 2.5.3

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 CHANGED
@@ -25202,17 +25202,17 @@ var require_utils4 = __commonJS((exports) => {
25202
25202
  Object.defineProperty(exports, "__esModule", { value: true });
25203
25203
  exports.shallowEqual = exports.assignUniqueKeysToParts = exports.DEFAULT_INTL_CONFIG = exports.invariantIntlContext = undefined;
25204
25204
  var tslib_1 = require_tslib();
25205
- var React11 = tslib_1.__importStar(react);
25205
+ var React12 = tslib_1.__importStar(react);
25206
25206
  var ecma402_abstract_1 = require_ecma402_abstract();
25207
25207
  var intl_1 = require_intl();
25208
25208
  function invariantIntlContext(intl) {
25209
25209
  (0, ecma402_abstract_1.invariant)(intl, "[React Intl] Could not find required `intl` object. " + "<IntlProvider> needs to exist in the component ancestry.");
25210
25210
  }
25211
25211
  exports.invariantIntlContext = invariantIntlContext;
25212
- exports.DEFAULT_INTL_CONFIG = tslib_1.__assign(tslib_1.__assign({}, intl_1.DEFAULT_INTL_CONFIG), { textComponent: React11.Fragment });
25212
+ exports.DEFAULT_INTL_CONFIG = tslib_1.__assign(tslib_1.__assign({}, intl_1.DEFAULT_INTL_CONFIG), { textComponent: React12.Fragment });
25213
25213
  function assignUniqueKeysToParts(formatXMLElementFn) {
25214
25214
  return function(parts) {
25215
- return formatXMLElementFn(React11.Children.toArray(parts));
25215
+ return formatXMLElementFn(React12.Children.toArray(parts));
25216
25216
  };
25217
25217
  }
25218
25218
  exports.assignUniqueKeysToParts = assignUniqueKeysToParts;
@@ -25246,13 +25246,13 @@ var require_injectIntl = __commonJS((exports) => {
25246
25246
  Object.defineProperty(exports, "__esModule", { value: true });
25247
25247
  exports.Context = exports.Provider = undefined;
25248
25248
  var tslib_1 = require_tslib();
25249
- var React11 = tslib_1.__importStar(react);
25249
+ var React12 = tslib_1.__importStar(react);
25250
25250
  var hoist_non_react_statics_1 = tslib_1.__importDefault(require_hoist_non_react_statics_cjs());
25251
25251
  var utils_1 = require_utils4();
25252
25252
  function getDisplayName(Component) {
25253
25253
  return Component.displayName || Component.name || "Component";
25254
25254
  }
25255
- var IntlContext = typeof window !== "undefined" && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__ ? window.__REACT_INTL_CONTEXT__ || (window.__REACT_INTL_CONTEXT__ = React11.createContext(null)) : React11.createContext(null);
25255
+ var IntlContext = typeof window !== "undefined" && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__ ? window.__REACT_INTL_CONTEXT__ || (window.__REACT_INTL_CONTEXT__ = React12.createContext(null)) : React12.createContext(null);
25256
25256
  var IntlConsumer = IntlContext.Consumer;
25257
25257
  var IntlProvider = IntlContext.Provider;
25258
25258
  exports.Provider = IntlProvider;
@@ -25260,20 +25260,20 @@ var require_injectIntl = __commonJS((exports) => {
25260
25260
  function injectIntl(WrappedComponent, options) {
25261
25261
  var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === undefined ? "intl" : _b, _c = _a.forwardRef, forwardRef2 = _c === undefined ? false : _c, _d = _a.enforceContext, enforceContext = _d === undefined ? true : _d;
25262
25262
  var WithIntl = function(props) {
25263
- return React11.createElement(IntlConsumer, null, function(intl) {
25263
+ return React12.createElement(IntlConsumer, null, function(intl) {
25264
25264
  var _a2;
25265
25265
  if (enforceContext) {
25266
25266
  (0, utils_1.invariantIntlContext)(intl);
25267
25267
  }
25268
25268
  var intlProp = (_a2 = {}, _a2[intlPropName] = intl, _a2);
25269
- return React11.createElement(WrappedComponent, tslib_1.__assign({}, props, intlProp, { ref: forwardRef2 ? props.forwardedRef : null }));
25269
+ return React12.createElement(WrappedComponent, tslib_1.__assign({}, props, intlProp, { ref: forwardRef2 ? props.forwardedRef : null }));
25270
25270
  });
25271
25271
  };
25272
25272
  WithIntl.displayName = "injectIntl(".concat(getDisplayName(WrappedComponent), ")");
25273
25273
  WithIntl.WrappedComponent = WrappedComponent;
25274
25274
  if (forwardRef2) {
25275
- return (0, hoist_non_react_statics_1.default)(React11.forwardRef(function(props, ref) {
25276
- return React11.createElement(WithIntl, tslib_1.__assign({}, props, { forwardedRef: ref }));
25275
+ return (0, hoist_non_react_statics_1.default)(React12.forwardRef(function(props, ref) {
25276
+ return React12.createElement(WithIntl, tslib_1.__assign({}, props, { forwardedRef: ref }));
25277
25277
  }), WrappedComponent);
25278
25278
  }
25279
25279
  return (0, hoist_non_react_statics_1.default)(WithIntl, WrappedComponent);
@@ -25286,11 +25286,11 @@ var require_useIntl = __commonJS((exports) => {
25286
25286
  var react = __toESM(require_react(), 1);
25287
25287
  Object.defineProperty(exports, "__esModule", { value: true });
25288
25288
  var tslib_1 = require_tslib();
25289
- var React11 = tslib_1.__importStar(react);
25289
+ var React12 = tslib_1.__importStar(react);
25290
25290
  var injectIntl_1 = require_injectIntl();
25291
25291
  var utils_1 = require_utils4();
25292
25292
  function useIntl() {
25293
- var intl = React11.useContext(injectIntl_1.Context);
25293
+ var intl = React12.useContext(injectIntl_1.Context);
25294
25294
  (0, utils_1.invariantIntlContext)(intl);
25295
25295
  return intl;
25296
25296
  }
@@ -25303,7 +25303,7 @@ var require_createFormattedComponent = __commonJS((exports) => {
25303
25303
  Object.defineProperty(exports, "__esModule", { value: true });
25304
25304
  exports.createFormattedComponent = exports.createFormattedDateTimePartsComponent = exports.FormattedListParts = exports.FormattedNumberParts = undefined;
25305
25305
  var tslib_1 = require_tslib();
25306
- var React11 = tslib_1.__importStar(react);
25306
+ var React12 = tslib_1.__importStar(react);
25307
25307
  var useIntl_1 = tslib_1.__importDefault(require_useIntl());
25308
25308
  var DisplayName;
25309
25309
  (function(DisplayName2) {
@@ -25354,8 +25354,8 @@ var require_createFormattedComponent = __commonJS((exports) => {
25354
25354
  if (typeof children === "function") {
25355
25355
  return children(formattedValue);
25356
25356
  }
25357
- var Text2 = intl.textComponent || React11.Fragment;
25358
- return React11.createElement(Text2, null, formattedValue);
25357
+ var Text2 = intl.textComponent || React12.Fragment;
25358
+ return React12.createElement(Text2, null, formattedValue);
25359
25359
  };
25360
25360
  Component.displayName = DisplayName[name];
25361
25361
  return Component;
@@ -25370,7 +25370,7 @@ var require_provider = __commonJS((exports) => {
25370
25370
  exports.createIntl = undefined;
25371
25371
  var tslib_1 = require_tslib();
25372
25372
  var intl_1 = require_intl();
25373
- var React11 = tslib_1.__importStar(react);
25373
+ var React12 = tslib_1.__importStar(react);
25374
25374
  var utils_1 = require_utils4();
25375
25375
  var injectIntl_1 = require_injectIntl();
25376
25376
  var intl_messageformat_1 = require_intl_messageformat();
@@ -25413,7 +25413,7 @@ var require_provider = __commonJS((exports) => {
25413
25413
  values
25414
25414
  ], rest, false));
25415
25415
  if (Array.isArray(chunks)) {
25416
- return React11.Children.toArray(chunks);
25416
+ return React12.Children.toArray(chunks);
25417
25417
  }
25418
25418
  return chunks;
25419
25419
  };
@@ -25463,12 +25463,12 @@ var require_provider = __commonJS((exports) => {
25463
25463
  };
25464
25464
  IntlProvider2.prototype.render = function() {
25465
25465
  (0, utils_1.invariantIntlContext)(this.state.intl);
25466
- return React11.createElement(injectIntl_1.Provider, { value: this.state.intl }, this.props.children);
25466
+ return React12.createElement(injectIntl_1.Provider, { value: this.state.intl }, this.props.children);
25467
25467
  };
25468
25468
  IntlProvider2.displayName = "IntlProvider";
25469
25469
  IntlProvider2.defaultProps = utils_1.DEFAULT_INTL_CONFIG;
25470
25470
  return IntlProvider2;
25471
- }(React11.PureComponent);
25471
+ }(React12.PureComponent);
25472
25472
  exports.default = IntlProvider;
25473
25473
  });
25474
25474
 
@@ -25477,7 +25477,7 @@ var require_relative = __commonJS((exports) => {
25477
25477
  var react = __toESM(require_react(), 1);
25478
25478
  Object.defineProperty(exports, "__esModule", { value: true });
25479
25479
  var tslib_1 = require_tslib();
25480
- var React11 = tslib_1.__importStar(react);
25480
+ var React12 = tslib_1.__importStar(react);
25481
25481
  var ecma402_abstract_1 = require_ecma402_abstract();
25482
25482
  var useIntl_1 = tslib_1.__importDefault(require_useIntl());
25483
25483
  var MINUTE = 60;
@@ -25540,23 +25540,23 @@ var require_relative = __commonJS((exports) => {
25540
25540
  return children(formattedRelativeTime);
25541
25541
  }
25542
25542
  if (Text2) {
25543
- return React11.createElement(Text2, null, formattedRelativeTime);
25543
+ return React12.createElement(Text2, null, formattedRelativeTime);
25544
25544
  }
25545
- return React11.createElement(React11.Fragment, null, formattedRelativeTime);
25545
+ return React12.createElement(React12.Fragment, null, formattedRelativeTime);
25546
25546
  };
25547
25547
  var FormattedRelativeTime = function(_a) {
25548
25548
  var { value, unit, updateIntervalInSeconds } = _a, otherProps = tslib_1.__rest(_a, ["value", "unit", "updateIntervalInSeconds"]);
25549
25549
  (0, ecma402_abstract_1.invariant)(!updateIntervalInSeconds || !!(updateIntervalInSeconds && canIncrement(unit)), "Cannot schedule update with unit longer than hour");
25550
- var _b = React11.useState(), prevUnit = _b[0], setPrevUnit = _b[1];
25551
- var _c = React11.useState(0), prevValue = _c[0], setPrevValue = _c[1];
25552
- var _d = React11.useState(0), currentValueInSeconds = _d[0], setCurrentValueInSeconds = _d[1];
25550
+ var _b = React12.useState(), prevUnit = _b[0], setPrevUnit = _b[1];
25551
+ var _c = React12.useState(0), prevValue = _c[0], setPrevValue = _c[1];
25552
+ var _d = React12.useState(0), currentValueInSeconds = _d[0], setCurrentValueInSeconds = _d[1];
25553
25553
  var updateTimer;
25554
25554
  if (unit !== prevUnit || value !== prevValue) {
25555
25555
  setPrevValue(value || 0);
25556
25556
  setPrevUnit(unit);
25557
25557
  setCurrentValueInSeconds(canIncrement(unit) ? valueToSeconds(value, unit) : 0);
25558
25558
  }
25559
- React11.useEffect(function() {
25559
+ React12.useEffect(function() {
25560
25560
  function clearUpdateTimer() {
25561
25561
  clearTimeout(updateTimer);
25562
25562
  }
@@ -25588,7 +25588,7 @@ var require_relative = __commonJS((exports) => {
25588
25588
  var unitDuration = getDurationInSeconds(currentUnit);
25589
25589
  currentValue = Math.round(currentValueInSeconds / unitDuration);
25590
25590
  }
25591
- return React11.createElement(SimpleFormattedRelativeTime, tslib_1.__assign({ value: currentValue, unit: currentUnit }, otherProps));
25591
+ return React12.createElement(SimpleFormattedRelativeTime, tslib_1.__assign({ value: currentValue, unit: currentUnit }, otherProps));
25592
25592
  };
25593
25593
  FormattedRelativeTime.displayName = "FormattedRelativeTime";
25594
25594
  FormattedRelativeTime.defaultProps = {
@@ -25603,7 +25603,7 @@ var require_plural2 = __commonJS((exports) => {
25603
25603
  var react = __toESM(require_react(), 1);
25604
25604
  Object.defineProperty(exports, "__esModule", { value: true });
25605
25605
  var tslib_1 = require_tslib();
25606
- var React11 = tslib_1.__importStar(react);
25606
+ var React12 = tslib_1.__importStar(react);
25607
25607
  var useIntl_1 = tslib_1.__importDefault(require_useIntl());
25608
25608
  var FormattedPlural = function(props) {
25609
25609
  var _a = (0, useIntl_1.default)(), formatPlural = _a.formatPlural, Text2 = _a.textComponent;
@@ -25614,7 +25614,7 @@ var require_plural2 = __commonJS((exports) => {
25614
25614
  return children(formattedPlural);
25615
25615
  }
25616
25616
  if (Text2) {
25617
- return React11.createElement(Text2, null, formattedPlural);
25617
+ return React12.createElement(Text2, null, formattedPlural);
25618
25618
  }
25619
25619
  return formattedPlural;
25620
25620
  };
@@ -25630,7 +25630,7 @@ var require_message2 = __commonJS((exports) => {
25630
25630
  var react = __toESM(require_react(), 1);
25631
25631
  Object.defineProperty(exports, "__esModule", { value: true });
25632
25632
  var tslib_1 = require_tslib();
25633
- var React11 = tslib_1.__importStar(react);
25633
+ var React12 = tslib_1.__importStar(react);
25634
25634
  var useIntl_1 = tslib_1.__importDefault(require_useIntl());
25635
25635
  var utils_1 = require_utils4();
25636
25636
  function areEqual(prevProps, nextProps) {
@@ -25640,7 +25640,7 @@ var require_message2 = __commonJS((exports) => {
25640
25640
  }
25641
25641
  function FormattedMessage(props) {
25642
25642
  var intl = (0, useIntl_1.default)();
25643
- var { formatMessage, textComponent: _a } = intl, Text2 = _a === undefined ? React11.Fragment : _a;
25643
+ var { formatMessage, textComponent: _a } = intl, Text2 = _a === undefined ? React12.Fragment : _a;
25644
25644
  var { id, description, defaultMessage, values, children, tagName: _b } = props, Component = _b === undefined ? Text2 : _b, ignoreTag = props.ignoreTag;
25645
25645
  var descriptor = { id, description, defaultMessage };
25646
25646
  var nodes = formatMessage(descriptor, values, {
@@ -25650,12 +25650,12 @@ var require_message2 = __commonJS((exports) => {
25650
25650
  return children(Array.isArray(nodes) ? nodes : [nodes]);
25651
25651
  }
25652
25652
  if (Component) {
25653
- return React11.createElement(Component, null, React11.Children.toArray(nodes));
25653
+ return React12.createElement(Component, null, React12.Children.toArray(nodes));
25654
25654
  }
25655
- return React11.createElement(React11.Fragment, null, nodes);
25655
+ return React12.createElement(React12.Fragment, null, nodes);
25656
25656
  }
25657
25657
  FormattedMessage.displayName = "FormattedMessage";
25658
- var MemoizedFormattedMessage = React11.memo(FormattedMessage, areEqual);
25658
+ var MemoizedFormattedMessage = React12.memo(FormattedMessage, areEqual);
25659
25659
  MemoizedFormattedMessage.displayName = "MemoizedFormattedMessage";
25660
25660
  exports.default = MemoizedFormattedMessage;
25661
25661
  });
@@ -25665,7 +25665,7 @@ var require_dateTimeRange = __commonJS((exports) => {
25665
25665
  var react = __toESM(require_react(), 1);
25666
25666
  Object.defineProperty(exports, "__esModule", { value: true });
25667
25667
  var tslib_1 = require_tslib();
25668
- var React11 = tslib_1.__importStar(react);
25668
+ var React12 = tslib_1.__importStar(react);
25669
25669
  var useIntl_1 = tslib_1.__importDefault(require_useIntl());
25670
25670
  var FormattedDateTimeRange = function(props) {
25671
25671
  var intl = (0, useIntl_1.default)();
@@ -25674,8 +25674,8 @@ var require_dateTimeRange = __commonJS((exports) => {
25674
25674
  if (typeof children === "function") {
25675
25675
  return children(formattedValue);
25676
25676
  }
25677
- var Text2 = intl.textComponent || React11.Fragment;
25678
- return React11.createElement(Text2, null, formattedValue);
25677
+ var Text2 = intl.textComponent || React12.Fragment;
25678
+ return React12.createElement(Text2, null, formattedValue);
25679
25679
  };
25680
25680
  FormattedDateTimeRange.displayName = "FormattedDateTimeRange";
25681
25681
  exports.default = FormattedDateTimeRange;
@@ -28098,9 +28098,9 @@ var require_last = __commonJS((exports, module) => {
28098
28098
  });
28099
28099
 
28100
28100
  // src/index.tsx
28101
- var React55 = __toESM(require_react(), 1);
28102
- import fs14 from "node:fs/promises";
28103
- import path10 from "node:path";
28101
+ var React56 = __toESM(require_react(), 1);
28102
+ import fs12 from "node:fs/promises";
28103
+ import path9 from "node:path";
28104
28104
 
28105
28105
  // node_modules/.pnpm/ink-cjs@4.4.1_@types+react@18.2.33_react-devtools-core@4.19.1_react@18.2.0/node_modules/ink-cjs/build/render.js
28106
28106
  import { Stream } from "node:stream";
@@ -31935,12 +31935,10 @@ var import_react20 = __toESM(require_react(), 1);
31935
31935
  // node_modules/.pnpm/ink-cjs@4.4.1_@types+react@18.2.33_react-devtools-core@4.19.1_react@18.2.0/node_modules/ink-cjs/build/hooks/use-focus-manager.js
31936
31936
  var import_react21 = __toESM(require_react(), 1);
31937
31937
  // src/app/App.tsx
31938
- var React54 = __toESM(require_react(), 1);
31938
+ var React55 = __toESM(require_react(), 1);
31939
31939
 
31940
31940
  // src/app/AutoUpdate.tsx
31941
- var React17 = __toESM(require_react(), 1);
31942
- import fs3 from "node:fs/promises";
31943
- import path from "node:path";
31941
+ var React18 = __toESM(require_react(), 1);
31944
31942
 
31945
31943
  // src/app/Brackets.tsx
31946
31944
  var React10 = __toESM(require_react(), 1);
@@ -31970,38 +31968,48 @@ function Brackets(props) {
31970
31968
  }, "]"));
31971
31969
  }
31972
31970
 
31973
- // src/app/FormatText.tsx
31971
+ // src/app/Command.tsx
31974
31972
  var React11 = __toESM(require_react(), 1);
31973
+ function Command(props) {
31974
+ const text_color = colors.orange;
31975
+ return /* @__PURE__ */ React11.createElement(Text, {
31976
+ bold: true,
31977
+ color: text_color
31978
+ }, props.children);
31979
+ }
31980
+
31981
+ // src/app/FormatText.tsx
31982
+ var React12 = __toESM(require_react(), 1);
31975
31983
  var import_react_intl = __toESM(require_react_intl(), 1);
31976
31984
  function FormatText(props) {
31977
- const wrapper = props.wrapper || /* @__PURE__ */ React11.createElement(Text, null);
31978
- return /* @__PURE__ */ React11.createElement(import_react_intl.FormattedMessage, {
31985
+ const wrapper = props.wrapper || /* @__PURE__ */ React12.createElement(Text, null);
31986
+ return /* @__PURE__ */ React12.createElement(import_react_intl.FormattedMessage, {
31979
31987
  id: "FormatText",
31980
31988
  defaultMessage: props.message,
31981
31989
  values: props.values
31982
31990
  }, (chunks) => {
31983
- return React11.cloneElement(wrapper, {}, chunks);
31991
+ return React12.cloneElement(wrapper, {}, chunks);
31984
31992
  });
31985
31993
  }
31986
31994
 
31987
31995
  // src/app/YesNoPrompt.tsx
31988
- var React13 = __toESM(require_react(), 1);
31996
+ var React14 = __toESM(require_react(), 1);
31989
31997
 
31990
31998
  // src/app/Parens.tsx
31991
- var React12 = __toESM(require_react(), 1);
31999
+ var React13 = __toESM(require_react(), 1);
31992
32000
  function Parens(props) {
31993
32001
  const color = colors.blue;
31994
- return /* @__PURE__ */ React12.createElement(Text, null, /* @__PURE__ */ React12.createElement(Text, {
32002
+ return /* @__PURE__ */ React13.createElement(Text, null, /* @__PURE__ */ React13.createElement(Text, {
31995
32003
  color
31996
- }, "("), props.children, /* @__PURE__ */ React12.createElement(Text, {
32004
+ }, "("), props.children, /* @__PURE__ */ React13.createElement(Text, {
31997
32005
  color
31998
32006
  }, ")"));
31999
32007
  }
32000
32008
 
32001
32009
  // src/app/YesNoPrompt.tsx
32002
32010
  function YesNoPrompt(props) {
32003
- const [answer, set_answer] = React13.useState("");
32004
- const answered_ref = React13.useRef(false);
32011
+ const [answer, set_answer] = React14.useState("");
32012
+ const answered_ref = React14.useRef(false);
32005
32013
  use_input_default((input) => {
32006
32014
  if (answered_ref.current) {
32007
32015
  return;
@@ -32023,11 +32031,11 @@ function YesNoPrompt(props) {
32023
32031
  }
32024
32032
  });
32025
32033
  const choices = function get_choices() {
32026
- const y3 = /* @__PURE__ */ React13.createElement(Text, {
32034
+ const y3 = /* @__PURE__ */ React14.createElement(Text, {
32027
32035
  bold: true,
32028
32036
  color: colors.green
32029
32037
  }, "Y");
32030
- const n3 = /* @__PURE__ */ React13.createElement(Text, {
32038
+ const n3 = /* @__PURE__ */ React14.createElement(Text, {
32031
32039
  color: colors.red
32032
32040
  }, "n");
32033
32041
  switch (answer) {
@@ -32036,19 +32044,19 @@ function YesNoPrompt(props) {
32036
32044
  case "n":
32037
32045
  return n3;
32038
32046
  default:
32039
- return /* @__PURE__ */ React13.createElement(FormatText, {
32047
+ return /* @__PURE__ */ React14.createElement(FormatText, {
32040
32048
  message: "{y}/{n}",
32041
32049
  values: { y: y3, n: n3 }
32042
32050
  });
32043
32051
  }
32044
32052
  }();
32045
- return /* @__PURE__ */ React13.createElement(Box_default, {
32053
+ return /* @__PURE__ */ React14.createElement(Box_default, {
32046
32054
  flexDirection: "column"
32047
- }, /* @__PURE__ */ React13.createElement(Box_default, {
32055
+ }, /* @__PURE__ */ React14.createElement(Box_default, {
32048
32056
  alignItems: "flex-end"
32049
- }, typeof props.message === "object" ? props.message : /* @__PURE__ */ React13.createElement(Text, {
32057
+ }, typeof props.message === "object" ? props.message : /* @__PURE__ */ React14.createElement(Text, {
32050
32058
  color: colors.yellow
32051
- }, props.message), /* @__PURE__ */ React13.createElement(Text, null, " "), /* @__PURE__ */ React13.createElement(Parens, null, /* @__PURE__ */ React13.createElement(Text, {
32059
+ }, props.message), /* @__PURE__ */ React14.createElement(Text, null, " "), /* @__PURE__ */ React14.createElement(Parens, null, /* @__PURE__ */ React14.createElement(Text, {
32052
32060
  color: colors.gray
32053
32061
  }, choices))));
32054
32062
  }
@@ -32057,7 +32065,7 @@ function YesNoPrompt(props) {
32057
32065
  import * as child from "node:child_process";
32058
32066
 
32059
32067
  // src/app/Store.tsx
32060
- var React16 = __toESM(require_react(), 1);
32068
+ var React17 = __toESM(require_react(), 1);
32061
32069
 
32062
32070
  // node_modules/.pnpm/zustand@4.4.4_@types+react@18.2.33_immer@10.0.3_react@18.2.0/node_modules/zustand/esm/vanilla.mjs
32063
32071
  var createStoreImpl = (createState) => {
@@ -32688,7 +32696,7 @@ var immerImpl = (initializer) => (set2, get, store) => {
32688
32696
  var immer2 = immerImpl;
32689
32697
 
32690
32698
  // src/app/Exit.tsx
32691
- var React14 = __toESM(require_react(), 1);
32699
+ var React15 = __toESM(require_react(), 1);
32692
32700
 
32693
32701
  // src/core/sleep.ts
32694
32702
  async function sleep(time) {
@@ -32697,7 +32705,7 @@ async function sleep(time) {
32697
32705
 
32698
32706
  // src/app/Exit.tsx
32699
32707
  function Exit(props) {
32700
- React14.useEffect(() => {
32708
+ React15.useEffect(() => {
32701
32709
  Exit.handle_exit(props).catch((err) => {
32702
32710
  console.error(err);
32703
32711
  });
@@ -32714,7 +32722,7 @@ Exit.handle_exit = async function handle_exit(props) {
32714
32722
  }
32715
32723
  if (state.is_dirty_check_stash) {
32716
32724
  await cli("git stash pop");
32717
- actions.output(/* @__PURE__ */ React14.createElement(Text, {
32725
+ actions.output(/* @__PURE__ */ React15.createElement(Text, {
32718
32726
  color: colors.green
32719
32727
  }, "✅ Changes restored from stash"));
32720
32728
  }
@@ -32728,7 +32736,7 @@ Exit.handle_exit = async function handle_exit(props) {
32728
32736
  };
32729
32737
 
32730
32738
  // src/app/LogTimestamp.tsx
32731
- var React15 = __toESM(require_react(), 1);
32739
+ var React16 = __toESM(require_react(), 1);
32732
32740
 
32733
32741
  // node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/errors.js
32734
32742
  class LuxonError extends Error {
@@ -37023,7 +37031,7 @@ function friendlyDateTime(dateTimeish) {
37023
37031
 
37024
37032
  // src/app/LogTimestamp.tsx
37025
37033
  function LogTimestamp() {
37026
- return /* @__PURE__ */ React15.createElement(Text, {
37034
+ return /* @__PURE__ */ React16.createElement(Text, {
37027
37035
  dimColor: true
37028
37036
  }, DateTime.now().toFormat("[yyyy-MM-dd HH:mm:ss.SSS] "));
37029
37037
  }
@@ -37066,7 +37074,7 @@ var BaseStore = createStore()(immer2((set2, get) => ({
37066
37074
  state.exit_mode = "normal";
37067
37075
  }
37068
37076
  let clear = args?.clear ?? true;
37069
- const node = /* @__PURE__ */ React16.createElement(Exit, {
37077
+ const node = /* @__PURE__ */ React17.createElement(Exit, {
37070
37078
  clear,
37071
37079
  code
37072
37080
  });
@@ -37094,17 +37102,17 @@ var BaseStore = createStore()(immer2((set2, get) => ({
37094
37102
  error(error) {
37095
37103
  let node;
37096
37104
  if (typeof error === "string") {
37097
- node = /* @__PURE__ */ React16.createElement(Text, {
37105
+ node = /* @__PURE__ */ React17.createElement(Text, {
37098
37106
  color: colors.red
37099
37107
  }, error);
37100
37108
  } else if (error instanceof Error) {
37101
- node = /* @__PURE__ */ React16.createElement(Box_default, {
37109
+ node = /* @__PURE__ */ React17.createElement(Box_default, {
37102
37110
  flexDirection: "column"
37103
- }, /* @__PURE__ */ React16.createElement(Text, {
37111
+ }, /* @__PURE__ */ React17.createElement(Text, {
37104
37112
  color: colors.red
37105
37113
  }, error.stack));
37106
37114
  } else {
37107
- node = /* @__PURE__ */ React16.createElement(Text, {
37115
+ node = /* @__PURE__ */ React17.createElement(Text, {
37108
37116
  color: colors.red
37109
37117
  }, `Unhandled error: ${JSON.stringify(error)}`);
37110
37118
  }
@@ -37188,12 +37196,12 @@ function renderOutputArgs(args) {
37188
37196
  case "boolean":
37189
37197
  case "number":
37190
37198
  case "string":
37191
- output = /* @__PURE__ */ React16.createElement(Text, {
37199
+ output = /* @__PURE__ */ React17.createElement(Text, {
37192
37200
  dimColor: args.debug
37193
37201
  }, String(args.node));
37194
37202
  }
37195
37203
  if (args.debug) {
37196
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, args.withoutTimestamp ? null : /* @__PURE__ */ React16.createElement(LogTimestamp, null), output);
37204
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, args.withoutTimestamp ? null : /* @__PURE__ */ React17.createElement(LogTimestamp, null), output);
37197
37205
  }
37198
37206
  return output;
37199
37207
  }
@@ -37393,19 +37401,6 @@ function is_finite_value(value) {
37393
37401
  return typeof value === "number" && Number.isFinite(value);
37394
37402
  }
37395
37403
 
37396
- // src/core/read_json.ts
37397
- import fs2 from "node:fs/promises";
37398
- async function read_json(path) {
37399
- try {
37400
- const file_buffer = await fs2.readFile(path);
37401
- const json_str = String(file_buffer);
37402
- const json = JSON.parse(json_str);
37403
- return json;
37404
- } catch (error) {
37405
- return null;
37406
- }
37407
- }
37408
-
37409
37404
  // src/core/semver_compare.ts
37410
37405
  function semver_compare(version_a, version_b) {
37411
37406
  const split_a = version_a.split(".").map(Number);
@@ -37427,14 +37422,15 @@ function reducer(state, patch) {
37427
37422
  return { ...state, ...patch };
37428
37423
  }
37429
37424
  function AutoUpdate(props) {
37430
- const props_ref = React17.useRef(props);
37425
+ const props_ref = React18.useRef(props);
37431
37426
  props_ref.current = props;
37432
- const [output, set_output] = React17.useState([]);
37433
- const [state, patch] = React17.useReducer(reducer, {
37427
+ const [output, set_output] = React18.useState([]);
37428
+ const [state, patch] = React18.useReducer(reducer, {
37434
37429
  error: null,
37435
37430
  local_version: null,
37436
37431
  latest_version: null,
37437
- status: "init"
37432
+ status: "init",
37433
+ is_brew_bun_standalone: false
37438
37434
  });
37439
37435
  function handle_output(node) {
37440
37436
  if (typeof props.onOutput === "function") {
@@ -37445,13 +37441,18 @@ function AutoUpdate(props) {
37445
37441
  });
37446
37442
  }
37447
37443
  }
37448
- React17.useEffect(() => {
37444
+ React18.useEffect(() => {
37449
37445
  let status2 = "done";
37450
- let local_version = null;
37451
37446
  let latest_version = null;
37447
+ let is_brew_bun_standalone = false;
37448
+ const local_version = "2.5.3";
37449
+ const is_output = props_ref.current.verbose || props_ref.current.force;
37452
37450
  async function auto_update() {
37453
- if (props_ref.current.verbose) {
37454
- handle_output(/* @__PURE__ */ React17.createElement(Text, {
37451
+ if (!local_version) {
37452
+ throw new Error("Auto update requires process.env.CLI_VERSION to be set");
37453
+ }
37454
+ if (is_output) {
37455
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37455
37456
  key: "init"
37456
37457
  }, "Checking for latest version..."));
37457
37458
  }
@@ -37466,27 +37467,40 @@ function AutoUpdate(props) {
37466
37467
  if (!latest_version) {
37467
37468
  throw new Error("Unable to retrieve latest version from npm");
37468
37469
  }
37469
- const script_path = await fs3.realpath(process.argv[1]);
37470
- const script_dir = path.dirname(script_path);
37471
- const package_json_path = path.join(script_dir, "..", "..", "package.json");
37472
- const package_json = await read_json(package_json_path);
37473
- if (!package_json) {
37474
- throw new Error(`Unable to read package.json [${package_json_path}]`);
37470
+ const binary_path = process.argv[1];
37471
+ if (props_ref.current.verbose) {
37472
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37473
+ dimColor: true
37474
+ }, JSON.stringify({ binary_path })));
37475
37475
  }
37476
- local_version = package_json.version;
37476
+ is_brew_bun_standalone = binary_path.startsWith("/$bunfs");
37477
37477
  if (props_ref.current.verbose) {
37478
- handle_output(/* @__PURE__ */ React17.createElement(FormatText, {
37478
+ if (is_brew_bun_standalone) {
37479
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37480
+ dimColor: true
37481
+ }, "brew install detected (compiled bun standalone)"));
37482
+ } else {
37483
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37484
+ dimColor: true
37485
+ }, "npm install detected"));
37486
+ }
37487
+ }
37488
+ if (props_ref.current.verbose) {
37489
+ handle_output(/* @__PURE__ */ React18.createElement(FormatText, {
37479
37490
  key: "versions",
37480
- wrapper: /* @__PURE__ */ React17.createElement(Text, null),
37491
+ wrapper: /* @__PURE__ */ React18.createElement(Text, null),
37481
37492
  message: "Auto update found latest version {latest_version} and current local version {local_version}",
37482
37493
  values: {
37483
- latest_version: /* @__PURE__ */ React17.createElement(Brackets, null, latest_version),
37484
- local_version: /* @__PURE__ */ React17.createElement(Brackets, null, local_version)
37494
+ latest_version: /* @__PURE__ */ React18.createElement(Brackets, null, latest_version),
37495
+ local_version: /* @__PURE__ */ React18.createElement(Brackets, null, local_version)
37485
37496
  }
37486
37497
  }));
37487
37498
  }
37488
37499
  const semver_result = semver_compare(latest_version, local_version);
37489
37500
  if (semver_result === 0) {
37501
+ if (is_output) {
37502
+ handle_output(/* @__PURE__ */ React18.createElement(Text, null, "✅ Everything up to date. ", /* @__PURE__ */ React18.createElement(Brackets, null, latest_version)));
37503
+ }
37490
37504
  return;
37491
37505
  }
37492
37506
  if (semver_result === -1) {
@@ -37497,12 +37511,12 @@ function AutoUpdate(props) {
37497
37511
  const onError = props_ref.current.onError || (() => {
37498
37512
  });
37499
37513
  auto_update().then(() => {
37500
- patch({ status: status2, local_version, latest_version });
37514
+ patch({ status: status2, local_version, latest_version, is_brew_bun_standalone });
37501
37515
  }).catch((error) => {
37502
- patch({ status: status2, error, local_version, latest_version });
37516
+ patch({ status: status2, error, local_version, latest_version, is_brew_bun_standalone });
37503
37517
  onError(error);
37504
37518
  if (props_ref.current.verbose) {
37505
- handle_output(/* @__PURE__ */ React17.createElement(Text, {
37519
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37506
37520
  key: "error",
37507
37521
  color: colors.red
37508
37522
  }, error?.message));
@@ -37515,29 +37529,48 @@ function AutoUpdate(props) {
37515
37529
  switch (state.status) {
37516
37530
  case "init":
37517
37531
  return null;
37518
- case "prompt":
37519
- return /* @__PURE__ */ React17.createElement(YesNoPrompt, {
37520
- message: /* @__PURE__ */ React17.createElement(Text, {
37532
+ case "prompt": {
37533
+ let install_command = "";
37534
+ if (state.is_brew_bun_standalone) {
37535
+ install_command = `npm install -g ${props.name}@latest`;
37536
+ } else {
37537
+ install_command = "brew upgrade magus/git-stack/git-stack";
37538
+ }
37539
+ return /* @__PURE__ */ React18.createElement(YesNoPrompt, {
37540
+ message: /* @__PURE__ */ React18.createElement(Box_default, {
37541
+ flexDirection: "column"
37542
+ }, /* @__PURE__ */ React18.createElement(Text, {
37521
37543
  color: colors.yellow
37522
- }, "New version available, would you like to update?"),
37544
+ }, /* @__PURE__ */ React18.createElement(FormatText, {
37545
+ wrapper: /* @__PURE__ */ React18.createElement(Text, null),
37546
+ message: "New version available {latest_version}, would you like to update?",
37547
+ values: {
37548
+ latest_version: /* @__PURE__ */ React18.createElement(Brackets, null, state.latest_version)
37549
+ }
37550
+ }), ","), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(Command, null, install_command), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(FormatText, {
37551
+ wrapper: /* @__PURE__ */ React18.createElement(Text, {
37552
+ color: colors.yellow
37553
+ }),
37554
+ message: "Would you like to run the above command to update?"
37555
+ })),
37523
37556
  onYes: async () => {
37524
- handle_output(/* @__PURE__ */ React17.createElement(FormatText, {
37557
+ handle_output(/* @__PURE__ */ React18.createElement(FormatText, {
37525
37558
  key: "install",
37526
- wrapper: /* @__PURE__ */ React17.createElement(Text, null),
37559
+ wrapper: /* @__PURE__ */ React18.createElement(Text, null),
37527
37560
  message: "Installing {name}@{version}...",
37528
37561
  values: {
37529
- name: /* @__PURE__ */ React17.createElement(Text, {
37562
+ name: /* @__PURE__ */ React18.createElement(Text, {
37530
37563
  color: colors.yellow
37531
37564
  }, props.name),
37532
- version: /* @__PURE__ */ React17.createElement(Text, {
37565
+ version: /* @__PURE__ */ React18.createElement(Text, {
37533
37566
  color: colors.blue
37534
37567
  }, state.latest_version)
37535
37568
  }
37536
37569
  }));
37537
37570
  patch({ status: "install" });
37538
- await cli(`npm install -g ${props.name}@latest`);
37571
+ await cli(install_command);
37539
37572
  patch({ status: "exit" });
37540
- handle_output(/* @__PURE__ */ React17.createElement(Text, {
37573
+ handle_output(/* @__PURE__ */ React18.createElement(Text, {
37541
37574
  key: "done"
37542
37575
  }, "Auto update done."));
37543
37576
  },
@@ -37545,6 +37578,7 @@ function AutoUpdate(props) {
37545
37578
  patch({ status: "done" });
37546
37579
  }
37547
37580
  });
37581
+ }
37548
37582
  case "install":
37549
37583
  return null;
37550
37584
  case "exit":
@@ -37553,15 +37587,15 @@ function AutoUpdate(props) {
37553
37587
  return props.children;
37554
37588
  }
37555
37589
  }();
37556
- return /* @__PURE__ */ React17.createElement(React17.Fragment, null, output, status);
37590
+ return /* @__PURE__ */ React18.createElement(React18.Fragment, null, output, status);
37557
37591
  }
37558
37592
 
37559
37593
  // src/app/CherryPickCheck.tsx
37560
37594
  var React20 = __toESM(require_react(), 1);
37561
- import path2 from "node:path";
37595
+ import path from "node:path";
37562
37596
 
37563
37597
  // src/app/Await.tsx
37564
- var React18 = __toESM(require_react(), 1);
37598
+ var React19 = __toESM(require_react(), 1);
37565
37599
 
37566
37600
  // src/core/cache.ts
37567
37601
  function cache3(cacheable) {
@@ -37609,8 +37643,8 @@ function invariant(condition, message) {
37609
37643
 
37610
37644
  // src/app/Await.tsx
37611
37645
  function Await(props) {
37612
- const [display_fallback, set_display_fallback] = React18.useState(false);
37613
- const cacheRef = React18.useRef(null);
37646
+ const [display_fallback, set_display_fallback] = React19.useState(false);
37647
+ const cacheRef = React19.useRef(null);
37614
37648
  if (!cacheRef.current) {
37615
37649
  cacheRef.current = cache3(props.function);
37616
37650
  }
@@ -37620,7 +37654,7 @@ function Await(props) {
37620
37654
  } else {
37621
37655
  delayFallbackMs = 1000;
37622
37656
  }
37623
- React18.useEffect(() => {
37657
+ React19.useEffect(() => {
37624
37658
  const cache4 = cacheRef.current;
37625
37659
  if (!cache4) {
37626
37660
  return;
@@ -37637,13 +37671,13 @@ function Await(props) {
37637
37671
  }, [delayFallbackMs]);
37638
37672
  invariant(cacheRef.current, "cache must exist");
37639
37673
  if ("fallback" in props) {
37640
- return /* @__PURE__ */ React18.createElement(React18.Suspense, {
37674
+ return /* @__PURE__ */ React19.createElement(React19.Suspense, {
37641
37675
  fallback: !display_fallback ? null : props.fallback
37642
- }, /* @__PURE__ */ React18.createElement(ReadCache, {
37676
+ }, /* @__PURE__ */ React19.createElement(ReadCache, {
37643
37677
  cache: cacheRef.current
37644
37678
  }, props.children));
37645
37679
  }
37646
- return /* @__PURE__ */ React18.createElement(ReadCache, {
37680
+ return /* @__PURE__ */ React19.createElement(ReadCache, {
37647
37681
  cache: cacheRef.current
37648
37682
  });
37649
37683
  }
@@ -37652,21 +37686,11 @@ function ReadCache(props) {
37652
37686
  return props.children;
37653
37687
  }
37654
37688
 
37655
- // src/app/Command.tsx
37656
- var React19 = __toESM(require_react(), 1);
37657
- function Command(props) {
37658
- const text_color = colors.orange;
37659
- return /* @__PURE__ */ React19.createElement(Text, {
37660
- bold: true,
37661
- color: text_color
37662
- }, props.children);
37663
- }
37664
-
37665
37689
  // src/core/safe_exists.ts
37666
- import fs4 from "node:fs/promises";
37690
+ import fs2 from "node:fs/promises";
37667
37691
  async function safe_exists(filepath) {
37668
37692
  try {
37669
- await fs4.access(filepath);
37693
+ await fs2.access(filepath);
37670
37694
  return true;
37671
37695
  } catch {
37672
37696
  return false;
@@ -37710,7 +37734,7 @@ function CherryPickCheck(props) {
37710
37734
  const actions2 = Store.getState().actions;
37711
37735
  try {
37712
37736
  const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
37713
- const cherry_pick_file = path2.join(git_dir, "CHERRY_PICK_HEAD");
37737
+ const cherry_pick_file = path.join(git_dir, "CHERRY_PICK_HEAD");
37714
37738
  if (await safe_exists(cherry_pick_file)) {
37715
37739
  return patch({ status: "prompt" });
37716
37740
  }
@@ -37730,8 +37754,8 @@ function CherryPickCheck(props) {
37730
37754
 
37731
37755
  // src/app/Debug.tsx
37732
37756
  var React21 = __toESM(require_react(), 1);
37733
- import fs6 from "node:fs/promises";
37734
- import path3 from "node:path";
37757
+ import fs4 from "node:fs/promises";
37758
+ import path2 from "node:path";
37735
37759
 
37736
37760
  // src/core/json.ts
37737
37761
  function serialize(obj) {
@@ -37767,11 +37791,11 @@ function deserialize(obj) {
37767
37791
  }
37768
37792
 
37769
37793
  // src/core/safe_rm.ts
37770
- import fs5 from "node:fs/promises";
37794
+ import fs3 from "node:fs/promises";
37771
37795
  async function safe_rm(filepath) {
37772
37796
  try {
37773
- await fs5.access(filepath);
37774
- await fs5.rm(filepath);
37797
+ await fs3.access(filepath);
37798
+ await fs3.rm(filepath);
37775
37799
  } catch {
37776
37800
  }
37777
37801
  }
@@ -37795,11 +37819,11 @@ function Debug() {
37795
37819
  }
37796
37820
  sync().catch(actions.error);
37797
37821
  async function sync() {
37798
- const output_file = path3.join(state.cwd, "git-stack-state.json");
37822
+ const output_file = path2.join(state.cwd, "git-stack-state.json");
37799
37823
  await safe_rm(output_file);
37800
37824
  const serialized = serialize(state);
37801
37825
  const content = pretty_json(serialized);
37802
- await fs6.writeFile(output_file, content);
37826
+ await fs4.writeFile(output_file, content);
37803
37827
  }
37804
37828
  }, [argv, state]);
37805
37829
  return null;
@@ -37819,15 +37843,15 @@ function Url(props) {
37819
37843
  }
37820
37844
 
37821
37845
  // src/core/is_command_available.ts
37822
- import fs7 from "node:fs";
37823
- import path4 from "node:path";
37846
+ import fs5 from "node:fs";
37847
+ import path3 from "node:path";
37824
37848
  function is_command_available(command) {
37825
37849
  const PATH = process.env["PATH"];
37826
37850
  invariant(PATH, "PATH env must exist");
37827
- const path_list = PATH.split(path4.delimiter);
37851
+ const path_list = PATH.split(path3.delimiter);
37828
37852
  for (const dir of path_list) {
37829
- const full_path = path4.join(dir, command);
37830
- if (fs7.existsSync(full_path)) {
37853
+ const full_path = path3.join(dir, command);
37854
+ if (fs5.existsSync(full_path)) {
37831
37855
  return true;
37832
37856
  }
37833
37857
  }
@@ -38046,16 +38070,16 @@ var RE2 = {
38046
38070
  // src/core/github.tsx
38047
38071
  var React24 = __toESM(require_react(), 1);
38048
38072
  import crypto from "node:crypto";
38049
- import fs9 from "node:fs/promises";
38050
- import path6 from "node:path";
38073
+ import fs7 from "node:fs/promises";
38074
+ import path5 from "node:path";
38051
38075
 
38052
38076
  // src/core/get_tmp_dir.ts
38053
- import fs8 from "node:fs/promises";
38077
+ import fs6 from "node:fs/promises";
38054
38078
  import os2 from "node:os";
38055
- import path5 from "node:path";
38079
+ import path4 from "node:path";
38056
38080
  async function get_tmp_dir() {
38057
- const dir = path5.join(os2.tmpdir(), "git-stack-cli");
38058
- await fs8.mkdir(dir, { recursive: true });
38081
+ const dir = path4.join(os2.tmpdir(), "git-stack-cli");
38082
+ await fs6.mkdir(dir, { recursive: true });
38059
38083
  return dir;
38060
38084
  }
38061
38085
 
@@ -38180,13 +38204,13 @@ var JSON_FIELDS = "--json id,number,state,baseRefName,headRefName,commits,title,
38180
38204
  async function gh_json(command) {
38181
38205
  let hash = crypto.createHash("md5").update(command).digest("hex");
38182
38206
  let tmp_filename = safe_filename(`gh_json-${hash}`);
38183
- const tmp_pr_json = path6.join(await get_tmp_dir(), `${tmp_filename}.json`);
38207
+ const tmp_pr_json = path5.join(await get_tmp_dir(), `${tmp_filename}.json`);
38184
38208
  const options = { ignoreExitCode: true };
38185
38209
  const cli_result = await cli(`gh ${command} > ${tmp_pr_json}`, options);
38186
38210
  if (cli_result.code !== 0) {
38187
38211
  return new Error(cli_result.output);
38188
38212
  }
38189
- const json_str = String(await fs9.readFile(tmp_pr_json));
38213
+ const json_str = String(await fs7.readFile(tmp_pr_json));
38190
38214
  try {
38191
38215
  const json = JSON.parse(json_str);
38192
38216
  return json;
@@ -38206,9 +38230,9 @@ async function write_body_file(args) {
38206
38230
  invariant(args.body, "args.body must exist");
38207
38231
  const base = args.base.replace(/^origin\//, "");
38208
38232
  let tmp_filename = safe_filename(`git-stack-body-${base}`);
38209
- const temp_path = path6.join(await get_tmp_dir(), tmp_filename);
38233
+ const temp_path = path5.join(await get_tmp_dir(), tmp_filename);
38210
38234
  await safe_rm(temp_path);
38211
- await fs9.writeFile(temp_path, args.body);
38235
+ await fs7.writeFile(temp_path, args.body);
38212
38236
  return temp_path;
38213
38237
  }
38214
38238
  function safe_filename(value) {
@@ -38368,8 +38392,8 @@ function lines(value) {
38368
38392
  var UNASSIGNED = "unassigned";
38369
38393
 
38370
38394
  // src/core/GitReviseTodo.ts
38371
- import fs10 from "node:fs/promises";
38372
- import path7 from "node:path";
38395
+ import fs8 from "node:fs/promises";
38396
+ import path6 from "node:path";
38373
38397
  function GitReviseTodo(args) {
38374
38398
  const commit_list = [];
38375
38399
  const group_list = args.commit_range.group_list;
@@ -38455,11 +38479,11 @@ echo "------ END ------"
38455
38479
  echo
38456
38480
  `;
38457
38481
  invariant(GIT_SEQUENCE_EDITOR_SCRIPT, "GIT_SEQUENCE_EDITOR_SCRIPT must exist");
38458
- const tmp_git_sequence_editor_path = path7.join(await get_tmp_dir(), "git-sequence-editor.sh");
38459
- await fs10.writeFile(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
38460
- await fs10.chmod(tmp_git_sequence_editor_path, "755");
38461
- const tmp_path_git_revise_todo = path7.join(await get_tmp_dir(), "git-revise-todo.txt");
38462
- await fs10.writeFile(tmp_path_git_revise_todo, GitReviseTodo(args));
38482
+ const tmp_git_sequence_editor_path = path6.join(await get_tmp_dir(), "git-sequence-editor.sh");
38483
+ await fs8.writeFile(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
38484
+ await fs8.chmod(tmp_git_sequence_editor_path, "755");
38485
+ const tmp_path_git_revise_todo = path6.join(await get_tmp_dir(), "git-revise-todo.txt");
38486
+ await fs8.writeFile(tmp_path_git_revise_todo, GitReviseTodo(args));
38463
38487
  const command = [
38464
38488
  `GIT_EDITOR="${tmp_git_sequence_editor_path}"`,
38465
38489
  `GIT_REVISE_TODO="${tmp_path_git_revise_todo}"`,
@@ -38910,7 +38934,7 @@ var React35 = __toESM(require_react(), 1);
38910
38934
 
38911
38935
  // src/commands/Rebase.tsx
38912
38936
  var React34 = __toESM(require_react(), 1);
38913
- import fs11 from "node:fs";
38937
+ import fs9 from "node:fs";
38914
38938
 
38915
38939
  // src/app/Status.tsx
38916
38940
  var React33 = __toESM(require_react(), 1);
@@ -39312,7 +39336,7 @@ Rebase.run = async function run5(props) {
39312
39336
  cli.sync(`git clean -df`, spawn_options);
39313
39337
  cli.sync(`git checkout ${branch_name}`, spawn_options);
39314
39338
  cli.sync(`git branch -D ${temp_branch_name}`, spawn_options);
39315
- if (fs11.existsSync(cwd2)) {
39339
+ if (fs9.existsSync(cwd2)) {
39316
39340
  process.chdir(cwd2);
39317
39341
  }
39318
39342
  cli.sync(`pwd`, spawn_options);
@@ -39342,7 +39366,7 @@ function LocalMergeRebase() {
39342
39366
 
39343
39367
  // src/app/ManualRebase.tsx
39344
39368
  var React36 = __toESM(require_react(), 1);
39345
- import fs12 from "node:fs";
39369
+ import fs10 from "node:fs";
39346
39370
  function ManualRebase() {
39347
39371
  return /* @__PURE__ */ React36.createElement(Await, {
39348
39372
  fallback: /* @__PURE__ */ React36.createElement(Text, {
@@ -39441,7 +39465,7 @@ async function run6() {
39441
39465
  cli.sync(`git clean -df`, spawn_options);
39442
39466
  cli.sync(`git checkout ${branch_name}`, spawn_options);
39443
39467
  cli.sync(`git branch -D ${temp_branch_name}`, spawn_options);
39444
- if (fs12.existsSync(cwd2)) {
39468
+ if (fs10.existsSync(cwd2)) {
39445
39469
  process.chdir(cwd2);
39446
39470
  }
39447
39471
  cli.sync(`pwd`, spawn_options);
@@ -39502,8 +39526,8 @@ function PreLocalMergeRebase() {
39502
39526
 
39503
39527
  // src/app/PreManualRebase.tsx
39504
39528
  var React39 = __toESM(require_react(), 1);
39505
- import fs13 from "node:fs/promises";
39506
- import path8 from "node:path";
39529
+ import fs11 from "node:fs/promises";
39530
+ import path7 from "node:path";
39507
39531
  function PreManualRebase() {
39508
39532
  return /* @__PURE__ */ React39.createElement(Await, {
39509
39533
  fallback: null,
@@ -39525,7 +39549,7 @@ async function run8() {
39525
39549
  for (const key of PR_TEMPLATE_KEY_LIST) {
39526
39550
  const pr_template_fn = PR_TEMPLATE[key];
39527
39551
  if (await safe_exists(pr_template_fn(repo_root))) {
39528
- pr_template_body = await fs13.readFile(pr_template_fn(repo_root), "utf-8");
39552
+ pr_template_body = await fs11.readFile(pr_template_fn(repo_root), "utf-8");
39529
39553
  actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
39530
39554
  wrapper: /* @__PURE__ */ React39.createElement(Text, {
39531
39555
  color: colors.yellow
@@ -39540,7 +39564,7 @@ async function run8() {
39540
39564
  }
39541
39565
  let pr_templates = [];
39542
39566
  if (await safe_exists(PR_TEMPLATE.TemplateDir(repo_root))) {
39543
- pr_templates = await fs13.readdir(PR_TEMPLATE.TemplateDir(repo_root));
39567
+ pr_templates = await fs11.readdir(PR_TEMPLATE.TemplateDir(repo_root));
39544
39568
  }
39545
39569
  actions.set((state2) => {
39546
39570
  state2.pr_template_body = pr_template_body;
@@ -39563,10 +39587,10 @@ async function run8() {
39563
39587
  });
39564
39588
  }
39565
39589
  var PR_TEMPLATE = Object.freeze({
39566
- Github: (root) => path8.join(root, ".github", "pull_request_template.md"),
39567
- Root: (root) => path8.join(root, "pull_request_template.md"),
39568
- Docs: (root) => path8.join(root, "docs", "pull_request_template.md"),
39569
- TemplateDir: (root) => path8.join(root, ".github", "PULL_REQUEST_TEMPLATE")
39590
+ Github: (root) => path7.join(root, ".github", "pull_request_template.md"),
39591
+ Root: (root) => path7.join(root, "pull_request_template.md"),
39592
+ Docs: (root) => path7.join(root, "docs", "pull_request_template.md"),
39593
+ TemplateDir: (root) => path7.join(root, ".github", "PULL_REQUEST_TEMPLATE")
39570
39594
  });
39571
39595
  var PR_TEMPLATE_KEY_LIST = Object.keys(PR_TEMPLATE);
39572
39596
 
@@ -40455,7 +40479,7 @@ function Providers(props) {
40455
40479
 
40456
40480
  // src/app/RebaseCheck.tsx
40457
40481
  var React48 = __toESM(require_react(), 1);
40458
- import path9 from "node:path";
40482
+ import path8 from "node:path";
40459
40483
  function reducer5(state, patch) {
40460
40484
  return { ...state, ...patch };
40461
40485
  }
@@ -40493,8 +40517,8 @@ function RebaseCheck(props) {
40493
40517
  try {
40494
40518
  const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
40495
40519
  let is_rebase = false;
40496
- is_rebase ||= await safe_exists(path9.join(git_dir, "rebase-apply"));
40497
- is_rebase ||= await safe_exists(path9.join(git_dir, "rebase-merge"));
40520
+ is_rebase ||= await safe_exists(path8.join(git_dir, "rebase-apply"));
40521
+ is_rebase ||= await safe_exists(path8.join(git_dir, "rebase-merge"));
40498
40522
  const status = is_rebase ? "prompt" : "done";
40499
40523
  patch({ status });
40500
40524
  } catch (err) {
@@ -40656,9 +40680,23 @@ async function run12(args) {
40656
40680
  actions.exit(0);
40657
40681
  }
40658
40682
 
40659
- // src/components/ErrorBoundary.tsx
40683
+ // src/commands/Update.tsx
40660
40684
  var React52 = __toESM(require_react(), 1);
40661
- class ErrorBoundary extends React52.Component {
40685
+ function Update() {
40686
+ return /* @__PURE__ */ React52.createElement(Await, {
40687
+ fallback: null,
40688
+ function: run13
40689
+ });
40690
+ }
40691
+ async function run13() {
40692
+ const state = Store.getState();
40693
+ const actions = state.actions;
40694
+ actions.exit(0);
40695
+ }
40696
+
40697
+ // src/components/ErrorBoundary.tsx
40698
+ var React53 = __toESM(require_react(), 1);
40699
+ class ErrorBoundary extends React53.Component {
40662
40700
  constructor(props) {
40663
40701
  super(props);
40664
40702
  this.state = {
@@ -40685,15 +40723,15 @@ class ErrorBoundary extends React52.Component {
40685
40723
  return this.props.children;
40686
40724
  }
40687
40725
  const message = this.state.error.message;
40688
- return /* @__PURE__ */ React52.createElement(Box_default, {
40726
+ return /* @__PURE__ */ React53.createElement(Box_default, {
40689
40727
  flexDirection: "column",
40690
40728
  gap: 0
40691
- }, /* @__PURE__ */ React52.createElement(Text, {
40729
+ }, /* @__PURE__ */ React53.createElement(Text, {
40692
40730
  color: colors.red
40693
- }, /* @__PURE__ */ React52.createElement(FormatText, {
40731
+ }, /* @__PURE__ */ React53.createElement(FormatText, {
40694
40732
  message: "\uD83D\uDEA8 Unhandled error {message}",
40695
40733
  values: {
40696
- message: /* @__PURE__ */ React52.createElement(Text, {
40734
+ message: /* @__PURE__ */ React53.createElement(Text, {
40697
40735
  color: colors.gray
40698
40736
  }, message)
40699
40737
  }
@@ -40702,20 +40740,20 @@ class ErrorBoundary extends React52.Component {
40702
40740
  _render_verbose() {
40703
40741
  const store_state = Store.getState();
40704
40742
  if (store_state.argv.verbose) {
40705
- return /* @__PURE__ */ React52.createElement(Text, {
40743
+ return /* @__PURE__ */ React53.createElement(Text, {
40706
40744
  color: colors.gray
40707
40745
  }, this.state.component_stack);
40708
40746
  }
40709
- return /* @__PURE__ */ React52.createElement(Text, {
40747
+ return /* @__PURE__ */ React53.createElement(Text, {
40710
40748
  color: colors.gray
40711
- }, /* @__PURE__ */ React52.createElement(FormatText, {
40749
+ }, /* @__PURE__ */ React53.createElement(FormatText, {
40712
40750
  message: "Try again with `--verbose` to see more information."
40713
40751
  }));
40714
40752
  }
40715
40753
  }
40716
40754
 
40717
40755
  // src/components/ExitingGate.tsx
40718
- var React53 = __toESM(require_react(), 1);
40756
+ var React54 = __toESM(require_react(), 1);
40719
40757
  function ExitingGate(props) {
40720
40758
  const exit_mode = Store.useState((state) => state.exit_mode);
40721
40759
  if (!exit_mode) {
@@ -40725,11 +40763,11 @@ function ExitingGate(props) {
40725
40763
  case "quiet":
40726
40764
  return null;
40727
40765
  case "normal":
40728
- return /* @__PURE__ */ React53.createElement(Box_default, {
40766
+ return /* @__PURE__ */ React54.createElement(Box_default, {
40729
40767
  flexDirection: "column"
40730
- }, /* @__PURE__ */ React53.createElement(Text, {
40768
+ }, /* @__PURE__ */ React54.createElement(Text, {
40731
40769
  color: colors.red
40732
- }, /* @__PURE__ */ React53.createElement(FormatText, {
40770
+ }, /* @__PURE__ */ React54.createElement(FormatText, {
40733
40771
  message: "\uD83D\uDEA8 Exiting…"
40734
40772
  })));
40735
40773
  default:
@@ -40742,32 +40780,37 @@ function App2() {
40742
40780
  const actions = Store.useActions();
40743
40781
  const ink = Store.useState((state) => state.ink);
40744
40782
  const argv = Store.useState((state) => state.argv);
40745
- if (!ink || !argv) {
40783
+ if (!ink || !argv || !argv.$0) {
40746
40784
  return null;
40747
40785
  }
40748
- return /* @__PURE__ */ React54.createElement(Providers, null, /* @__PURE__ */ React54.createElement(ErrorBoundary, null, /* @__PURE__ */ React54.createElement(Debug, null), /* @__PURE__ */ React54.createElement(Output2, null), /* @__PURE__ */ React54.createElement(ExitingGate, null, /* @__PURE__ */ React54.createElement(AutoUpdate, {
40786
+ const positional_list = new Set(argv["_"]);
40787
+ const is_update = positional_list.has("update") || positional_list.has("upgrade");
40788
+ return /* @__PURE__ */ React55.createElement(Providers, null, /* @__PURE__ */ React55.createElement(ErrorBoundary, null, /* @__PURE__ */ React55.createElement(Debug, null), /* @__PURE__ */ React55.createElement(Output2, null), /* @__PURE__ */ React55.createElement(ExitingGate, null, /* @__PURE__ */ React55.createElement(AutoUpdate, {
40749
40789
  name: "git-stack-cli",
40750
- verbose: argv.verbose || argv.update,
40751
- timeoutMs: argv.update ? 30 * 1000 : 2 * 1000,
40790
+ verbose: argv.verbose,
40791
+ force: is_update,
40792
+ timeoutMs: is_update ? 30 * 1000 : 2 * 1000,
40752
40793
  onOutput: actions.output,
40753
40794
  onDone: () => {
40754
- if (argv.update) {
40795
+ if (is_update) {
40755
40796
  actions.exit(0);
40756
40797
  }
40757
40798
  }
40758
- }, /* @__PURE__ */ React54.createElement(VerboseDebugInfo, null, /* @__PURE__ */ React54.createElement(RebaseCheck, null, /* @__PURE__ */ React54.createElement(CherryPickCheck, null, /* @__PURE__ */ React54.createElement(MaybeMain, null))))), /* @__PURE__ */ React54.createElement(HandleCtrlCSigint, null))));
40799
+ }, /* @__PURE__ */ React55.createElement(VerboseDebugInfo, null, /* @__PURE__ */ React55.createElement(RebaseCheck, null, /* @__PURE__ */ React55.createElement(CherryPickCheck, null, /* @__PURE__ */ React55.createElement(MaybeMain, null))))), /* @__PURE__ */ React55.createElement(HandleCtrlCSigint, null))));
40759
40800
  }
40760
40801
  function MaybeMain() {
40761
40802
  const argv = Store.useState((state) => state.argv);
40762
40803
  const positional_list = new Set(argv["_"]);
40763
40804
  if (positional_list.has("fixup")) {
40764
- return /* @__PURE__ */ React54.createElement(Fixup, null);
40805
+ return /* @__PURE__ */ React55.createElement(Fixup, null);
40765
40806
  } else if (positional_list.has("log")) {
40766
- return /* @__PURE__ */ React54.createElement(Log, null);
40807
+ return /* @__PURE__ */ React55.createElement(Log, null);
40808
+ } else if (positional_list.has("update")) {
40809
+ return /* @__PURE__ */ React55.createElement(Update, null);
40767
40810
  } else if (positional_list.has("rebase")) {
40768
- return /* @__PURE__ */ React54.createElement(GatherMetadata, null, /* @__PURE__ */ React54.createElement(LocalCommitStatus, null, /* @__PURE__ */ React54.createElement(Rebase, null)));
40811
+ 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)))));
40769
40812
  }
40770
- return /* @__PURE__ */ React54.createElement(React54.Fragment, null, !argv.verbose ? null : /* @__PURE__ */ React54.createElement(GithubApiError, null), /* @__PURE__ */ React54.createElement(DependencyCheck, null, /* @__PURE__ */ React54.createElement(GatherMetadata, null, /* @__PURE__ */ React54.createElement(DirtyCheck, null, /* @__PURE__ */ React54.createElement(LocalCommitStatus, null, /* @__PURE__ */ React54.createElement(DetectInitialPR, null, /* @__PURE__ */ React54.createElement(Main, null)))))));
40813
+ 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)))))));
40771
40814
  }
40772
40815
 
40773
40816
  // node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
@@ -42047,9 +42090,9 @@ var parser = new YargsParser({
42047
42090
  format,
42048
42091
  normalize,
42049
42092
  resolve: resolve2,
42050
- require: (path10) => {
42093
+ require: (path9) => {
42051
42094
  if (true) {
42052
- return __require(path10);
42095
+ return __require(path9);
42053
42096
  } else
42054
42097
  ;
42055
42098
  }
@@ -45632,7 +45675,7 @@ var yargs_default = Yargs;
45632
45675
 
45633
45676
  // src/command.ts
45634
45677
  async function command2() {
45635
- 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.5.1").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45678
+ 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.5.3").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45636
45679
  }
45637
45680
  var GlobalOptions = {
45638
45681
  verbose: {
@@ -45670,12 +45713,6 @@ var DefaultOptions = {
45670
45713
  ].join(`
45671
45714
  `)
45672
45715
  },
45673
- update: {
45674
- type: "boolean",
45675
- alias: ["u", "upgrade"],
45676
- default: false,
45677
- description: "Check and install the latest version"
45678
- },
45679
45716
  branch: {
45680
45717
  type: "string",
45681
45718
  alias: ["b"],
@@ -45759,8 +45796,8 @@ var FixupOptions = {
45759
45796
  process.exit(238);
45760
45797
  });
45761
45798
  const tmp_dir = await get_tmp_dir();
45762
- await fs14.rm(tmp_dir, { recursive: true });
45763
- const ink = render_default(/* @__PURE__ */ React55.createElement(App2, null), {
45799
+ await fs12.rm(tmp_dir, { recursive: true });
45800
+ const ink = render_default(/* @__PURE__ */ React56.createElement(App2, null), {
45764
45801
  exitOnCtrlC: false
45765
45802
  });
45766
45803
  Store.setState((state) => {
@@ -45772,7 +45809,7 @@ var FixupOptions = {
45772
45809
  const actions = Store.getState().actions;
45773
45810
  actions.debug(pretty_json(argv));
45774
45811
  const PATH = process.env["PATH"];
45775
- const PATH_LIST = pretty_json(PATH.split(path10.delimiter));
45812
+ const PATH_LIST = pretty_json(PATH.split(path9.delimiter));
45776
45813
  actions.debug(`process.env.PATH ${PATH_LIST}`);
45777
45814
  await ink.waitUntilExit();
45778
45815
  } catch (err) {