@shopify/cli-kit 3.49.1 → 3.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/private/node/ui/hooks/use-abort-signal.d.ts +1 -1
- package/dist/private/node/ui/hooks/use-abort-signal.js +3 -2
- package/dist/private/node/ui/hooks/use-abort-signal.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AbortSignal } from '../../../../public/node/abort.js';
|
|
2
|
-
export default function useAbortSignal(abortSignal?: AbortSignal, onAbort?: () => Promise<void>): {
|
|
2
|
+
export default function useAbortSignal(abortSignal?: AbortSignal, onAbort?: (error?: unknown) => Promise<void>): {
|
|
3
3
|
isAborted: boolean;
|
|
4
4
|
};
|
|
@@ -6,10 +6,11 @@ export default function useAbortSignal(abortSignal, onAbort = noop) {
|
|
|
6
6
|
const [isAborted, setIsAborted] = useState(false);
|
|
7
7
|
useLayoutEffect(() => {
|
|
8
8
|
abortSignal?.addEventListener('abort', () => {
|
|
9
|
-
|
|
9
|
+
const abortWithError = abortSignal?.reason.message === 'AbortError' ? undefined : abortSignal?.reason;
|
|
10
|
+
onAbort(abortWithError)
|
|
10
11
|
.then(() => {
|
|
11
12
|
setIsAborted(true);
|
|
12
|
-
unmountInk();
|
|
13
|
+
unmountInk(abortWithError);
|
|
13
14
|
})
|
|
14
15
|
.catch(() => { });
|
|
15
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-abort-signal.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/hooks/use-abort-signal.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAE/C,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;AAEpC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,WAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"use-abort-signal.js","sourceRoot":"","sources":["../../../../../src/private/node/ui/hooks/use-abort-signal.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAE/C,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;AAEpC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,WAAyB,EAAE,UAA8C,IAAI;IAClH,MAAM,EAAC,IAAI,EAAE,UAAU,EAAC,GAAG,MAAM,EAAE,CAAA;IACnC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjD,eAAe,CAAC,GAAG,EAAE;QACnB,WAAW,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YAC1C,MAAM,cAAc,GAAG,WAAW,EAAE,MAAM,CAAC,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,CAAA;YACrG,OAAO,CAAC,cAAc,CAAC;iBACpB,IAAI,CAAC,GAAG,EAAE;gBACT,YAAY,CAAC,IAAI,CAAC,CAAA;gBAClB,UAAU,CAAC,cAAc,CAAC,CAAA;YAC5B,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACpB,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,EAAC,SAAS,EAAC,CAAA;AACpB,CAAC","sourcesContent":["import {AbortSignal} from '../../../../public/node/abort.js'\nimport {useApp} from 'ink'\nimport {useLayoutEffect, useState} from 'react'\n\nconst noop = () => Promise.resolve()\n\nexport default function useAbortSignal(abortSignal?: AbortSignal, onAbort: (error?: unknown) => Promise<void> = noop) {\n const {exit: unmountInk} = useApp()\n const [isAborted, setIsAborted] = useState(false)\n\n useLayoutEffect(() => {\n abortSignal?.addEventListener('abort', () => {\n const abortWithError = abortSignal?.reason.message === 'AbortError' ? undefined : abortSignal?.reason\n onAbort(abortWithError)\n .then(() => {\n setIsAborted(true)\n unmountInk(abortWithError)\n })\n .catch(() => {})\n })\n }, [])\n\n return {isAborted}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_KIT_VERSION = "3.49.
|
|
1
|
+
export declare const CLI_KIT_VERSION = "3.49.2";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLI_KIT_VERSION = '3.49.
|
|
1
|
+
export const CLI_KIT_VERSION = '3.49.2';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.49.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.49.2'\n"]}
|