git-stack-cli 2.5.1 → 2.5.2
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 +203 -188
- package/package.json +1 -1
- package/src/app/App.tsx +13 -9
- package/src/app/AutoUpdate.tsx +49 -23
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
|
|
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:
|
|
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(
|
|
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
|
|
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__ =
|
|
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
|
|
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
|
|
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)(
|
|
25276
|
-
return
|
|
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
|
|
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 =
|
|
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
|
|
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 ||
|
|
25358
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
-
}(
|
|
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
|
|
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
|
|
25543
|
+
return React12.createElement(Text2, null, formattedRelativeTime);
|
|
25544
25544
|
}
|
|
25545
|
-
return
|
|
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 =
|
|
25551
|
-
var _c =
|
|
25552
|
-
var _d =
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 ?
|
|
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
|
|
25653
|
+
return React12.createElement(Component, null, React12.Children.toArray(nodes));
|
|
25654
25654
|
}
|
|
25655
|
-
return
|
|
25655
|
+
return React12.createElement(React12.Fragment, null, nodes);
|
|
25656
25656
|
}
|
|
25657
25657
|
FormattedMessage.displayName = "FormattedMessage";
|
|
25658
|
-
var MemoizedFormattedMessage =
|
|
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
|
|
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 ||
|
|
25678
|
-
return
|
|
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;
|
|
@@ -28099,8 +28099,8 @@ var require_last = __commonJS((exports, module) => {
|
|
|
28099
28099
|
|
|
28100
28100
|
// src/index.tsx
|
|
28101
28101
|
var React55 = __toESM(require_react(), 1);
|
|
28102
|
-
import
|
|
28103
|
-
import
|
|
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";
|
|
@@ -31938,9 +31938,7 @@ var import_react21 = __toESM(require_react(), 1);
|
|
|
31938
31938
|
var React54 = __toESM(require_react(), 1);
|
|
31939
31939
|
|
|
31940
31940
|
// src/app/AutoUpdate.tsx
|
|
31941
|
-
var
|
|
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/
|
|
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__ */
|
|
31978
|
-
return /* @__PURE__ */
|
|
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
|
|
31991
|
+
return React12.cloneElement(wrapper, {}, chunks);
|
|
31984
31992
|
});
|
|
31985
31993
|
}
|
|
31986
31994
|
|
|
31987
31995
|
// src/app/YesNoPrompt.tsx
|
|
31988
|
-
var
|
|
31996
|
+
var React14 = __toESM(require_react(), 1);
|
|
31989
31997
|
|
|
31990
31998
|
// src/app/Parens.tsx
|
|
31991
|
-
var
|
|
31999
|
+
var React13 = __toESM(require_react(), 1);
|
|
31992
32000
|
function Parens(props) {
|
|
31993
32001
|
const color = colors.blue;
|
|
31994
|
-
return /* @__PURE__ */
|
|
32002
|
+
return /* @__PURE__ */ React13.createElement(Text, null, /* @__PURE__ */ React13.createElement(Text, {
|
|
31995
32003
|
color
|
|
31996
|
-
}, "("), props.children, /* @__PURE__ */
|
|
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] =
|
|
32004
|
-
const answered_ref =
|
|
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__ */
|
|
32034
|
+
const y3 = /* @__PURE__ */ React14.createElement(Text, {
|
|
32027
32035
|
bold: true,
|
|
32028
32036
|
color: colors.green
|
|
32029
32037
|
}, "Y");
|
|
32030
|
-
const n3 = /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
32053
|
+
return /* @__PURE__ */ React14.createElement(Box_default, {
|
|
32046
32054
|
flexDirection: "column"
|
|
32047
|
-
}, /* @__PURE__ */
|
|
32055
|
+
}, /* @__PURE__ */ React14.createElement(Box_default, {
|
|
32048
32056
|
alignItems: "flex-end"
|
|
32049
|
-
}, typeof props.message === "object" ? props.message : /* @__PURE__ */
|
|
32057
|
+
}, typeof props.message === "object" ? props.message : /* @__PURE__ */ React14.createElement(Text, {
|
|
32050
32058
|
color: colors.yellow
|
|
32051
|
-
}, props.message), /* @__PURE__ */
|
|
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
|
|
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
|
|
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
|
-
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
37105
|
+
node = /* @__PURE__ */ React17.createElement(Text, {
|
|
37098
37106
|
color: colors.red
|
|
37099
37107
|
}, error);
|
|
37100
37108
|
} else if (error instanceof Error) {
|
|
37101
|
-
node = /* @__PURE__ */
|
|
37109
|
+
node = /* @__PURE__ */ React17.createElement(Box_default, {
|
|
37102
37110
|
flexDirection: "column"
|
|
37103
|
-
}, /* @__PURE__ */
|
|
37111
|
+
}, /* @__PURE__ */ React17.createElement(Text, {
|
|
37104
37112
|
color: colors.red
|
|
37105
37113
|
}, error.stack));
|
|
37106
37114
|
} else {
|
|
37107
|
-
node = /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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 =
|
|
37425
|
+
const props_ref = React18.useRef(props);
|
|
37431
37426
|
props_ref.current = props;
|
|
37432
|
-
const [output, set_output] =
|
|
37433
|
-
const [state, patch] =
|
|
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,17 @@ function AutoUpdate(props) {
|
|
|
37445
37441
|
});
|
|
37446
37442
|
}
|
|
37447
37443
|
}
|
|
37448
|
-
|
|
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.2";
|
|
37452
37449
|
async function auto_update() {
|
|
37450
|
+
if (!local_version) {
|
|
37451
|
+
throw new Error("Auto update requires process.env.CLI_VERSION to be set");
|
|
37452
|
+
}
|
|
37453
37453
|
if (props_ref.current.verbose) {
|
|
37454
|
-
handle_output(/* @__PURE__ */
|
|
37454
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37455
37455
|
key: "init"
|
|
37456
37456
|
}, "Checking for latest version..."));
|
|
37457
37457
|
}
|
|
@@ -37466,26 +37466,37 @@ function AutoUpdate(props) {
|
|
|
37466
37466
|
if (!latest_version) {
|
|
37467
37467
|
throw new Error("Unable to retrieve latest version from npm");
|
|
37468
37468
|
}
|
|
37469
|
-
const
|
|
37470
|
-
|
|
37471
|
-
|
|
37472
|
-
|
|
37473
|
-
|
|
37474
|
-
|
|
37469
|
+
const binary_path = process.argv[1];
|
|
37470
|
+
if (props_ref.current.verbose) {
|
|
37471
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37472
|
+
dimColor: true
|
|
37473
|
+
}, JSON.stringify({ binary_path })));
|
|
37474
|
+
}
|
|
37475
|
+
is_brew_bun_standalone = binary_path.startsWith("/$bunfs");
|
|
37476
|
+
if (props_ref.current.verbose) {
|
|
37477
|
+
if (is_brew_bun_standalone) {
|
|
37478
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37479
|
+
dimColor: true
|
|
37480
|
+
}, "brew install detected (compiled bun standalone)"));
|
|
37481
|
+
} else {
|
|
37482
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37483
|
+
dimColor: true
|
|
37484
|
+
}, "npm install detected"));
|
|
37485
|
+
}
|
|
37475
37486
|
}
|
|
37476
|
-
local_version = package_json.version;
|
|
37477
37487
|
if (props_ref.current.verbose) {
|
|
37478
|
-
handle_output(/* @__PURE__ */
|
|
37488
|
+
handle_output(/* @__PURE__ */ React18.createElement(FormatText, {
|
|
37479
37489
|
key: "versions",
|
|
37480
|
-
wrapper: /* @__PURE__ */
|
|
37490
|
+
wrapper: /* @__PURE__ */ React18.createElement(Text, null),
|
|
37481
37491
|
message: "Auto update found latest version {latest_version} and current local version {local_version}",
|
|
37482
37492
|
values: {
|
|
37483
|
-
latest_version: /* @__PURE__ */
|
|
37484
|
-
local_version: /* @__PURE__ */
|
|
37493
|
+
latest_version: /* @__PURE__ */ React18.createElement(Brackets, null, latest_version),
|
|
37494
|
+
local_version: /* @__PURE__ */ React18.createElement(Brackets, null, local_version)
|
|
37485
37495
|
}
|
|
37486
37496
|
}));
|
|
37487
37497
|
}
|
|
37488
37498
|
const semver_result = semver_compare(latest_version, local_version);
|
|
37499
|
+
status2 = "prompt";
|
|
37489
37500
|
if (semver_result === 0) {
|
|
37490
37501
|
return;
|
|
37491
37502
|
}
|
|
@@ -37497,12 +37508,12 @@ function AutoUpdate(props) {
|
|
|
37497
37508
|
const onError = props_ref.current.onError || (() => {
|
|
37498
37509
|
});
|
|
37499
37510
|
auto_update().then(() => {
|
|
37500
|
-
patch({ status: status2, local_version, latest_version });
|
|
37511
|
+
patch({ status: status2, local_version, latest_version, is_brew_bun_standalone });
|
|
37501
37512
|
}).catch((error) => {
|
|
37502
|
-
patch({ status: status2, error, local_version, latest_version });
|
|
37513
|
+
patch({ status: status2, error, local_version, latest_version, is_brew_bun_standalone });
|
|
37503
37514
|
onError(error);
|
|
37504
37515
|
if (props_ref.current.verbose) {
|
|
37505
|
-
handle_output(/* @__PURE__ */
|
|
37516
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37506
37517
|
key: "error",
|
|
37507
37518
|
color: colors.red
|
|
37508
37519
|
}, error?.message));
|
|
@@ -37515,29 +37526,42 @@ function AutoUpdate(props) {
|
|
|
37515
37526
|
switch (state.status) {
|
|
37516
37527
|
case "init":
|
|
37517
37528
|
return null;
|
|
37518
|
-
case "prompt":
|
|
37519
|
-
|
|
37520
|
-
|
|
37529
|
+
case "prompt": {
|
|
37530
|
+
let install_command = "";
|
|
37531
|
+
if (state.is_brew_bun_standalone) {
|
|
37532
|
+
install_command = `npm install -g ${props.name}@latest`;
|
|
37533
|
+
} else {
|
|
37534
|
+
install_command = `HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade magus/git-stack/git-stack`;
|
|
37535
|
+
}
|
|
37536
|
+
return /* @__PURE__ */ React18.createElement(YesNoPrompt, {
|
|
37537
|
+
message: /* @__PURE__ */ React18.createElement(Box_default, {
|
|
37538
|
+
flexDirection: "column"
|
|
37539
|
+
}, /* @__PURE__ */ React18.createElement(Text, {
|
|
37521
37540
|
color: colors.yellow
|
|
37522
|
-
}, "New version available, would you like to update?"),
|
|
37541
|
+
}, "New version available, would you like to update?"), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(Command, null, install_command), /* @__PURE__ */ React18.createElement(Text, null, " "), /* @__PURE__ */ React18.createElement(FormatText, {
|
|
37542
|
+
wrapper: /* @__PURE__ */ React18.createElement(Text, {
|
|
37543
|
+
color: colors.yellow
|
|
37544
|
+
}),
|
|
37545
|
+
message: "Would you like to run the above command to update?"
|
|
37546
|
+
})),
|
|
37523
37547
|
onYes: async () => {
|
|
37524
|
-
handle_output(/* @__PURE__ */
|
|
37548
|
+
handle_output(/* @__PURE__ */ React18.createElement(FormatText, {
|
|
37525
37549
|
key: "install",
|
|
37526
|
-
wrapper: /* @__PURE__ */
|
|
37550
|
+
wrapper: /* @__PURE__ */ React18.createElement(Text, null),
|
|
37527
37551
|
message: "Installing {name}@{version}...",
|
|
37528
37552
|
values: {
|
|
37529
|
-
name: /* @__PURE__ */
|
|
37553
|
+
name: /* @__PURE__ */ React18.createElement(Text, {
|
|
37530
37554
|
color: colors.yellow
|
|
37531
37555
|
}, props.name),
|
|
37532
|
-
version: /* @__PURE__ */
|
|
37556
|
+
version: /* @__PURE__ */ React18.createElement(Text, {
|
|
37533
37557
|
color: colors.blue
|
|
37534
37558
|
}, state.latest_version)
|
|
37535
37559
|
}
|
|
37536
37560
|
}));
|
|
37537
37561
|
patch({ status: "install" });
|
|
37538
|
-
await cli(
|
|
37562
|
+
await cli(install_command);
|
|
37539
37563
|
patch({ status: "exit" });
|
|
37540
|
-
handle_output(/* @__PURE__ */
|
|
37564
|
+
handle_output(/* @__PURE__ */ React18.createElement(Text, {
|
|
37541
37565
|
key: "done"
|
|
37542
37566
|
}, "Auto update done."));
|
|
37543
37567
|
},
|
|
@@ -37545,6 +37569,7 @@ function AutoUpdate(props) {
|
|
|
37545
37569
|
patch({ status: "done" });
|
|
37546
37570
|
}
|
|
37547
37571
|
});
|
|
37572
|
+
}
|
|
37548
37573
|
case "install":
|
|
37549
37574
|
return null;
|
|
37550
37575
|
case "exit":
|
|
@@ -37553,15 +37578,15 @@ function AutoUpdate(props) {
|
|
|
37553
37578
|
return props.children;
|
|
37554
37579
|
}
|
|
37555
37580
|
}();
|
|
37556
|
-
return /* @__PURE__ */
|
|
37581
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, output, status);
|
|
37557
37582
|
}
|
|
37558
37583
|
|
|
37559
37584
|
// src/app/CherryPickCheck.tsx
|
|
37560
37585
|
var React20 = __toESM(require_react(), 1);
|
|
37561
|
-
import
|
|
37586
|
+
import path from "node:path";
|
|
37562
37587
|
|
|
37563
37588
|
// src/app/Await.tsx
|
|
37564
|
-
var
|
|
37589
|
+
var React19 = __toESM(require_react(), 1);
|
|
37565
37590
|
|
|
37566
37591
|
// src/core/cache.ts
|
|
37567
37592
|
function cache3(cacheable) {
|
|
@@ -37609,8 +37634,8 @@ function invariant(condition, message) {
|
|
|
37609
37634
|
|
|
37610
37635
|
// src/app/Await.tsx
|
|
37611
37636
|
function Await(props) {
|
|
37612
|
-
const [display_fallback, set_display_fallback] =
|
|
37613
|
-
const cacheRef =
|
|
37637
|
+
const [display_fallback, set_display_fallback] = React19.useState(false);
|
|
37638
|
+
const cacheRef = React19.useRef(null);
|
|
37614
37639
|
if (!cacheRef.current) {
|
|
37615
37640
|
cacheRef.current = cache3(props.function);
|
|
37616
37641
|
}
|
|
@@ -37620,7 +37645,7 @@ function Await(props) {
|
|
|
37620
37645
|
} else {
|
|
37621
37646
|
delayFallbackMs = 1000;
|
|
37622
37647
|
}
|
|
37623
|
-
|
|
37648
|
+
React19.useEffect(() => {
|
|
37624
37649
|
const cache4 = cacheRef.current;
|
|
37625
37650
|
if (!cache4) {
|
|
37626
37651
|
return;
|
|
@@ -37637,13 +37662,13 @@ function Await(props) {
|
|
|
37637
37662
|
}, [delayFallbackMs]);
|
|
37638
37663
|
invariant(cacheRef.current, "cache must exist");
|
|
37639
37664
|
if ("fallback" in props) {
|
|
37640
|
-
return /* @__PURE__ */
|
|
37665
|
+
return /* @__PURE__ */ React19.createElement(React19.Suspense, {
|
|
37641
37666
|
fallback: !display_fallback ? null : props.fallback
|
|
37642
|
-
}, /* @__PURE__ */
|
|
37667
|
+
}, /* @__PURE__ */ React19.createElement(ReadCache, {
|
|
37643
37668
|
cache: cacheRef.current
|
|
37644
37669
|
}, props.children));
|
|
37645
37670
|
}
|
|
37646
|
-
return /* @__PURE__ */
|
|
37671
|
+
return /* @__PURE__ */ React19.createElement(ReadCache, {
|
|
37647
37672
|
cache: cacheRef.current
|
|
37648
37673
|
});
|
|
37649
37674
|
}
|
|
@@ -37652,21 +37677,11 @@ function ReadCache(props) {
|
|
|
37652
37677
|
return props.children;
|
|
37653
37678
|
}
|
|
37654
37679
|
|
|
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
37680
|
// src/core/safe_exists.ts
|
|
37666
|
-
import
|
|
37681
|
+
import fs2 from "node:fs/promises";
|
|
37667
37682
|
async function safe_exists(filepath) {
|
|
37668
37683
|
try {
|
|
37669
|
-
await
|
|
37684
|
+
await fs2.access(filepath);
|
|
37670
37685
|
return true;
|
|
37671
37686
|
} catch {
|
|
37672
37687
|
return false;
|
|
@@ -37710,7 +37725,7 @@ function CherryPickCheck(props) {
|
|
|
37710
37725
|
const actions2 = Store.getState().actions;
|
|
37711
37726
|
try {
|
|
37712
37727
|
const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
|
|
37713
|
-
const cherry_pick_file =
|
|
37728
|
+
const cherry_pick_file = path.join(git_dir, "CHERRY_PICK_HEAD");
|
|
37714
37729
|
if (await safe_exists(cherry_pick_file)) {
|
|
37715
37730
|
return patch({ status: "prompt" });
|
|
37716
37731
|
}
|
|
@@ -37730,8 +37745,8 @@ function CherryPickCheck(props) {
|
|
|
37730
37745
|
|
|
37731
37746
|
// src/app/Debug.tsx
|
|
37732
37747
|
var React21 = __toESM(require_react(), 1);
|
|
37733
|
-
import
|
|
37734
|
-
import
|
|
37748
|
+
import fs4 from "node:fs/promises";
|
|
37749
|
+
import path2 from "node:path";
|
|
37735
37750
|
|
|
37736
37751
|
// src/core/json.ts
|
|
37737
37752
|
function serialize(obj) {
|
|
@@ -37767,11 +37782,11 @@ function deserialize(obj) {
|
|
|
37767
37782
|
}
|
|
37768
37783
|
|
|
37769
37784
|
// src/core/safe_rm.ts
|
|
37770
|
-
import
|
|
37785
|
+
import fs3 from "node:fs/promises";
|
|
37771
37786
|
async function safe_rm(filepath) {
|
|
37772
37787
|
try {
|
|
37773
|
-
await
|
|
37774
|
-
await
|
|
37788
|
+
await fs3.access(filepath);
|
|
37789
|
+
await fs3.rm(filepath);
|
|
37775
37790
|
} catch {
|
|
37776
37791
|
}
|
|
37777
37792
|
}
|
|
@@ -37795,11 +37810,11 @@ function Debug() {
|
|
|
37795
37810
|
}
|
|
37796
37811
|
sync().catch(actions.error);
|
|
37797
37812
|
async function sync() {
|
|
37798
|
-
const output_file =
|
|
37813
|
+
const output_file = path2.join(state.cwd, "git-stack-state.json");
|
|
37799
37814
|
await safe_rm(output_file);
|
|
37800
37815
|
const serialized = serialize(state);
|
|
37801
37816
|
const content = pretty_json(serialized);
|
|
37802
|
-
await
|
|
37817
|
+
await fs4.writeFile(output_file, content);
|
|
37803
37818
|
}
|
|
37804
37819
|
}, [argv, state]);
|
|
37805
37820
|
return null;
|
|
@@ -37819,15 +37834,15 @@ function Url(props) {
|
|
|
37819
37834
|
}
|
|
37820
37835
|
|
|
37821
37836
|
// src/core/is_command_available.ts
|
|
37822
|
-
import
|
|
37823
|
-
import
|
|
37837
|
+
import fs5 from "node:fs";
|
|
37838
|
+
import path3 from "node:path";
|
|
37824
37839
|
function is_command_available(command) {
|
|
37825
37840
|
const PATH = process.env["PATH"];
|
|
37826
37841
|
invariant(PATH, "PATH env must exist");
|
|
37827
|
-
const path_list = PATH.split(
|
|
37842
|
+
const path_list = PATH.split(path3.delimiter);
|
|
37828
37843
|
for (const dir of path_list) {
|
|
37829
|
-
const full_path =
|
|
37830
|
-
if (
|
|
37844
|
+
const full_path = path3.join(dir, command);
|
|
37845
|
+
if (fs5.existsSync(full_path)) {
|
|
37831
37846
|
return true;
|
|
37832
37847
|
}
|
|
37833
37848
|
}
|
|
@@ -38046,16 +38061,16 @@ var RE2 = {
|
|
|
38046
38061
|
// src/core/github.tsx
|
|
38047
38062
|
var React24 = __toESM(require_react(), 1);
|
|
38048
38063
|
import crypto from "node:crypto";
|
|
38049
|
-
import
|
|
38050
|
-
import
|
|
38064
|
+
import fs7 from "node:fs/promises";
|
|
38065
|
+
import path5 from "node:path";
|
|
38051
38066
|
|
|
38052
38067
|
// src/core/get_tmp_dir.ts
|
|
38053
|
-
import
|
|
38068
|
+
import fs6 from "node:fs/promises";
|
|
38054
38069
|
import os2 from "node:os";
|
|
38055
|
-
import
|
|
38070
|
+
import path4 from "node:path";
|
|
38056
38071
|
async function get_tmp_dir() {
|
|
38057
|
-
const dir =
|
|
38058
|
-
await
|
|
38072
|
+
const dir = path4.join(os2.tmpdir(), "git-stack-cli");
|
|
38073
|
+
await fs6.mkdir(dir, { recursive: true });
|
|
38059
38074
|
return dir;
|
|
38060
38075
|
}
|
|
38061
38076
|
|
|
@@ -38180,13 +38195,13 @@ var JSON_FIELDS = "--json id,number,state,baseRefName,headRefName,commits,title,
|
|
|
38180
38195
|
async function gh_json(command) {
|
|
38181
38196
|
let hash = crypto.createHash("md5").update(command).digest("hex");
|
|
38182
38197
|
let tmp_filename = safe_filename(`gh_json-${hash}`);
|
|
38183
|
-
const tmp_pr_json =
|
|
38198
|
+
const tmp_pr_json = path5.join(await get_tmp_dir(), `${tmp_filename}.json`);
|
|
38184
38199
|
const options = { ignoreExitCode: true };
|
|
38185
38200
|
const cli_result = await cli(`gh ${command} > ${tmp_pr_json}`, options);
|
|
38186
38201
|
if (cli_result.code !== 0) {
|
|
38187
38202
|
return new Error(cli_result.output);
|
|
38188
38203
|
}
|
|
38189
|
-
const json_str = String(await
|
|
38204
|
+
const json_str = String(await fs7.readFile(tmp_pr_json));
|
|
38190
38205
|
try {
|
|
38191
38206
|
const json = JSON.parse(json_str);
|
|
38192
38207
|
return json;
|
|
@@ -38206,9 +38221,9 @@ async function write_body_file(args) {
|
|
|
38206
38221
|
invariant(args.body, "args.body must exist");
|
|
38207
38222
|
const base = args.base.replace(/^origin\//, "");
|
|
38208
38223
|
let tmp_filename = safe_filename(`git-stack-body-${base}`);
|
|
38209
|
-
const temp_path =
|
|
38224
|
+
const temp_path = path5.join(await get_tmp_dir(), tmp_filename);
|
|
38210
38225
|
await safe_rm(temp_path);
|
|
38211
|
-
await
|
|
38226
|
+
await fs7.writeFile(temp_path, args.body);
|
|
38212
38227
|
return temp_path;
|
|
38213
38228
|
}
|
|
38214
38229
|
function safe_filename(value) {
|
|
@@ -38368,8 +38383,8 @@ function lines(value) {
|
|
|
38368
38383
|
var UNASSIGNED = "unassigned";
|
|
38369
38384
|
|
|
38370
38385
|
// src/core/GitReviseTodo.ts
|
|
38371
|
-
import
|
|
38372
|
-
import
|
|
38386
|
+
import fs8 from "node:fs/promises";
|
|
38387
|
+
import path6 from "node:path";
|
|
38373
38388
|
function GitReviseTodo(args) {
|
|
38374
38389
|
const commit_list = [];
|
|
38375
38390
|
const group_list = args.commit_range.group_list;
|
|
@@ -38455,11 +38470,11 @@ echo "------ END ------"
|
|
|
38455
38470
|
echo
|
|
38456
38471
|
`;
|
|
38457
38472
|
invariant(GIT_SEQUENCE_EDITOR_SCRIPT, "GIT_SEQUENCE_EDITOR_SCRIPT must exist");
|
|
38458
|
-
const tmp_git_sequence_editor_path =
|
|
38459
|
-
await
|
|
38460
|
-
await
|
|
38461
|
-
const tmp_path_git_revise_todo =
|
|
38462
|
-
await
|
|
38473
|
+
const tmp_git_sequence_editor_path = path6.join(await get_tmp_dir(), "git-sequence-editor.sh");
|
|
38474
|
+
await fs8.writeFile(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
|
|
38475
|
+
await fs8.chmod(tmp_git_sequence_editor_path, "755");
|
|
38476
|
+
const tmp_path_git_revise_todo = path6.join(await get_tmp_dir(), "git-revise-todo.txt");
|
|
38477
|
+
await fs8.writeFile(tmp_path_git_revise_todo, GitReviseTodo(args));
|
|
38463
38478
|
const command = [
|
|
38464
38479
|
`GIT_EDITOR="${tmp_git_sequence_editor_path}"`,
|
|
38465
38480
|
`GIT_REVISE_TODO="${tmp_path_git_revise_todo}"`,
|
|
@@ -38910,7 +38925,7 @@ var React35 = __toESM(require_react(), 1);
|
|
|
38910
38925
|
|
|
38911
38926
|
// src/commands/Rebase.tsx
|
|
38912
38927
|
var React34 = __toESM(require_react(), 1);
|
|
38913
|
-
import
|
|
38928
|
+
import fs9 from "node:fs";
|
|
38914
38929
|
|
|
38915
38930
|
// src/app/Status.tsx
|
|
38916
38931
|
var React33 = __toESM(require_react(), 1);
|
|
@@ -39312,7 +39327,7 @@ Rebase.run = async function run5(props) {
|
|
|
39312
39327
|
cli.sync(`git clean -df`, spawn_options);
|
|
39313
39328
|
cli.sync(`git checkout ${branch_name}`, spawn_options);
|
|
39314
39329
|
cli.sync(`git branch -D ${temp_branch_name}`, spawn_options);
|
|
39315
|
-
if (
|
|
39330
|
+
if (fs9.existsSync(cwd2)) {
|
|
39316
39331
|
process.chdir(cwd2);
|
|
39317
39332
|
}
|
|
39318
39333
|
cli.sync(`pwd`, spawn_options);
|
|
@@ -39342,7 +39357,7 @@ function LocalMergeRebase() {
|
|
|
39342
39357
|
|
|
39343
39358
|
// src/app/ManualRebase.tsx
|
|
39344
39359
|
var React36 = __toESM(require_react(), 1);
|
|
39345
|
-
import
|
|
39360
|
+
import fs10 from "node:fs";
|
|
39346
39361
|
function ManualRebase() {
|
|
39347
39362
|
return /* @__PURE__ */ React36.createElement(Await, {
|
|
39348
39363
|
fallback: /* @__PURE__ */ React36.createElement(Text, {
|
|
@@ -39441,7 +39456,7 @@ async function run6() {
|
|
|
39441
39456
|
cli.sync(`git clean -df`, spawn_options);
|
|
39442
39457
|
cli.sync(`git checkout ${branch_name}`, spawn_options);
|
|
39443
39458
|
cli.sync(`git branch -D ${temp_branch_name}`, spawn_options);
|
|
39444
|
-
if (
|
|
39459
|
+
if (fs10.existsSync(cwd2)) {
|
|
39445
39460
|
process.chdir(cwd2);
|
|
39446
39461
|
}
|
|
39447
39462
|
cli.sync(`pwd`, spawn_options);
|
|
@@ -39502,8 +39517,8 @@ function PreLocalMergeRebase() {
|
|
|
39502
39517
|
|
|
39503
39518
|
// src/app/PreManualRebase.tsx
|
|
39504
39519
|
var React39 = __toESM(require_react(), 1);
|
|
39505
|
-
import
|
|
39506
|
-
import
|
|
39520
|
+
import fs11 from "node:fs/promises";
|
|
39521
|
+
import path7 from "node:path";
|
|
39507
39522
|
function PreManualRebase() {
|
|
39508
39523
|
return /* @__PURE__ */ React39.createElement(Await, {
|
|
39509
39524
|
fallback: null,
|
|
@@ -39525,7 +39540,7 @@ async function run8() {
|
|
|
39525
39540
|
for (const key of PR_TEMPLATE_KEY_LIST) {
|
|
39526
39541
|
const pr_template_fn = PR_TEMPLATE[key];
|
|
39527
39542
|
if (await safe_exists(pr_template_fn(repo_root))) {
|
|
39528
|
-
pr_template_body = await
|
|
39543
|
+
pr_template_body = await fs11.readFile(pr_template_fn(repo_root), "utf-8");
|
|
39529
39544
|
actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
|
|
39530
39545
|
wrapper: /* @__PURE__ */ React39.createElement(Text, {
|
|
39531
39546
|
color: colors.yellow
|
|
@@ -39540,7 +39555,7 @@ async function run8() {
|
|
|
39540
39555
|
}
|
|
39541
39556
|
let pr_templates = [];
|
|
39542
39557
|
if (await safe_exists(PR_TEMPLATE.TemplateDir(repo_root))) {
|
|
39543
|
-
pr_templates = await
|
|
39558
|
+
pr_templates = await fs11.readdir(PR_TEMPLATE.TemplateDir(repo_root));
|
|
39544
39559
|
}
|
|
39545
39560
|
actions.set((state2) => {
|
|
39546
39561
|
state2.pr_template_body = pr_template_body;
|
|
@@ -39563,10 +39578,10 @@ async function run8() {
|
|
|
39563
39578
|
});
|
|
39564
39579
|
}
|
|
39565
39580
|
var PR_TEMPLATE = Object.freeze({
|
|
39566
|
-
Github: (root) =>
|
|
39567
|
-
Root: (root) =>
|
|
39568
|
-
Docs: (root) =>
|
|
39569
|
-
TemplateDir: (root) =>
|
|
39581
|
+
Github: (root) => path7.join(root, ".github", "pull_request_template.md"),
|
|
39582
|
+
Root: (root) => path7.join(root, "pull_request_template.md"),
|
|
39583
|
+
Docs: (root) => path7.join(root, "docs", "pull_request_template.md"),
|
|
39584
|
+
TemplateDir: (root) => path7.join(root, ".github", "PULL_REQUEST_TEMPLATE")
|
|
39570
39585
|
});
|
|
39571
39586
|
var PR_TEMPLATE_KEY_LIST = Object.keys(PR_TEMPLATE);
|
|
39572
39587
|
|
|
@@ -40455,7 +40470,7 @@ function Providers(props) {
|
|
|
40455
40470
|
|
|
40456
40471
|
// src/app/RebaseCheck.tsx
|
|
40457
40472
|
var React48 = __toESM(require_react(), 1);
|
|
40458
|
-
import
|
|
40473
|
+
import path8 from "node:path";
|
|
40459
40474
|
function reducer5(state, patch) {
|
|
40460
40475
|
return { ...state, ...patch };
|
|
40461
40476
|
}
|
|
@@ -40493,8 +40508,8 @@ function RebaseCheck(props) {
|
|
|
40493
40508
|
try {
|
|
40494
40509
|
const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
|
|
40495
40510
|
let is_rebase = false;
|
|
40496
|
-
is_rebase ||= await safe_exists(
|
|
40497
|
-
is_rebase ||= await safe_exists(
|
|
40511
|
+
is_rebase ||= await safe_exists(path8.join(git_dir, "rebase-apply"));
|
|
40512
|
+
is_rebase ||= await safe_exists(path8.join(git_dir, "rebase-merge"));
|
|
40498
40513
|
const status = is_rebase ? "prompt" : "done";
|
|
40499
40514
|
patch({ status });
|
|
40500
40515
|
} catch (err) {
|
|
@@ -40765,9 +40780,9 @@ function MaybeMain() {
|
|
|
40765
40780
|
} else if (positional_list.has("log")) {
|
|
40766
40781
|
return /* @__PURE__ */ React54.createElement(Log, null);
|
|
40767
40782
|
} else if (positional_list.has("rebase")) {
|
|
40768
|
-
return /* @__PURE__ */ React54.createElement(GatherMetadata, null, /* @__PURE__ */ React54.createElement(LocalCommitStatus, null, /* @__PURE__ */ React54.createElement(Rebase, null)));
|
|
40783
|
+
return /* @__PURE__ */ React54.createElement(DependencyCheck, null, /* @__PURE__ */ React54.createElement(DirtyCheck, null, /* @__PURE__ */ React54.createElement(GatherMetadata, null, /* @__PURE__ */ React54.createElement(LocalCommitStatus, null, /* @__PURE__ */ React54.createElement(Rebase, null)))));
|
|
40769
40784
|
}
|
|
40770
|
-
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, !argv.verbose ? null : /* @__PURE__ */ React54.createElement(GithubApiError, null), /* @__PURE__ */ React54.createElement(DependencyCheck, null, /* @__PURE__ */ React54.createElement(
|
|
40785
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, !argv.verbose ? null : /* @__PURE__ */ React54.createElement(GithubApiError, null), /* @__PURE__ */ React54.createElement(DependencyCheck, null, /* @__PURE__ */ React54.createElement(DirtyCheck, null, /* @__PURE__ */ React54.createElement(GatherMetadata, null, /* @__PURE__ */ React54.createElement(LocalCommitStatus, null, /* @__PURE__ */ React54.createElement(DetectInitialPR, null, /* @__PURE__ */ React54.createElement(Main, null)))))));
|
|
40771
40786
|
}
|
|
40772
40787
|
|
|
40773
40788
|
// node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
@@ -42047,9 +42062,9 @@ var parser = new YargsParser({
|
|
|
42047
42062
|
format,
|
|
42048
42063
|
normalize,
|
|
42049
42064
|
resolve: resolve2,
|
|
42050
|
-
require: (
|
|
42065
|
+
require: (path9) => {
|
|
42051
42066
|
if (true) {
|
|
42052
|
-
return __require(
|
|
42067
|
+
return __require(path9);
|
|
42053
42068
|
} else
|
|
42054
42069
|
;
|
|
42055
42070
|
}
|
|
@@ -45632,7 +45647,7 @@ var yargs_default = Yargs;
|
|
|
45632
45647
|
|
|
45633
45648
|
// src/command.ts
|
|
45634
45649
|
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.
|
|
45650
|
+
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.2").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
|
|
45636
45651
|
}
|
|
45637
45652
|
var GlobalOptions = {
|
|
45638
45653
|
verbose: {
|
|
@@ -45759,7 +45774,7 @@ var FixupOptions = {
|
|
|
45759
45774
|
process.exit(238);
|
|
45760
45775
|
});
|
|
45761
45776
|
const tmp_dir = await get_tmp_dir();
|
|
45762
|
-
await
|
|
45777
|
+
await fs12.rm(tmp_dir, { recursive: true });
|
|
45763
45778
|
const ink = render_default(/* @__PURE__ */ React55.createElement(App2, null), {
|
|
45764
45779
|
exitOnCtrlC: false
|
|
45765
45780
|
});
|
|
@@ -45772,7 +45787,7 @@ var FixupOptions = {
|
|
|
45772
45787
|
const actions = Store.getState().actions;
|
|
45773
45788
|
actions.debug(pretty_json(argv));
|
|
45774
45789
|
const PATH = process.env["PATH"];
|
|
45775
|
-
const PATH_LIST = pretty_json(PATH.split(
|
|
45790
|
+
const PATH_LIST = pretty_json(PATH.split(path9.delimiter));
|
|
45776
45791
|
actions.debug(`process.env.PATH ${PATH_LIST}`);
|
|
45777
45792
|
await ink.waitUntilExit();
|
|
45778
45793
|
} catch (err) {
|
package/package.json
CHANGED
package/src/app/App.tsx
CHANGED
|
@@ -86,11 +86,15 @@ function MaybeMain() {
|
|
|
86
86
|
return <Log />;
|
|
87
87
|
} else if (positional_list.has("rebase")) {
|
|
88
88
|
return (
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
<DependencyCheck>
|
|
90
|
+
<DirtyCheck>
|
|
91
|
+
<GatherMetadata>
|
|
92
|
+
<LocalCommitStatus>
|
|
93
|
+
<Rebase />
|
|
94
|
+
</LocalCommitStatus>
|
|
95
|
+
</GatherMetadata>
|
|
96
|
+
</DirtyCheck>
|
|
97
|
+
</DependencyCheck>
|
|
94
98
|
);
|
|
95
99
|
}
|
|
96
100
|
|
|
@@ -99,15 +103,15 @@ function MaybeMain() {
|
|
|
99
103
|
{!argv.verbose ? null : <GithubApiError />}
|
|
100
104
|
|
|
101
105
|
<DependencyCheck>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
106
|
+
<DirtyCheck>
|
|
107
|
+
<GatherMetadata>
|
|
104
108
|
<LocalCommitStatus>
|
|
105
109
|
<DetectInitialPR>
|
|
106
110
|
<Main />
|
|
107
111
|
</DetectInitialPR>
|
|
108
112
|
</LocalCommitStatus>
|
|
109
|
-
</
|
|
110
|
-
</
|
|
113
|
+
</GatherMetadata>
|
|
114
|
+
</DirtyCheck>
|
|
111
115
|
</DependencyCheck>
|
|
112
116
|
</React.Fragment>
|
|
113
117
|
);
|
package/src/app/AutoUpdate.tsx
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
|
|
6
3
|
import * as Ink from "ink-cjs";
|
|
7
4
|
|
|
8
5
|
import { Brackets } from "~/app/Brackets";
|
|
6
|
+
import { Command } from "~/app/Command";
|
|
9
7
|
import { FormatText } from "~/app/FormatText";
|
|
10
8
|
import { YesNoPrompt } from "~/app/YesNoPrompt";
|
|
11
9
|
import { cli } from "~/core/cli";
|
|
12
10
|
import { colors } from "~/core/colors";
|
|
13
11
|
import { fetch_json } from "~/core/fetch_json";
|
|
14
12
|
import { is_finite_value } from "~/core/is_finite_value";
|
|
15
|
-
import { read_json } from "~/core/read_json";
|
|
16
13
|
import { semver_compare } from "~/core/semver_compare";
|
|
17
14
|
import { sleep } from "~/core/sleep";
|
|
18
15
|
|
|
@@ -31,6 +28,7 @@ type State = {
|
|
|
31
28
|
local_version: null | string;
|
|
32
29
|
latest_version: null | string;
|
|
33
30
|
status: "init" | "prompt" | "install" | "done" | "exit";
|
|
31
|
+
is_brew_bun_standalone: boolean;
|
|
34
32
|
};
|
|
35
33
|
|
|
36
34
|
function reducer(state: State, patch: Partial<State>) {
|
|
@@ -48,6 +46,7 @@ export function AutoUpdate(props: Props) {
|
|
|
48
46
|
local_version: null,
|
|
49
47
|
latest_version: null,
|
|
50
48
|
status: "init",
|
|
49
|
+
is_brew_bun_standalone: false,
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
function handle_output(node: React.ReactNode) {
|
|
@@ -62,10 +61,16 @@ export function AutoUpdate(props: Props) {
|
|
|
62
61
|
|
|
63
62
|
React.useEffect(() => {
|
|
64
63
|
let status: State["status"] = "done";
|
|
65
|
-
let local_version: string | null = null;
|
|
66
64
|
let latest_version: string | null = null;
|
|
65
|
+
let is_brew_bun_standalone = false;
|
|
66
|
+
|
|
67
|
+
const local_version = process.env.CLI_VERSION;
|
|
67
68
|
|
|
68
69
|
async function auto_update() {
|
|
70
|
+
if (!local_version) {
|
|
71
|
+
throw new Error("Auto update requires process.env.CLI_VERSION to be set");
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
if (props_ref.current.verbose) {
|
|
70
75
|
handle_output(<Ink.Text key="init">Checking for latest version...</Ink.Text>);
|
|
71
76
|
}
|
|
@@ -86,22 +91,24 @@ export function AutoUpdate(props: Props) {
|
|
|
86
91
|
throw new Error("Unable to retrieve latest version from npm");
|
|
87
92
|
}
|
|
88
93
|
|
|
89
|
-
const
|
|
90
|
-
const script_dir = path.dirname(script_path);
|
|
94
|
+
const binary_path = process.argv[1];
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
if (props_ref.current.verbose) {
|
|
97
|
+
handle_output(<Ink.Text dimColor>{JSON.stringify({ binary_path })}</Ink.Text>);
|
|
98
|
+
}
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
const package_json = await read_json<PackageJson>(package_json_path);
|
|
100
|
+
is_brew_bun_standalone = binary_path.startsWith("/$bunfs");
|
|
97
101
|
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
if (props_ref.current.verbose) {
|
|
103
|
+
if (is_brew_bun_standalone) {
|
|
104
|
+
handle_output(
|
|
105
|
+
<Ink.Text dimColor>brew install detected (compiled bun standalone)</Ink.Text>,
|
|
106
|
+
);
|
|
107
|
+
} else {
|
|
108
|
+
handle_output(<Ink.Text dimColor>npm install detected</Ink.Text>);
|
|
109
|
+
}
|
|
101
110
|
}
|
|
102
111
|
|
|
103
|
-
local_version = package_json.version;
|
|
104
|
-
|
|
105
112
|
if (props_ref.current.verbose) {
|
|
106
113
|
handle_output(
|
|
107
114
|
<FormatText
|
|
@@ -118,6 +125,8 @@ export function AutoUpdate(props: Props) {
|
|
|
118
125
|
|
|
119
126
|
const semver_result = semver_compare(latest_version, local_version);
|
|
120
127
|
|
|
128
|
+
status = "prompt";
|
|
129
|
+
|
|
121
130
|
if (semver_result === 0) {
|
|
122
131
|
return;
|
|
123
132
|
}
|
|
@@ -137,10 +146,10 @@ export function AutoUpdate(props: Props) {
|
|
|
137
146
|
|
|
138
147
|
auto_update()
|
|
139
148
|
.then(() => {
|
|
140
|
-
patch({ status, local_version, latest_version });
|
|
149
|
+
patch({ status, local_version, latest_version, is_brew_bun_standalone });
|
|
141
150
|
})
|
|
142
151
|
.catch((error) => {
|
|
143
|
-
patch({ status, error, local_version, latest_version });
|
|
152
|
+
patch({ status, error, local_version, latest_version, is_brew_bun_standalone });
|
|
144
153
|
onError(error);
|
|
145
154
|
|
|
146
155
|
if (props_ref.current.verbose) {
|
|
@@ -161,13 +170,29 @@ export function AutoUpdate(props: Props) {
|
|
|
161
170
|
case "init":
|
|
162
171
|
return null;
|
|
163
172
|
|
|
164
|
-
case "prompt":
|
|
173
|
+
case "prompt": {
|
|
174
|
+
let install_command = "";
|
|
175
|
+
if (state.is_brew_bun_standalone) {
|
|
176
|
+
install_command = `npm install -g ${props.name}@latest`;
|
|
177
|
+
} else {
|
|
178
|
+
install_command = `HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade magus/git-stack/git-stack`;
|
|
179
|
+
}
|
|
180
|
+
|
|
165
181
|
return (
|
|
166
182
|
<YesNoPrompt
|
|
167
183
|
message={
|
|
168
|
-
<Ink.
|
|
169
|
-
|
|
170
|
-
|
|
184
|
+
<Ink.Box flexDirection="column">
|
|
185
|
+
<Ink.Text color={colors.yellow}>
|
|
186
|
+
New version available, would you like to update?
|
|
187
|
+
</Ink.Text>
|
|
188
|
+
<Ink.Text> </Ink.Text>
|
|
189
|
+
<Command>{install_command}</Command>
|
|
190
|
+
<Ink.Text> </Ink.Text>
|
|
191
|
+
<FormatText
|
|
192
|
+
wrapper={<Ink.Text color={colors.yellow} />}
|
|
193
|
+
message="Would you like to run the above command to update?"
|
|
194
|
+
/>
|
|
195
|
+
</Ink.Box>
|
|
171
196
|
}
|
|
172
197
|
onYes={async () => {
|
|
173
198
|
handle_output(
|
|
@@ -184,7 +209,7 @@ export function AutoUpdate(props: Props) {
|
|
|
184
209
|
|
|
185
210
|
patch({ status: "install" });
|
|
186
211
|
|
|
187
|
-
await cli(
|
|
212
|
+
await cli(install_command);
|
|
188
213
|
|
|
189
214
|
patch({ status: "exit" });
|
|
190
215
|
|
|
@@ -195,6 +220,7 @@ export function AutoUpdate(props: Props) {
|
|
|
195
220
|
}}
|
|
196
221
|
/>
|
|
197
222
|
);
|
|
223
|
+
}
|
|
198
224
|
|
|
199
225
|
case "install":
|
|
200
226
|
return null;
|