@shopify/cli 3.63.2 → 3.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/cli-ruby/lib/shopify_cli/reporting_configuration_controller.rb +2 -37
- package/dist/assets/cli-ruby/lib/shopify_cli/theme/file.rb +5 -1
- package/dist/assets/dev-console/extensions/dev-console/assets/index-Cgb-oKsM.css +1 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/{index-Dui3DO9f.js → index-D7F9wNys.js} +12 -12
- package/dist/assets/dev-console/index.html +2 -2
- package/dist/assets/hydrogen/starter/.graphqlrc.ts +27 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +108 -6
- package/dist/assets/hydrogen/starter/app/components/AddToCartButton.tsx +37 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +150 -0
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +101 -0
- package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +2 -2
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +80 -0
- package/dist/assets/hydrogen/starter/app/components/ProductImage.tsx +23 -0
- package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +27 -0
- package/dist/assets/hydrogen/starter/app/root.tsx +11 -17
- package/dist/assets/hydrogen/starter/app/routes/cart.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +51 -232
- package/dist/assets/hydrogen/starter/package.json +11 -11
- package/dist/assets/hydrogen/tailwind/package.json +1 -6
- package/dist/assets/hydrogen/tailwind/tailwind.css +6 -3
- package/dist/assets/hydrogen/vanilla-extract/package.json +2 -3
- package/dist/assets/hydrogen/virtual-routes/components/{Layout.jsx → PageLayout.jsx} +2 -2
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +8 -30
- package/dist/{chunk-YAYFJITA.js → chunk-2DXCIFDK.js} +3 -3
- package/dist/{chunk-EQR6CWKL.js → chunk-63D4EGTO.js} +3 -3
- package/dist/{chunk-EZYMDZPN.js → chunk-6PJAGL2L.js} +5 -5
- package/dist/{chunk-S4VBXFXP.js → chunk-7PVTYKQI.js} +220 -16
- package/dist/{chunk-IRWSC76I.js → chunk-7TIDA343.js} +3 -3
- package/dist/{chunk-NPLAQVTF.js → chunk-7W6SRTYP.js} +3 -3
- package/dist/{chunk-UJYIV6JP.js → chunk-ARCFCLME.js} +5 -5
- package/dist/{chunk-DIZHFZTJ.js → chunk-ATGUMSCJ.js} +4 -4
- package/dist/chunk-B3D5VLUA.js +12 -0
- package/dist/{chunk-UNPXLODI.js → chunk-B7RN7IRD.js} +3 -4
- package/dist/{chunk-5BLMIE7F.js → chunk-DX43V2L4.js} +4 -4
- package/dist/{chunk-6UDFXWNE.js → chunk-EJITPGUJ.js} +21 -4
- package/dist/chunk-FDLU3RD4.js +29 -0
- package/dist/{chunk-7OCUVNSF.js → chunk-H6AQTECB.js} +1485 -2977
- package/dist/{chunk-T54B5GJP.js → chunk-JNUJZFQL.js} +2 -2
- package/dist/{chunk-XER2L725.js → chunk-KUVX423E.js} +2 -2
- package/dist/{chunk-R5KML52V.js → chunk-KZTALMEV.js} +4 -4
- package/dist/{chunk-CM4H6QMH.js → chunk-M6KGRVDD.js} +3 -3
- package/dist/{chunk-3MDI6LZT.js → chunk-NLE3ZLU6.js} +905 -896
- package/dist/{chunk-WADS2TV5.js → chunk-NO7MYZEO.js} +5 -4
- package/dist/{chunk-LH533WG4.js → chunk-NPH2SXRO.js} +2 -2
- package/dist/{chunk-VZUWS5IH.js → chunk-OVWFZSJT.js} +3 -3
- package/dist/{chunk-UQUO22Q5.js → chunk-OXMHVKM3.js} +5 -5
- package/dist/{chunk-PNFEODLY.js → chunk-QNI6VLVR.js} +3 -3
- package/dist/{chunk-MCT2524Y.js → chunk-QYT42J3T.js} +4 -4
- package/dist/{chunk-VQTHQBEC.js → chunk-S3HWVIGJ.js} +9 -14
- package/dist/{chunk-23OKKZ5V.js → chunk-S7A7BHNA.js} +4 -4
- package/dist/{chunk-3TGMDPDI.js → chunk-SSAUIEBT.js} +2 -2
- package/dist/{chunk-YMPGWFWU.js → chunk-UQQI7TQG.js} +3 -3
- package/dist/{chunk-UZUD5DRI.js → chunk-UXA5YROL.js} +2 -2
- package/dist/{chunk-K3CVGV3F.js → chunk-V7NH4SZB.js} +3 -3
- package/dist/{chunk-7AVKIH7O.js → chunk-WVY52EEZ.js} +5 -5
- package/dist/{chunk-QEOBHRRQ.js → chunk-X3OUSYUQ.js} +17912 -17444
- package/dist/{chunk-EARPFFS7.js → chunk-XNCQBHNR.js} +241 -4
- package/dist/{chunk-EQPYUHNM.js → chunk-ZIGJPI5N.js} +1497 -112
- package/dist/{chunk-A2UVOX6O.js → chunk-ZKWHKX2C.js} +7066 -6051
- package/dist/{chunk-GPMHDCWK.js → chunk-ZRGD2HUL.js} +3 -3
- package/dist/{chunk-PQKGBYDC.js → chunk-ZVT2WZZF.js} +3 -3
- package/dist/cli/commands/auth/logout.js +14 -19
- package/dist/cli/commands/auth/logout.test.js +17 -21
- package/dist/cli/commands/debug/command-flags.js +11 -15
- package/dist/cli/commands/demo/catalog.js +13 -18
- package/dist/cli/commands/demo/generate-file.js +13 -18
- package/dist/cli/commands/demo/index.js +13 -18
- package/dist/cli/commands/demo/print-ai-prompt.js +13 -18
- package/dist/cli/commands/docs/generate.js +11 -15
- package/dist/cli/commands/docs/generate.test.js +11 -15
- package/dist/cli/commands/help.js +11 -15
- package/dist/cli/commands/kitchen-sink/async.js +12 -16
- package/dist/cli/commands/kitchen-sink/async.test.js +12 -16
- package/dist/cli/commands/kitchen-sink/index.js +14 -18
- package/dist/cli/commands/kitchen-sink/index.test.js +14 -18
- package/dist/cli/commands/kitchen-sink/prompts.js +12 -16
- package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -16
- package/dist/cli/commands/kitchen-sink/static.js +12 -16
- package/dist/cli/commands/kitchen-sink/static.test.js +12 -16
- package/dist/cli/commands/search.js +12 -16
- package/dist/cli/commands/upgrade.js +11 -15
- package/dist/cli/commands/version.js +12 -16
- package/dist/cli/commands/version.test.js +12 -16
- package/dist/cli/services/commands/search.js +4 -4
- package/dist/cli/services/commands/search.test.js +4 -4
- package/dist/cli/services/commands/version.js +6 -7
- package/dist/cli/services/commands/version.test.js +7 -8
- package/dist/cli/services/demo.js +5 -6
- package/dist/cli/services/demo.test.js +5 -6
- package/dist/cli/services/kitchen-sink/async.js +4 -4
- package/dist/cli/services/kitchen-sink/prompts.js +4 -4
- package/dist/cli/services/kitchen-sink/static.js +4 -4
- package/dist/cli/services/upgrade.js +5 -6
- package/dist/cli/services/upgrade.test.js +7 -8
- package/dist/{constants-3CLHB4LQ.js → constants-EVER32LA.js} +3 -3
- package/dist/{custom-oclif-loader-D4H5EJW6.js → custom-oclif-loader-BQAFOUNG.js} +13 -6
- package/dist/{error-handler-HUI4HW3X.js → error-handler-S56KHSGD.js} +10 -8
- package/dist/hooks/postrun.js +12 -14
- package/dist/hooks/prerun.js +8 -11
- package/dist/index.js +7811 -7490
- package/dist/{local-7IRDZWLW.js → local-UQAQKOVL.js} +4 -4
- package/dist/{morph-6NYGHGNT.js → morph-DN4AZJZW.js} +9 -9
- package/dist/{node-UIH7JP3D.js → node-GZYZUMBW.js} +21 -19
- package/dist/{node-package-manager-2LWT2MNN.js → node-package-manager-AOVZD6TP.js} +5 -6
- package/dist/{path-JVVXOELJ.js → path-KUSF6CYC.js} +2 -2
- package/dist/{system-4HHX42JS.js → system-G7DVECOP.js} +4 -4
- package/dist/templates/ui-extensions/projects/web_pixel_extension/package.json.liquid +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-NFBKMC4P.js → ui-2AOZFYFM.js} +4 -4
- package/dist/{workerd-4HFD3PS4.js → workerd-2MO23YDQ.js} +22 -19
- package/oclif.manifest.json +265 -4
- package/package.json +7 -10
- package/dist/assets/dev-console/extensions/dev-console/assets/index-Bi7y6lI5.css +0 -1
- package/dist/assets/hydrogen/css-modules/package.json +0 -6
- package/dist/assets/hydrogen/postcss/package.json +0 -10
- package/dist/assets/hydrogen/postcss/postcss.config.js +0 -8
- package/dist/assets/hydrogen/starter/.graphqlrc.yml +0 -12
- package/dist/assets/hydrogen/starter/app/components/Cart.tsx +0 -364
- package/dist/assets/hydrogen/tailwind/postcss.config.js +0 -10
- package/dist/assets/hydrogen/tailwind/tailwind.config.js +0 -8
- package/dist/chunk-4WBV3WP3.js +0 -221
- package/dist/chunk-OWICSMFV.js +0 -12
- package/dist/chunk-QCDYZY46.js +0 -1070
- package/dist/chunk-QEKTVN5A.js +0 -4385
- package/dist/chunk-QOUOFEGO.js +0 -35
- package/dist/chunk-WP234IUO.js +0 -265
- package/dist/chunk-XLPMGRR3.js +0 -496
- package/dist/chunk-XSKJYEAZ.js +0 -1453
- package/dist/error-handler-QDDLQDOJ.js +0 -43
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
environmentVariables,
|
|
6
6
|
pathConstants
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NO7MYZEO.js";
|
|
8
8
|
import {
|
|
9
9
|
require_cross_spawn,
|
|
10
10
|
require_lib,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
normalizePath,
|
|
26
26
|
relativizePath,
|
|
27
27
|
sniffForPath
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-B7RN7IRD.js";
|
|
29
29
|
import {
|
|
30
30
|
require_graceful_fs
|
|
31
31
|
} from "./chunk-LSCXQWNO.js";
|
|
@@ -6466,7 +6466,7 @@ var require_react_development = __commonJS({
|
|
|
6466
6466
|
}
|
|
6467
6467
|
}
|
|
6468
6468
|
}
|
|
6469
|
-
var
|
|
6469
|
+
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
6470
6470
|
var element = {
|
|
6471
6471
|
// This tag allows us to uniquely identify this as a React Element
|
|
6472
6472
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
@@ -6567,10 +6567,10 @@ var require_react_development = __commonJS({
|
|
|
6567
6567
|
}
|
|
6568
6568
|
}
|
|
6569
6569
|
}
|
|
6570
|
-
return
|
|
6570
|
+
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
6571
6571
|
}
|
|
6572
6572
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
6573
|
-
var newElement =
|
|
6573
|
+
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
6574
6574
|
return newElement;
|
|
6575
6575
|
}
|
|
6576
6576
|
function cloneElement2(element, config, children) {
|
|
@@ -6619,7 +6619,7 @@ var require_react_development = __commonJS({
|
|
|
6619
6619
|
}
|
|
6620
6620
|
props.children = childArray;
|
|
6621
6621
|
}
|
|
6622
|
-
return
|
|
6622
|
+
return ReactElement(element.type, key, ref, self2, source, owner, props);
|
|
6623
6623
|
}
|
|
6624
6624
|
function isValidElement(object) {
|
|
6625
6625
|
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
@@ -14465,7 +14465,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
14465
14465
|
var enableSchedulingProfiler = true;
|
|
14466
14466
|
var enableProfilerTimer = true;
|
|
14467
14467
|
var enableProfilerCommitHooks = true;
|
|
14468
|
-
var
|
|
14468
|
+
var FunctionComponent = 0;
|
|
14469
14469
|
var ClassComponent = 1;
|
|
14470
14470
|
var IndeterminateComponent = 2;
|
|
14471
14471
|
var HostRoot = 3;
|
|
@@ -14642,7 +14642,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
14642
14642
|
case TracingMarkerComponent:
|
|
14643
14643
|
return "TracingMarker";
|
|
14644
14644
|
case ClassComponent:
|
|
14645
|
-
case
|
|
14645
|
+
case FunctionComponent:
|
|
14646
14646
|
case IncompleteClassComponent:
|
|
14647
14647
|
case IndeterminateComponent:
|
|
14648
14648
|
case MemoComponent:
|
|
@@ -17218,7 +17218,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17218
17218
|
return describeBuiltInComponentFrame("Suspense");
|
|
17219
17219
|
case SuspenseListComponent:
|
|
17220
17220
|
return describeBuiltInComponentFrame("SuspenseList");
|
|
17221
|
-
case
|
|
17221
|
+
case FunctionComponent:
|
|
17222
17222
|
case IndeterminateComponent:
|
|
17223
17223
|
case SimpleMemoComponent:
|
|
17224
17224
|
return describeFunctionComponentFrame(fiber.type);
|
|
@@ -21829,7 +21829,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21829
21829
|
}
|
|
21830
21830
|
function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
|
|
21831
21831
|
var tag = sourceFiber.tag;
|
|
21832
|
-
if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag ===
|
|
21832
|
+
if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
|
|
21833
21833
|
var currentSource = sourceFiber.alternate;
|
|
21834
21834
|
if (currentSource) {
|
|
21835
21835
|
sourceFiber.updateQueue = currentSource.updateQueue;
|
|
@@ -22522,7 +22522,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22522
22522
|
var resolvedProps = resolveDefaultProps(Component, props);
|
|
22523
22523
|
var child;
|
|
22524
22524
|
switch (resolvedTag) {
|
|
22525
|
-
case
|
|
22525
|
+
case FunctionComponent: {
|
|
22526
22526
|
{
|
|
22527
22527
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
22528
22528
|
workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
|
|
@@ -22665,7 +22665,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22665
22665
|
mountClassInstance(workInProgress2, Component, props, renderLanes2);
|
|
22666
22666
|
return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
|
|
22667
22667
|
} else {
|
|
22668
|
-
workInProgress2.tag =
|
|
22668
|
+
workInProgress2.tag = FunctionComponent;
|
|
22669
22669
|
{
|
|
22670
22670
|
if (workInProgress2.mode & StrictLegacyMode) {
|
|
22671
22671
|
setIsStrictModeForDevtools(true);
|
|
@@ -23614,7 +23614,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
23614
23614
|
var elementType = workInProgress2.elementType;
|
|
23615
23615
|
return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
|
|
23616
23616
|
}
|
|
23617
|
-
case
|
|
23617
|
+
case FunctionComponent: {
|
|
23618
23618
|
var Component = workInProgress2.type;
|
|
23619
23619
|
var unresolvedProps = workInProgress2.pendingProps;
|
|
23620
23620
|
var resolvedProps = workInProgress2.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps);
|
|
@@ -24081,7 +24081,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24081
24081
|
case IndeterminateComponent:
|
|
24082
24082
|
case LazyComponent:
|
|
24083
24083
|
case SimpleMemoComponent:
|
|
24084
|
-
case
|
|
24084
|
+
case FunctionComponent:
|
|
24085
24085
|
case ForwardRef:
|
|
24086
24086
|
case Fragment:
|
|
24087
24087
|
case Mode:
|
|
@@ -24767,7 +24767,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24767
24767
|
if ((flags & Snapshot) !== NoFlags) {
|
|
24768
24768
|
setCurrentFiber(finishedWork);
|
|
24769
24769
|
switch (finishedWork.tag) {
|
|
24770
|
-
case
|
|
24770
|
+
case FunctionComponent:
|
|
24771
24771
|
case ForwardRef:
|
|
24772
24772
|
case SimpleMemoComponent: {
|
|
24773
24773
|
break;
|
|
@@ -24962,7 +24962,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
24962
24962
|
function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
|
|
24963
24963
|
if ((finishedWork.flags & LayoutMask) !== NoFlags) {
|
|
24964
24964
|
switch (finishedWork.tag) {
|
|
24965
|
-
case
|
|
24965
|
+
case FunctionComponent:
|
|
24966
24966
|
case ForwardRef:
|
|
24967
24967
|
case SimpleMemoComponent: {
|
|
24968
24968
|
if (!offscreenSubtreeWasHidden) {
|
|
@@ -25143,7 +25143,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25143
25143
|
}
|
|
25144
25144
|
function reappearLayoutEffectsOnFiber(node) {
|
|
25145
25145
|
switch (node.tag) {
|
|
25146
|
-
case
|
|
25146
|
+
case FunctionComponent:
|
|
25147
25147
|
case ForwardRef:
|
|
25148
25148
|
case SimpleMemoComponent: {
|
|
25149
25149
|
if (node.mode & ProfileMode) {
|
|
@@ -25532,7 +25532,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25532
25532
|
}
|
|
25533
25533
|
return;
|
|
25534
25534
|
}
|
|
25535
|
-
case
|
|
25535
|
+
case FunctionComponent:
|
|
25536
25536
|
case ForwardRef:
|
|
25537
25537
|
case MemoComponent:
|
|
25538
25538
|
case SimpleMemoComponent: {
|
|
@@ -25690,7 +25690,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
25690
25690
|
var current2 = finishedWork.alternate;
|
|
25691
25691
|
var flags = finishedWork.flags;
|
|
25692
25692
|
switch (finishedWork.tag) {
|
|
25693
|
-
case
|
|
25693
|
+
case FunctionComponent:
|
|
25694
25694
|
case ForwardRef:
|
|
25695
25695
|
case MemoComponent:
|
|
25696
25696
|
case SimpleMemoComponent: {
|
|
@@ -26020,7 +26020,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26020
26020
|
var fiber = nextEffect;
|
|
26021
26021
|
var firstChild = fiber.child;
|
|
26022
26022
|
switch (fiber.tag) {
|
|
26023
|
-
case
|
|
26023
|
+
case FunctionComponent:
|
|
26024
26024
|
case ForwardRef:
|
|
26025
26025
|
case MemoComponent:
|
|
26026
26026
|
case SimpleMemoComponent: {
|
|
@@ -26166,7 +26166,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26166
26166
|
}
|
|
26167
26167
|
function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
|
|
26168
26168
|
switch (finishedWork.tag) {
|
|
26169
|
-
case
|
|
26169
|
+
case FunctionComponent:
|
|
26170
26170
|
case ForwardRef:
|
|
26171
26171
|
case SimpleMemoComponent: {
|
|
26172
26172
|
if (finishedWork.mode & ProfileMode) {
|
|
@@ -26243,7 +26243,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26243
26243
|
}
|
|
26244
26244
|
function commitPassiveUnmountOnFiber(finishedWork) {
|
|
26245
26245
|
switch (finishedWork.tag) {
|
|
26246
|
-
case
|
|
26246
|
+
case FunctionComponent:
|
|
26247
26247
|
case ForwardRef:
|
|
26248
26248
|
case SimpleMemoComponent: {
|
|
26249
26249
|
if (finishedWork.mode & ProfileMode) {
|
|
@@ -26294,7 +26294,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26294
26294
|
}
|
|
26295
26295
|
function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
|
|
26296
26296
|
switch (current2.tag) {
|
|
26297
|
-
case
|
|
26297
|
+
case FunctionComponent:
|
|
26298
26298
|
case ForwardRef:
|
|
26299
26299
|
case SimpleMemoComponent: {
|
|
26300
26300
|
if (current2.mode & ProfileMode) {
|
|
@@ -26311,7 +26311,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26311
26311
|
function invokeLayoutEffectMountInDEV(fiber) {
|
|
26312
26312
|
{
|
|
26313
26313
|
switch (fiber.tag) {
|
|
26314
|
-
case
|
|
26314
|
+
case FunctionComponent:
|
|
26315
26315
|
case ForwardRef:
|
|
26316
26316
|
case SimpleMemoComponent: {
|
|
26317
26317
|
try {
|
|
@@ -26336,7 +26336,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26336
26336
|
function invokePassiveEffectMountInDEV(fiber) {
|
|
26337
26337
|
{
|
|
26338
26338
|
switch (fiber.tag) {
|
|
26339
|
-
case
|
|
26339
|
+
case FunctionComponent:
|
|
26340
26340
|
case ForwardRef:
|
|
26341
26341
|
case SimpleMemoComponent: {
|
|
26342
26342
|
try {
|
|
@@ -26352,7 +26352,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26352
26352
|
function invokeLayoutEffectUnmountInDEV(fiber) {
|
|
26353
26353
|
{
|
|
26354
26354
|
switch (fiber.tag) {
|
|
26355
|
-
case
|
|
26355
|
+
case FunctionComponent:
|
|
26356
26356
|
case ForwardRef:
|
|
26357
26357
|
case SimpleMemoComponent: {
|
|
26358
26358
|
try {
|
|
@@ -26375,7 +26375,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26375
26375
|
function invokePassiveEffectUnmountInDEV(fiber) {
|
|
26376
26376
|
{
|
|
26377
26377
|
switch (fiber.tag) {
|
|
26378
|
-
case
|
|
26378
|
+
case FunctionComponent:
|
|
26379
26379
|
case ForwardRef:
|
|
26380
26380
|
case SimpleMemoComponent: {
|
|
26381
26381
|
try {
|
|
@@ -28099,7 +28099,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28099
28099
|
return;
|
|
28100
28100
|
}
|
|
28101
28101
|
var tag = fiber.tag;
|
|
28102
|
-
if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !==
|
|
28102
|
+
if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
|
|
28103
28103
|
return;
|
|
28104
28104
|
}
|
|
28105
28105
|
var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
|
|
@@ -28162,7 +28162,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28162
28162
|
{
|
|
28163
28163
|
if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
|
|
28164
28164
|
switch (fiber.tag) {
|
|
28165
|
-
case
|
|
28165
|
+
case FunctionComponent:
|
|
28166
28166
|
case ForwardRef:
|
|
28167
28167
|
case SimpleMemoComponent: {
|
|
28168
28168
|
var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
|
|
@@ -28229,7 +28229,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28229
28229
|
if (executionContext !== NoContext) {
|
|
28230
28230
|
return;
|
|
28231
28231
|
}
|
|
28232
|
-
if (fiber.tag !==
|
|
28232
|
+
if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
|
|
28233
28233
|
return;
|
|
28234
28234
|
}
|
|
28235
28235
|
}
|
|
@@ -28323,7 +28323,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28323
28323
|
}
|
|
28324
28324
|
break;
|
|
28325
28325
|
}
|
|
28326
|
-
case
|
|
28326
|
+
case FunctionComponent: {
|
|
28327
28327
|
if (typeof nextType === "function") {
|
|
28328
28328
|
needsCompareFamilies = true;
|
|
28329
28329
|
} else if ($$typeofNextType === REACT_LAZY_TYPE) {
|
|
@@ -28402,7 +28402,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28402
28402
|
var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
28403
28403
|
var candidateType = null;
|
|
28404
28404
|
switch (tag) {
|
|
28405
|
-
case
|
|
28405
|
+
case FunctionComponent:
|
|
28406
28406
|
case SimpleMemoComponent:
|
|
28407
28407
|
case ClassComponent:
|
|
28408
28408
|
candidateType = type;
|
|
@@ -28467,7 +28467,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28467
28467
|
var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
|
|
28468
28468
|
var candidateType = null;
|
|
28469
28469
|
switch (tag) {
|
|
28470
|
-
case
|
|
28470
|
+
case FunctionComponent:
|
|
28471
28471
|
case SimpleMemoComponent:
|
|
28472
28472
|
case ClassComponent:
|
|
28473
28473
|
candidateType = type;
|
|
@@ -28614,7 +28614,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28614
28614
|
}
|
|
28615
28615
|
function resolveLazyComponentTag(Component) {
|
|
28616
28616
|
if (typeof Component === "function") {
|
|
28617
|
-
return shouldConstruct$1(Component) ? ClassComponent :
|
|
28617
|
+
return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
|
|
28618
28618
|
} else if (Component !== void 0 && Component !== null) {
|
|
28619
28619
|
var $$typeof = Component.$$typeof;
|
|
28620
28620
|
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
|
@@ -28674,7 +28674,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
28674
28674
|
workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
|
|
28675
28675
|
switch (workInProgress2.tag) {
|
|
28676
28676
|
case IndeterminateComponent:
|
|
28677
|
-
case
|
|
28677
|
+
case FunctionComponent:
|
|
28678
28678
|
case SimpleMemoComponent:
|
|
28679
28679
|
workInProgress2.type = resolveFunctionForHotReloading(current2.type);
|
|
28680
28680
|
break;
|
|
@@ -32784,22 +32784,22 @@ var require_gradient_string = __commonJS({
|
|
|
32784
32784
|
}
|
|
32785
32785
|
});
|
|
32786
32786
|
|
|
32787
|
-
// ../cli-kit/
|
|
32787
|
+
// ../cli-kit/dist/public/node/ui.js
|
|
32788
32788
|
init_cjs_shims();
|
|
32789
32789
|
|
|
32790
|
-
// ../cli-kit/
|
|
32790
|
+
// ../cli-kit/dist/public/node/error.js
|
|
32791
32791
|
init_cjs_shims();
|
|
32792
32792
|
|
|
32793
|
-
// ../cli-kit/
|
|
32793
|
+
// ../cli-kit/dist/public/node/output.js
|
|
32794
32794
|
init_cjs_shims();
|
|
32795
32795
|
|
|
32796
|
-
// ../cli-kit/
|
|
32796
|
+
// ../cli-kit/dist/public/node/context/local.js
|
|
32797
32797
|
init_cjs_shims();
|
|
32798
32798
|
|
|
32799
|
-
// ../cli-kit/
|
|
32799
|
+
// ../cli-kit/dist/public/node/context/spin.js
|
|
32800
32800
|
init_cjs_shims();
|
|
32801
32801
|
|
|
32802
|
-
// ../cli-kit/
|
|
32802
|
+
// ../cli-kit/dist/public/node/context/utilities.js
|
|
32803
32803
|
init_cjs_shims();
|
|
32804
32804
|
function isTruthy(variable) {
|
|
32805
32805
|
if (!variable) {
|
|
@@ -32808,13 +32808,13 @@ function isTruthy(variable) {
|
|
|
32808
32808
|
return ["1", "true", "TRUE", "yes", "YES"].includes(variable);
|
|
32809
32809
|
}
|
|
32810
32810
|
|
|
32811
|
-
// ../cli-kit/
|
|
32811
|
+
// ../cli-kit/dist/public/node/fs.js
|
|
32812
32812
|
init_cjs_shims();
|
|
32813
32813
|
|
|
32814
|
-
// ../cli-kit/
|
|
32814
|
+
// ../cli-kit/dist/public/common/string.js
|
|
32815
32815
|
init_cjs_shims();
|
|
32816
32816
|
|
|
32817
|
-
// ../cli-kit/
|
|
32817
|
+
// ../cli-kit/dist/public/common/array.js
|
|
32818
32818
|
init_cjs_shims();
|
|
32819
32819
|
var import_uniqBy = __toESM(require_uniqBy(), 1);
|
|
32820
32820
|
var import_difference = __toESM(require_difference(), 1);
|
|
@@ -32837,7 +32837,7 @@ function difference(array, ...values) {
|
|
|
32837
32837
|
return (0, import_difference.default)(array, ...values);
|
|
32838
32838
|
}
|
|
32839
32839
|
|
|
32840
|
-
// ../cli-kit/
|
|
32840
|
+
// ../cli-kit/dist/public/common/string.js
|
|
32841
32841
|
var import_change_case = __toESM(require_dist15(), 1);
|
|
32842
32842
|
var SAFE_RANDOM_BUSINESS_ADJECTIVES = [
|
|
32843
32843
|
"commercial",
|
|
@@ -34819,32 +34819,9 @@ minimatch.Minimatch = Minimatch;
|
|
|
34819
34819
|
minimatch.escape = escape;
|
|
34820
34820
|
minimatch.unescape = unescape2;
|
|
34821
34821
|
|
|
34822
|
-
// ../cli-kit/
|
|
34823
|
-
import {
|
|
34824
|
-
|
|
34825
|
-
readFileSync as fsReadFileSync,
|
|
34826
|
-
writeFileSync as fsWriteFileSync,
|
|
34827
|
-
appendFileSync as fsAppendFileSync,
|
|
34828
|
-
statSync as fsStatSync,
|
|
34829
|
-
createReadStream as fsCreateReadStream,
|
|
34830
|
-
createWriteStream as fsCreateWriteStream,
|
|
34831
|
-
constants as fsConstants,
|
|
34832
|
-
existsSync as fsFileExistsSync,
|
|
34833
|
-
unlinkSync as fsUnlinkSync
|
|
34834
|
-
} from "fs";
|
|
34835
|
-
import {
|
|
34836
|
-
mkdir as fsMkdir,
|
|
34837
|
-
writeFile as fsWriteFile,
|
|
34838
|
-
readFile as fsReadFile,
|
|
34839
|
-
realpath as fsRealPath,
|
|
34840
|
-
appendFile as fsAppendFile,
|
|
34841
|
-
mkdtemp as fsMkdtemp,
|
|
34842
|
-
stat as fsStat,
|
|
34843
|
-
lstat as fsLstat,
|
|
34844
|
-
chmod as fsChmod,
|
|
34845
|
-
access as fsAccess,
|
|
34846
|
-
rename as fsRename
|
|
34847
|
-
} from "fs/promises";
|
|
34822
|
+
// ../cli-kit/dist/public/node/fs.js
|
|
34823
|
+
import { mkdirSync as fsMkdirSync, readFileSync as fsReadFileSync, writeFileSync as fsWriteFileSync, appendFileSync as fsAppendFileSync, statSync as fsStatSync, createReadStream as fsCreateReadStream, createWriteStream as fsCreateWriteStream, constants as fsConstants, existsSync as fsFileExistsSync, unlinkSync as fsUnlinkSync } from "fs";
|
|
34824
|
+
import { mkdir as fsMkdir, writeFile as fsWriteFile, readFile as fsReadFile, realpath as fsRealPath, appendFile as fsAppendFile, mkdtemp as fsMkdtemp, stat as fsStat, lstat as fsLstat, chmod as fsChmod, access as fsAccess, rename as fsRename } from "fs/promises";
|
|
34848
34825
|
async function inTemporaryDirectory(callback) {
|
|
34849
34826
|
return temporaryDirectoryTask(callback);
|
|
34850
34827
|
}
|
|
@@ -34910,6 +34887,10 @@ async function fileSize(path7) {
|
|
|
34910
34887
|
outputDebug(outputContent`Getting the size of file file at ${outputToken.path(path7)}...`);
|
|
34911
34888
|
return (await fsStat(path7)).size;
|
|
34912
34889
|
}
|
|
34890
|
+
function fileSizeSync(path7) {
|
|
34891
|
+
outputDebug(outputContent`Sync-getting the size of file file at ${outputToken.path(path7)}...`);
|
|
34892
|
+
return fsStatSync(path7).size;
|
|
34893
|
+
}
|
|
34913
34894
|
function unlinkFileSync(path7) {
|
|
34914
34895
|
return fsUnlinkSync(path7);
|
|
34915
34896
|
}
|
|
@@ -34982,13 +34963,13 @@ function matchGlob(key, pattern, options = { matchBase: true }) {
|
|
|
34982
34963
|
return minimatch(key, pattern, options);
|
|
34983
34964
|
}
|
|
34984
34965
|
|
|
34985
|
-
// ../cli-kit/
|
|
34966
|
+
// ../cli-kit/dist/public/node/system.js
|
|
34986
34967
|
init_cjs_shims();
|
|
34987
34968
|
|
|
34988
|
-
// ../cli-kit/
|
|
34969
|
+
// ../cli-kit/dist/public/node/tree-kill.js
|
|
34989
34970
|
init_cjs_shims();
|
|
34990
34971
|
|
|
34991
|
-
// ../cli-kit/
|
|
34972
|
+
// ../cli-kit/dist/private/node/demo-recorder.js
|
|
34992
34973
|
init_cjs_shims();
|
|
34993
34974
|
var DemoRecorder = class {
|
|
34994
34975
|
constructor() {
|
|
@@ -35006,14 +34987,10 @@ var DemoRecorder = class {
|
|
|
35006
34987
|
this.sleepStart = Date.now();
|
|
35007
34988
|
}
|
|
35008
34989
|
recordedEventsJson() {
|
|
35009
|
-
return JSON.stringify(
|
|
35010
|
-
|
|
35011
|
-
|
|
35012
|
-
|
|
35013
|
-
},
|
|
35014
|
-
null,
|
|
35015
|
-
2
|
|
35016
|
-
);
|
|
34990
|
+
return JSON.stringify({
|
|
34991
|
+
command: this.command,
|
|
34992
|
+
steps: this.withFormattedConcurrent(this.recorded)
|
|
34993
|
+
}, null, 2);
|
|
35017
34994
|
}
|
|
35018
34995
|
addSleep() {
|
|
35019
34996
|
const duration = (Date.now() - this.sleepStart) / 1e3;
|
|
@@ -35112,7 +35089,7 @@ function isRecording() {
|
|
|
35112
35089
|
return isTruthy(process.env.RECORD_DEMO);
|
|
35113
35090
|
}
|
|
35114
35091
|
|
|
35115
|
-
// ../cli-kit/
|
|
35092
|
+
// ../cli-kit/dist/public/node/tree-kill.js
|
|
35116
35093
|
import { exec, spawn } from "child_process";
|
|
35117
35094
|
function treeKill(pid = process.pid, killSignal = "SIGTERM", killRoot = true, callback) {
|
|
35118
35095
|
const after = callback ?? ((error) => {
|
|
@@ -35140,30 +35117,18 @@ function adaptedTreeKill(pid, killSignal, killRoot, callback) {
|
|
|
35140
35117
|
exec(`taskkill /pid ${pid} /T /F`, callback);
|
|
35141
35118
|
break;
|
|
35142
35119
|
case "darwin":
|
|
35143
|
-
buildProcessTree(
|
|
35144
|
-
|
|
35145
|
-
|
|
35146
|
-
|
|
35147
|
-
|
|
35148
|
-
return spawn("pgrep", ["-lfP", parentPid]);
|
|
35149
|
-
},
|
|
35150
|
-
function() {
|
|
35151
|
-
killAll(tree, killSignal, rootPid, killRoot, callback);
|
|
35152
|
-
}
|
|
35153
|
-
);
|
|
35120
|
+
buildProcessTree(rootPid, tree, pidsToProcess, function(parentPid) {
|
|
35121
|
+
return spawn("pgrep", ["-lfP", parentPid]);
|
|
35122
|
+
}, function() {
|
|
35123
|
+
killAll(tree, killSignal, rootPid, killRoot, callback);
|
|
35124
|
+
});
|
|
35154
35125
|
break;
|
|
35155
35126
|
default:
|
|
35156
|
-
buildProcessTree(
|
|
35157
|
-
|
|
35158
|
-
|
|
35159
|
-
|
|
35160
|
-
|
|
35161
|
-
return spawn("ps", ["-o", "pid command", "--no-headers", "--ppid", parentPid]);
|
|
35162
|
-
},
|
|
35163
|
-
function() {
|
|
35164
|
-
killAll(tree, killSignal, rootPid, killRoot, callback);
|
|
35165
|
-
}
|
|
35166
|
-
);
|
|
35127
|
+
buildProcessTree(rootPid, tree, pidsToProcess, function(parentPid) {
|
|
35128
|
+
return spawn("ps", ["-o", "pid command", "--no-headers", "--ppid", parentPid]);
|
|
35129
|
+
}, function() {
|
|
35130
|
+
killAll(tree, killSignal, rootPid, killRoot, callback);
|
|
35131
|
+
});
|
|
35167
35132
|
break;
|
|
35168
35133
|
}
|
|
35169
35134
|
}
|
|
@@ -36384,7 +36349,7 @@ function create$(options) {
|
|
|
36384
36349
|
}
|
|
36385
36350
|
var $ = create$();
|
|
36386
36351
|
|
|
36387
|
-
// ../cli-kit/
|
|
36352
|
+
// ../cli-kit/dist/public/node/system.js
|
|
36388
36353
|
async function openURL(url) {
|
|
36389
36354
|
const externalOpen = await import("./open-JRS7RW22.js");
|
|
36390
36355
|
await externalOpen.default(url);
|
|
@@ -36462,7 +36427,7 @@ function terminalSupportsRawMode(stdin, env2 = process.env) {
|
|
|
36462
36427
|
return process.stdin.isTTY;
|
|
36463
36428
|
}
|
|
36464
36429
|
|
|
36465
|
-
// ../cli-kit/
|
|
36430
|
+
// ../cli-kit/dist/private/node/context/spin-cache.js
|
|
36466
36431
|
init_cjs_shims();
|
|
36467
36432
|
var cachedSpinFQDN;
|
|
36468
36433
|
function getCachedSpinFqdn() {
|
|
@@ -36472,24 +36437,28 @@ function setCachedSpinFqdn(fqdn) {
|
|
|
36472
36437
|
cachedSpinFQDN = fqdn;
|
|
36473
36438
|
}
|
|
36474
36439
|
|
|
36475
|
-
// ../cli-kit/
|
|
36440
|
+
// ../cli-kit/dist/private/node/context/service.js
|
|
36476
36441
|
init_cjs_shims();
|
|
36442
|
+
var Environment;
|
|
36443
|
+
(function(Environment2) {
|
|
36444
|
+
Environment2["Local"] = "local";
|
|
36445
|
+
Environment2["Production"] = "production";
|
|
36446
|
+
Environment2["Spin"] = "spin";
|
|
36447
|
+
})(Environment || (Environment = {}));
|
|
36477
36448
|
function serviceEnvironment(env2 = process.env) {
|
|
36478
36449
|
const value = env2[environmentVariables.serviceEnv];
|
|
36479
36450
|
if (value === "local") {
|
|
36480
|
-
return
|
|
36451
|
+
return Environment.Local;
|
|
36481
36452
|
} else if (value === "spin" || isSpin(env2)) {
|
|
36482
|
-
return
|
|
36453
|
+
return Environment.Spin;
|
|
36483
36454
|
} else {
|
|
36484
|
-
return
|
|
36455
|
+
return Environment.Production;
|
|
36485
36456
|
}
|
|
36486
36457
|
}
|
|
36487
36458
|
|
|
36488
|
-
// ../cli-kit/
|
|
36459
|
+
// ../cli-kit/dist/public/node/context/spin.js
|
|
36489
36460
|
var SpinInstanceNotFoundMessages = (spinInstance, error) => {
|
|
36490
|
-
const errorMessage = outputContent`${outputToken.genericShellCommand(
|
|
36491
|
-
`spin`
|
|
36492
|
-
)} yielded the following error trying to obtain the fully qualified domain name of the Spin instance:
|
|
36461
|
+
const errorMessage = outputContent`${outputToken.genericShellCommand(`spin`)} yielded the following error trying to obtain the fully qualified domain name of the Spin instance:
|
|
36493
36462
|
${error}
|
|
36494
36463
|
`;
|
|
36495
36464
|
let nextSteps;
|
|
@@ -36532,7 +36501,7 @@ function instance(env2 = process.env) {
|
|
|
36532
36501
|
return env2[environmentVariables.spinInstance];
|
|
36533
36502
|
}
|
|
36534
36503
|
function isSpinEnvironment(env2 = process.env) {
|
|
36535
|
-
return serviceEnvironment(env2) ===
|
|
36504
|
+
return serviceEnvironment(env2) === Environment.Spin;
|
|
36536
36505
|
}
|
|
36537
36506
|
function appPort(env2 = process.env) {
|
|
36538
36507
|
const port = Number(env2[environmentVariables.spinAppPort]);
|
|
@@ -36571,7 +36540,7 @@ async function fetchSpinPort(service, portEnvName, basePath = "/run") {
|
|
|
36571
36540
|
return void 0;
|
|
36572
36541
|
}
|
|
36573
36542
|
|
|
36574
|
-
// ../cli-kit/
|
|
36543
|
+
// ../cli-kit/dist/private/node/context/utilities.js
|
|
36575
36544
|
init_cjs_shims();
|
|
36576
36545
|
function isSet(variable) {
|
|
36577
36546
|
if (variable === void 0 || variable.trim() === "") {
|
|
@@ -36641,7 +36610,7 @@ function isInteractive({ stream: stream2 = process.stdout } = {}) {
|
|
|
36641
36610
|
);
|
|
36642
36611
|
}
|
|
36643
36612
|
|
|
36644
|
-
// ../cli-kit/
|
|
36613
|
+
// ../cli-kit/dist/public/node/context/local.js
|
|
36645
36614
|
var import_macaddress = __toESM(require_macaddress(), 1);
|
|
36646
36615
|
import { homedir } from "os";
|
|
36647
36616
|
function isTerminalInteractive() {
|
|
@@ -36679,7 +36648,7 @@ function firstPartyDev(env2 = process.env) {
|
|
|
36679
36648
|
return isTruthy(env2[environmentVariables.firstPartyDev]);
|
|
36680
36649
|
}
|
|
36681
36650
|
function useDeviceAuth(env2 = process.env) {
|
|
36682
|
-
return isTruthy(env2[environmentVariables.deviceAuth]) || isCloudEnvironment(env2);
|
|
36651
|
+
return !isTruthy(env2[environmentVariables.accessCodeAuth]) || isTruthy(env2[environmentVariables.deviceAuth]) || isCloudEnvironment(env2);
|
|
36683
36652
|
}
|
|
36684
36653
|
function useThemebundling(env2 = process.env) {
|
|
36685
36654
|
return !isTruthy(env2[environmentVariables.noThemeBundling]);
|
|
@@ -36756,7 +36725,7 @@ function opentelemetryDomain(env2 = process.env) {
|
|
|
36756
36725
|
return "https://otlp-http-production-cli.shopifysvc.com";
|
|
36757
36726
|
}
|
|
36758
36727
|
|
|
36759
|
-
// ../cli-kit/
|
|
36728
|
+
// ../cli-kit/dist/public/node/is-global.js
|
|
36760
36729
|
init_cjs_shims();
|
|
36761
36730
|
var _isGlobal;
|
|
36762
36731
|
function currentProcessIsGlobal(argv = process.argv) {
|
|
@@ -36810,7 +36779,7 @@ function inferPackageManagerForGlobalCLI(argv = process.argv) {
|
|
|
36810
36779
|
return "npm";
|
|
36811
36780
|
}
|
|
36812
36781
|
|
|
36813
|
-
// ../cli-kit/
|
|
36782
|
+
// ../cli-kit/dist/public/node/colors.js
|
|
36814
36783
|
init_cjs_shims();
|
|
36815
36784
|
|
|
36816
36785
|
// ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
|
@@ -37308,7 +37277,7 @@ var chalk = createChalk();
|
|
|
37308
37277
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
37309
37278
|
var source_default = chalk;
|
|
37310
37279
|
|
|
37311
|
-
// ../cli-kit/
|
|
37280
|
+
// ../cli-kit/dist/private/node/content-tokens.js
|
|
37312
37281
|
init_cjs_shims();
|
|
37313
37282
|
|
|
37314
37283
|
// ../../node_modules/.pnpm/terminal-link@3.0.0/node_modules/terminal-link/index.js
|
|
@@ -37515,7 +37484,7 @@ function colorJson(json, colors = defaultColors, colorMap = defaultColorMap, spa
|
|
|
37515
37484
|
}
|
|
37516
37485
|
}
|
|
37517
37486
|
|
|
37518
|
-
// ../cli-kit/
|
|
37487
|
+
// ../cli-kit/dist/private/node/content-tokens.js
|
|
37519
37488
|
var ContentToken = class {
|
|
37520
37489
|
constructor(value) {
|
|
37521
37490
|
this.value = value;
|
|
@@ -37606,10 +37575,10 @@ var ItalicContentToken = class extends ContentToken {
|
|
|
37606
37575
|
}
|
|
37607
37576
|
};
|
|
37608
37577
|
|
|
37609
|
-
// ../cli-kit/
|
|
37578
|
+
// ../cli-kit/dist/private/node/ui/components/TokenizedText.js
|
|
37610
37579
|
init_cjs_shims();
|
|
37611
37580
|
|
|
37612
|
-
// ../cli-kit/
|
|
37581
|
+
// ../cli-kit/dist/private/node/ui/components/Command.js
|
|
37613
37582
|
init_cjs_shims();
|
|
37614
37583
|
|
|
37615
37584
|
// ../../node_modules/.pnpm/ink@4.4.1_@types+react@17.0.2_react@18.2.0/node_modules/ink/build/index.js
|
|
@@ -42235,21 +42204,27 @@ var measureElement = (node) => ({
|
|
|
42235
42204
|
});
|
|
42236
42205
|
var measure_element_default = measureElement;
|
|
42237
42206
|
|
|
42238
|
-
// ../cli-kit/
|
|
42207
|
+
// ../cli-kit/dist/private/node/ui/components/Command.js
|
|
42239
42208
|
var import_react22 = __toESM(require_react(), 1);
|
|
42240
42209
|
var Command = ({ command }) => {
|
|
42241
|
-
return
|
|
42210
|
+
return import_react22.default.createElement(
|
|
42211
|
+
Text,
|
|
42212
|
+
{ color: "magentaBright" },
|
|
42213
|
+
"`",
|
|
42214
|
+
command,
|
|
42215
|
+
"`"
|
|
42216
|
+
);
|
|
42242
42217
|
};
|
|
42243
42218
|
|
|
42244
|
-
// ../cli-kit/
|
|
42219
|
+
// ../cli-kit/dist/private/node/ui/components/Link.js
|
|
42245
42220
|
init_cjs_shims();
|
|
42246
42221
|
|
|
42247
|
-
// ../cli-kit/
|
|
42222
|
+
// ../cli-kit/dist/private/node/ui/contexts/LinksContext.js
|
|
42248
42223
|
init_cjs_shims();
|
|
42249
42224
|
var import_react23 = __toESM(require_react(), 1);
|
|
42250
42225
|
var LinksContext = import_react23.default.createContext(null);
|
|
42251
42226
|
|
|
42252
|
-
// ../cli-kit/
|
|
42227
|
+
// ../cli-kit/dist/private/node/ui/components/Link.js
|
|
42253
42228
|
var import_react24 = __toESM(require_react(), 1);
|
|
42254
42229
|
var import_supports_hyperlinks2 = __toESM(require_supports_hyperlinks2(), 1);
|
|
42255
42230
|
function link(label, url, linksContext) {
|
|
@@ -42264,21 +42239,14 @@ function link(label, url, linksContext) {
|
|
|
42264
42239
|
}
|
|
42265
42240
|
var Link = ({ label, url }) => {
|
|
42266
42241
|
const linksContext = (0, import_react24.useContext)(LinksContext);
|
|
42267
|
-
return
|
|
42242
|
+
return import_react24.default.createElement(Text, null, link(label, url, linksContext));
|
|
42268
42243
|
};
|
|
42269
42244
|
|
|
42270
|
-
// ../cli-kit/
|
|
42245
|
+
// ../cli-kit/dist/private/node/ui/components/List.js
|
|
42271
42246
|
init_cjs_shims();
|
|
42272
42247
|
var import_react25 = __toESM(require_react(), 1);
|
|
42273
42248
|
var DOT = "\u2022";
|
|
42274
|
-
var List = ({
|
|
42275
|
-
title,
|
|
42276
|
-
items,
|
|
42277
|
-
margin = true,
|
|
42278
|
-
ordered = false,
|
|
42279
|
-
color,
|
|
42280
|
-
bullet = DOT
|
|
42281
|
-
}) => {
|
|
42249
|
+
var List = ({ title, items, margin = true, ordered = false, color, bullet = DOT }) => {
|
|
42282
42250
|
function isCustomListItem(item) {
|
|
42283
42251
|
return item.item !== void 0;
|
|
42284
42252
|
}
|
|
@@ -42296,33 +42264,55 @@ var List = ({
|
|
|
42296
42264
|
} : resolvedItem;
|
|
42297
42265
|
}
|
|
42298
42266
|
const ListItem = ({ item, color: color2, bullet: bullet2, index, ordered: ordered2 }) => {
|
|
42299
|
-
return
|
|
42267
|
+
return import_react25.default.createElement(
|
|
42268
|
+
Box_default,
|
|
42269
|
+
{ key: index, marginLeft: margin ? 2 : 0 },
|
|
42270
|
+
import_react25.default.createElement(Text, { color: color2 }, `${ordered2 ? `${index + 1}.` : bullet2}`),
|
|
42271
|
+
import_react25.default.createElement(
|
|
42272
|
+
Box_default,
|
|
42273
|
+
{ flexGrow: 1, marginLeft: 1 },
|
|
42274
|
+
import_react25.default.createElement(
|
|
42275
|
+
Text,
|
|
42276
|
+
{ color: color2 },
|
|
42277
|
+
import_react25.default.createElement(TokenizedText, { item })
|
|
42278
|
+
)
|
|
42279
|
+
)
|
|
42280
|
+
);
|
|
42300
42281
|
};
|
|
42301
|
-
return
|
|
42282
|
+
return import_react25.default.createElement(
|
|
42283
|
+
Box_default,
|
|
42284
|
+
{ flexDirection: "column" },
|
|
42285
|
+
title ? import_react25.default.createElement(
|
|
42286
|
+
Text,
|
|
42287
|
+
{ color },
|
|
42288
|
+
import_react25.default.createElement(TokenizedText, { item: title })
|
|
42289
|
+
) : null,
|
|
42290
|
+
items.map(resolveListItem).map(({ index, item, color: color2, bullet: bullet2, ordered: ordered2 }) => import_react25.default.createElement(ListItem, { key: index, item, color: color2, bullet: bullet2, index, ordered: ordered2 }))
|
|
42291
|
+
);
|
|
42302
42292
|
};
|
|
42303
42293
|
|
|
42304
|
-
// ../cli-kit/
|
|
42294
|
+
// ../cli-kit/dist/private/node/ui/components/UserInput.js
|
|
42305
42295
|
init_cjs_shims();
|
|
42306
42296
|
var import_react26 = __toESM(require_react(), 1);
|
|
42307
42297
|
var UserInput = ({ userInput }) => {
|
|
42308
|
-
return
|
|
42298
|
+
return import_react26.default.createElement(Text, { color: "cyan" }, userInput);
|
|
42309
42299
|
};
|
|
42310
42300
|
|
|
42311
|
-
// ../cli-kit/
|
|
42301
|
+
// ../cli-kit/dist/private/node/ui/components/FilePath.js
|
|
42312
42302
|
init_cjs_shims();
|
|
42313
42303
|
var import_react27 = __toESM(require_react(), 1);
|
|
42314
42304
|
var FilePath = ({ filePath }) => {
|
|
42315
|
-
return
|
|
42305
|
+
return import_react27.default.createElement(Text, { italic: true }, filePath);
|
|
42316
42306
|
};
|
|
42317
42307
|
|
|
42318
|
-
// ../cli-kit/
|
|
42308
|
+
// ../cli-kit/dist/private/node/ui/components/Subdued.js
|
|
42319
42309
|
init_cjs_shims();
|
|
42320
42310
|
var import_react28 = __toESM(require_react(), 1);
|
|
42321
42311
|
var Subdued = ({ subdued }) => {
|
|
42322
|
-
return
|
|
42312
|
+
return import_react28.default.createElement(Text, { dimColor: true }, subdued);
|
|
42323
42313
|
};
|
|
42324
42314
|
|
|
42325
|
-
// ../cli-kit/
|
|
42315
|
+
// ../cli-kit/dist/private/node/ui/components/TokenizedText.js
|
|
42326
42316
|
var import_react29 = __toESM(require_react(), 1);
|
|
42327
42317
|
function tokenToBlock(token) {
|
|
42328
42318
|
return {
|
|
@@ -42382,46 +42372,51 @@ function splitByDisplayType(acc, item) {
|
|
|
42382
42372
|
return acc;
|
|
42383
42373
|
}
|
|
42384
42374
|
var InlineBlocks = ({ blocks }) => {
|
|
42385
|
-
return
|
|
42375
|
+
return import_react29.default.createElement(Text, null, blocks.map((block, blockIndex) => import_react29.default.createElement(
|
|
42376
|
+
Text,
|
|
42377
|
+
{ key: blockIndex },
|
|
42378
|
+
blockIndex !== 0 && !(typeof block.value !== "string" && "char" in block.value) && import_react29.default.createElement(Text, null, " "),
|
|
42379
|
+
import_react29.default.createElement(TokenizedText, { item: block.value })
|
|
42380
|
+
)));
|
|
42386
42381
|
};
|
|
42387
42382
|
var TokenizedText = ({ item }) => {
|
|
42388
42383
|
if (typeof item === "string") {
|
|
42389
|
-
return
|
|
42384
|
+
return import_react29.default.createElement(Text, null, item);
|
|
42390
42385
|
} else if ("command" in item) {
|
|
42391
|
-
return
|
|
42386
|
+
return import_react29.default.createElement(Command, { command: item.command });
|
|
42392
42387
|
} else if ("link" in item) {
|
|
42393
|
-
return
|
|
42388
|
+
return import_react29.default.createElement(Link, { ...item.link });
|
|
42394
42389
|
} else if ("char" in item) {
|
|
42395
|
-
return
|
|
42390
|
+
return import_react29.default.createElement(Text, null, item.char[0]);
|
|
42396
42391
|
} else if ("userInput" in item) {
|
|
42397
|
-
return
|
|
42392
|
+
return import_react29.default.createElement(UserInput, { userInput: item.userInput });
|
|
42398
42393
|
} else if ("subdued" in item) {
|
|
42399
|
-
return
|
|
42394
|
+
return import_react29.default.createElement(Subdued, { subdued: item.subdued });
|
|
42400
42395
|
} else if ("filePath" in item) {
|
|
42401
|
-
return
|
|
42396
|
+
return import_react29.default.createElement(FilePath, { filePath: item.filePath });
|
|
42402
42397
|
} else if ("list" in item) {
|
|
42403
|
-
return
|
|
42398
|
+
return import_react29.default.createElement(List, { ...item.list });
|
|
42404
42399
|
} else if ("bold" in item) {
|
|
42405
|
-
return
|
|
42400
|
+
return import_react29.default.createElement(Text, { bold: true }, item.bold);
|
|
42406
42401
|
} else if ("info" in item) {
|
|
42407
|
-
return
|
|
42402
|
+
return import_react29.default.createElement(Text, { color: "blue" }, item.info);
|
|
42408
42403
|
} else if ("warn" in item) {
|
|
42409
|
-
return
|
|
42404
|
+
return import_react29.default.createElement(Text, { color: "yellow" }, item.warn);
|
|
42410
42405
|
} else if ("error" in item) {
|
|
42411
|
-
return
|
|
42406
|
+
return import_react29.default.createElement(Text, { color: "red" }, item.error);
|
|
42412
42407
|
} else {
|
|
42413
42408
|
const groupedItems = item.map(tokenToBlock).reduce(splitByDisplayType, []);
|
|
42414
|
-
return groupedItems.length === 1 && groupedItems[0].every((item2) => item2.display === "inline") ?
|
|
42409
|
+
return groupedItems.length === 1 && groupedItems[0].every((item2) => item2.display === "inline") ? import_react29.default.createElement(InlineBlocks, { blocks: groupedItems[0] }) : import_react29.default.createElement(Box_default, { flexDirection: "column" }, groupedItems.map((items, groupIndex) => {
|
|
42415
42410
|
if (items[0].display === "inline") {
|
|
42416
|
-
return
|
|
42411
|
+
return import_react29.default.createElement(InlineBlocks, { blocks: items, key: groupIndex });
|
|
42417
42412
|
} else {
|
|
42418
|
-
return
|
|
42413
|
+
return import_react29.default.createElement(List, { key: groupIndex, ...items[0].value.list });
|
|
42419
42414
|
}
|
|
42420
42415
|
}));
|
|
42421
42416
|
}
|
|
42422
42417
|
};
|
|
42423
42418
|
|
|
42424
|
-
// ../cli-kit/
|
|
42419
|
+
// ../cli-kit/dist/public/node/output.js
|
|
42425
42420
|
import { Writable } from "stream";
|
|
42426
42421
|
var TokenizedString = class {
|
|
42427
42422
|
constructor(value) {
|
|
@@ -42670,9 +42665,15 @@ function formatSection(title, body) {
|
|
|
42670
42665
|
return outputContent`${outputToken.heading(formattedTitle)}\n${body}`.value;
|
|
42671
42666
|
}
|
|
42672
42667
|
|
|
42673
|
-
// ../cli-kit/
|
|
42674
|
-
var import_core2 = __toESM(require_lib()
|
|
42675
|
-
var import_ts_error = __toESM(require_cjs()
|
|
42668
|
+
// ../cli-kit/dist/public/node/error.js
|
|
42669
|
+
var import_core2 = __toESM(require_lib());
|
|
42670
|
+
var import_ts_error = __toESM(require_cjs());
|
|
42671
|
+
var FatalErrorType;
|
|
42672
|
+
(function(FatalErrorType2) {
|
|
42673
|
+
FatalErrorType2[FatalErrorType2["Abort"] = 0] = "Abort";
|
|
42674
|
+
FatalErrorType2[FatalErrorType2["AbortSilent"] = 1] = "AbortSilent";
|
|
42675
|
+
FatalErrorType2[FatalErrorType2["Bug"] = 2] = "Bug";
|
|
42676
|
+
})(FatalErrorType || (FatalErrorType = {}));
|
|
42676
42677
|
var CancelExecution = class extends Error {
|
|
42677
42678
|
};
|
|
42678
42679
|
var FatalError = class extends Error {
|
|
@@ -42710,24 +42711,24 @@ var FatalError = class extends Error {
|
|
|
42710
42711
|
};
|
|
42711
42712
|
var AbortError = class extends FatalError {
|
|
42712
42713
|
constructor(message, tryMessage = null, nextSteps, customSections) {
|
|
42713
|
-
super(message,
|
|
42714
|
+
super(message, FatalErrorType.Abort, tryMessage, nextSteps, customSections);
|
|
42714
42715
|
}
|
|
42715
42716
|
};
|
|
42716
42717
|
var ExternalError = class extends FatalError {
|
|
42717
42718
|
constructor(message, command, args, tryMessage = null) {
|
|
42718
|
-
super(message,
|
|
42719
|
+
super(message, FatalErrorType.Abort, tryMessage);
|
|
42719
42720
|
this.command = command;
|
|
42720
42721
|
this.args = args;
|
|
42721
42722
|
}
|
|
42722
42723
|
};
|
|
42723
42724
|
var AbortSilentError = class extends FatalError {
|
|
42724
42725
|
constructor() {
|
|
42725
|
-
super("",
|
|
42726
|
+
super("", FatalErrorType.AbortSilent);
|
|
42726
42727
|
}
|
|
42727
42728
|
};
|
|
42728
42729
|
var BugError = class extends FatalError {
|
|
42729
42730
|
constructor(message, tryMessage = null) {
|
|
42730
|
-
super(message,
|
|
42731
|
+
super(message, FatalErrorType.Bug, tryMessage);
|
|
42731
42732
|
}
|
|
42732
42733
|
};
|
|
42733
42734
|
async function handler(error) {
|
|
@@ -42769,7 +42770,7 @@ function shouldReportError(error) {
|
|
|
42769
42770
|
if (!isFatal(error)) {
|
|
42770
42771
|
return true;
|
|
42771
42772
|
}
|
|
42772
|
-
if (error.type ===
|
|
42773
|
+
if (error.type === FatalErrorType.Bug) {
|
|
42773
42774
|
return true;
|
|
42774
42775
|
}
|
|
42775
42776
|
return false;
|
|
@@ -42778,13 +42779,13 @@ function cleanSingleStackTracePath(filePath) {
|
|
|
42778
42779
|
return normalizePath(filePath).replace("file:/", "/").replace(/^\/?[A-Z]:/, "");
|
|
42779
42780
|
}
|
|
42780
42781
|
|
|
42781
|
-
// ../cli-kit/
|
|
42782
|
+
// ../cli-kit/dist/public/node/abort.js
|
|
42782
42783
|
init_cjs_shims();
|
|
42783
42784
|
var import_node_abort_controller = __toESM(require_node_abort_controller(), 1);
|
|
42784
42785
|
var AbortController = class extends import_node_abort_controller.AbortController {
|
|
42785
42786
|
};
|
|
42786
42787
|
|
|
42787
|
-
// ../cli-kit/
|
|
42788
|
+
// ../cli-kit/dist/public/node/metadata.js
|
|
42788
42789
|
init_cjs_shims();
|
|
42789
42790
|
import { performance as performance2 } from "node:perf_hooks";
|
|
42790
42791
|
function getMetadataErrorHandlingStrategy() {
|
|
@@ -42818,7 +42819,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
|
|
|
42818
42819
|
try {
|
|
42819
42820
|
await getAndSet();
|
|
42820
42821
|
} catch (error) {
|
|
42821
|
-
const { sendErrorToBugsnag } = await import("./error-handler-
|
|
42822
|
+
const { sendErrorToBugsnag } = await import("./error-handler-S56KHSGD.js");
|
|
42822
42823
|
await sendErrorToBugsnag(error, "unexpected_error");
|
|
42823
42824
|
}
|
|
42824
42825
|
}
|
|
@@ -42874,7 +42875,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
|
|
|
42874
42875
|
var coreData = createRuntimeMetadataContainer({ cmd_all_timing_network_ms: 0, cmd_all_timing_prompts_ms: 0 });
|
|
42875
42876
|
var { getAllPublicMetadata, getAllSensitiveMetadata, addPublicMetadata, addSensitiveMetadata, runWithTimer } = coreData;
|
|
42876
42877
|
|
|
42877
|
-
// ../cli-kit/
|
|
42878
|
+
// ../cli-kit/dist/private/node/ui/components/ConcurrentOutput.js
|
|
42878
42879
|
init_cjs_shims();
|
|
42879
42880
|
var import_react30 = __toESM(require_react(), 1);
|
|
42880
42881
|
|
|
@@ -43179,7 +43180,7 @@ var shouldUseMain = isUnicodeSupported();
|
|
|
43179
43180
|
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
43180
43181
|
var figures_default = figures;
|
|
43181
43182
|
|
|
43182
|
-
// ../cli-kit/
|
|
43183
|
+
// ../cli-kit/dist/private/node/ui/components/ConcurrentOutput.js
|
|
43183
43184
|
import { Writable as Writable2 } from "stream";
|
|
43184
43185
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
43185
43186
|
function addLeadingZero(number) {
|
|
@@ -43200,13 +43201,7 @@ var outputContextStore = new AsyncLocalStorage();
|
|
|
43200
43201
|
function useConcurrentOutputContext(context, callback) {
|
|
43201
43202
|
return outputContextStore.run(context, callback);
|
|
43202
43203
|
}
|
|
43203
|
-
var ConcurrentOutput = ({
|
|
43204
|
-
processes,
|
|
43205
|
-
prefixColumnSize,
|
|
43206
|
-
abortSignal,
|
|
43207
|
-
showTimestamps = true,
|
|
43208
|
-
keepRunningAfterProcessesResolve = false
|
|
43209
|
-
}) => {
|
|
43204
|
+
var ConcurrentOutput = ({ processes, prefixColumnSize, abortSignal, showTimestamps = true, keepRunningAfterProcessesResolve = false }) => {
|
|
43210
43205
|
const [processOutput, setProcessOutput] = (0, import_react30.useState)([]);
|
|
43211
43206
|
const { exit: unmountInk } = use_app_default();
|
|
43212
43207
|
const concurrentColors = (0, import_react30.useMemo)(() => ["yellow", "cyan", "magenta", "green", "blue"], []);
|
|
@@ -43223,38 +43218,32 @@ var ConcurrentOutput = ({
|
|
|
43223
43218
|
prefixes.push(prefix);
|
|
43224
43219
|
return prefixes.length - 1;
|
|
43225
43220
|
};
|
|
43226
|
-
const lineColor = (0, import_react30.useCallback)(
|
|
43227
|
-
|
|
43228
|
-
|
|
43229
|
-
|
|
43230
|
-
|
|
43231
|
-
|
|
43232
|
-
|
|
43233
|
-
|
|
43234
|
-
|
|
43235
|
-
|
|
43236
|
-
|
|
43237
|
-
|
|
43238
|
-
|
|
43239
|
-
|
|
43240
|
-
|
|
43241
|
-
|
|
43242
|
-
|
|
43243
|
-
|
|
43244
|
-
|
|
43245
|
-
|
|
43246
|
-
|
|
43247
|
-
|
|
43248
|
-
|
|
43249
|
-
|
|
43250
|
-
|
|
43251
|
-
|
|
43252
|
-
next();
|
|
43253
|
-
}
|
|
43254
|
-
});
|
|
43255
|
-
},
|
|
43256
|
-
[lineColor]
|
|
43257
|
-
);
|
|
43221
|
+
const lineColor = (0, import_react30.useCallback)((index) => {
|
|
43222
|
+
const colorIndex = index % concurrentColors.length;
|
|
43223
|
+
return concurrentColors[colorIndex];
|
|
43224
|
+
}, [concurrentColors]);
|
|
43225
|
+
const writableStream = (0, import_react30.useCallback)((process20, prefixes) => {
|
|
43226
|
+
return new Writable2({
|
|
43227
|
+
write(chunk, _encoding, next) {
|
|
43228
|
+
const context = outputContextStore.getStore();
|
|
43229
|
+
const prefix = context?.outputPrefix ?? process20.prefix;
|
|
43230
|
+
const shouldStripAnsi = context?.stripAnsi ?? true;
|
|
43231
|
+
const log = chunk.toString("utf8").replace(/(\n)$/, "");
|
|
43232
|
+
const index = addPrefix(prefix, prefixes);
|
|
43233
|
+
const lines = shouldStripAnsi ? stripAnsi(log).split(/\n/) : log.split(/\n/);
|
|
43234
|
+
addOrUpdateConcurrentUIEventOutput({ prefix, index, output: lines.join("\n") });
|
|
43235
|
+
setProcessOutput((previousProcessOutput) => [
|
|
43236
|
+
...previousProcessOutput,
|
|
43237
|
+
{
|
|
43238
|
+
color: lineColor(index),
|
|
43239
|
+
prefix,
|
|
43240
|
+
lines
|
|
43241
|
+
}
|
|
43242
|
+
]);
|
|
43243
|
+
next();
|
|
43244
|
+
}
|
|
43245
|
+
});
|
|
43246
|
+
}, [lineColor]);
|
|
43258
43247
|
const formatPrefix = (prefix) => {
|
|
43259
43248
|
if (prefix.length > calculatedPrefixColumnSize) {
|
|
43260
43249
|
return prefix.substring(0, calculatedPrefixColumnSize);
|
|
@@ -43265,13 +43254,11 @@ var ConcurrentOutput = ({
|
|
|
43265
43254
|
const runProcesses = async () => {
|
|
43266
43255
|
const prefixes = [];
|
|
43267
43256
|
try {
|
|
43268
|
-
await Promise.all(
|
|
43269
|
-
|
|
43270
|
-
|
|
43271
|
-
|
|
43272
|
-
|
|
43273
|
-
})
|
|
43274
|
-
);
|
|
43257
|
+
await Promise.all(processes.map(async (process20) => {
|
|
43258
|
+
const stdout = writableStream(process20, prefixes);
|
|
43259
|
+
const stderr = writableStream(process20, prefixes);
|
|
43260
|
+
await process20.action(stdout, stderr, abortSignal);
|
|
43261
|
+
}));
|
|
43275
43262
|
if (!keepRunningAfterProcessesResolve) {
|
|
43276
43263
|
unmountInk();
|
|
43277
43264
|
}
|
|
@@ -43284,12 +43271,36 @@ var ConcurrentOutput = ({
|
|
|
43284
43271
|
runProcesses();
|
|
43285
43272
|
}, [abortSignal, processes, writableStream, unmountInk, keepRunningAfterProcessesResolve]);
|
|
43286
43273
|
const { lineVertical } = figures_default;
|
|
43287
|
-
return
|
|
43288
|
-
return
|
|
43274
|
+
return import_react30.default.createElement(Static, { items: processOutput }, (chunk, index) => {
|
|
43275
|
+
return import_react30.default.createElement(Box_default, { flexDirection: "column", key: index }, chunk.lines.map((line, index2) => import_react30.default.createElement(
|
|
43276
|
+
Box_default,
|
|
43277
|
+
{ key: index2, flexDirection: "row" },
|
|
43278
|
+
import_react30.default.createElement(
|
|
43279
|
+
Text,
|
|
43280
|
+
null,
|
|
43281
|
+
showTimestamps ? import_react30.default.createElement(
|
|
43282
|
+
Text,
|
|
43283
|
+
null,
|
|
43284
|
+
currentTime(),
|
|
43285
|
+
" ",
|
|
43286
|
+
lineVertical,
|
|
43287
|
+
" "
|
|
43288
|
+
) : null,
|
|
43289
|
+
import_react30.default.createElement(Text, { color: chunk.color }, formatPrefix(chunk.prefix)),
|
|
43290
|
+
import_react30.default.createElement(
|
|
43291
|
+
Text,
|
|
43292
|
+
null,
|
|
43293
|
+
" ",
|
|
43294
|
+
lineVertical,
|
|
43295
|
+
" ",
|
|
43296
|
+
line
|
|
43297
|
+
)
|
|
43298
|
+
)
|
|
43299
|
+
)));
|
|
43289
43300
|
});
|
|
43290
43301
|
};
|
|
43291
43302
|
|
|
43292
|
-
// ../cli-kit/
|
|
43303
|
+
// ../cli-kit/dist/private/node/ui.js
|
|
43293
43304
|
init_cjs_shims();
|
|
43294
43305
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
43295
43306
|
function renderOnce(element, { logLevel = "info", logger = consoleLog, renderOptions }) {
|
|
@@ -43342,16 +43353,16 @@ function handleCtrlC(input, key, exit = () => treeKill(process.pid, "SIGINT")) {
|
|
|
43342
43353
|
}
|
|
43343
43354
|
}
|
|
43344
43355
|
|
|
43345
|
-
// ../cli-kit/
|
|
43356
|
+
// ../cli-kit/dist/private/node/ui/alert.js
|
|
43346
43357
|
init_cjs_shims();
|
|
43347
43358
|
|
|
43348
|
-
// ../cli-kit/
|
|
43359
|
+
// ../cli-kit/dist/private/node/ui/components/Alert.js
|
|
43349
43360
|
init_cjs_shims();
|
|
43350
43361
|
|
|
43351
|
-
// ../cli-kit/
|
|
43362
|
+
// ../cli-kit/dist/private/node/ui/components/Banner.js
|
|
43352
43363
|
init_cjs_shims();
|
|
43353
43364
|
|
|
43354
|
-
// ../cli-kit/
|
|
43365
|
+
// ../cli-kit/dist/private/node/ui/hooks/use-layout.js
|
|
43355
43366
|
init_cjs_shims();
|
|
43356
43367
|
var import_react31 = __toESM(require_react(), 1);
|
|
43357
43368
|
var MIN_FULL_WIDTH = 20;
|
|
@@ -43391,11 +43402,7 @@ function calculateLayout(stdout) {
|
|
|
43391
43402
|
twoThirds
|
|
43392
43403
|
};
|
|
43393
43404
|
}
|
|
43394
|
-
function column({
|
|
43395
|
-
fullWidth,
|
|
43396
|
-
fraction,
|
|
43397
|
-
minWidth
|
|
43398
|
-
}) {
|
|
43405
|
+
function column({ fullWidth, fraction, minWidth }) {
|
|
43399
43406
|
const fractionedWidth = Math.floor(fullWidth / fraction[1] * fraction[0]);
|
|
43400
43407
|
if (fractionedWidth < minWidth) {
|
|
43401
43408
|
return minWidth;
|
|
@@ -43404,7 +43411,7 @@ function column({
|
|
|
43404
43411
|
}
|
|
43405
43412
|
}
|
|
43406
43413
|
|
|
43407
|
-
// ../cli-kit/
|
|
43414
|
+
// ../cli-kit/dist/private/node/ui/components/Banner.js
|
|
43408
43415
|
var import_react32 = __toESM(require_react(), 1);
|
|
43409
43416
|
function typeToColor(type) {
|
|
43410
43417
|
return {
|
|
@@ -43422,43 +43429,39 @@ var Footnotes = () => {
|
|
|
43422
43429
|
}
|
|
43423
43430
|
const links = linksContext.links.current;
|
|
43424
43431
|
const linkIds = Object.keys(links);
|
|
43425
|
-
return linkIds.length > 0 ?
|
|
43432
|
+
return linkIds.length > 0 ? import_react32.default.createElement(Box_default, { marginBottom: 1, marginTop: -1, flexDirection: "column" }, linkIds.map((id) => import_react32.default.createElement(Text, { key: id }, `[${id}] ${links[id]?.url}`))) : null;
|
|
43426
43433
|
};
|
|
43427
43434
|
var BoxWithBorder = ({ type, children }) => {
|
|
43428
43435
|
const { twoThirds } = useLayout();
|
|
43429
43436
|
const links = (0, import_react32.useRef)({});
|
|
43430
|
-
return
|
|
43437
|
+
return import_react32.default.createElement(
|
|
43431
43438
|
LinksContext.Provider,
|
|
43432
|
-
{
|
|
43433
|
-
|
|
43434
|
-
|
|
43435
|
-
|
|
43436
|
-
|
|
43437
|
-
|
|
43438
|
-
return id;
|
|
43439
|
-
}
|
|
43440
|
-
const newId = (Object.keys(links.current).length + 1).toString();
|
|
43441
|
-
links.current = {
|
|
43442
|
-
...links.current,
|
|
43443
|
-
[newId]: { label, url }
|
|
43444
|
-
};
|
|
43445
|
-
return newId;
|
|
43439
|
+
{ value: {
|
|
43440
|
+
links,
|
|
43441
|
+
addLink: (label, url) => {
|
|
43442
|
+
const id = Object.keys(links.current).find((id2) => links.current[id2].url === url);
|
|
43443
|
+
if (id) {
|
|
43444
|
+
return id;
|
|
43446
43445
|
}
|
|
43446
|
+
const newId = (Object.keys(links.current).length + 1).toString();
|
|
43447
|
+
links.current = {
|
|
43448
|
+
...links.current,
|
|
43449
|
+
[newId]: { label, url }
|
|
43450
|
+
};
|
|
43451
|
+
return newId;
|
|
43447
43452
|
}
|
|
43448
|
-
},
|
|
43449
|
-
|
|
43453
|
+
} },
|
|
43454
|
+
import_react32.default.createElement(
|
|
43450
43455
|
Box_default,
|
|
43451
|
-
{
|
|
43452
|
-
|
|
43453
|
-
|
|
43454
|
-
|
|
43455
|
-
|
|
43456
|
-
|
|
43457
|
-
},
|
|
43458
|
-
/* @__PURE__ */ import_react32.default.createElement(Box_default, { marginTop: -1, marginLeft: 1 }, /* @__PURE__ */ import_react32.default.createElement(Text, null, ` ${type.replace(/_/g, " ")} `)),
|
|
43459
|
-
/* @__PURE__ */ import_react32.default.createElement(Box_default, { flexDirection: "column", paddingY: 1, paddingX: 2, gap: 1 }, children)
|
|
43456
|
+
{ width: twoThirds, marginBottom: 1, borderStyle: "round", flexDirection: "column", borderColor: typeToColor(type) },
|
|
43457
|
+
import_react32.default.createElement(
|
|
43458
|
+
Box_default,
|
|
43459
|
+
{ marginTop: -1, marginLeft: 1 },
|
|
43460
|
+
import_react32.default.createElement(Text, null, ` ${type.replace(/_/g, " ")} `)
|
|
43461
|
+
),
|
|
43462
|
+
import_react32.default.createElement(Box_default, { flexDirection: "column", paddingY: 1, paddingX: 2, gap: 1 }, children)
|
|
43460
43463
|
),
|
|
43461
|
-
|
|
43464
|
+
import_react32.default.createElement(Footnotes, null)
|
|
43462
43465
|
);
|
|
43463
43466
|
};
|
|
43464
43467
|
var BoxWithTopBottomLines = ({ type, children }) => {
|
|
@@ -43466,7 +43469,19 @@ var BoxWithTopBottomLines = ({ type, children }) => {
|
|
|
43466
43469
|
let topLineAfterTypeLength = twoThirds - 2 - type.length - 2;
|
|
43467
43470
|
if (topLineAfterTypeLength < 0)
|
|
43468
43471
|
topLineAfterTypeLength = 0;
|
|
43469
|
-
return
|
|
43472
|
+
return import_react32.default.createElement(
|
|
43473
|
+
Box_default,
|
|
43474
|
+
{ flexDirection: "column", marginBottom: 1, gap: 1 },
|
|
43475
|
+
import_react32.default.createElement(
|
|
43476
|
+
Text,
|
|
43477
|
+
null,
|
|
43478
|
+
import_react32.default.createElement(Text, { color: typeToColor(type) }, "\u2500".repeat(2)),
|
|
43479
|
+
import_react32.default.createElement(Text, null, ` ${type.replace(/_/g, " ")} `),
|
|
43480
|
+
import_react32.default.createElement(Text, { color: typeToColor(type) }, "\u2500".repeat(topLineAfterTypeLength))
|
|
43481
|
+
),
|
|
43482
|
+
children,
|
|
43483
|
+
import_react32.default.createElement(Text, { color: typeToColor(type) }, "\u2500".repeat(twoThirds))
|
|
43484
|
+
);
|
|
43470
43485
|
};
|
|
43471
43486
|
var Banner = ({ children, ...props }) => {
|
|
43472
43487
|
if (props.type === "external_error") {
|
|
@@ -43476,22 +43491,31 @@ var Banner = ({ children, ...props }) => {
|
|
|
43476
43491
|
}
|
|
43477
43492
|
};
|
|
43478
43493
|
|
|
43479
|
-
// ../cli-kit/
|
|
43494
|
+
// ../cli-kit/dist/private/node/ui/components/Alert.js
|
|
43480
43495
|
var import_react33 = __toESM(require_react(), 1);
|
|
43481
|
-
var Alert = ({
|
|
43482
|
-
|
|
43483
|
-
|
|
43484
|
-
|
|
43485
|
-
|
|
43486
|
-
|
|
43487
|
-
|
|
43488
|
-
|
|
43489
|
-
|
|
43490
|
-
})
|
|
43491
|
-
|
|
43496
|
+
var Alert = ({ type, headline, body, nextSteps, reference, link: link2, customSections, orderedNextSteps = false }) => {
|
|
43497
|
+
return import_react33.default.createElement(
|
|
43498
|
+
Banner,
|
|
43499
|
+
{ type },
|
|
43500
|
+
headline ? import_react33.default.createElement(
|
|
43501
|
+
Text,
|
|
43502
|
+
{ bold: true },
|
|
43503
|
+
import_react33.default.createElement(TokenizedText, { item: headline })
|
|
43504
|
+
) : null,
|
|
43505
|
+
body ? import_react33.default.createElement(TokenizedText, { item: body }) : null,
|
|
43506
|
+
nextSteps && nextSteps.length > 0 ? import_react33.default.createElement(List, { title: "Next steps", items: nextSteps, ordered: orderedNextSteps }) : null,
|
|
43507
|
+
reference && reference.length > 0 ? import_react33.default.createElement(List, { title: "Reference", items: reference }) : null,
|
|
43508
|
+
link2 ? import_react33.default.createElement(Link, { url: link2.url, label: link2.label }) : null,
|
|
43509
|
+
customSections && customSections.length > 0 ? import_react33.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, customSections.map((section, index) => import_react33.default.createElement(
|
|
43510
|
+
Box_default,
|
|
43511
|
+
{ key: index, flexDirection: "column" },
|
|
43512
|
+
section.title ? import_react33.default.createElement(Text, { bold: true }, section.title) : null,
|
|
43513
|
+
import_react33.default.createElement(TokenizedText, { item: section.body })
|
|
43514
|
+
))) : null
|
|
43515
|
+
);
|
|
43492
43516
|
};
|
|
43493
43517
|
|
|
43494
|
-
// ../cli-kit/
|
|
43518
|
+
// ../cli-kit/dist/private/node/ui/alert.js
|
|
43495
43519
|
var import_react34 = __toESM(require_react(), 1);
|
|
43496
43520
|
var typeToLogLevel = {
|
|
43497
43521
|
info: "info",
|
|
@@ -43505,38 +43529,13 @@ var typeToLogger = {
|
|
|
43505
43529
|
success: consoleLog,
|
|
43506
43530
|
error: consoleError
|
|
43507
43531
|
};
|
|
43508
|
-
function alert({
|
|
43509
|
-
type,
|
|
43510
|
-
headline,
|
|
43511
|
-
body,
|
|
43512
|
-
nextSteps,
|
|
43513
|
-
reference,
|
|
43514
|
-
link: link2,
|
|
43515
|
-
customSections,
|
|
43516
|
-
orderedNextSteps = false,
|
|
43517
|
-
renderOptions
|
|
43518
|
-
}) {
|
|
43532
|
+
function alert({ type, headline, body, nextSteps, reference, link: link2, customSections, orderedNextSteps = false, renderOptions }) {
|
|
43519
43533
|
const { type: alertType, ...eventProps } = arguments[0];
|
|
43520
43534
|
recordUIEvent({ type, properties: eventProps });
|
|
43521
|
-
return renderOnce(
|
|
43522
|
-
/* @__PURE__ */ import_react34.default.createElement(
|
|
43523
|
-
Alert,
|
|
43524
|
-
{
|
|
43525
|
-
type,
|
|
43526
|
-
headline,
|
|
43527
|
-
body,
|
|
43528
|
-
nextSteps,
|
|
43529
|
-
reference,
|
|
43530
|
-
link: link2,
|
|
43531
|
-
orderedNextSteps,
|
|
43532
|
-
customSections
|
|
43533
|
-
}
|
|
43534
|
-
),
|
|
43535
|
-
{ logLevel: typeToLogLevel[type], logger: typeToLogger[type], renderOptions }
|
|
43536
|
-
);
|
|
43535
|
+
return renderOnce(import_react34.default.createElement(Alert, { type, headline, body, nextSteps, reference, link: link2, orderedNextSteps, customSections }), { logLevel: typeToLogLevel[type], logger: typeToLogger[type], renderOptions });
|
|
43537
43536
|
}
|
|
43538
43537
|
|
|
43539
|
-
// ../cli-kit/
|
|
43538
|
+
// ../cli-kit/dist/private/node/ui/components/FatalError.js
|
|
43540
43539
|
init_cjs_shims();
|
|
43541
43540
|
var import_react35 = __toESM(require_react(), 1);
|
|
43542
43541
|
var import_stacktracey = __toESM(require_stacktracey(), 1);
|
|
@@ -43560,13 +43559,52 @@ var FatalError2 = ({ error }) => {
|
|
|
43560
43559
|
if (error instanceof ExternalError) {
|
|
43561
43560
|
tool = `${error.command} ${error.args.join(" ")}`;
|
|
43562
43561
|
}
|
|
43563
|
-
return
|
|
43562
|
+
return import_react35.default.createElement(
|
|
43563
|
+
Banner,
|
|
43564
|
+
{ type: tool ? "external_error" : "error" },
|
|
43565
|
+
tool ? import_react35.default.createElement(
|
|
43566
|
+
Text,
|
|
43567
|
+
null,
|
|
43568
|
+
"Error coming from ",
|
|
43569
|
+
import_react35.default.createElement(Command, { command: tool })
|
|
43570
|
+
) : null,
|
|
43571
|
+
error.formattedMessage ? import_react35.default.createElement(TokenizedText, { item: error.formattedMessage }) : import_react35.default.createElement(Text, null, error.message),
|
|
43572
|
+
error.tryMessage ? import_react35.default.createElement(TokenizedText, { item: error.tryMessage }) : null,
|
|
43573
|
+
error.nextSteps && error.nextSteps.length > 0 ? import_react35.default.createElement(List, { title: "Next steps", items: error.nextSteps }) : null,
|
|
43574
|
+
error.customSections && error.customSections.length > 0 ? import_react35.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, error.customSections.map((section, index) => import_react35.default.createElement(
|
|
43575
|
+
Box_default,
|
|
43576
|
+
{ key: index, flexDirection: "column" },
|
|
43577
|
+
section.title ? import_react35.default.createElement(Text, { bold: true }, section.title) : null,
|
|
43578
|
+
import_react35.default.createElement(TokenizedText, { item: section.body })
|
|
43579
|
+
))) : null,
|
|
43580
|
+
stack && stack.items.length !== 0 ? import_react35.default.createElement(
|
|
43581
|
+
Box_default,
|
|
43582
|
+
{ flexDirection: "column" },
|
|
43583
|
+
import_react35.default.createElement(Text, null, "To investigate the issue, examine this stack trace:"),
|
|
43584
|
+
stack.items.map((item, index) => import_react35.default.createElement(
|
|
43585
|
+
Box_default,
|
|
43586
|
+
{ flexDirection: "column", key: index, paddingLeft: 2 },
|
|
43587
|
+
import_react35.default.createElement(
|
|
43588
|
+
Text,
|
|
43589
|
+
null,
|
|
43590
|
+
"at",
|
|
43591
|
+
item.calleeShort ? import_react35.default.createElement(Text, { color: "yellow" }, ` ${item.calleeShort}`) : null,
|
|
43592
|
+
item.fileShort ? ` (${item.fileShort}:${item.line})` : null
|
|
43593
|
+
),
|
|
43594
|
+
import_react35.default.createElement(
|
|
43595
|
+
Box_default,
|
|
43596
|
+
{ paddingLeft: 2 },
|
|
43597
|
+
import_react35.default.createElement(Text, { dimColor: true }, item.sourceLine?.trim())
|
|
43598
|
+
)
|
|
43599
|
+
))
|
|
43600
|
+
) : null
|
|
43601
|
+
);
|
|
43564
43602
|
};
|
|
43565
43603
|
|
|
43566
|
-
// ../cli-kit/
|
|
43604
|
+
// ../cli-kit/dist/private/node/ui/components/Table/Table.js
|
|
43567
43605
|
init_cjs_shims();
|
|
43568
43606
|
|
|
43569
|
-
// ../cli-kit/
|
|
43607
|
+
// ../cli-kit/dist/private/node/ui/components/Table/Row.js
|
|
43570
43608
|
init_cjs_shims();
|
|
43571
43609
|
var import_react36 = __toESM(require_react(), 1);
|
|
43572
43610
|
function join(elements, separator) {
|
|
@@ -43578,21 +43616,23 @@ function join(elements, separator) {
|
|
|
43578
43616
|
}, []);
|
|
43579
43617
|
}
|
|
43580
43618
|
var Row = ({ rowKey, columns, data, fillerChar, ignoreColumnColor }) => {
|
|
43581
|
-
return
|
|
43582
|
-
|
|
43583
|
-
|
|
43584
|
-
|
|
43585
|
-
|
|
43586
|
-
|
|
43587
|
-
|
|
43588
|
-
|
|
43589
|
-
|
|
43590
|
-
|
|
43591
|
-
|
|
43592
|
-
|
|
43619
|
+
return import_react36.default.createElement(Box_default, { flexDirection: "row" }, ...join(columns.map((column2) => {
|
|
43620
|
+
const content = data[column2.name];
|
|
43621
|
+
const key = `${rowKey}-cell-${column2.name.toString()}`;
|
|
43622
|
+
const marginRight = column2.width - unstyled(String(content ?? "")).length;
|
|
43623
|
+
return import_react36.default.createElement(
|
|
43624
|
+
Text,
|
|
43625
|
+
{ key, color: ignoreColumnColor ? void 0 : column2.color },
|
|
43626
|
+
content,
|
|
43627
|
+
fillerChar.repeat(marginRight)
|
|
43628
|
+
);
|
|
43629
|
+
}), (index) => {
|
|
43630
|
+
const key = `${rowKey}-horizontal-separator-${index}`;
|
|
43631
|
+
return import_react36.default.createElement(Text, { key }, " ");
|
|
43632
|
+
}));
|
|
43593
43633
|
};
|
|
43594
43634
|
|
|
43595
|
-
// ../cli-kit/
|
|
43635
|
+
// ../cli-kit/dist/private/node/ui/components/Table/Table.js
|
|
43596
43636
|
var import_react37 = __toESM(require_react(), 1);
|
|
43597
43637
|
function Table({ rows, columns: columnsConfiguration }) {
|
|
43598
43638
|
const columns = Object.entries(columnsConfiguration).map(([key, { header, color }]) => {
|
|
@@ -43610,32 +43650,30 @@ function Table({ rows, columns: columnsConfiguration }) {
|
|
|
43610
43650
|
color
|
|
43611
43651
|
};
|
|
43612
43652
|
});
|
|
43613
|
-
const headings = Object.entries(columnsConfiguration).reduce(
|
|
43614
|
-
|
|
43615
|
-
|
|
43653
|
+
const headings = Object.entries(columnsConfiguration).reduce((headings2, [column2, { header }]) => ({ ...headings2, [column2]: header || column2 }), {});
|
|
43654
|
+
return import_react37.default.createElement(
|
|
43655
|
+
Box_default,
|
|
43656
|
+
{ flexDirection: "column" },
|
|
43657
|
+
import_react37.default.createElement(Row, { rowKey: "heading", fillerChar: " ", columns, data: headings, ignoreColumnColor: true }),
|
|
43658
|
+
import_react37.default.createElement(Row, { rowKey: "separator", fillerChar: "\u2500", columns, data: {}, ignoreColumnColor: true }),
|
|
43659
|
+
rows.map((row, index) => {
|
|
43660
|
+
const key = `row-${index}`;
|
|
43661
|
+
return import_react37.default.createElement(
|
|
43662
|
+
Box_default,
|
|
43663
|
+
{ flexDirection: "column", key },
|
|
43664
|
+
import_react37.default.createElement(Row, { rowKey: `data-${key}`, fillerChar: " ", columns, data: row })
|
|
43665
|
+
);
|
|
43666
|
+
})
|
|
43616
43667
|
);
|
|
43617
|
-
return /* @__PURE__ */ import_react37.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react37.default.createElement(Row, { rowKey: "heading", fillerChar: " ", columns, data: headings, ignoreColumnColor: true }), /* @__PURE__ */ import_react37.default.createElement(Row, { rowKey: "separator", fillerChar: "\u2500", columns, data: {}, ignoreColumnColor: true }), rows.map((row, index) => {
|
|
43618
|
-
const key = `row-${index}`;
|
|
43619
|
-
return /* @__PURE__ */ import_react37.default.createElement(Box_default, { flexDirection: "column", key }, /* @__PURE__ */ import_react37.default.createElement(Row, { rowKey: `data-${key}`, fillerChar: " ", columns, data: row }));
|
|
43620
|
-
}));
|
|
43621
43668
|
}
|
|
43622
43669
|
|
|
43623
|
-
// ../cli-kit/
|
|
43670
|
+
// ../cli-kit/dist/private/node/ui/components/DangerousConfirmationPrompt.js
|
|
43624
43671
|
init_cjs_shims();
|
|
43625
43672
|
|
|
43626
|
-
// ../cli-kit/
|
|
43673
|
+
// ../cli-kit/dist/private/node/ui/components/TextInput.js
|
|
43627
43674
|
init_cjs_shims();
|
|
43628
43675
|
var import_react38 = __toESM(require_react(), 1);
|
|
43629
|
-
var TextInput = ({
|
|
43630
|
-
value: originalValue,
|
|
43631
|
-
defaultValue = "",
|
|
43632
|
-
onChange,
|
|
43633
|
-
placeholder = "",
|
|
43634
|
-
noColor = !shouldDisplayColors(),
|
|
43635
|
-
color = noColor ? void 0 : "cyan",
|
|
43636
|
-
password = false,
|
|
43637
|
-
focus = true
|
|
43638
|
-
}) => {
|
|
43676
|
+
var TextInput = ({ value: originalValue, defaultValue = "", onChange, placeholder = "", noColor = !shouldDisplayColors(), color = noColor ? void 0 : "cyan", password = false, focus = true }) => {
|
|
43639
43677
|
const [cursorOffset, setCursorOffset] = (0, import_react38.useState)((originalValue || "").length);
|
|
43640
43678
|
(0, import_react38.useEffect)(() => {
|
|
43641
43679
|
setCursorOffset((previousOffset) => {
|
|
@@ -43652,7 +43690,7 @@ var TextInput = ({
|
|
|
43652
43690
|
return source_default.inverse(value2[0]) + source_default.dim(value2.slice(1));
|
|
43653
43691
|
};
|
|
43654
43692
|
const cursorChar = figures_default.square;
|
|
43655
|
-
const defaultCursor =
|
|
43693
|
+
const defaultCursor = import_react38.default.createElement(Text, { backgroundColor: color }, cursorChar);
|
|
43656
43694
|
const placeholderText = defaultValue.length > 0 ? defaultValue : placeholder.length > 0 ? placeholder : "";
|
|
43657
43695
|
const renderedPlaceholder = placeholderText.length > 0 ? renderPlaceholder(placeholderText) : defaultCursor;
|
|
43658
43696
|
renderedValue = value.split("").map((char, index) => {
|
|
@@ -43663,49 +43701,51 @@ var TextInput = ({
|
|
|
43663
43701
|
}
|
|
43664
43702
|
}).join("");
|
|
43665
43703
|
if (cursorOffset === value.length) {
|
|
43666
|
-
renderedValue =
|
|
43704
|
+
renderedValue = import_react38.default.createElement(
|
|
43705
|
+
Text,
|
|
43706
|
+
null,
|
|
43707
|
+
renderedValue,
|
|
43708
|
+
defaultCursor
|
|
43709
|
+
);
|
|
43667
43710
|
}
|
|
43668
|
-
use_input_default(
|
|
43669
|
-
(input
|
|
43670
|
-
|
|
43711
|
+
use_input_default((input, key) => {
|
|
43712
|
+
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.shift && key.tab || key.return) {
|
|
43713
|
+
return;
|
|
43714
|
+
} else if (key.tab) {
|
|
43715
|
+
if (originalValue.length === 0 && placeholderText) {
|
|
43716
|
+
onChange(placeholderText);
|
|
43717
|
+
setCursorOffset(placeholderText.length);
|
|
43671
43718
|
return;
|
|
43672
|
-
} else if (key.tab) {
|
|
43673
|
-
if (originalValue.length === 0 && placeholderText) {
|
|
43674
|
-
onChange(placeholderText);
|
|
43675
|
-
setCursorOffset(placeholderText.length);
|
|
43676
|
-
return;
|
|
43677
|
-
}
|
|
43678
43719
|
}
|
|
43679
|
-
|
|
43680
|
-
|
|
43681
|
-
|
|
43682
|
-
|
|
43683
|
-
|
|
43684
|
-
|
|
43685
|
-
} else if (key.rightArrow) {
|
|
43686
|
-
if (cursorOffset < originalValue.length) {
|
|
43687
|
-
nextCursorOffset++;
|
|
43688
|
-
}
|
|
43689
|
-
} else if (key.backspace || key.delete) {
|
|
43690
|
-
if (cursorOffset > 0) {
|
|
43691
|
-
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
43692
|
-
nextCursorOffset--;
|
|
43693
|
-
}
|
|
43694
|
-
} else {
|
|
43695
|
-
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
43696
|
-
nextCursorOffset += input.length;
|
|
43720
|
+
}
|
|
43721
|
+
let nextCursorOffset = cursorOffset;
|
|
43722
|
+
let nextValue = originalValue;
|
|
43723
|
+
if (key.leftArrow) {
|
|
43724
|
+
if (cursorOffset > 0) {
|
|
43725
|
+
nextCursorOffset--;
|
|
43697
43726
|
}
|
|
43698
|
-
|
|
43699
|
-
if (
|
|
43700
|
-
|
|
43727
|
+
} else if (key.rightArrow) {
|
|
43728
|
+
if (cursorOffset < originalValue.length) {
|
|
43729
|
+
nextCursorOffset++;
|
|
43701
43730
|
}
|
|
43702
|
-
}
|
|
43703
|
-
|
|
43704
|
-
|
|
43705
|
-
|
|
43731
|
+
} else if (key.backspace || key.delete) {
|
|
43732
|
+
if (cursorOffset > 0) {
|
|
43733
|
+
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
43734
|
+
nextCursorOffset--;
|
|
43735
|
+
}
|
|
43736
|
+
} else {
|
|
43737
|
+
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
43738
|
+
nextCursorOffset += input.length;
|
|
43739
|
+
}
|
|
43740
|
+
setCursorOffset(nextCursorOffset);
|
|
43741
|
+
if (nextValue !== originalValue) {
|
|
43742
|
+
onChange(nextValue);
|
|
43743
|
+
}
|
|
43744
|
+
}, { isActive: focus });
|
|
43745
|
+
return import_react38.default.createElement(Text, { color }, value.length > 0 ? renderedValue : renderedPlaceholder);
|
|
43706
43746
|
};
|
|
43707
43747
|
|
|
43708
|
-
// ../cli-kit/
|
|
43748
|
+
// ../cli-kit/dist/private/node/ui/components/Prompts/InfoTable.js
|
|
43709
43749
|
init_cjs_shims();
|
|
43710
43750
|
var import_react39 = __toESM(require_react(), 1);
|
|
43711
43751
|
var InfoTable = ({ table }) => {
|
|
@@ -43717,26 +43757,40 @@ var InfoTable = ({ table }) => {
|
|
|
43717
43757
|
bullet: void 0,
|
|
43718
43758
|
emptyItemsText: void 0
|
|
43719
43759
|
}));
|
|
43720
|
-
const headerColumnWidth = Math.max(
|
|
43721
|
-
...
|
|
43722
|
-
return
|
|
43723
|
-
|
|
43724
|
-
|
|
43725
|
-
|
|
43726
|
-
|
|
43727
|
-
}
|
|
43728
|
-
|
|
43729
|
-
|
|
43760
|
+
const headerColumnWidth = Math.max(...sections.map((section) => {
|
|
43761
|
+
return Math.max(...section.header.split("\n").map((line) => {
|
|
43762
|
+
return line.length;
|
|
43763
|
+
}));
|
|
43764
|
+
}));
|
|
43765
|
+
return import_react39.default.createElement(Box_default, { flexDirection: "column" }, sections.map((section, index) => import_react39.default.createElement(
|
|
43766
|
+
Box_default,
|
|
43767
|
+
{ key: index, marginBottom: index === sections.length - 1 ? 0 : 1, flexDirection: "column" },
|
|
43768
|
+
section.header.length > 0 && import_react39.default.createElement(
|
|
43769
|
+
Box_default,
|
|
43770
|
+
{ width: headerColumnWidth + 1 },
|
|
43771
|
+
import_react39.default.createElement(Text, { color: section.color, bold: true }, capitalize(section.header))
|
|
43772
|
+
),
|
|
43773
|
+
import_react39.default.createElement(
|
|
43774
|
+
Box_default,
|
|
43775
|
+
{ flexGrow: 1, flexDirection: "column", gap: 1 },
|
|
43776
|
+
section.emptyItemsText && section.items.length === 0 ? import_react39.default.createElement(
|
|
43777
|
+
Text,
|
|
43778
|
+
{ color: section.color },
|
|
43779
|
+
import_react39.default.createElement(TokenizedText, { item: { subdued: section.emptyItemsText } })
|
|
43780
|
+
) : import_react39.default.createElement(List, { margin: false, items: section.items, color: section.color, bullet: section.bullet }),
|
|
43781
|
+
section.helperText ? import_react39.default.createElement(Text, { color: section.color }, section.helperText) : null
|
|
43782
|
+
)
|
|
43783
|
+
)));
|
|
43730
43784
|
};
|
|
43731
43785
|
|
|
43732
|
-
// ../cli-kit/
|
|
43786
|
+
// ../cli-kit/dist/private/node/ui/utilities.js
|
|
43733
43787
|
init_cjs_shims();
|
|
43734
43788
|
function messageWithPunctuation(message) {
|
|
43735
43789
|
const messageToString = tokenItemToString(message);
|
|
43736
43790
|
return messageToString.endsWith("?") || messageToString.endsWith(":") || messageToString.endsWith(".") ? message : appendToTokenItem(message, ":");
|
|
43737
43791
|
}
|
|
43738
43792
|
|
|
43739
|
-
// ../cli-kit/
|
|
43793
|
+
// ../cli-kit/dist/private/node/ui/hooks/use-abort-signal.js
|
|
43740
43794
|
init_cjs_shims();
|
|
43741
43795
|
var import_react40 = __toESM(require_react(), 1);
|
|
43742
43796
|
var noop2 = () => Promise.resolve();
|
|
@@ -43756,11 +43810,19 @@ function useAbortSignal(abortSignal, onAbort = noop2) {
|
|
|
43756
43810
|
return { isAborted };
|
|
43757
43811
|
}
|
|
43758
43812
|
|
|
43759
|
-
// ../cli-kit/
|
|
43813
|
+
// ../cli-kit/dist/private/node/ui/hooks/use-prompt.js
|
|
43760
43814
|
init_cjs_shims();
|
|
43761
43815
|
var import_react41 = __toESM(require_react(), 1);
|
|
43816
|
+
var PromptState;
|
|
43817
|
+
(function(PromptState2) {
|
|
43818
|
+
PromptState2["Idle"] = "idle";
|
|
43819
|
+
PromptState2["Loading"] = "loading";
|
|
43820
|
+
PromptState2["Submitted"] = "submitted";
|
|
43821
|
+
PromptState2["Error"] = "error";
|
|
43822
|
+
PromptState2["Cancelled"] = "cancelled";
|
|
43823
|
+
})(PromptState || (PromptState = {}));
|
|
43762
43824
|
function usePrompt({ initialAnswer }) {
|
|
43763
|
-
const [promptState, setPromptState] = (0, import_react41.useState)(
|
|
43825
|
+
const [promptState, setPromptState] = (0, import_react41.useState)(PromptState.Idle);
|
|
43764
43826
|
const [answer, setAnswer] = (0, import_react41.useState)(initialAnswer);
|
|
43765
43827
|
return {
|
|
43766
43828
|
promptState,
|
|
@@ -43770,109 +43832,138 @@ function usePrompt({ initialAnswer }) {
|
|
|
43770
43832
|
};
|
|
43771
43833
|
}
|
|
43772
43834
|
|
|
43773
|
-
// ../cli-kit/
|
|
43835
|
+
// ../cli-kit/dist/private/node/ui/components/DangerousConfirmationPrompt.js
|
|
43774
43836
|
var import_react42 = __toESM(require_react(), 1);
|
|
43775
|
-
var DangerousConfirmationPrompt = ({
|
|
43776
|
-
|
|
43777
|
-
|
|
43778
|
-
|
|
43779
|
-
onSubmit,
|
|
43780
|
-
abortSignal
|
|
43781
|
-
}) => {
|
|
43782
|
-
const validateAnswer = (0, import_react42.useCallback)(
|
|
43783
|
-
(value) => {
|
|
43784
|
-
return value === confirmation ? void 0 : ["Value must be exactly", { userInput: confirmation }];
|
|
43785
|
-
},
|
|
43786
|
-
[confirmation]
|
|
43787
|
-
);
|
|
43837
|
+
var DangerousConfirmationPrompt = ({ message, confirmation, infoTable, onSubmit, abortSignal }) => {
|
|
43838
|
+
const validateAnswer = (0, import_react42.useCallback)((value) => {
|
|
43839
|
+
return value === confirmation ? void 0 : ["Value must be exactly", { userInput: confirmation }];
|
|
43840
|
+
}, [confirmation]);
|
|
43788
43841
|
const { oneThird, twoThirds } = useLayout();
|
|
43789
43842
|
const { promptState, setPromptState, answer, setAnswer } = usePrompt({
|
|
43790
43843
|
initialAnswer: ""
|
|
43791
43844
|
});
|
|
43792
43845
|
const { exit: unmountInk } = use_app_default();
|
|
43793
43846
|
const [error, setError] = (0, import_react42.useState)(void 0);
|
|
43794
|
-
const color = promptState ===
|
|
43847
|
+
const color = promptState === PromptState.Error ? "red" : "cyan";
|
|
43795
43848
|
const underline = new Array(oneThird - 3).fill("\u2594");
|
|
43796
43849
|
const { isAborted } = useAbortSignal(abortSignal);
|
|
43797
43850
|
use_input_default((input, key) => {
|
|
43798
43851
|
handleCtrlC(input, key);
|
|
43799
43852
|
if (key.escape) {
|
|
43800
|
-
setPromptState(
|
|
43853
|
+
setPromptState(PromptState.Cancelled);
|
|
43801
43854
|
setError(void 0);
|
|
43802
43855
|
}
|
|
43803
43856
|
if (key.return) {
|
|
43804
43857
|
const error2 = validateAnswer(answer);
|
|
43805
43858
|
if (error2) {
|
|
43806
|
-
setPromptState(
|
|
43859
|
+
setPromptState(PromptState.Error);
|
|
43807
43860
|
setError(error2);
|
|
43808
43861
|
} else {
|
|
43809
|
-
setPromptState(
|
|
43862
|
+
setPromptState(PromptState.Submitted);
|
|
43810
43863
|
}
|
|
43811
43864
|
}
|
|
43812
43865
|
});
|
|
43813
43866
|
(0, import_react42.useEffect)(() => {
|
|
43814
|
-
if (promptState ===
|
|
43867
|
+
if (promptState === PromptState.Submitted) {
|
|
43815
43868
|
onSubmit(true);
|
|
43816
43869
|
unmountInk();
|
|
43817
|
-
} else if (promptState ===
|
|
43870
|
+
} else if (promptState === PromptState.Cancelled) {
|
|
43818
43871
|
onSubmit(false);
|
|
43819
43872
|
unmountInk();
|
|
43820
43873
|
}
|
|
43821
43874
|
}, [onSubmit, promptState, unmountInk]);
|
|
43822
|
-
const completed = promptState ===
|
|
43823
|
-
return isAborted ? null :
|
|
43875
|
+
const completed = promptState === PromptState.Submitted || promptState === PromptState.Cancelled;
|
|
43876
|
+
return isAborted ? null : import_react42.default.createElement(
|
|
43824
43877
|
Box_default,
|
|
43825
|
-
{
|
|
43826
|
-
|
|
43827
|
-
|
|
43828
|
-
|
|
43829
|
-
|
|
43830
|
-
|
|
43831
|
-
|
|
43832
|
-
|
|
43833
|
-
|
|
43834
|
-
|
|
43835
|
-
|
|
43836
|
-
|
|
43837
|
-
|
|
43838
|
-
|
|
43839
|
-
|
|
43840
|
-
|
|
43841
|
-
|
|
43842
|
-
|
|
43843
|
-
|
|
43844
|
-
|
|
43845
|
-
|
|
43846
|
-
|
|
43847
|
-
|
|
43878
|
+
{ flexDirection: "column", marginBottom: 1, width: twoThirds },
|
|
43879
|
+
import_react42.default.createElement(
|
|
43880
|
+
Box_default,
|
|
43881
|
+
null,
|
|
43882
|
+
import_react42.default.createElement(
|
|
43883
|
+
Box_default,
|
|
43884
|
+
{ marginRight: 2 },
|
|
43885
|
+
import_react42.default.createElement(Text, null, "?")
|
|
43886
|
+
),
|
|
43887
|
+
import_react42.default.createElement(TokenizedText, { item: messageWithPunctuation(message) })
|
|
43888
|
+
),
|
|
43889
|
+
completed ? import_react42.default.createElement(CompletedPrompt, { cancelled: promptState === PromptState.Cancelled }) : import_react42.default.createElement(
|
|
43890
|
+
import_react42.default.Fragment,
|
|
43891
|
+
null,
|
|
43892
|
+
import_react42.default.createElement(
|
|
43893
|
+
Box_default,
|
|
43894
|
+
{ flexDirection: "column", gap: 1, marginTop: 1, marginLeft: 3 },
|
|
43895
|
+
infoTable ? import_react42.default.createElement(
|
|
43896
|
+
Box_default,
|
|
43897
|
+
{ paddingLeft: 2, borderStyle: "bold", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, flexDirection: "column", gap: 1 },
|
|
43898
|
+
import_react42.default.createElement(InfoTable, { table: infoTable })
|
|
43899
|
+
) : null,
|
|
43900
|
+
import_react42.default.createElement(
|
|
43901
|
+
Box_default,
|
|
43902
|
+
null,
|
|
43903
|
+
import_react42.default.createElement(TokenizedText, { item: ["Type", { userInput: confirmation }, "to confirm, or press Escape to cancel."] })
|
|
43904
|
+
)
|
|
43905
|
+
),
|
|
43906
|
+
import_react42.default.createElement(
|
|
43907
|
+
Box_default,
|
|
43908
|
+
{ flexDirection: "column", width: oneThird },
|
|
43909
|
+
import_react42.default.createElement(
|
|
43910
|
+
Box_default,
|
|
43911
|
+
null,
|
|
43912
|
+
import_react42.default.createElement(
|
|
43913
|
+
Box_default,
|
|
43914
|
+
{ marginRight: 2 },
|
|
43915
|
+
import_react42.default.createElement(Text, { color }, `>`)
|
|
43916
|
+
),
|
|
43917
|
+
import_react42.default.createElement(
|
|
43918
|
+
Box_default,
|
|
43919
|
+
{ flexGrow: 1 },
|
|
43920
|
+
import_react42.default.createElement(TextInput, { value: answer, onChange: (answer2) => {
|
|
43921
|
+
setAnswer(answer2);
|
|
43922
|
+
setPromptState(PromptState.Idle);
|
|
43923
|
+
}, defaultValue: "", color })
|
|
43924
|
+
)
|
|
43925
|
+
),
|
|
43926
|
+
import_react42.default.createElement(
|
|
43927
|
+
Box_default,
|
|
43928
|
+
{ marginLeft: 3 },
|
|
43929
|
+
import_react42.default.createElement(Text, { color }, underline)
|
|
43930
|
+
),
|
|
43931
|
+
promptState === PromptState.Error && error ? import_react42.default.createElement(
|
|
43932
|
+
Box_default,
|
|
43933
|
+
{ marginLeft: 3 },
|
|
43934
|
+
import_react42.default.createElement(
|
|
43935
|
+
Text,
|
|
43936
|
+
{ color },
|
|
43937
|
+
import_react42.default.createElement(TokenizedText, { item: error })
|
|
43938
|
+
)
|
|
43939
|
+
) : null
|
|
43940
|
+
)
|
|
43941
|
+
)
|
|
43942
|
+
);
|
|
43848
43943
|
};
|
|
43849
|
-
var CompletedPrompt = ({ cancelled }) =>
|
|
43944
|
+
var CompletedPrompt = ({ cancelled }) => import_react42.default.createElement(
|
|
43945
|
+
Box_default,
|
|
43946
|
+
null,
|
|
43947
|
+
import_react42.default.createElement(Box_default, { marginRight: 2 }, cancelled ? import_react42.default.createElement(Text, { color: "red" }, figures_default.cross) : import_react42.default.createElement(Text, { color: "cyan" }, figures_default.tick)),
|
|
43948
|
+
import_react42.default.createElement(Box_default, { flexGrow: 1 }, cancelled ? import_react42.default.createElement(Text, { color: "red" }, "Cancelled") : import_react42.default.createElement(Text, { color: "cyan" }, "Confirmed"))
|
|
43949
|
+
);
|
|
43850
43950
|
|
|
43851
|
-
// ../cli-kit/
|
|
43951
|
+
// ../cli-kit/dist/private/node/ui/components/SelectPrompt.js
|
|
43852
43952
|
init_cjs_shims();
|
|
43853
43953
|
|
|
43854
|
-
// ../cli-kit/
|
|
43954
|
+
// ../cli-kit/dist/private/node/ui/components/SelectInput.js
|
|
43855
43955
|
init_cjs_shims();
|
|
43856
43956
|
|
|
43857
|
-
// ../cli-kit/
|
|
43957
|
+
// ../cli-kit/dist/private/node/ui/components/Scrollbar.js
|
|
43858
43958
|
init_cjs_shims();
|
|
43859
43959
|
var import_react43 = __toESM(require_react(), 1);
|
|
43860
43960
|
var BACKGROUND_CHAR = "\u2502";
|
|
43861
43961
|
var SCROLLBOX_CHAR = "\u2551";
|
|
43862
|
-
var Scrollbar = ({
|
|
43863
|
-
containerHeight,
|
|
43864
|
-
visibleListSectionLength,
|
|
43865
|
-
fullListLength,
|
|
43866
|
-
visibleFromIndex,
|
|
43867
|
-
noColor = !shouldDisplayColors()
|
|
43868
|
-
}) => {
|
|
43962
|
+
var Scrollbar = ({ containerHeight, visibleListSectionLength, fullListLength, visibleFromIndex, noColor = !shouldDisplayColors() }) => {
|
|
43869
43963
|
const displayArrows = containerHeight >= 4 && noColor;
|
|
43870
43964
|
const visibleToIndex = visibleFromIndex + visibleListSectionLength - 1;
|
|
43871
43965
|
const fullHeight = displayArrows ? containerHeight - 2 : containerHeight;
|
|
43872
|
-
const scrollboxHeight = Math.min(
|
|
43873
|
-
fullHeight - 1,
|
|
43874
|
-
Math.ceil(Math.min(1, visibleListSectionLength / fullListLength) * fullHeight)
|
|
43875
|
-
);
|
|
43966
|
+
const scrollboxHeight = Math.min(fullHeight - 1, Math.ceil(Math.min(1, visibleListSectionLength / fullListLength) * fullHeight));
|
|
43876
43967
|
let topBuffer;
|
|
43877
43968
|
if (visibleToIndex >= fullListLength - 1) {
|
|
43878
43969
|
topBuffer = fullHeight - scrollboxHeight;
|
|
@@ -43894,10 +43985,30 @@ var Scrollbar = ({
|
|
|
43894
43985
|
const scrollboxChar = noColor ? SCROLLBOX_CHAR : " ";
|
|
43895
43986
|
const bgColor = noColor ? void 0 : "gray";
|
|
43896
43987
|
const scrollboxColor = noColor ? void 0 : "cyan";
|
|
43897
|
-
return
|
|
43988
|
+
return import_react43.default.createElement(
|
|
43989
|
+
Box_default,
|
|
43990
|
+
{ flexDirection: "column" },
|
|
43991
|
+
displayArrows ? import_react43.default.createElement(Text, null, "\u25B3") : null,
|
|
43992
|
+
import_react43.default.createElement(
|
|
43993
|
+
Box_default,
|
|
43994
|
+
{ width: 1 },
|
|
43995
|
+
import_react43.default.createElement(Text, { backgroundColor: bgColor }, backgroundChar.repeat(topBuffer))
|
|
43996
|
+
),
|
|
43997
|
+
import_react43.default.createElement(
|
|
43998
|
+
Box_default,
|
|
43999
|
+
{ width: 1 },
|
|
44000
|
+
import_react43.default.createElement(Text, { backgroundColor: scrollboxColor }, scrollboxChar.repeat(scrollboxHeight))
|
|
44001
|
+
),
|
|
44002
|
+
import_react43.default.createElement(
|
|
44003
|
+
Box_default,
|
|
44004
|
+
{ width: 1 },
|
|
44005
|
+
import_react43.default.createElement(Text, { backgroundColor: bgColor }, backgroundChar.repeat(bottomBuffer))
|
|
44006
|
+
),
|
|
44007
|
+
displayArrows ? import_react43.default.createElement(Text, null, "\u25BD") : null
|
|
44008
|
+
);
|
|
43898
44009
|
};
|
|
43899
44010
|
|
|
43900
|
-
// ../cli-kit/
|
|
44011
|
+
// ../cli-kit/dist/private/node/ui/hooks/use-select-state.js
|
|
43901
44012
|
init_cjs_shims();
|
|
43902
44013
|
var import_react44 = __toESM(require_react(), 1);
|
|
43903
44014
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -44013,11 +44124,7 @@ var reducer = (state, action) => {
|
|
|
44013
44124
|
}
|
|
44014
44125
|
}
|
|
44015
44126
|
};
|
|
44016
|
-
var createDefaultState = ({
|
|
44017
|
-
visibleOptionCount: customVisibleOptionCount,
|
|
44018
|
-
defaultValue,
|
|
44019
|
-
options
|
|
44020
|
-
}) => {
|
|
44127
|
+
var createDefaultState = ({ visibleOptionCount: customVisibleOptionCount, defaultValue, options }) => {
|
|
44021
44128
|
const visibleOptionCount = typeof customVisibleOptionCount === "number" ? Math.min(customVisibleOptionCount, options.length) : options.length;
|
|
44022
44129
|
const optionMap = new OptionMap(options);
|
|
44023
44130
|
const defaultOption = typeof defaultValue === "undefined" ? void 0 : optionMap.get(defaultValue);
|
|
@@ -44083,7 +44190,7 @@ var useSelectState = ({ visibleOptionCount, options, defaultValue }) => {
|
|
|
44083
44190
|
};
|
|
44084
44191
|
};
|
|
44085
44192
|
|
|
44086
|
-
// ../cli-kit/
|
|
44193
|
+
// ../cli-kit/dist/private/node/ui/components/SelectInput.js
|
|
44087
44194
|
var import_react45 = __toESM(require_react(), 1);
|
|
44088
44195
|
var import_sortBy = __toESM(require_sortBy(), 1);
|
|
44089
44196
|
function highlightedLabel(label, term) {
|
|
@@ -44103,16 +44210,7 @@ function validateKeys(items) {
|
|
|
44103
44210
|
throw new Error("SelectInput: All items must have keys if one does");
|
|
44104
44211
|
}
|
|
44105
44212
|
}
|
|
44106
|
-
function Item({
|
|
44107
|
-
item,
|
|
44108
|
-
previousItem,
|
|
44109
|
-
isSelected,
|
|
44110
|
-
highlightedTerm,
|
|
44111
|
-
enableShortcuts,
|
|
44112
|
-
items,
|
|
44113
|
-
hasAnyGroup,
|
|
44114
|
-
index
|
|
44115
|
-
}) {
|
|
44213
|
+
function Item({ item, previousItem, isSelected, highlightedTerm, enableShortcuts, items, hasAnyGroup, index }) {
|
|
44116
44214
|
const label = highlightedLabel(item.label, highlightedTerm);
|
|
44117
44215
|
let title;
|
|
44118
44216
|
let labelColor;
|
|
@@ -44125,36 +44223,24 @@ function Item({
|
|
|
44125
44223
|
title = item.group ?? (hasAnyGroup ? "Other" : void 0);
|
|
44126
44224
|
}
|
|
44127
44225
|
const showKey = enableShortcuts && item.key && item.key.length > 0;
|
|
44128
|
-
return
|
|
44226
|
+
return import_react45.default.createElement(
|
|
44129
44227
|
Box_default,
|
|
44130
|
-
{
|
|
44131
|
-
|
|
44132
|
-
|
|
44133
|
-
|
|
44134
|
-
|
|
44135
|
-
|
|
44136
|
-
|
|
44137
|
-
|
|
44228
|
+
{ key: index, flexDirection: "column", marginTop: items.indexOf(item) !== 0 && title ? 1 : 0, minHeight: title ? 2 : 1 },
|
|
44229
|
+
title ? import_react45.default.createElement(
|
|
44230
|
+
Box_default,
|
|
44231
|
+
{ marginLeft: 3 },
|
|
44232
|
+
import_react45.default.createElement(Text, { bold: true }, title)
|
|
44233
|
+
) : null,
|
|
44234
|
+
import_react45.default.createElement(
|
|
44235
|
+
Box_default,
|
|
44236
|
+
{ key: index, marginLeft: hasAnyGroup ? 3 : 0 },
|
|
44237
|
+
import_react45.default.createElement(Box_default, { marginRight: 2 }, isSelected ? import_react45.default.createElement(Text, { color: "cyan" }, `>`) : import_react45.default.createElement(Text, null, " ")),
|
|
44238
|
+
import_react45.default.createElement(Text, { color: labelColor }, showKey ? `(${item.key}) ${label}` : label)
|
|
44239
|
+
)
|
|
44138
44240
|
);
|
|
44139
44241
|
}
|
|
44140
44242
|
var MAX_AVAILABLE_LINES = 25;
|
|
44141
|
-
function SelectInputInner({
|
|
44142
|
-
items: rawItems,
|
|
44143
|
-
initialItems = rawItems,
|
|
44144
|
-
onChange,
|
|
44145
|
-
enableShortcuts = true,
|
|
44146
|
-
focus = true,
|
|
44147
|
-
emptyMessage = "No items to select.",
|
|
44148
|
-
defaultValue,
|
|
44149
|
-
highlightedTerm,
|
|
44150
|
-
loading = false,
|
|
44151
|
-
errorMessage,
|
|
44152
|
-
hasMorePages = false,
|
|
44153
|
-
morePagesMessage,
|
|
44154
|
-
availableLines = MAX_AVAILABLE_LINES,
|
|
44155
|
-
onSubmit,
|
|
44156
|
-
inputFixedAreaRef
|
|
44157
|
-
}, ref) {
|
|
44243
|
+
function SelectInputInner({ items: rawItems, initialItems = rawItems, onChange, enableShortcuts = true, focus = true, emptyMessage = "No items to select.", defaultValue, highlightedTerm, loading = false, errorMessage, hasMorePages = false, morePagesMessage, availableLines = MAX_AVAILABLE_LINES, onSubmit, inputFixedAreaRef }, ref) {
|
|
44158
44244
|
let noItems = false;
|
|
44159
44245
|
if (rawItems.length === 0) {
|
|
44160
44246
|
rawItems = [{ label: emptyMessage, value: null, disabled: true }];
|
|
@@ -44191,117 +44277,120 @@ function SelectInputInner({
|
|
|
44191
44277
|
state.selectNextOption();
|
|
44192
44278
|
}
|
|
44193
44279
|
};
|
|
44194
|
-
const handleShortcuts = (0, import_react45.useCallback)(
|
|
44195
|
-
(
|
|
44196
|
-
|
|
44197
|
-
|
|
44198
|
-
|
|
44199
|
-
if (
|
|
44200
|
-
if (onSubmit && item) {
|
|
44201
|
-
onSubmit(item);
|
|
44202
|
-
}
|
|
44203
|
-
state.selectOption({ option: itemWithKey });
|
|
44204
|
-
}
|
|
44205
|
-
}
|
|
44206
|
-
},
|
|
44207
|
-
[items, onSubmit, state]
|
|
44208
|
-
);
|
|
44209
|
-
use_input_default(
|
|
44210
|
-
(input, key) => {
|
|
44211
|
-
handleCtrlC(input, key);
|
|
44212
|
-
if (typeof state.value !== "undefined" && key.return) {
|
|
44213
|
-
const item = items.find((item2) => item2.value === state.value);
|
|
44214
|
-
if (item && onSubmit) {
|
|
44280
|
+
const handleShortcuts = (0, import_react45.useCallback)((input) => {
|
|
44281
|
+
if (state.visibleOptions.map((item) => item.key).includes(input)) {
|
|
44282
|
+
const itemWithKey = state.visibleOptions.find((item2) => item2.key === input);
|
|
44283
|
+
const item = items.find((item2) => item2.value === itemWithKey?.value);
|
|
44284
|
+
if (itemWithKey && !itemWithKey.disabled) {
|
|
44285
|
+
if (onSubmit && item) {
|
|
44215
44286
|
onSubmit(item);
|
|
44216
44287
|
}
|
|
44288
|
+
state.selectOption({ option: itemWithKey });
|
|
44217
44289
|
}
|
|
44218
|
-
|
|
44219
|
-
|
|
44220
|
-
|
|
44221
|
-
|
|
44290
|
+
}
|
|
44291
|
+
}, [items, onSubmit, state]);
|
|
44292
|
+
use_input_default((input, key) => {
|
|
44293
|
+
handleCtrlC(input, key);
|
|
44294
|
+
if (typeof state.value !== "undefined" && key.return) {
|
|
44295
|
+
const item = items.find((item2) => item2.value === state.value);
|
|
44296
|
+
if (item && onSubmit) {
|
|
44297
|
+
onSubmit(item);
|
|
44222
44298
|
}
|
|
44223
|
-
}
|
|
44224
|
-
|
|
44225
|
-
|
|
44299
|
+
}
|
|
44300
|
+
if (enableShortcuts && input.length > 0 && Object.values(key).every((value) => value === false)) {
|
|
44301
|
+
handleShortcuts(input);
|
|
44302
|
+
} else {
|
|
44303
|
+
handleArrows(key);
|
|
44304
|
+
}
|
|
44305
|
+
}, { isActive: focus });
|
|
44226
44306
|
const { twoThirds } = useLayout();
|
|
44227
44307
|
if (loading) {
|
|
44228
|
-
return
|
|
44308
|
+
return import_react45.default.createElement(
|
|
44309
|
+
Box_default,
|
|
44310
|
+
{ marginLeft: 3 },
|
|
44311
|
+
import_react45.default.createElement(Text, { dimColor: true }, "Loading...")
|
|
44312
|
+
);
|
|
44229
44313
|
} else if (errorMessage && errorMessage.length > 0) {
|
|
44230
|
-
return
|
|
44314
|
+
return import_react45.default.createElement(
|
|
44315
|
+
Box_default,
|
|
44316
|
+
{ marginLeft: 3 },
|
|
44317
|
+
import_react45.default.createElement(Text, { color: "red" }, errorMessage)
|
|
44318
|
+
);
|
|
44231
44319
|
} else {
|
|
44232
44320
|
const optionsHeight = initialItems.length + maximumLinesLostToGroups(initialItems);
|
|
44233
44321
|
const minHeight = hasAnyGroup ? 5 : 2;
|
|
44234
44322
|
const sectionHeight = Math.max(minHeight, Math.min(availableLinesToUse, optionsHeight));
|
|
44235
|
-
return
|
|
44236
|
-
|
|
44237
|
-
{
|
|
44238
|
-
|
|
44239
|
-
|
|
44240
|
-
|
|
44241
|
-
highlightedTerm,
|
|
44242
|
-
|
|
44243
|
-
|
|
44244
|
-
|
|
44245
|
-
|
|
44246
|
-
|
|
44247
|
-
|
|
44248
|
-
|
|
44249
|
-
|
|
44250
|
-
|
|
44251
|
-
|
|
44252
|
-
|
|
44253
|
-
|
|
44254
|
-
|
|
44255
|
-
|
|
44256
|
-
|
|
44323
|
+
return import_react45.default.createElement(
|
|
44324
|
+
Box_default,
|
|
44325
|
+
{ flexDirection: "column", ref, gap: 1, width: twoThirds },
|
|
44326
|
+
import_react45.default.createElement(
|
|
44327
|
+
Box_default,
|
|
44328
|
+
{ flexDirection: "row", height: sectionHeight, width: "100%" },
|
|
44329
|
+
import_react45.default.createElement(Box_default, { flexDirection: "column", overflowY: "hidden", flexGrow: 1 }, state.visibleOptions.map((item, index) => import_react45.default.createElement(Item, { key: index, item, previousItem: state.visibleOptions[index - 1], highlightedTerm, isSelected: item.value === state.value, items: state.visibleOptions, enableShortcuts, hasAnyGroup, index }))),
|
|
44330
|
+
hasLimit ? import_react45.default.createElement(Scrollbar, { containerHeight: sectionHeight, visibleListSectionLength: limit, fullListLength: items.length, visibleFromIndex: state.visibleFromIndex }) : null
|
|
44331
|
+
),
|
|
44332
|
+
import_react45.default.createElement(Box_default, { ref: inputFixedAreaRef }, noItems ? import_react45.default.createElement(
|
|
44333
|
+
Box_default,
|
|
44334
|
+
{ marginLeft: 3 },
|
|
44335
|
+
import_react45.default.createElement(Text, { dimColor: true }, "Try again with a different keyword.")
|
|
44336
|
+
) : import_react45.default.createElement(
|
|
44337
|
+
Box_default,
|
|
44338
|
+
{ marginLeft: 3, flexDirection: "column" },
|
|
44339
|
+
import_react45.default.createElement(Text, { dimColor: true }, `Press ${figures_default.arrowUp}${figures_default.arrowDown} arrows to select, enter ${itemsHaveKeys ? "or a shortcut " : ""}to confirm.`),
|
|
44340
|
+
hasMorePages ? import_react45.default.createElement(
|
|
44341
|
+
Text,
|
|
44342
|
+
null,
|
|
44343
|
+
import_react45.default.createElement(
|
|
44344
|
+
Text,
|
|
44345
|
+
{ bold: true },
|
|
44346
|
+
"1-",
|
|
44347
|
+
items.length,
|
|
44348
|
+
" of many"
|
|
44349
|
+
),
|
|
44350
|
+
morePagesMessage ? ` ${morePagesMessage}` : null
|
|
44351
|
+
) : null
|
|
44352
|
+
))
|
|
44353
|
+
);
|
|
44257
44354
|
}
|
|
44258
44355
|
}
|
|
44259
44356
|
var SelectInput = (0, import_react45.forwardRef)(SelectInputInner);
|
|
44260
44357
|
|
|
44261
|
-
// ../cli-kit/
|
|
44358
|
+
// ../cli-kit/dist/private/node/ui/components/Prompts/PromptLayout.js
|
|
44262
44359
|
init_cjs_shims();
|
|
44263
44360
|
|
|
44264
|
-
// ../cli-kit/
|
|
44361
|
+
// ../cli-kit/dist/private/node/ui/components/Prompts/InfoMessage.js
|
|
44265
44362
|
init_cjs_shims();
|
|
44266
44363
|
var import_react46 = __toESM(require_react(), 1);
|
|
44267
|
-
var InfoMessage = ({
|
|
44268
|
-
|
|
44269
|
-
|
|
44270
|
-
|
|
44271
|
-
|
|
44272
|
-
|
|
44273
|
-
|
|
44364
|
+
var InfoMessage = ({ message: { title: { color, text: title }, body } }) => {
|
|
44365
|
+
return import_react46.default.createElement(
|
|
44366
|
+
Box_default,
|
|
44367
|
+
{ flexDirection: "column", gap: 1 },
|
|
44368
|
+
import_react46.default.createElement(
|
|
44369
|
+
Text,
|
|
44370
|
+
{ color },
|
|
44371
|
+
import_react46.default.createElement(TokenizedText, { item: title })
|
|
44372
|
+
),
|
|
44373
|
+
import_react46.default.createElement(TokenizedText, { item: body })
|
|
44374
|
+
);
|
|
44274
44375
|
};
|
|
44275
44376
|
|
|
44276
|
-
// ../cli-kit/
|
|
44377
|
+
// ../cli-kit/dist/private/node/ui/components/Prompts/PromptLayout.js
|
|
44277
44378
|
var import_react47 = __toESM(require_react(), 1);
|
|
44278
|
-
var PromptLayout = ({
|
|
44279
|
-
message,
|
|
44280
|
-
infoTable,
|
|
44281
|
-
abortSignal,
|
|
44282
|
-
infoMessage,
|
|
44283
|
-
header,
|
|
44284
|
-
state,
|
|
44285
|
-
input,
|
|
44286
|
-
submittedAnswerLabel
|
|
44287
|
-
}) => {
|
|
44379
|
+
var PromptLayout = ({ message, infoTable, abortSignal, infoMessage, header, state, input, submittedAnswerLabel }) => {
|
|
44288
44380
|
const { stdout } = use_stdout_default();
|
|
44289
44381
|
const [wrapperHeight, setWrapperHeight] = (0, import_react47.useState)(0);
|
|
44290
44382
|
const [promptAreaHeight, setPromptAreaHeight] = (0, import_react47.useState)(0);
|
|
44291
44383
|
const [inputFixedAreaHeight, setInputFixedAreaHeight] = (0, import_react47.useState)(0);
|
|
44292
44384
|
const currentAvailableLines = stdout.rows - promptAreaHeight - inputFixedAreaHeight;
|
|
44293
44385
|
const [availableLines, setAvailableLines] = (0, import_react47.useState)(currentAvailableLines);
|
|
44294
|
-
const wrapperRef = (0, import_react47.useCallback)(
|
|
44295
|
-
(node)
|
|
44296
|
-
|
|
44297
|
-
|
|
44298
|
-
|
|
44299
|
-
setWrapperHeight(height);
|
|
44300
|
-
}
|
|
44386
|
+
const wrapperRef = (0, import_react47.useCallback)((node) => {
|
|
44387
|
+
if (node !== null) {
|
|
44388
|
+
const { height } = measure_element_default(node);
|
|
44389
|
+
if (wrapperHeight !== height) {
|
|
44390
|
+
setWrapperHeight(height);
|
|
44301
44391
|
}
|
|
44302
|
-
}
|
|
44303
|
-
|
|
44304
|
-
);
|
|
44392
|
+
}
|
|
44393
|
+
}, [wrapperHeight]);
|
|
44305
44394
|
const promptAreaRef = (0, import_react47.useCallback)((node) => {
|
|
44306
44395
|
if (node !== null) {
|
|
44307
44396
|
const { height } = measure_element_default(node);
|
|
@@ -44330,36 +44419,46 @@ var PromptLayout = ({
|
|
|
44330
44419
|
}, [wrapperHeight, promptAreaHeight, stdout, availableLines, inputFixedAreaHeight]);
|
|
44331
44420
|
const { isAborted } = useAbortSignal(abortSignal);
|
|
44332
44421
|
const showInfoTable = infoTable && Object.keys(infoTable).length > 0;
|
|
44333
|
-
return isAborted ? null :
|
|
44422
|
+
return isAborted ? null : import_react47.default.createElement(
|
|
44334
44423
|
Box_default,
|
|
44335
|
-
{
|
|
44336
|
-
|
|
44337
|
-
|
|
44338
|
-
|
|
44339
|
-
|
|
44340
|
-
|
|
44341
|
-
|
|
44342
|
-
|
|
44343
|
-
|
|
44344
|
-
|
|
44345
|
-
|
|
44346
|
-
|
|
44347
|
-
|
|
44348
|
-
|
|
44349
|
-
|
|
44424
|
+
{ flexDirection: "column", marginBottom: 1, ref: wrapperRef },
|
|
44425
|
+
import_react47.default.createElement(
|
|
44426
|
+
Box_default,
|
|
44427
|
+
{ ref: promptAreaRef, flexDirection: "column" },
|
|
44428
|
+
import_react47.default.createElement(
|
|
44429
|
+
Box_default,
|
|
44430
|
+
null,
|
|
44431
|
+
import_react47.default.createElement(
|
|
44432
|
+
Box_default,
|
|
44433
|
+
{ marginRight: 2 },
|
|
44434
|
+
import_react47.default.createElement(Text, null, "?")
|
|
44435
|
+
),
|
|
44436
|
+
import_react47.default.createElement(TokenizedText, { item: messageWithPunctuation(message) }),
|
|
44437
|
+
header
|
|
44438
|
+
),
|
|
44439
|
+
(showInfoTable || infoMessage) && state !== PromptState.Submitted ? import_react47.default.createElement(
|
|
44440
|
+
Box_default,
|
|
44441
|
+
{ marginTop: 1, marginLeft: 3, paddingLeft: 2, borderStyle: "bold", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, flexDirection: "column", gap: 1 },
|
|
44442
|
+
infoMessage ? import_react47.default.createElement(InfoMessage, { message: infoMessage }) : null,
|
|
44443
|
+
showInfoTable ? import_react47.default.createElement(InfoTable, { table: infoTable }) : null
|
|
44444
|
+
) : null
|
|
44445
|
+
),
|
|
44446
|
+
state === PromptState.Submitted && submittedAnswerLabel ? import_react47.default.createElement(
|
|
44447
|
+
Box_default,
|
|
44448
|
+
null,
|
|
44449
|
+
import_react47.default.createElement(
|
|
44450
|
+
Box_default,
|
|
44451
|
+
{ marginRight: 2 },
|
|
44452
|
+
import_react47.default.createElement(Text, { color: "cyan" }, figures_default.tick)
|
|
44453
|
+
),
|
|
44454
|
+
import_react47.default.createElement(Text, { color: "cyan" }, submittedAnswerLabel)
|
|
44455
|
+
) : import_react47.default.createElement(Box_default, { marginTop: 1 }, inputComponent)
|
|
44456
|
+
);
|
|
44350
44457
|
};
|
|
44351
44458
|
|
|
44352
|
-
// ../cli-kit/
|
|
44459
|
+
// ../cli-kit/dist/private/node/ui/components/SelectPrompt.js
|
|
44353
44460
|
var import_react48 = __toESM(require_react(), 1);
|
|
44354
|
-
function SelectPrompt({
|
|
44355
|
-
message,
|
|
44356
|
-
choices,
|
|
44357
|
-
infoTable,
|
|
44358
|
-
infoMessage,
|
|
44359
|
-
onSubmit,
|
|
44360
|
-
defaultValue,
|
|
44361
|
-
abortSignal
|
|
44362
|
-
}) {
|
|
44461
|
+
function SelectPrompt({ message, choices, infoTable, infoMessage, onSubmit, defaultValue, abortSignal }) {
|
|
44363
44462
|
if (choices.length === 0) {
|
|
44364
44463
|
throw new Error("SelectPrompt requires at least one choice");
|
|
44365
44464
|
}
|
|
@@ -44367,37 +44466,23 @@ function SelectPrompt({
|
|
|
44367
44466
|
const { promptState, setPromptState, answer, setAnswer } = usePrompt({
|
|
44368
44467
|
initialAnswer: void 0
|
|
44369
44468
|
});
|
|
44370
|
-
const submitAnswer = (0, import_react48.useCallback)(
|
|
44371
|
-
(answer2)
|
|
44372
|
-
|
|
44373
|
-
|
|
44374
|
-
},
|
|
44375
|
-
[setAnswer, setPromptState]
|
|
44376
|
-
);
|
|
44469
|
+
const submitAnswer = (0, import_react48.useCallback)((answer2) => {
|
|
44470
|
+
setAnswer(answer2);
|
|
44471
|
+
setPromptState(PromptState.Submitted);
|
|
44472
|
+
}, [setAnswer, setPromptState]);
|
|
44377
44473
|
(0, import_react48.useEffect)(() => {
|
|
44378
|
-
if (promptState ===
|
|
44474
|
+
if (promptState === PromptState.Submitted && answer) {
|
|
44379
44475
|
unmountInk();
|
|
44380
44476
|
onSubmit(answer.value);
|
|
44381
44477
|
}
|
|
44382
44478
|
}, [answer, onSubmit, promptState, unmountInk]);
|
|
44383
|
-
return
|
|
44384
|
-
PromptLayout,
|
|
44385
|
-
{
|
|
44386
|
-
message,
|
|
44387
|
-
state: promptState,
|
|
44388
|
-
submittedAnswerLabel: answer?.label,
|
|
44389
|
-
infoTable,
|
|
44390
|
-
infoMessage,
|
|
44391
|
-
abortSignal,
|
|
44392
|
-
input: /* @__PURE__ */ import_react48.default.createElement(SelectInput, { defaultValue, items: choices, onSubmit: submitAnswer })
|
|
44393
|
-
}
|
|
44394
|
-
);
|
|
44479
|
+
return import_react48.default.createElement(PromptLayout, { message, state: promptState, submittedAnswerLabel: answer?.label, infoTable, infoMessage, abortSignal, input: import_react48.default.createElement(SelectInput, { defaultValue, items: choices, onSubmit: submitAnswer }) });
|
|
44395
44480
|
}
|
|
44396
44481
|
|
|
44397
|
-
// ../cli-kit/
|
|
44482
|
+
// ../cli-kit/dist/private/node/ui/components/Tasks.js
|
|
44398
44483
|
init_cjs_shims();
|
|
44399
44484
|
|
|
44400
|
-
// ../cli-kit/
|
|
44485
|
+
// ../cli-kit/dist/private/node/ui/components/TextAnimation.js
|
|
44401
44486
|
init_cjs_shims();
|
|
44402
44487
|
var import_react49 = __toESM(require_react(), 1);
|
|
44403
44488
|
var import_gradient_string = __toESM(require_gradient_string(), 1);
|
|
@@ -44425,11 +44510,11 @@ var TextAnimation = (0, import_react49.memo)(({ text }) => {
|
|
|
44425
44510
|
clearTimeout(timeout.current);
|
|
44426
44511
|
};
|
|
44427
44512
|
}, [renderAnimation]);
|
|
44428
|
-
return
|
|
44513
|
+
return import_react49.default.createElement(Text, null, renderedFrame);
|
|
44429
44514
|
});
|
|
44430
44515
|
TextAnimation.displayName = "TextAnimation";
|
|
44431
44516
|
|
|
44432
|
-
// ../cli-kit/
|
|
44517
|
+
// ../cli-kit/dist/private/node/ui/hooks/use-async-and-unmount.js
|
|
44433
44518
|
init_cjs_shims();
|
|
44434
44519
|
var import_react50 = __toESM(require_react(), 1);
|
|
44435
44520
|
function useAsyncAndUnmount(asyncFunction, { onFulfilled = () => {
|
|
@@ -44447,9 +44532,15 @@ function useAsyncAndUnmount(asyncFunction, { onFulfilled = () => {
|
|
|
44447
44532
|
}, []);
|
|
44448
44533
|
}
|
|
44449
44534
|
|
|
44450
|
-
// ../cli-kit/
|
|
44535
|
+
// ../cli-kit/dist/private/node/ui/components/Tasks.js
|
|
44451
44536
|
var import_react51 = __toESM(require_react(), 1);
|
|
44452
44537
|
var loadingBarChar = "\u2580";
|
|
44538
|
+
var TasksState;
|
|
44539
|
+
(function(TasksState2) {
|
|
44540
|
+
TasksState2["Loading"] = "loading";
|
|
44541
|
+
TasksState2["Success"] = "success";
|
|
44542
|
+
TasksState2["Failure"] = "failure";
|
|
44543
|
+
})(TasksState || (TasksState = {}));
|
|
44453
44544
|
async function runTask2(task, ctx) {
|
|
44454
44545
|
task.retryCount = 0;
|
|
44455
44546
|
task.errors = [];
|
|
@@ -44472,16 +44563,11 @@ async function runTask2(task, ctx) {
|
|
|
44472
44563
|
}
|
|
44473
44564
|
var noop3 = () => {
|
|
44474
44565
|
};
|
|
44475
|
-
function Tasks({
|
|
44476
|
-
tasks,
|
|
44477
|
-
silent = isUnitTest(),
|
|
44478
|
-
onComplete = noop3,
|
|
44479
|
-
abortSignal
|
|
44480
|
-
}) {
|
|
44566
|
+
function Tasks({ tasks, silent = isUnitTest(), onComplete = noop3, abortSignal }) {
|
|
44481
44567
|
const { twoThirds } = useLayout();
|
|
44482
44568
|
const loadingBar = new Array(twoThirds).fill(loadingBarChar).join("");
|
|
44483
44569
|
const [currentTask, setCurrentTask] = (0, import_react51.useState)(tasks[0]);
|
|
44484
|
-
const [state, setState] = (0, import_react51.useState)(
|
|
44570
|
+
const [state, setState] = (0, import_react51.useState)(TasksState.Loading);
|
|
44485
44571
|
const ctx = (0, import_react51.useRef)({});
|
|
44486
44572
|
const { isRawModeSupported } = use_stdin_default();
|
|
44487
44573
|
const runTasks = async () => {
|
|
@@ -44498,58 +44584,51 @@ function Tasks({
|
|
|
44498
44584
|
};
|
|
44499
44585
|
useAsyncAndUnmount(runTasks, {
|
|
44500
44586
|
onFulfilled: () => {
|
|
44501
|
-
setState(
|
|
44587
|
+
setState(TasksState.Success);
|
|
44502
44588
|
onComplete(ctx.current);
|
|
44503
44589
|
},
|
|
44504
44590
|
onRejected: () => {
|
|
44505
|
-
setState(
|
|
44591
|
+
setState(TasksState.Failure);
|
|
44506
44592
|
}
|
|
44507
44593
|
});
|
|
44508
|
-
use_input_default(
|
|
44509
|
-
(input, key)
|
|
44510
|
-
|
|
44511
|
-
|
|
44512
|
-
|
|
44513
|
-
|
|
44514
|
-
},
|
|
44515
|
-
{ isActive: Boolean(isRawModeSupported) }
|
|
44516
|
-
);
|
|
44594
|
+
use_input_default((input, key) => {
|
|
44595
|
+
handleCtrlC(input, key);
|
|
44596
|
+
if (key.return) {
|
|
44597
|
+
return null;
|
|
44598
|
+
}
|
|
44599
|
+
}, { isActive: Boolean(isRawModeSupported) });
|
|
44517
44600
|
const { isAborted } = useAbortSignal(abortSignal);
|
|
44518
44601
|
if (silent) {
|
|
44519
44602
|
return null;
|
|
44520
44603
|
}
|
|
44521
|
-
return state ===
|
|
44604
|
+
return state === TasksState.Loading && !isAborted ? import_react51.default.createElement(
|
|
44605
|
+
Box_default,
|
|
44606
|
+
{ flexDirection: "column" },
|
|
44607
|
+
import_react51.default.createElement(TextAnimation, { text: loadingBar }),
|
|
44608
|
+
import_react51.default.createElement(
|
|
44609
|
+
Text,
|
|
44610
|
+
null,
|
|
44611
|
+
currentTask.title,
|
|
44612
|
+
" ..."
|
|
44613
|
+
)
|
|
44614
|
+
) : null;
|
|
44522
44615
|
}
|
|
44523
44616
|
|
|
44524
|
-
// ../cli-kit/
|
|
44617
|
+
// ../cli-kit/dist/private/node/ui/components/TextPrompt.js
|
|
44525
44618
|
init_cjs_shims();
|
|
44526
44619
|
var import_react52 = __toESM(require_react(), 1);
|
|
44527
|
-
var TextPrompt = ({
|
|
44528
|
-
message,
|
|
44529
|
-
onSubmit,
|
|
44530
|
-
validate,
|
|
44531
|
-
defaultValue = "",
|
|
44532
|
-
password = false,
|
|
44533
|
-
allowEmpty = false,
|
|
44534
|
-
emptyDisplayedValue = "(empty)",
|
|
44535
|
-
abortSignal,
|
|
44536
|
-
preview,
|
|
44537
|
-
initialAnswer = ""
|
|
44538
|
-
}) => {
|
|
44620
|
+
var TextPrompt = ({ message, onSubmit, validate, defaultValue = "", password = false, allowEmpty = false, emptyDisplayedValue = "(empty)", abortSignal, preview, initialAnswer = "" }) => {
|
|
44539
44621
|
if (password && defaultValue) {
|
|
44540
44622
|
throw new Error("Can't use defaultValue with password");
|
|
44541
44623
|
}
|
|
44542
|
-
const validateAnswer = (0, import_react52.useCallback)(
|
|
44543
|
-
(
|
|
44544
|
-
|
|
44545
|
-
|
|
44546
|
-
|
|
44547
|
-
|
|
44548
|
-
|
|
44549
|
-
|
|
44550
|
-
},
|
|
44551
|
-
[allowEmpty, validate]
|
|
44552
|
-
);
|
|
44624
|
+
const validateAnswer = (0, import_react52.useCallback)((value) => {
|
|
44625
|
+
if (validate) {
|
|
44626
|
+
return validate(value);
|
|
44627
|
+
}
|
|
44628
|
+
if (value.length === 0 && !allowEmpty)
|
|
44629
|
+
return "Type an answer to the prompt.";
|
|
44630
|
+
return void 0;
|
|
44631
|
+
}, [allowEmpty, validate]);
|
|
44553
44632
|
const { oneThird } = useLayout();
|
|
44554
44633
|
const { promptState, setPromptState, answer, setAnswer } = usePrompt({
|
|
44555
44634
|
initialAnswer
|
|
@@ -44559,7 +44638,7 @@ var TextPrompt = ({
|
|
|
44559
44638
|
const displayedAnswer = displayEmptyValue ? emptyDisplayedValue : answerOrDefault;
|
|
44560
44639
|
const { exit: unmountInk } = use_app_default();
|
|
44561
44640
|
const [error, setError] = (0, import_react52.useState)(void 0);
|
|
44562
|
-
const color = promptState ===
|
|
44641
|
+
const color = promptState === PromptState.Error ? "red" : "cyan";
|
|
44563
44642
|
const underline = new Array(oneThird - 3).fill("\u2594");
|
|
44564
44643
|
const { isAborted } = useAbortSignal(abortSignal);
|
|
44565
44644
|
use_input_default((input, key) => {
|
|
@@ -44567,38 +44646,88 @@ var TextPrompt = ({
|
|
|
44567
44646
|
if (key.return) {
|
|
44568
44647
|
const error2 = validateAnswer(answerOrDefault);
|
|
44569
44648
|
if (error2) {
|
|
44570
|
-
setPromptState(
|
|
44649
|
+
setPromptState(PromptState.Error);
|
|
44571
44650
|
setError(error2);
|
|
44572
44651
|
} else {
|
|
44573
|
-
setPromptState(
|
|
44652
|
+
setPromptState(PromptState.Submitted);
|
|
44574
44653
|
}
|
|
44575
44654
|
}
|
|
44576
44655
|
});
|
|
44577
44656
|
(0, import_react52.useEffect)(() => {
|
|
44578
|
-
if (promptState ===
|
|
44657
|
+
if (promptState === PromptState.Submitted) {
|
|
44579
44658
|
onSubmit(answerOrDefault);
|
|
44580
44659
|
unmountInk();
|
|
44581
44660
|
}
|
|
44582
44661
|
}, [answerOrDefault, onSubmit, promptState, unmountInk]);
|
|
44583
|
-
return isAborted ? null :
|
|
44584
|
-
|
|
44585
|
-
{
|
|
44586
|
-
|
|
44587
|
-
|
|
44588
|
-
|
|
44589
|
-
|
|
44590
|
-
|
|
44591
|
-
|
|
44592
|
-
|
|
44593
|
-
|
|
44594
|
-
|
|
44595
|
-
|
|
44662
|
+
return isAborted ? null : import_react52.default.createElement(
|
|
44663
|
+
Box_default,
|
|
44664
|
+
{ flexDirection: "column", marginBottom: 1, width: oneThird },
|
|
44665
|
+
import_react52.default.createElement(
|
|
44666
|
+
Box_default,
|
|
44667
|
+
null,
|
|
44668
|
+
import_react52.default.createElement(
|
|
44669
|
+
Box_default,
|
|
44670
|
+
{ marginRight: 2 },
|
|
44671
|
+
import_react52.default.createElement(Text, null, "?")
|
|
44672
|
+
),
|
|
44673
|
+
import_react52.default.createElement(TokenizedText, { item: messageWithPunctuation(message) })
|
|
44674
|
+
),
|
|
44675
|
+
promptState === PromptState.Submitted ? import_react52.default.createElement(
|
|
44676
|
+
Box_default,
|
|
44677
|
+
null,
|
|
44678
|
+
import_react52.default.createElement(
|
|
44679
|
+
Box_default,
|
|
44680
|
+
{ marginRight: 2 },
|
|
44681
|
+
import_react52.default.createElement(Text, { color: "cyan" }, figures_default.tick)
|
|
44682
|
+
),
|
|
44683
|
+
import_react52.default.createElement(
|
|
44684
|
+
Box_default,
|
|
44685
|
+
{ flexGrow: 1 },
|
|
44686
|
+
import_react52.default.createElement(Text, { color: "cyan", dimColor: displayEmptyValue }, password ? "*".repeat(answer.length) : displayedAnswer)
|
|
44687
|
+
)
|
|
44688
|
+
) : import_react52.default.createElement(
|
|
44689
|
+
Box_default,
|
|
44690
|
+
{ flexDirection: "column" },
|
|
44691
|
+
import_react52.default.createElement(
|
|
44692
|
+
Box_default,
|
|
44693
|
+
null,
|
|
44694
|
+
import_react52.default.createElement(
|
|
44695
|
+
Box_default,
|
|
44696
|
+
{ marginRight: 2 },
|
|
44697
|
+
import_react52.default.createElement(Text, { color }, `>`)
|
|
44698
|
+
),
|
|
44699
|
+
import_react52.default.createElement(
|
|
44700
|
+
Box_default,
|
|
44701
|
+
{ flexGrow: 1 },
|
|
44702
|
+
import_react52.default.createElement(TextInput, { value: answer, onChange: (answer2) => {
|
|
44703
|
+
setAnswer(answer2);
|
|
44704
|
+
setPromptState(PromptState.Idle);
|
|
44705
|
+
}, defaultValue, color, password })
|
|
44706
|
+
)
|
|
44707
|
+
),
|
|
44708
|
+
import_react52.default.createElement(
|
|
44709
|
+
Box_default,
|
|
44710
|
+
{ marginLeft: 3 },
|
|
44711
|
+
import_react52.default.createElement(Text, { color }, underline)
|
|
44712
|
+
),
|
|
44713
|
+
promptState === PromptState.Error ? import_react52.default.createElement(
|
|
44714
|
+
Box_default,
|
|
44715
|
+
{ marginLeft: 3 },
|
|
44716
|
+
import_react52.default.createElement(Text, { color }, error)
|
|
44717
|
+
) : null,
|
|
44718
|
+
promptState !== PromptState.Error && preview ? import_react52.default.createElement(
|
|
44719
|
+
Box_default,
|
|
44720
|
+
{ marginLeft: 3 },
|
|
44721
|
+
import_react52.default.createElement(TokenizedText, { item: preview(answerOrDefault) })
|
|
44722
|
+
) : null
|
|
44723
|
+
)
|
|
44724
|
+
);
|
|
44596
44725
|
};
|
|
44597
44726
|
|
|
44598
|
-
// ../cli-kit/
|
|
44727
|
+
// ../cli-kit/dist/private/node/ui/components/AutocompletePrompt.js
|
|
44599
44728
|
init_cjs_shims();
|
|
44600
44729
|
|
|
44601
|
-
// ../cli-kit/
|
|
44730
|
+
// ../cli-kit/dist/public/common/function.js
|
|
44602
44731
|
init_cjs_shims();
|
|
44603
44732
|
var import_memoize = __toESM(require_memoize(), 1);
|
|
44604
44733
|
var import_debounce = __toESM(require_debounce(), 1);
|
|
@@ -44606,19 +44735,10 @@ function debounce(func, wait, options) {
|
|
|
44606
44735
|
return (0, import_debounce.default)(func, wait, options);
|
|
44607
44736
|
}
|
|
44608
44737
|
|
|
44609
|
-
// ../cli-kit/
|
|
44738
|
+
// ../cli-kit/dist/private/node/ui/components/AutocompletePrompt.js
|
|
44610
44739
|
var import_react53 = __toESM(require_react(), 1);
|
|
44611
44740
|
var MIN_NUMBER_OF_ITEMS_FOR_SEARCH = 5;
|
|
44612
|
-
function AutocompletePrompt({
|
|
44613
|
-
message,
|
|
44614
|
-
choices,
|
|
44615
|
-
infoTable,
|
|
44616
|
-
onSubmit,
|
|
44617
|
-
search,
|
|
44618
|
-
hasMorePages: initialHasMorePages = false,
|
|
44619
|
-
abortSignal,
|
|
44620
|
-
infoMessage
|
|
44621
|
-
}) {
|
|
44741
|
+
function AutocompletePrompt({ message, choices, infoTable, onSubmit, search, hasMorePages: initialHasMorePages = false, abortSignal, infoMessage }) {
|
|
44622
44742
|
const { exit: unmountInk } = use_app_default();
|
|
44623
44743
|
const [searchTerm, setSearchTerm] = (0, import_react53.useState)("");
|
|
44624
44744
|
const [searchResults, setSearchResults] = (0, import_react53.useState)(choices);
|
|
@@ -44627,24 +44747,18 @@ function AutocompletePrompt({
|
|
|
44627
44747
|
const { promptState, setPromptState, answer, setAnswer } = usePrompt({
|
|
44628
44748
|
initialAnswer: void 0
|
|
44629
44749
|
});
|
|
44630
|
-
const paginatedSearch = (0, import_react53.useCallback)(
|
|
44631
|
-
|
|
44632
|
-
|
|
44633
|
-
|
|
44634
|
-
|
|
44635
|
-
|
|
44636
|
-
|
|
44637
|
-
|
|
44638
|
-
|
|
44639
|
-
|
|
44640
|
-
setAnswer(answer2);
|
|
44641
|
-
setPromptState("submitted" /* Submitted */);
|
|
44642
|
-
}
|
|
44643
|
-
},
|
|
44644
|
-
[promptState, setAnswer, setPromptState]
|
|
44645
|
-
);
|
|
44750
|
+
const paginatedSearch = (0, import_react53.useCallback)(async (term) => {
|
|
44751
|
+
const results = await search(term);
|
|
44752
|
+
return results;
|
|
44753
|
+
}, [search]);
|
|
44754
|
+
const submitAnswer = (0, import_react53.useCallback)((answer2) => {
|
|
44755
|
+
if (promptState === PromptState.Idle) {
|
|
44756
|
+
setAnswer(answer2);
|
|
44757
|
+
setPromptState(PromptState.Submitted);
|
|
44758
|
+
}
|
|
44759
|
+
}, [promptState, setAnswer, setPromptState]);
|
|
44646
44760
|
(0, import_react53.useEffect)(() => {
|
|
44647
|
-
if (promptState ===
|
|
44761
|
+
if (promptState === PromptState.Submitted && answer) {
|
|
44648
44762
|
setSearchTerm("");
|
|
44649
44763
|
unmountInk();
|
|
44650
44764
|
onSubmit(answer.value);
|
|
@@ -44653,85 +44767,49 @@ function AutocompletePrompt({
|
|
|
44653
44767
|
const setLoadingWhenSlow = (0, import_react53.useRef)();
|
|
44654
44768
|
const searchTermRef = (0, import_react53.useRef)("");
|
|
44655
44769
|
searchTermRef.current = searchTerm;
|
|
44656
|
-
const debounceSearch = (0, import_react53.useCallback)(
|
|
44657
|
-
|
|
44658
|
-
(
|
|
44659
|
-
|
|
44660
|
-
|
|
44661
|
-
|
|
44662
|
-
|
|
44663
|
-
|
|
44664
|
-
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
|
|
44669
|
-
|
|
44670
|
-
|
|
44671
|
-
|
|
44672
|
-
|
|
44673
|
-
|
|
44674
|
-
|
|
44675
|
-
|
|
44676
|
-
|
|
44677
|
-
|
|
44678
|
-
|
|
44679
|
-
|
|
44680
|
-
|
|
44681
|
-
|
|
44682
|
-
|
|
44683
|
-
|
|
44684
|
-
|
|
44685
|
-
|
|
44686
|
-
|
|
44687
|
-
|
|
44688
|
-
|
|
44689
|
-
abortSignal,
|
|
44690
|
-
header: promptState !== "submitted" /* Submitted */ && canSearch ? /* @__PURE__ */ import_react53.default.createElement(Box_default, { marginLeft: 3 }, /* @__PURE__ */ import_react53.default.createElement(
|
|
44691
|
-
TextInput,
|
|
44692
|
-
{
|
|
44693
|
-
value: searchTerm,
|
|
44694
|
-
onChange: (term) => {
|
|
44695
|
-
setSearchTerm(term);
|
|
44696
|
-
if (term.length > 0) {
|
|
44697
|
-
debounceSearch(term);
|
|
44698
|
-
} else {
|
|
44699
|
-
debounceSearch.cancel();
|
|
44700
|
-
setPromptState("idle" /* Idle */);
|
|
44701
|
-
setSearchResults(choices);
|
|
44702
|
-
}
|
|
44703
|
-
},
|
|
44704
|
-
placeholder: "Type to search..."
|
|
44705
|
-
}
|
|
44706
|
-
)) : null,
|
|
44707
|
-
submittedAnswerLabel: answer?.label,
|
|
44708
|
-
input: /* @__PURE__ */ import_react53.default.createElement(
|
|
44709
|
-
SelectInput,
|
|
44710
|
-
{
|
|
44711
|
-
items: searchResults,
|
|
44712
|
-
initialItems: choices,
|
|
44713
|
-
enableShortcuts: false,
|
|
44714
|
-
emptyMessage: "No results found.",
|
|
44715
|
-
highlightedTerm: searchTerm,
|
|
44716
|
-
loading: promptState === "loading" /* Loading */,
|
|
44717
|
-
errorMessage: promptState === "error" /* Error */ ? "There has been an error while searching. Please try again later." : void 0,
|
|
44718
|
-
hasMorePages,
|
|
44719
|
-
morePagesMessage: "Find what you're looking for by typing its name.",
|
|
44720
|
-
onSubmit: submitAnswer
|
|
44721
|
-
}
|
|
44722
|
-
)
|
|
44723
|
-
}
|
|
44724
|
-
);
|
|
44770
|
+
const debounceSearch = (0, import_react53.useCallback)(debounce((term) => {
|
|
44771
|
+
setLoadingWhenSlow.current = setTimeout(() => {
|
|
44772
|
+
setPromptState(PromptState.Loading);
|
|
44773
|
+
}, 100);
|
|
44774
|
+
paginatedSearch(term).then((result) => {
|
|
44775
|
+
if (searchTermRef.current.length === 0) {
|
|
44776
|
+
setSearchResults(choices);
|
|
44777
|
+
setHasMorePages(initialHasMorePages);
|
|
44778
|
+
} else {
|
|
44779
|
+
setSearchResults(result.data);
|
|
44780
|
+
setHasMorePages(result.meta?.hasNextPage ?? false);
|
|
44781
|
+
}
|
|
44782
|
+
setPromptState(PromptState.Idle);
|
|
44783
|
+
}).catch(() => {
|
|
44784
|
+
setPromptState(PromptState.Error);
|
|
44785
|
+
}).finally(() => {
|
|
44786
|
+
clearTimeout(setLoadingWhenSlow.current);
|
|
44787
|
+
});
|
|
44788
|
+
}, 300, { leading: true }), [initialHasMorePages, choices, paginatedSearch, searchResults]);
|
|
44789
|
+
return import_react53.default.createElement(PromptLayout, { message, state: promptState, infoTable, infoMessage, abortSignal, header: promptState !== PromptState.Submitted && canSearch ? import_react53.default.createElement(
|
|
44790
|
+
Box_default,
|
|
44791
|
+
{ marginLeft: 3 },
|
|
44792
|
+
import_react53.default.createElement(TextInput, { value: searchTerm, onChange: (term) => {
|
|
44793
|
+
setSearchTerm(term);
|
|
44794
|
+
if (term.length > 0) {
|
|
44795
|
+
debounceSearch(term);
|
|
44796
|
+
} else {
|
|
44797
|
+
debounceSearch.cancel();
|
|
44798
|
+
setPromptState(PromptState.Idle);
|
|
44799
|
+
setSearchResults(choices);
|
|
44800
|
+
}
|
|
44801
|
+
}, placeholder: "Type to search..." })
|
|
44802
|
+
) : null, submittedAnswerLabel: answer?.label, input: import_react53.default.createElement(SelectInput, { items: searchResults, initialItems: choices, enableShortcuts: false, emptyMessage: "No results found.", highlightedTerm: searchTerm, loading: promptState === PromptState.Loading, errorMessage: promptState === PromptState.Error ? "There has been an error while searching. Please try again later." : void 0, hasMorePages, morePagesMessage: "Find what you're looking for by typing its name.", onSubmit: submitAnswer }) });
|
|
44725
44803
|
}
|
|
44726
44804
|
|
|
44727
|
-
// ../cli-kit/
|
|
44728
|
-
var import_react54 = __toESM(require_react()
|
|
44805
|
+
// ../cli-kit/dist/public/node/ui.js
|
|
44806
|
+
var import_react54 = __toESM(require_react());
|
|
44729
44807
|
var defaultUIDebugOptions = {
|
|
44730
44808
|
skipTTYCheck: false
|
|
44731
44809
|
};
|
|
44732
44810
|
async function renderConcurrent({ renderOptions, ...props }) {
|
|
44733
44811
|
const abortSignal = props.abortSignal ?? new AbortController().signal;
|
|
44734
|
-
return render2(
|
|
44812
|
+
return render2(import_react54.default.createElement(ConcurrentOutput, { ...props, abortSignal }), renderOptions);
|
|
44735
44813
|
}
|
|
44736
44814
|
function renderInfo(options) {
|
|
44737
44815
|
return alert({ ...options, type: "info" });
|
|
@@ -44748,9 +44826,9 @@ function renderError(options) {
|
|
|
44748
44826
|
function renderFatalError(error, { renderOptions } = {}) {
|
|
44749
44827
|
recordUIEvent({
|
|
44750
44828
|
type: "fatalError",
|
|
44751
|
-
properties: { ...error, errorType: error.type ===
|
|
44829
|
+
properties: { ...error, errorType: error.type === FatalErrorType.Bug ? "bug" : "abort" }
|
|
44752
44830
|
});
|
|
44753
|
-
return renderOnce(
|
|
44831
|
+
return renderOnce(import_react54.default.createElement(FatalError2, { error }), { logLevel: "error", logger: consoleError, renderOptions });
|
|
44754
44832
|
}
|
|
44755
44833
|
async function renderSelectPrompt({ renderOptions, isConfirmationPrompt, ...props }, uiDebugOptions = defaultUIDebugOptions) {
|
|
44756
44834
|
throwInNonTTY({ message: props.message, stdin: renderOptions?.stdin }, uiDebugOptions);
|
|
@@ -44760,37 +44838,19 @@ async function renderSelectPrompt({ renderOptions, isConfirmationPrompt, ...prop
|
|
|
44760
44838
|
return runWithTimer("cmd_all_timing_prompts_ms")(async () => {
|
|
44761
44839
|
let selectedValue;
|
|
44762
44840
|
try {
|
|
44763
|
-
await render2(
|
|
44764
|
-
|
|
44765
|
-
|
|
44766
|
-
|
|
44767
|
-
|
|
44768
|
-
|
|
44769
|
-
selectedValue = value;
|
|
44770
|
-
}
|
|
44771
|
-
}
|
|
44772
|
-
),
|
|
44773
|
-
{
|
|
44774
|
-
...renderOptions,
|
|
44775
|
-
exitOnCtrlC: false
|
|
44776
|
-
}
|
|
44777
|
-
);
|
|
44841
|
+
await render2(import_react54.default.createElement(SelectPrompt, { ...props, onSubmit: (value) => {
|
|
44842
|
+
selectedValue = value;
|
|
44843
|
+
} }), {
|
|
44844
|
+
...renderOptions,
|
|
44845
|
+
exitOnCtrlC: false
|
|
44846
|
+
});
|
|
44778
44847
|
return selectedValue;
|
|
44779
44848
|
} finally {
|
|
44780
44849
|
resetRecordedSleep();
|
|
44781
44850
|
}
|
|
44782
44851
|
});
|
|
44783
44852
|
}
|
|
44784
|
-
async function renderConfirmationPrompt({
|
|
44785
|
-
message,
|
|
44786
|
-
infoTable,
|
|
44787
|
-
confirmationMessage = "Yes, confirm",
|
|
44788
|
-
cancellationMessage = "No, cancel",
|
|
44789
|
-
renderOptions,
|
|
44790
|
-
defaultValue = true,
|
|
44791
|
-
abortSignal,
|
|
44792
|
-
infoMessage
|
|
44793
|
-
}) {
|
|
44853
|
+
async function renderConfirmationPrompt({ message, infoTable, confirmationMessage = "Yes, confirm", cancellationMessage = "No, cancel", renderOptions, defaultValue = true, abortSignal, infoMessage }) {
|
|
44794
44854
|
recordUIEvent({ type: "confirmationPrompt", properties: arguments[0] });
|
|
44795
44855
|
const choices = [
|
|
44796
44856
|
{
|
|
@@ -44832,21 +44892,12 @@ async function renderAutocompletePrompt({ renderOptions, ...props }, uiDebugOpti
|
|
|
44832
44892
|
return runWithTimer("cmd_all_timing_prompts_ms")(async () => {
|
|
44833
44893
|
let selectedValue;
|
|
44834
44894
|
try {
|
|
44835
|
-
await render2(
|
|
44836
|
-
|
|
44837
|
-
|
|
44838
|
-
|
|
44839
|
-
|
|
44840
|
-
|
|
44841
|
-
selectedValue = value;
|
|
44842
|
-
}
|
|
44843
|
-
}
|
|
44844
|
-
),
|
|
44845
|
-
{
|
|
44846
|
-
...renderOptions,
|
|
44847
|
-
exitOnCtrlC: false
|
|
44848
|
-
}
|
|
44849
|
-
);
|
|
44895
|
+
await render2(import_react54.default.createElement(AutocompletePrompt, { ...newProps, onSubmit: (value) => {
|
|
44896
|
+
selectedValue = value;
|
|
44897
|
+
} }), {
|
|
44898
|
+
...renderOptions,
|
|
44899
|
+
exitOnCtrlC: false
|
|
44900
|
+
});
|
|
44850
44901
|
return selectedValue;
|
|
44851
44902
|
} finally {
|
|
44852
44903
|
resetRecordedSleep();
|
|
@@ -44855,7 +44906,7 @@ async function renderAutocompletePrompt({ renderOptions, ...props }, uiDebugOpti
|
|
|
44855
44906
|
}
|
|
44856
44907
|
function renderTable({ renderOptions, ...props }) {
|
|
44857
44908
|
recordUIEvent({ type: "table", properties: arguments[0] });
|
|
44858
|
-
return renderOnce(
|
|
44909
|
+
return renderOnce(import_react54.default.createElement(Table, { ...props }), { renderOptions });
|
|
44859
44910
|
}
|
|
44860
44911
|
async function renderTasks(tasks, { renderOptions } = {}) {
|
|
44861
44912
|
recordUIEvent({
|
|
@@ -44869,7 +44920,7 @@ async function renderTasks(tasks, { renderOptions } = {}) {
|
|
|
44869
44920
|
}
|
|
44870
44921
|
});
|
|
44871
44922
|
return new Promise((resolve, reject) => {
|
|
44872
|
-
render2(
|
|
44923
|
+
render2(import_react54.default.createElement(Tasks, { tasks, onComplete: resolve }), {
|
|
44873
44924
|
...renderOptions,
|
|
44874
44925
|
exitOnCtrlC: false
|
|
44875
44926
|
}).then(() => resetRecordedSleep()).catch(reject);
|
|
@@ -44881,21 +44932,12 @@ async function renderTextPrompt({ renderOptions, ...props }, uiDebugOptions = de
|
|
|
44881
44932
|
return runWithTimer("cmd_all_timing_prompts_ms")(async () => {
|
|
44882
44933
|
let enteredText = "";
|
|
44883
44934
|
try {
|
|
44884
|
-
await render2(
|
|
44885
|
-
|
|
44886
|
-
|
|
44887
|
-
|
|
44888
|
-
|
|
44889
|
-
|
|
44890
|
-
enteredText = value;
|
|
44891
|
-
}
|
|
44892
|
-
}
|
|
44893
|
-
),
|
|
44894
|
-
{
|
|
44895
|
-
...renderOptions,
|
|
44896
|
-
exitOnCtrlC: false
|
|
44897
|
-
}
|
|
44898
|
-
);
|
|
44935
|
+
await render2(import_react54.default.createElement(TextPrompt, { ...props, onSubmit: (value) => {
|
|
44936
|
+
enteredText = value;
|
|
44937
|
+
} }), {
|
|
44938
|
+
...renderOptions,
|
|
44939
|
+
exitOnCtrlC: false
|
|
44940
|
+
});
|
|
44899
44941
|
return enteredText;
|
|
44900
44942
|
} finally {
|
|
44901
44943
|
resetRecordedSleep();
|
|
@@ -44908,21 +44950,12 @@ async function renderDangerousConfirmationPrompt({ renderOptions, ...props }, ui
|
|
|
44908
44950
|
return runWithTimer("cmd_all_timing_prompts_ms")(async () => {
|
|
44909
44951
|
let confirmed;
|
|
44910
44952
|
try {
|
|
44911
|
-
await render2(
|
|
44912
|
-
|
|
44913
|
-
|
|
44914
|
-
|
|
44915
|
-
|
|
44916
|
-
|
|
44917
|
-
confirmed = value;
|
|
44918
|
-
}
|
|
44919
|
-
}
|
|
44920
|
-
),
|
|
44921
|
-
{
|
|
44922
|
-
...renderOptions,
|
|
44923
|
-
exitOnCtrlC: false
|
|
44924
|
-
}
|
|
44925
|
-
);
|
|
44953
|
+
await render2(import_react54.default.createElement(DangerousConfirmationPrompt, { ...props, onSubmit: (value) => {
|
|
44954
|
+
confirmed = value;
|
|
44955
|
+
} }), {
|
|
44956
|
+
...renderOptions,
|
|
44957
|
+
exitOnCtrlC: false
|
|
44958
|
+
});
|
|
44926
44959
|
return confirmed;
|
|
44927
44960
|
} finally {
|
|
44928
44961
|
resetRecordedSleep();
|
|
@@ -44970,10 +45003,7 @@ function throwInNonTTY({ message, stdin = void 0 }, uiDebugOptions) {
|
|
|
44970
45003
|
${outputContent`${outputToken.cyan(promptText)}`.value}
|
|
44971
45004
|
|
|
44972
45005
|
This usually happens when running a command non-interactively, for example in a CI environment, or when piping input from another process.`;
|
|
44973
|
-
throw new AbortError(
|
|
44974
|
-
errorMessage,
|
|
44975
|
-
"To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal."
|
|
44976
|
-
);
|
|
45006
|
+
throw new AbortError(errorMessage, "To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.");
|
|
44977
45007
|
}
|
|
44978
45008
|
|
|
44979
45009
|
export {
|
|
@@ -44998,7 +45028,6 @@ export {
|
|
|
44998
45028
|
require_keys,
|
|
44999
45029
|
require_getTag,
|
|
45000
45030
|
require_baseIsEqual,
|
|
45001
|
-
require_memoize,
|
|
45002
45031
|
require_arrayMap,
|
|
45003
45032
|
require_toString,
|
|
45004
45033
|
require_castPath,
|
|
@@ -45006,13 +45035,11 @@ export {
|
|
|
45006
45035
|
require_baseGet,
|
|
45007
45036
|
require_get,
|
|
45008
45037
|
require_baseIteratee,
|
|
45009
|
-
require_uniqBy,
|
|
45010
45038
|
require_baseDifference,
|
|
45011
45039
|
require_baseFlatten,
|
|
45012
45040
|
require_defineProperty,
|
|
45013
45041
|
require_baseRest,
|
|
45014
45042
|
require_isArrayLikeObject,
|
|
45015
|
-
require_difference,
|
|
45016
45043
|
getArrayRejectingUndefined,
|
|
45017
45044
|
getArrayContainsDuplicates,
|
|
45018
45045
|
uniq,
|
|
@@ -45020,7 +45047,6 @@ export {
|
|
|
45020
45047
|
difference,
|
|
45021
45048
|
tslib_es6_exports,
|
|
45022
45049
|
init_tslib_es6,
|
|
45023
|
-
require_dist15 as require_dist,
|
|
45024
45050
|
getRandomName,
|
|
45025
45051
|
capitalize,
|
|
45026
45052
|
pluralize,
|
|
@@ -45035,13 +45061,7 @@ export {
|
|
|
45035
45061
|
joinWithAnd,
|
|
45036
45062
|
pascalize,
|
|
45037
45063
|
normalizeDelimitedString,
|
|
45038
|
-
copy,
|
|
45039
|
-
ensureFile,
|
|
45040
|
-
createSymlink,
|
|
45041
|
-
move,
|
|
45042
|
-
remove,
|
|
45043
45064
|
temporaryDirectory,
|
|
45044
|
-
findUp,
|
|
45045
45065
|
inTemporaryDirectory,
|
|
45046
45066
|
readFile,
|
|
45047
45067
|
readFileSync,
|
|
@@ -45058,6 +45078,7 @@ export {
|
|
|
45058
45078
|
rmdir,
|
|
45059
45079
|
isDirectory,
|
|
45060
45080
|
fileSize,
|
|
45081
|
+
fileSizeSync,
|
|
45061
45082
|
unlinkFileSync,
|
|
45062
45083
|
createFileReadStream,
|
|
45063
45084
|
createFileWriteStream,
|
|
@@ -45071,7 +45092,6 @@ export {
|
|
|
45071
45092
|
glob,
|
|
45072
45093
|
findPathUp,
|
|
45073
45094
|
matchGlob,
|
|
45074
|
-
require_node_abort_controller,
|
|
45075
45095
|
AbortController,
|
|
45076
45096
|
createRuntimeMetadataContainer,
|
|
45077
45097
|
getAllPublicMetadata,
|
|
@@ -45082,7 +45102,6 @@ export {
|
|
|
45082
45102
|
initDemoRecorder,
|
|
45083
45103
|
printEventsJson,
|
|
45084
45104
|
require_react,
|
|
45085
|
-
require_debounce,
|
|
45086
45105
|
ansi_escapes_default2 as ansi_escapes_default,
|
|
45087
45106
|
require_scheduler,
|
|
45088
45107
|
stripAnsi,
|
|
@@ -45090,25 +45109,18 @@ export {
|
|
|
45090
45109
|
source_default,
|
|
45091
45110
|
Box_default,
|
|
45092
45111
|
Text,
|
|
45093
|
-
render_default,
|
|
45094
45112
|
use_stdin_default,
|
|
45095
45113
|
use_input_default,
|
|
45096
|
-
use_app_default,
|
|
45097
|
-
use_stdout_default,
|
|
45098
|
-
measure_element_default,
|
|
45099
45114
|
figures_default,
|
|
45100
45115
|
useConcurrentOutputContext,
|
|
45101
45116
|
ConcurrentOutput,
|
|
45102
45117
|
treeKill,
|
|
45103
45118
|
render2 as render,
|
|
45104
45119
|
handleCtrlC,
|
|
45105
|
-
require_supports_hyperlinks2 as require_supports_hyperlinks,
|
|
45106
45120
|
require_stacktracey,
|
|
45107
45121
|
useAbortSignal,
|
|
45108
45122
|
require_baseForOwn,
|
|
45109
45123
|
require_baseEach,
|
|
45110
|
-
require_sortBy,
|
|
45111
|
-
require_gradient_string,
|
|
45112
45124
|
renderConcurrent,
|
|
45113
45125
|
renderInfo,
|
|
45114
45126
|
renderSuccess,
|
|
@@ -45125,7 +45137,6 @@ export {
|
|
|
45125
45137
|
renderText,
|
|
45126
45138
|
keypress,
|
|
45127
45139
|
isTTY,
|
|
45128
|
-
require_cjs,
|
|
45129
45140
|
CancelExecution,
|
|
45130
45141
|
FatalError,
|
|
45131
45142
|
AbortError,
|
|
@@ -45146,6 +45157,7 @@ export {
|
|
|
45146
45157
|
exec2 as exec,
|
|
45147
45158
|
sleep,
|
|
45148
45159
|
terminalSupportsRawMode,
|
|
45160
|
+
Environment,
|
|
45149
45161
|
serviceEnvironment,
|
|
45150
45162
|
spinFqdn,
|
|
45151
45163
|
isSpin,
|
|
@@ -45154,8 +45166,6 @@ export {
|
|
|
45154
45166
|
appHost,
|
|
45155
45167
|
spinVariables,
|
|
45156
45168
|
fetchSpinPort,
|
|
45157
|
-
isInteractive,
|
|
45158
|
-
require_macaddress,
|
|
45159
45169
|
isTerminalInteractive,
|
|
45160
45170
|
homeDirectory,
|
|
45161
45171
|
isDevelopment,
|
|
@@ -45182,12 +45192,11 @@ export {
|
|
|
45182
45192
|
installGlobalShopifyCLI,
|
|
45183
45193
|
installGlobalCLIPrompt,
|
|
45184
45194
|
inferPackageManagerForGlobalCLI,
|
|
45185
|
-
terminalLink,
|
|
45186
|
-
colorJson,
|
|
45187
45195
|
outputToken,
|
|
45188
45196
|
formatPackageManagerCommand,
|
|
45189
45197
|
outputContent,
|
|
45190
45198
|
collectedLogs,
|
|
45199
|
+
collectLog,
|
|
45191
45200
|
clearCollectedLogs,
|
|
45192
45201
|
outputInfo,
|
|
45193
45202
|
outputSuccess,
|
|
@@ -45292,4 +45301,4 @@ react-reconciler/cjs/react-reconciler-constants.development.js:
|
|
|
45292
45301
|
* LICENSE file in the root directory of this source tree.
|
|
45293
45302
|
*)
|
|
45294
45303
|
*/
|
|
45295
|
-
//# sourceMappingURL=chunk-
|
|
45304
|
+
//# sourceMappingURL=chunk-NLE3ZLU6.js.map
|