@shell-shock/core 0.15.2 → 0.16.0
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/api.cjs +10 -7
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +11 -8
- package/dist/api.mjs.map +1 -1
- package/dist/components/helpers.cjs +1 -1
- package/dist/components/helpers.cjs.map +1 -1
- package/dist/components/helpers.mjs +1 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +8 -4
- package/dist/components/index.d.cts +4 -2
- package/dist/components/index.d.mts +4 -2
- package/dist/components/index.mjs +4 -2
- package/dist/components/options-parser-logic.cjs +68 -48
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +68 -48
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/spawn-builtin.cjs +656 -0
- package/dist/components/spawn-builtin.cjs.map +1 -0
- package/dist/components/spawn-builtin.d.cts +12 -0
- package/dist/components/spawn-builtin.d.cts.map +1 -0
- package/dist/components/spawn-builtin.d.mts +12 -0
- package/dist/components/spawn-builtin.d.mts.map +1 -0
- package/dist/components/spawn-builtin.mjs +653 -0
- package/dist/components/spawn-builtin.mjs.map +1 -0
- package/dist/components/state-builtin.cjs +545 -0
- package/dist/components/state-builtin.cjs.map +1 -0
- package/dist/components/state-builtin.d.cts +18 -0
- package/dist/components/state-builtin.d.cts.map +1 -0
- package/dist/components/state-builtin.d.mts +18 -0
- package/dist/components/state-builtin.d.mts.map +1 -0
- package/dist/components/state-builtin.mjs +539 -0
- package/dist/components/state-builtin.mjs.map +1 -0
- package/dist/components/utils-builtin.cjs +3 -499
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +1 -10
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +1 -10
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +5 -498
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/options.cjs +9 -9
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.d.cts +2 -2
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +2 -2
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +9 -9
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/index.cjs +2 -10
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -7
- package/dist/plugin.cjs +11 -26
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +10 -24
- package/dist/plugin.mjs.map +1 -1
- package/dist/types/config.cjs +3 -1
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.cts +1 -1
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +1 -1
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +3 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/env.cjs +2 -1
- package/dist/types/env.cjs.map +1 -1
- package/dist/types/env.d.cts +15 -0
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts +15 -0
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/env.mjs +2 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +1 -2
- package/package.json +49 -35
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/runtime.cjs +0 -13
- package/dist/types/runtime.cjs.map +0 -1
- package/dist/types/runtime.d.cts +0 -14
- package/dist/types/runtime.d.cts.map +0 -1
- package/dist/types/runtime.d.mts +0 -14
- package/dist/types/runtime.d.mts.map +0 -1
- package/dist/types/runtime.mjs +0 -11
- package/dist/types/runtime.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-builtin.mjs","names":[],"sources":["../../src/components/state-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Show, splitProps } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration,\n InterfaceMember,\n TypeDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocInternal,\n TSDocLink,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\nimport { computedOptions } from \"../contexts/options\";\nimport { getAppBin } from \"../plugin-utils\";\nimport { getAppTitle } from \"../plugin-utils/context-helpers\";\nimport type { Context } from \"../types\";\nimport { OptionsMember } from \"./options-parser-logic\";\n\nexport function GlobalTypeDefinitions() {\n const context = usePowerlines<Context>();\n\n const options = computed(() => computedOptions(context.options));\n\n return (\n <>\n <TSDoc\n heading={`An object representing the global options available for every command in the ${getAppTitle(\n context,\n true\n )} command-line application.`}\n />\n <InterfaceDeclaration export name=\"GlobalOptions\">\n <For each={Object.values(options.value)} hardline>\n {option => <OptionsMember option={option} />}\n </For>\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"The context object for the current command execution, containing the command path and segments.\" />\n <InterfaceDeclaration\n export\n name=\"CommandContext\"\n typeParameters={[\n {\n name: \"THandler\",\n extends: \"(...params: any[]) => any\"\n }\n ]}>\n <TSDoc\n heading={`The full command path as a string. For example, if the user runs \\`${getAppBin(\n context\n )} foo bar\\`, this would be \\`foo bar\\`. This is useful for commands that need to know their full invocation path, such as for help text or for commands that have dynamic behavior based on their position in the command hierarchy.`}\n />\n <InterfaceMember name=\"path\" type=\"string\" />\n <Spacing />\n <TSDoc\n heading={`An array of command path segments. For example, if the user runs \\`${getAppBin(\n context\n )} foo bar\\`, this would be \\`[\"foo\", \"bar\"]\\`. This is useful for commands that need to know their individual path segments, such as for dynamic routing or for commands that have behavior based on specific segments in the command hierarchy.`}\n />\n <InterfaceMember name=\"segments\" type=\"string[]\" />\n <Spacing />\n <TSDoc\n heading={`The parameters for the current command's handler function.`}\n />\n <InterfaceMember name=\"params\" type=\"Parameters<THandler>\" />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration export name=\"GlobalContextStatus\">\n {code`\"initializing\" | \"preparing\" | \"executing\" | \"completed\"`}\n </TypeDeclaration>\n <Spacing />\n <TSDoc\n heading={`The state object for the ${getAppTitle(context)} application context.`}\n />\n <InterfaceDeclaration export name=\"GlobalContextState\">\n <TSDoc heading=\"The unique identifier for the current execution context.\" />\n <InterfaceMember name=\"executionId\" type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The status of the current execution context.\" />\n <InterfaceMember name=\"status\" type=\"GlobalContextStatus\" />\n <Spacing />\n <TSDoc heading=\"Indicates whether the current execution context has encountered an error.\" />\n <InterfaceMember name=\"isError\" type=\"boolean\" />\n <Spacing />\n <TSDoc heading=\"A map containing arbitrary data associated with the current execution context.\" />\n <InterfaceMember name=\"meta\" type=\"Map<string, unknown>\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc\n heading={`The context object for the ${getAppTitle(context)} application.`}\n />\n <InterfaceDeclaration export name=\"GlobalContext\">\n <TSDoc heading=\"The global options shared across all commands in the application.\" />\n <InterfaceMember name=\"options\" type=\"GlobalOptions\" />\n <Spacing />\n <TSDoc heading=\"The raw command-line arguments passed to the application.\" />\n <InterfaceMember name=\"inputArgs\" type=\"string[]\" />\n <Spacing />\n <TSDoc heading=\"The state of the current execution context.\" />\n <InterfaceMember name=\"state\" type=\"GlobalContextState\" />\n </InterfaceDeclaration>\n </>\n );\n}\n\n/**\n * Generates utilities for detecting terminal color support.\n */\nexport function ArgsUtilities() {\n return (\n <>\n <TSDoc heading=\"Retrieves the command-line arguments from Deno or Node.js environments.\">\n <TSDocRemarks>\n {`This function is only intended for internal use. Please use \\`useArgs()\\` instead.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocInternal />\n <Spacing />\n <TSDocReturns>\n {`An array of command-line arguments from Deno or Node.js environments.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration name=\"getInputArgs\" returnType=\"string[]\">\n {code`return ((globalThis as { Deno?: { args: string[] } })?.Deno?.args ?? process.argv ?? []) as string[];`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport function ContextUtilities() {\n const context = usePowerlines<Context>();\n\n return (\n <>\n <Spacing />\n\n <TSDoc\n heading={`The global ${getAppTitle(context)} application context store instance.`}>\n <TSDocInternal />\n </TSDoc>\n <VarDeclaration export const name=\"unstable_globalStore\">\n {code` new AsyncLocalStorage<GlobalContext>({ name: \"globalStore\" }); `}\n </VarDeclaration>\n <Spacing />\n <TSDoc\n heading={`Get the ${getAppTitle(context)} application context for the current application.`}>\n <TSDocParam name=\"options\">\n {`The options to use when getting the context. This can include parameters for how to handle missing contexts, such as whether to throw an error or return undefined. By default, if the context is not available, this function will return undefined.`}\n </TSDocParam>\n <TSDocReturns>\n {`The ${getAppTitle(context)} application context for the current application or undefined if the context is not available.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"useGlobal\" returnType=\"GlobalContext\">\n {code`return unstable_globalStore.getStore() as GlobalContext;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility hook function to get the command-line arguments from the ${getAppTitle(\n context\n )} application context.`}>\n <TSDocReturns>\n {\"An array of command-line arguments from the application context.\"}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"useArgs\" returnType=\"string[]\">\n {code`return useGlobal()?.inputArgs ?? getInputArgs();`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility hook function to get the state of the ${getAppTitle(\n context\n )} application context.`}>\n <TSDocReturns>{\"The state of the application context.\"}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"useState\"\n returnType=\"GlobalContextState\">\n {code`return useGlobal()?.state;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility function to update the state of the ${getAppTitle(\n context\n )} application context.`}>\n <TSDocRemarks>\n {`This function will throw an error if the global context is not available, so it should only be used within a valid context scope, such as within a command handler or within the \\`withGlobal()\\` function.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocParam name=\"update\">\n {`The new state or a function that receives the previous state and returns the new state. This allows for both direct state updates and functional updates based on the previous state.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"setState\"\n parameters={[\n {\n name: \"update\",\n type: \"GlobalContextState | ((prev: GlobalContextState) => GlobalContextState)\"\n }\n ]}>\n {code`const prev = useGlobal()?.state;\n if (!prev) {\n throw new Error(\n \\`The ${getAppTitle(\n context\n )} application context is not available. Make sure to call setState() within a valid context scope.\\`\n );\n }\n\n useGlobal().state = typeof update === \"function\" ? update(prev) : { ...prev, ...update }; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility hook function to get the execution ID of the ${getAppTitle(\n context\n )} application context.`}>\n <TSDocReturns>\n {\"The execution ID of the application context.\"}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"useExecutionId\" returnType=\"string\">\n {code`return useState().executionId;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility hook function to get the metadata of the ${getAppTitle(\n context\n )} application context.`}>\n <TSDocReturns>\n {\"The metadata of the application context.\"}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"useMeta\"\n returnType=\"Map<string, unknown>\">\n {code`return useState().meta;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility hook function to get the current status of the ${getAppTitle(\n context\n )} application.`}>\n <TSDocReturns>{\"The current status of the application.\"}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"useStatus\"\n returnType=\"GlobalContextStatus\">\n {code`return useState().status;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`The global ${getAppTitle(context)} - command context store instance.`}>\n <TSDocInternal />\n </TSDoc>\n <VarDeclaration export name=\"unstable_commandStore\">\n {code`new AsyncLocalStorage<CommandContext>({ name: \"commandStore\" });`}\n </VarDeclaration>\n <Spacing />\n <TSDoc\n heading={`Get the ${getAppTitle(context)} - command context for the current application.`}>\n <TSDocReturns>\n {`The ${getAppTitle(context)} - command context for the current application.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"useCommand\" returnType=\"CommandContext\">\n {code`const result = unstable_commandStore.getStore();\nif (!result) {\n throw new Error(\n \\`The ${getAppTitle(context)} - command context is not available. Make sure to call useCommand() within a valid context scope.\\`\n );\n}\nreturn result;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"A utility hook function to get the individual segments of the current command path.\">\n <TSDocReturns>{\"An array of command path segments.\"}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"useSegments\" returnType=\"string[]\">\n {code`return useCommand().segments;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"A utility hook function to get the full command path as a string.\">\n <TSDocReturns>\n {`The full command path as a string. For example, if the user runs \\`${getAppBin(\n context\n )} foo bar\\`, this would return \\`\"foo bar\"\\`. This is useful for commands that need to know their full invocation path, such as for help text or for commands that have dynamic behavior based on their position in the command hierarchy.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration export name=\"usePath\" returnType=\"string\">\n {code`return useCommand().path;`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"Checks if a specific flag is present in the command-line arguments.\">\n <TSDocLink>\n {\"https://github.com/sindresorhus/has-flag/blob/main/index.js\"}\n </TSDocLink>\n <TSDocParam name=\"flag\">\n {\n 'The flag (or an array of flags/aliases) to check for, e.g., \"color\", \"no-color\".'\n }\n </TSDocParam>\n <TSDocParam name=\"argv\">\n {\n \"The command-line arguments to check against. Defaults to global Deno args or process args.\"\n }\n </TSDocParam>\n <TSDocReturns>\n {\"True if the flag is present, false otherwise.\"}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"hasFlag\"\n parameters={[\n { name: \"flag\", type: \"string | string[]\" },\n {\n name: \"argv\",\n type: \"string[]\",\n default: \"useArgs()\"\n }\n ]}>\n <VarDeclaration\n const\n name=\"position\"\n type=\"number\"\n initializer={code`(Array.isArray(flag) ? flag : [flag]).reduce((ret, f) => {\n const pos = argv.findIndex(arg => (f.startsWith(\"-\") ? \"\" : (f.length === 1 ? \"-\" : \"--\") + f)?.toLowerCase() === arg?.toLowerCase() || arg?.toLowerCase().startsWith((f.length === 1 ? \"-\" : \"--\") + f + \"=\"));\n return pos !== -1 ? pos : ret;\n }, -1);`}\n />\n <hbr />\n {code`return position !== -1 && argv.indexOf(\"--\") === -1 || position < argv.indexOf(\"--\");`}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration export name=\"isHelp\" returnType=\"boolean\">\n {code`!isCI && (hasFlag([\"help\", \"h\", \"?\"]) || (useStatus() === \"preparing\" && useState().isError));`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility function to wrap the ${getAppTitle(\n context\n )} application within the global context scope.`}>\n <TSDocParam name=\"handler\">\n {`The callback function to run within the global context scope. This function will receive the global context as its argument, allowing it to access any properties or utilities defined on the context. The callback function can be asynchronous and can return a value or a promise.`}\n </TSDocParam>\n <TSDocReturns>\n {`The result of the callback function, which can be a value or a promise that resolves to a value.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"withGlobal\"\n parameters={[{ name: \"handler\", type: \"() => any\" }]}\n returnType=\"Promise<void>\">\n {code`\n return unstable_globalStore.run({ options: {} as unknown as GlobalOptions, inputArgs: getInputArgs(), state: { executionId: randomUUID(), status: \"init\" } as GlobalContextState }, handler);`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc\n heading={`A utility function to wrap a ${getAppTitle(\n context\n )} application command handler within the command context scope.`}>\n <TSDocParam name=\"handler\">\n {`The callback function to run within the command context scope. This function will receive the command context as its argument, allowing it to access any properties or utilities defined on the context. The callback function can be asynchronous and can return a value or a promise.`}\n </TSDocParam>\n <TSDocReturns>\n {`The result of the callback function, which can be a value or a promise that resolves to a value.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"withCommand\"\n typeParameters={[\n {\n name: \"THandler\",\n extends: \"(...params: any[]) => any\"\n }\n ]}\n parameters={[\n { name: \"path\", type: \"string\" },\n { name: \"segments\", type: \"string[]\" },\n { name: \"params\", type: \"Parameters<THandler>\" },\n { name: \"handler\", type: \"THandler\" }\n ]}\n returnType=\"Promise<{ error: string | Error }>\">\n {code`setState({ status: \"preparing\", isError: false });\n \n const ctx = { path, segments, params } as CommandContext<THandler>;\n const result = await Promise.resolve(unstable_commandStore.run(ctx, Reflect.apply(ctx, handler, params)));\n if (result instanceof Error || (typeof result === \"object\" && result?.error instanceof Error)) {\n setState({ status: \"completed\", isError: true });\n return { error: result instanceof Error ? result : result.error };\n }\n\n setState({ status: \"completed\", isError: false });\n return { error: null }; `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface StateBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A built-in module for handling application state utilities in Shell Shock.\n */\nexport function StateBuiltin(props: StateBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"state\"\n description=\"A module that provides context hooks and utilities for accessing the application state.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:async_hooks\": [\"AsyncLocalStorage\"]\n })}>\n <GlobalTypeDefinitions />\n <Spacing />\n <ArgsUtilities />\n <Spacing />\n <ContextUtilities />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,SAAe,wBAAA;CACb,MAAA,UAAS,eAAA;CACT,MAAA,UAAU,eAAA,gBAAA,QAAA,QAAA,CAAA;AACV,QAAA;EAAA,gBAAY,OAAA,EACZ,IAAA,UAAA;AACI,UAAG,gFAAoD,YAAA,SAAA,KAAA,CAAA;KAE7D,CAAA;EAAM,gBAAkB,sBAAqB;GAC7C,UAAS;GACT,MAAS;GACT,IAAO,WAAO;AACR,WAAG,gBAAsB,KAAE;;AAE1B,aAAS,OAAA,OAAA,QAAuB,MAAC;;;KAGhC,WAAU,WAAU,gBAAK,eAAwB,UAEhD,CAAA;KACJ,CAAA;;GAEF,CAAC;EAAE,gBAAe,SAAO,EAAA,CAAA;EAAA,gBAAwB,OAAQ,EACxD,SAAM,mGACP,CAAC;EAAE,gBAAI,sBAAA;GACN,UAAO;GACP,MAAG;GACH,gBAAG,CAAA;IACD,MAAM;IACN,SAAK;IACN,CAAC;G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
548
|
-
* Generates utilities for detecting terminal color support.
|
|
549
|
-
*/
|
|
550
|
-
function ArgsUtilities() {
|
|
551
|
-
return [
|
|
552
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
553
|
-
heading: "Retrieves the command-line arguments from Deno or Node.js environments.",
|
|
554
|
-
get children() {
|
|
555
|
-
return [
|
|
556
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: "This function is only intended for internal use. Please use `useArgs()` instead." }),
|
|
557
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
558
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocInternal, {}),
|
|
559
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
560
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "An array of command-line arguments from Deno or Node.js environments." })
|
|
561
|
-
];
|
|
562
|
-
}
|
|
563
|
-
}),
|
|
564
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
565
|
-
"export": true,
|
|
566
|
-
name: "getArgs",
|
|
567
|
-
returnType: "string[]",
|
|
568
|
-
children: _alloy_js_core.code`return ((globalThis as { Deno?: { args: string[] } })?.Deno?.args ?? process.argv ?? []) as string[];`
|
|
569
|
-
}),
|
|
570
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
571
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
572
|
-
heading: "Checks if a specific flag is present in the command-line arguments.",
|
|
573
|
-
get children() {
|
|
574
|
-
return [
|
|
575
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: "https://github.com/sindresorhus/has-flag/blob/main/index.js" }),
|
|
576
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
577
|
-
name: "flag",
|
|
578
|
-
children: "The flag (or an array of flags/aliases) to check for, e.g., \"color\", \"no-color\"."
|
|
579
|
-
}),
|
|
580
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
581
|
-
name: "argv",
|
|
582
|
-
children: "The command-line arguments to check against. Defaults to global Deno args or process args."
|
|
583
|
-
}),
|
|
584
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "True if the flag is present, false otherwise." })
|
|
585
|
-
];
|
|
586
|
-
}
|
|
587
|
-
}),
|
|
588
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
589
|
-
"export": true,
|
|
590
|
-
name: "hasFlag",
|
|
591
|
-
parameters: [{
|
|
592
|
-
name: "flag",
|
|
593
|
-
type: "string | string[]"
|
|
594
|
-
}, {
|
|
595
|
-
name: "argv",
|
|
596
|
-
type: "string[]",
|
|
597
|
-
default: "useArgs()"
|
|
598
|
-
}],
|
|
599
|
-
get children() {
|
|
600
|
-
return [
|
|
601
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
602
|
-
"const": true,
|
|
603
|
-
name: "position",
|
|
604
|
-
type: "number",
|
|
605
|
-
initializer: _alloy_js_core.code`(Array.isArray(flag) ? flag : [flag]).reduce((ret, f) => {
|
|
606
|
-
const pos = argv.findIndex(arg => (f.startsWith("-") ? "" : (f.length === 1 ? "-" : "--") + f)?.toLowerCase() === arg?.toLowerCase() || arg?.toLowerCase().startsWith((f.length === 1 ? "-" : "--") + f + "="));
|
|
607
|
-
return pos !== -1 ? pos : ret;
|
|
608
|
-
}, -1);`
|
|
609
|
-
}),
|
|
610
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
611
|
-
_alloy_js_core.code`return position !== -1 && argv.indexOf("--") === -1 || position < argv.indexOf("--");`
|
|
612
|
-
];
|
|
613
|
-
}
|
|
614
|
-
}),
|
|
615
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
616
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
617
|
-
"export": true,
|
|
618
|
-
name: "isHelp",
|
|
619
|
-
type: "boolean",
|
|
620
|
-
initializer: _alloy_js_core.code` !isCI && hasFlag(["help", "h", "?"]); `
|
|
621
|
-
})
|
|
622
|
-
];
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Generates the `spawn` function declaration, which is a cross-platform utility for spawning child processes with proper color support and environment variable handling.
|
|
626
|
-
*/
|
|
627
|
-
function SpawnFunctionDeclaration() {
|
|
628
|
-
return [
|
|
629
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
630
|
-
async: true,
|
|
631
|
-
name: "resolveCommand",
|
|
632
|
-
parameters: [
|
|
633
|
-
{
|
|
634
|
-
name: "command",
|
|
635
|
-
type: "string"
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
name: "options",
|
|
639
|
-
type: "Record<string, any>",
|
|
640
|
-
default: "{}"
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
name: "pathExt",
|
|
644
|
-
type: "string",
|
|
645
|
-
default: "process.env.PATHEXT || [\".EXE\", \".CMD\", \".BAT\", \".COM\"].join(delimiter)"
|
|
646
|
-
}
|
|
647
|
-
],
|
|
648
|
-
children: _alloy_js_core.code`const env = options.env || process.env;
|
|
649
|
-
const cwd = process.cwd();
|
|
650
|
-
if (!!options.cwd && process.chdir !== undefined && !(process.chdir as any).disabled) {
|
|
651
|
-
try {
|
|
652
|
-
process.chdir(options.cwd);
|
|
653
|
-
} catch (err) {
|
|
654
|
-
// Do nothing
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
let resolved;
|
|
659
|
-
try {
|
|
660
|
-
let extensions = [""];
|
|
661
|
-
if (isWindows) {
|
|
662
|
-
extensions = pathExt.split(delimiter).flatMap((item) => [item, item.toLowerCase()]);
|
|
663
|
-
if (command.includes(".") && extensions[0] !== "") {
|
|
664
|
-
extensions.unshift("");
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
for (const envPart of (command.match(new RegExp(\`[\${posix.sep}\${sep === posix.sep ? "" : sep}]\`.replace(/(\\\\)/g, "\\\\$1"))))
|
|
669
|
-
? [...(isWindows ? [process.cwd()] : []), ...(process.env.PATH || "").split(delimiter)]
|
|
670
|
-
: [""]
|
|
671
|
-
) {
|
|
672
|
-
const part = \`\${!(/^".*"$/.test(envPart) ? envPart.slice(1, -1) : envPart) && new RegExp(\`^\\.\${new RegExp(\`[\${posix.sep}\${sep === posix.sep ? "" : sep}]\`.replace(/(\\\\)/g, "\\\\$1")).source}\`).test(command) ? command.slice(0, 2) : ""}\${join(/^".*"$/.test(envPart) ? envPart.slice(1, -1) : envPart, command)}\`;
|
|
673
|
-
for (const extension of extensions) {
|
|
674
|
-
if (isWindows) {
|
|
675
|
-
const filePath = part + extension;
|
|
676
|
-
if ((await stat(filePath)).isFile() && extensions.some((ext) => filePath.substring(filePath.length - ext.length).toLowerCase() === ext.toLowerCase())) {
|
|
677
|
-
resolved = filePath;
|
|
678
|
-
break;
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
const file = await stat(part + extension);
|
|
682
|
-
if (file.isFile() && (file.mode & 0o111) !== 0) {
|
|
683
|
-
resolved = part + extension;
|
|
684
|
-
break;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
} catch (err) {
|
|
690
|
-
// Do nothing
|
|
691
|
-
} finally {
|
|
692
|
-
if (!!options.cwd && process.chdir !== undefined && !(process.chdir as any).disabled) {
|
|
693
|
-
process.chdir(cwd);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
if (resolved) {
|
|
699
|
-
resolved = resolve(
|
|
700
|
-
options.cwd ? options.cwd : "",
|
|
701
|
-
resolved
|
|
702
|
-
);
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
return resolved; `
|
|
706
|
-
}),
|
|
707
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
708
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
709
|
-
name: "SpawnBaseOptions",
|
|
710
|
-
doc: "Options for the `spawn` handler function.",
|
|
711
|
-
get children() {
|
|
712
|
-
return [
|
|
713
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
714
|
-
name: "stdout",
|
|
715
|
-
optional: true,
|
|
716
|
-
type: "(data: string) => void",
|
|
717
|
-
doc: "The writable stream to use for prompt output, defaults to process.stdout"
|
|
718
|
-
}),
|
|
719
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
720
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
721
|
-
name: "stderr",
|
|
722
|
-
optional: true,
|
|
723
|
-
type: "(data: string) => void",
|
|
724
|
-
doc: "The writable stream to use for prompt error output, defaults to process.stderr"
|
|
725
|
-
}),
|
|
726
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
727
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
728
|
-
name: "rejectOnError",
|
|
729
|
-
optional: true,
|
|
730
|
-
type: "boolean",
|
|
731
|
-
doc: "Whether to reject the promise on error. Defaults to false."
|
|
732
|
-
}),
|
|
733
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
734
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
735
|
-
name: "file",
|
|
736
|
-
optional: true,
|
|
737
|
-
type: "string",
|
|
738
|
-
doc: "The file to execute."
|
|
739
|
-
}),
|
|
740
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
741
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
742
|
-
name: "shell",
|
|
743
|
-
optional: true,
|
|
744
|
-
type: "boolean | string",
|
|
745
|
-
doc: "If true, runs command inside of a shell. Uses '/bin/sh' on UNIX, and process.env.ComSpec on Windows. If a string is provided, it specifies the shell to use."
|
|
746
|
-
}),
|
|
747
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
748
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
|
|
749
|
-
name: "forceShell",
|
|
750
|
-
optional: true,
|
|
751
|
-
type: "boolean",
|
|
752
|
-
doc: "If true, forces the command to run inside of a shell, even if the command is a file."
|
|
753
|
-
})
|
|
754
|
-
];
|
|
755
|
-
}
|
|
756
|
-
}),
|
|
757
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
758
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeDeclaration, {
|
|
759
|
-
"export": true,
|
|
760
|
-
name: "SpawnOptions",
|
|
761
|
-
children: _alloy_js_core.code`SpawnBaseOptions & Parameters<typeof _spawn>[1]`
|
|
762
|
-
}),
|
|
763
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
764
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
765
|
-
heading: "A function to spawn child processes with proper color support and environment variable handling.",
|
|
766
|
-
get children() {
|
|
767
|
-
return [
|
|
768
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
769
|
-
name: "command",
|
|
770
|
-
children: `The command to execute.`
|
|
771
|
-
}),
|
|
772
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
773
|
-
name: "args",
|
|
774
|
-
children: `The command-line arguments to pass to the command. Defaults to an empty array.`
|
|
775
|
-
}),
|
|
776
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
777
|
-
name: "options",
|
|
778
|
-
children: `Additional options for spawning the process, such as the current working directory (\`cwd\`).`
|
|
779
|
-
}),
|
|
780
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The result of the spawned process.` })
|
|
781
|
-
];
|
|
782
|
-
}
|
|
783
|
-
}),
|
|
784
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
785
|
-
"export": true,
|
|
786
|
-
async: true,
|
|
787
|
-
name: "spawn",
|
|
788
|
-
parameters: [
|
|
789
|
-
{
|
|
790
|
-
name: "command",
|
|
791
|
-
type: "string"
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
name: "args",
|
|
795
|
-
type: "string[] | SpawnOptions",
|
|
796
|
-
default: "{} as SpawnOptions"
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
name: "options",
|
|
800
|
-
type: "SpawnOptions",
|
|
801
|
-
default: "{} as SpawnOptions"
|
|
802
|
-
}
|
|
803
|
-
],
|
|
804
|
-
children: _alloy_js_core.code`const normalized = {
|
|
805
|
-
command,
|
|
806
|
-
args: [] as string[],
|
|
807
|
-
options: options as SpawnOptions | any,
|
|
808
|
-
file: undefined as string | undefined,
|
|
809
|
-
original: {
|
|
810
|
-
command,
|
|
811
|
-
args,
|
|
812
|
-
},
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
if (args) {
|
|
816
|
-
if (Array.isArray(args)) {
|
|
817
|
-
if (args.length > 0) {
|
|
818
|
-
normalized.args = args.slice(0);
|
|
819
|
-
}
|
|
820
|
-
} else {
|
|
821
|
-
normalized.options = { ...args } as SpawnOptions | any;
|
|
822
|
-
normalized.args = [];
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
if (!normalized.options.shell && isWindows) {
|
|
827
|
-
normalized.file = (await resolveCommand(normalized.command, normalized.options)) || (await resolveCommand(normalized.command, normalized.options, delimiter));
|
|
828
|
-
|
|
829
|
-
let commandFile = normalized.file;
|
|
830
|
-
if (normalized.file) {
|
|
831
|
-
let shebang: string | undefined;
|
|
832
|
-
const buffer = Buffer.alloc(150);
|
|
833
|
-
|
|
834
|
-
try {
|
|
835
|
-
const fd = openSync(normalized.file, "r");
|
|
836
|
-
await promisify(read)(fd, buffer, 0, 150, 0);
|
|
837
|
-
closeSync(fd);
|
|
838
|
-
} catch (err) {
|
|
839
|
-
// Do nothing
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
const matched = buffer.toString().match(/^#!(.*)/);
|
|
843
|
-
if (matched) {
|
|
844
|
-
const [path, argument] = matched[0].replace(/#! ?/, "").split(" ");
|
|
845
|
-
const binary = path.split("/").pop();
|
|
846
|
-
if (binary === "env") {
|
|
847
|
-
shebang = argument;
|
|
848
|
-
} else {
|
|
849
|
-
shebang = argument ? \`\${binary} \${argument}\` : binary;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
if (shebang) {
|
|
854
|
-
normalized.args.unshift(normalized.file);
|
|
855
|
-
normalized.command = shebang;
|
|
856
|
-
|
|
857
|
-
commandFile = await resolveCommand(normalized.command, normalized.options);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
if (commandFile && (normalized.options.forceShell || /\\.(?:com|exe)$/i.test(commandFile))) {
|
|
862
|
-
normalized.command = normalize(normalized.command).replace(/([()\\][%!^"\`<>&|;, *?])/g, "^$1");
|
|
863
|
-
|
|
864
|
-
normalized.args = ["/d", "/s", "/c", \`"\${normalized.command} \${normalized.args.map(arg =>
|
|
865
|
-
\`\${arg}\`.replace(/(?=(\\\\+?)?)\\1"/g, "$1$1\\"").replace(/(?=(\\\\+?)?)\\1$/, "$1$1")
|
|
866
|
-
).map(arg =>
|
|
867
|
-
\`"\${arg}"\`.replace(/([()\\][%!^"\`<>&|;, *?])/g, "^$1")
|
|
868
|
-
).map(arg =>
|
|
869
|
-
/node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i.test(commandFile) ? arg.replace(/([()\\][%!^"\`<>&|;, *?])/g, "^$1") : arg
|
|
870
|
-
).join(" ")}"\`];
|
|
871
|
-
normalized.command = process.env.comspec || "cmd.exe";
|
|
872
|
-
normalized.options.windowsVerbatimArguments = true;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
let stdout = "";
|
|
877
|
-
let stderr = "";
|
|
878
|
-
|
|
879
|
-
const child = _spawn(normalized.command, normalized.args, {
|
|
880
|
-
cwd: process.cwd(),
|
|
881
|
-
env: {
|
|
882
|
-
...process.env,
|
|
883
|
-
FORCE_COLOR: isColorSupported ? "1" : "0",
|
|
884
|
-
},
|
|
885
|
-
...normalized.options,
|
|
886
|
-
}) as ReturnType<typeof _spawn>;
|
|
887
|
-
|
|
888
|
-
if (isWindows) {
|
|
889
|
-
const emit = child.emit;
|
|
890
|
-
child.emit = (eventName: string | symbol, ...eventArgs: any[]) => {
|
|
891
|
-
if (eventName === "exit") {
|
|
892
|
-
let err: Error | null = null;
|
|
893
|
-
if (eventArgs[0] === 1 && !normalized.file) {
|
|
894
|
-
err = Object.assign(new Error(\`spawn \${normalized.original.command} ENOENT\`), {
|
|
895
|
-
code: "ENOENT",
|
|
896
|
-
errno: "ENOENT",
|
|
897
|
-
syscall: \`spawn \${normalized.original.command}\`,
|
|
898
|
-
path: normalized.original.command,
|
|
899
|
-
spawnargs: normalized.original.args,
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
if (err) {
|
|
904
|
-
return emit.call(child, "error", err);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
return emit.apply(child, [eventName, ...eventArgs]);
|
|
909
|
-
};
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
return new Promise((resolve, reject) => {
|
|
913
|
-
if (normalized.options.stdin !== undefined) {
|
|
914
|
-
child.stdin?.write(normalized.options.stdin);
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
child.stdin?.end();
|
|
918
|
-
|
|
919
|
-
child.stdout?.on("data", data => {
|
|
920
|
-
stdout += data;
|
|
921
|
-
if (normalized.options.stdout) {
|
|
922
|
-
normalized.options.stdout(data);
|
|
923
|
-
}
|
|
924
|
-
});
|
|
925
|
-
|
|
926
|
-
child.stderr?.on("data", data => {
|
|
927
|
-
stderr += data;
|
|
928
|
-
if (normalized.options.stderr) {
|
|
929
|
-
normalized.options.stderr(data);
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
|
-
|
|
933
|
-
if (normalized.options.rejectOnError) {
|
|
934
|
-
child.addListener("error", reject);
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
child.on("close", code => {
|
|
938
|
-
if (code !== 0 && normalized.options.rejectOnError) {
|
|
939
|
-
reject(stderr);
|
|
940
|
-
} else {
|
|
941
|
-
resolve({ stdout, stderr });
|
|
942
|
-
}
|
|
943
|
-
});
|
|
944
|
-
}); `
|
|
945
|
-
})
|
|
946
|
-
];
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
548
|
* Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.
|
|
950
549
|
*/
|
|
951
550
|
function ResolveModuleFunctionDeclaration() {
|
|
@@ -1939,88 +1538,6 @@ function ResolveModuleFunctionDeclaration() {
|
|
|
1939
1538
|
})
|
|
1940
1539
|
];
|
|
1941
1540
|
}
|
|
1942
|
-
function ContextUtilities() {
|
|
1943
|
-
return _alloy_js_core.code`
|
|
1944
|
-
/**
|
|
1945
|
-
* The global Shell Shock - Application context instance.
|
|
1946
|
-
*
|
|
1947
|
-
* @internal
|
|
1948
|
-
*/
|
|
1949
|
-
export let internal_appContext = new AsyncLocalStorage<Map<string, any>>();
|
|
1950
|
-
|
|
1951
|
-
/**
|
|
1952
|
-
* Get the Shell Shock - Application context for the current application.
|
|
1953
|
-
*
|
|
1954
|
-
* @param options - The options to use when getting the context.
|
|
1955
|
-
* @returns The Shell Shock - Application context for the current application or undefined if the context is not available.
|
|
1956
|
-
*/
|
|
1957
|
-
export function useApp(): Map<string, any> | undefined {
|
|
1958
|
-
return internal_appContext.getStore();
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
/**
|
|
1962
|
-
* A utility hook function to get the command-line arguments from the application context.
|
|
1963
|
-
*
|
|
1964
|
-
* @returns An array of command-line arguments from the application context.
|
|
1965
|
-
* @throws If the application context is not available.
|
|
1966
|
-
*/
|
|
1967
|
-
export function useArgs(): string[] {
|
|
1968
|
-
return useApp()?.get("args") ?? getArgs();
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
/**
|
|
1972
|
-
* The context object for the current command execution, containing the command path and segments.
|
|
1973
|
-
*/
|
|
1974
|
-
export interface CommandContext {
|
|
1975
|
-
path: string;
|
|
1976
|
-
segments: string[];
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
/**
|
|
1980
|
-
* The global Shell Shock - Command context instance.
|
|
1981
|
-
*
|
|
1982
|
-
* @internal
|
|
1983
|
-
*/
|
|
1984
|
-
export let internal_commandContext = new AsyncLocalStorage<CommandContext>();
|
|
1985
|
-
|
|
1986
|
-
/**
|
|
1987
|
-
* Get the Shell Shock - Command context for the current application.
|
|
1988
|
-
*
|
|
1989
|
-
* @param options - The options to use when getting the context.
|
|
1990
|
-
* @returns The Shell Shock - Command context for the current application.
|
|
1991
|
-
* @throws If the Shell Shock - Command context is not available.
|
|
1992
|
-
*/
|
|
1993
|
-
export function useCommand(): CommandContext {
|
|
1994
|
-
const result = internal_commandContext.getStore();
|
|
1995
|
-
if (!result) {
|
|
1996
|
-
throw new Error(
|
|
1997
|
-
\`The Shell Shock - Command context is not available. Make sure to call useCommand() within a valid context scope.\`
|
|
1998
|
-
);
|
|
1999
|
-
}
|
|
2000
|
-
return result;
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
/**
|
|
2004
|
-
* A utility hook function to get the individual segments of the current command path.
|
|
2005
|
-
*
|
|
2006
|
-
* @returns An array of command path segments.
|
|
2007
|
-
* @throws If the command context is not available.
|
|
2008
|
-
*/
|
|
2009
|
-
export function useSegments(): string[] {
|
|
2010
|
-
return useCommand().segments;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* A utility hook function to get the full command path as a string.
|
|
2015
|
-
*
|
|
2016
|
-
* @returns The full command path as a string.
|
|
2017
|
-
* @throws If the command context is not available.
|
|
2018
|
-
*/
|
|
2019
|
-
export function usePath(): string {
|
|
2020
|
-
return useCommand().path;
|
|
2021
|
-
}
|
|
2022
|
-
`;
|
|
2023
|
-
}
|
|
2024
1541
|
/**
|
|
2025
1542
|
* A built-in utilities module for Shell Shock.
|
|
2026
1543
|
*/
|
|
@@ -2055,12 +1572,7 @@ function UtilsBuiltin(props) {
|
|
|
2055
1572
|
"node:fs/promises": ["stat"],
|
|
2056
1573
|
"node:util": ["promisify"],
|
|
2057
1574
|
"node:url": ["fileURLToPath", "pathToFileURL"],
|
|
2058
|
-
"node:module": ["builtinModules"]
|
|
2059
|
-
"node:child_process": [{
|
|
2060
|
-
name: "spawn",
|
|
2061
|
-
alias: "_spawn"
|
|
2062
|
-
}],
|
|
2063
|
-
"node:async_hooks": ["AsyncLocalStorage"]
|
|
1575
|
+
"node:module": ["builtinModules"]
|
|
2064
1576
|
});
|
|
2065
1577
|
},
|
|
2066
1578
|
get builtinImports() {
|
|
@@ -2077,7 +1589,8 @@ function UtilsBuiltin(props) {
|
|
|
2077
1589
|
"isWindows",
|
|
2078
1590
|
"isDevelopment",
|
|
2079
1591
|
"isDebug"
|
|
2080
|
-
]
|
|
1592
|
+
],
|
|
1593
|
+
state: ["hasFlag"]
|
|
2081
1594
|
});
|
|
2082
1595
|
},
|
|
2083
1596
|
get children() {
|
|
@@ -2102,18 +1615,12 @@ function UtilsBuiltin(props) {
|
|
|
2102
1615
|
children: _alloy_js_core.code`return new Promise((resolve) => setTimeout(resolve, durationMs)); `
|
|
2103
1616
|
}),
|
|
2104
1617
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2105
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(ContextUtilities, {}),
|
|
2106
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2107
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(ArgsUtilities, {}),
|
|
2108
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2109
1618
|
(0, _alloy_js_core_jsx_runtime.createComponent)(EnvSupportUtilities, {}),
|
|
2110
1619
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2111
1620
|
(0, _alloy_js_core_jsx_runtime.createComponent)(HyperlinkSupportUtilities, {}),
|
|
2112
1621
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2113
1622
|
(0, _alloy_js_core_jsx_runtime.createComponent)(ColorSupportUtilities, {}),
|
|
2114
1623
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2115
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(SpawnFunctionDeclaration, {}),
|
|
2116
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2117
1624
|
(0, _alloy_js_core_jsx_runtime.createComponent)(ResolveModuleFunctionDeclaration, {}),
|
|
2118
1625
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2119
1626
|
(0, _alloy_js_core_jsx_runtime.createComponent)(FindSuggestionsDeclaration, {}),
|
|
@@ -2130,13 +1637,10 @@ function UtilsBuiltin(props) {
|
|
|
2130
1637
|
}
|
|
2131
1638
|
|
|
2132
1639
|
//#endregion
|
|
2133
|
-
exports.ArgsUtilities = ArgsUtilities;
|
|
2134
1640
|
exports.ColorSupportUtilities = ColorSupportUtilities;
|
|
2135
|
-
exports.ContextUtilities = ContextUtilities;
|
|
2136
1641
|
exports.EnvSupportUtilities = EnvSupportUtilities;
|
|
2137
1642
|
exports.FindSuggestionsDeclaration = FindSuggestionsDeclaration;
|
|
2138
1643
|
exports.HyperlinkSupportUtilities = HyperlinkSupportUtilities;
|
|
2139
1644
|
exports.ResolveModuleFunctionDeclaration = ResolveModuleFunctionDeclaration;
|
|
2140
|
-
exports.SpawnFunctionDeclaration = SpawnFunctionDeclaration;
|
|
2141
1645
|
exports.UtilsBuiltin = UtilsBuiltin;
|
|
2142
1646
|
//# sourceMappingURL=utils-builtin.cjs.map
|