@shell-shock/preset-cli 0.7.12 → 0.8.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/components/banner-function-declaration.cjs +15 -15
- package/dist/components/banner-function-declaration.d.cts +2 -2
- package/dist/components/banner-function-declaration.d.mts +2 -2
- package/dist/components/banner-function-declaration.mjs +1 -1
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/command-entry.cjs +128 -89
- package/dist/components/command-entry.d.cts +3 -3
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +3 -3
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +127 -88
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +5 -4
- package/dist/components/command-router.d.cts +5 -5
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +2 -2
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +3 -2
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/virtual-command-entry.cjs +2 -2
- package/dist/components/virtual-command-entry.d.cts +3 -3
- package/dist/components/virtual-command-entry.d.mts +3 -3
- package/dist/components/virtual-command-entry.mjs +1 -1
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-default-options.cjs +3 -3
- package/dist/helpers/get-default-options.mjs +3 -3
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/types/plugin.d.cts +1 -2
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +1 -2
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +14 -14
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { CommandTree } from "@shell-shock/core
|
|
3
|
-
import { CommandRouterProps } from "@shell-shock/preset-script/components
|
|
1
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
2
|
+
import { CommandTree } from "@shell-shock/core";
|
|
3
|
+
import { CommandRouterProps } from "@shell-shock/preset-script/components";
|
|
4
4
|
|
|
5
5
|
//#region src/components/command-router.d.ts
|
|
6
6
|
interface CommandRouterSelectOptionsProps {
|
|
7
7
|
commands?: Record<string, CommandTree>;
|
|
8
8
|
}
|
|
9
|
-
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps):
|
|
9
|
+
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core2.Children;
|
|
10
10
|
/**
|
|
11
11
|
* A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
|
|
12
12
|
*/
|
|
13
|
-
declare function CommandRouter(props: CommandRouterProps):
|
|
13
|
+
declare function CommandRouter(props: CommandRouterProps): _alloy_js_core2.Children;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
|
|
16
16
|
//# sourceMappingURL=command-router.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA6BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,eAAA,CAAA,QAJrB;AAGnB;AA2BA;;iBAAgB,aAAA,QAAqB,qBAAkB,eAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { CommandTree } from "@shell-shock/core";
|
|
3
|
+
import { CommandRouterProps } from "@shell-shock/preset-script/components";
|
|
4
4
|
|
|
5
5
|
//#region src/components/command-router.d.ts
|
|
6
6
|
interface CommandRouterSelectOptionsProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.d.mts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"command-router.d.mts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA6BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,eAAA,CAAA,QAJrB;AAGnB;AA2BA;;iBAAgB,aAAA,QAAqB,qBAAkB,eAAA,CAAA"}
|
|
@@ -2,7 +2,8 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
|
2
2
|
import { For, code } from "@alloy-js/core";
|
|
3
3
|
import { IfStatement } from "@alloy-js/typescript";
|
|
4
4
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
5
|
-
import {
|
|
5
|
+
import { formatShortDescription } from "@shell-shock/core/plugin-utils";
|
|
6
|
+
import { CommandRouter as CommandRouter$1, CommandRouterBody } from "@shell-shock/preset-script/components";
|
|
6
7
|
|
|
7
8
|
//#region src/components/command-router.tsx
|
|
8
9
|
function CommandRouterSelectOptions(props) {
|
|
@@ -15,7 +16,7 @@ function CommandRouterSelectOptions(props) {
|
|
|
15
16
|
hardline: true,
|
|
16
17
|
children: (command) => command.isVirtual ? createComponent(CommandRouterSelectOptions, { get commands() {
|
|
17
18
|
return command.children ?? {};
|
|
18
|
-
} }) : code`{ value: [${command.segments.map((segment) => `"${segment}"`).join(", ")}], label: "${command.title}", description:
|
|
19
|
+
} }) : code`{ value: [${command.segments.map((segment) => `"${segment}"`).join(", ")}], label: "${command.title}", description: \`${formatShortDescription(command.description)}\`${command.icon ? `, icon: "${command.icon}"` : ""} }`
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.mjs","names":["code","For","IfStatement","Spacing","CommandRouter","BaseCommandRouter","CommandRouterBody","CommandRouterSelectOptions","props","commands","_$createComponent","each","Object","values","joiner","hardline","children","command","isVirtual","segments","map","segment","join","title","description","icon","_$mergeProps","condition","_$memo","length"],"sources":["../../src/components/command-router.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, For } from \"@alloy-js/core\";\nimport { IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { CommandTree } from \"@shell-shock/core/
|
|
1
|
+
{"version":3,"file":"command-router.mjs","names":["code","For","IfStatement","Spacing","formatShortDescription","CommandRouter","BaseCommandRouter","CommandRouterBody","CommandRouterSelectOptions","props","commands","_$createComponent","each","Object","values","joiner","hardline","children","command","isVirtual","segments","map","segment","join","title","description","icon","_$mergeProps","condition","_$memo","length"],"sources":["../../src/components/command-router.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, For } from \"@alloy-js/core\";\nimport { IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { formatShortDescription } from \"@shell-shock/core/plugin-utils\";\nimport type { CommandRouterProps } from \"@shell-shock/preset-script/components\";\nimport {\n CommandRouter as BaseCommandRouter,\n CommandRouterBody\n} from \"@shell-shock/preset-script/components\";\n\nexport interface CommandRouterSelectOptionsProps {\n commands?: Record<string, CommandTree>;\n}\n\nexport function CommandRouterSelectOptions(\n props: CommandRouterSelectOptionsProps\n) {\n const { commands } = props;\n\n return (\n <For each={Object.values(commands ?? {})} joiner=\",\" hardline>\n {command =>\n command.isVirtual ? (\n <CommandRouterSelectOptions commands={command.children ?? {}} />\n ) : (\n code`{ value: [${command.segments\n .map(segment => `\"${segment}\"`)\n .join(\n \", \"\n )}], label: \"${command.title}\", description: \\`${formatShortDescription(\n command.description\n )}\\`${command.icon ? `, icon: \"${command.icon}\"` : \"\"} }`\n )\n }\n </For>\n );\n}\n\n/**\n * A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.\n */\nexport function CommandRouter(props: CommandRouterProps) {\n const { segments, commands } = props;\n\n return (\n <>\n <BaseCommandRouter {...props} segments={segments} commands={commands} />\n <Spacing />\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await banner();\n\n let segments = await select({\n message: \"Which command would you like to execute?\",\n options: [ `}\n <CommandRouterSelectOptions commands={commands} />\n {` ],\n });\n if (isCancel(segments)) {\n return;\n }\n\n let dynamics = {} as Record<string, string>;\n for (const dynamic of segments.filter(segment => segment.startsWith(\"[\") && segment.endsWith(\"]\"))) {\n const value = await text({\n message: \\`Please provide a value for \\${dynamic.replace(/^\\[+/, \"\").replace(/\\]+$/, \"\")}:\\`,\n });\n if (isCancel(value)) {\n return;\n }\n dynamics[dynamic] = value;\n }\n\n segments = segments.map(segment => dynamics[segment] || segment);\n const context = useApp();\n context.set(\"args\", [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${\n segments.length + 2\n })].filter(Boolean) as string[]);\n\n command = segments[0];\n args = context.get(\"args\"); `}\n <CommandRouterBody {...props} segments={segments} commands={commands} />\n </IfStatement>\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;;AAiCA,SAAgBQ,2BACdC,OACA;CACA,MAAM,EAAEC,aAAaD;AAErB,QAAAE,gBACGV,KAAG;EAAA,IAACW,OAAI;AAAA,UAAEC,OAAOC,OAAOJ,YAAY,EAAE,CAAC;;EAAEK,QAAM;EAAKC,UAAQ;EAAAC,WAC1DC,YACCA,QAAQC,YAASR,gBACdH,4BAA0B,EAAA,IAACE,WAAQ;AAAA,UAAEQ,QAAQD,YAAY,EAAE;KAAA,CAAA,GAE5DjB,IAAI,aAAakB,QAAQE,SACtBC,KAAIC,YAAW,IAAIA,QAAO,GAAI,CAC9BC,KACC,KACD,CAAA,aAAcL,QAAQM,MAAK,oBAAqBpB,uBACjDc,QAAQO,YACT,CAAA,IAAKP,QAAQQ,OAAO,YAAYR,QAAQQ,KAAI,KAAM,GAAE;EACtD,CAAA;;;;;AAST,SAAgBrB,cAAcI,OAA2B;CACvD,MAAM,EAAEW,UAAUV,aAAaD;AAE/B,QAAA;EAAAE,gBAEKL,iBAAiBqB,WAAKlB,OAAK;GAAYW;GAAoBV;GAAQ,CAAA,CAAA;EAAAC,gBACnER,SAAO,EAAA,CAAA;EAAAQ,gBACPT,aAAW;GAAC0B,WAAW5B,IAAI;GAA0B,IAAAiB,WAAA;AAAA,WAAA;KACnDjB,IAAI;;;;;KAISW,gBACbH,4BAA0B,EAAWE,UAAQ,CAAA;KAAAmB,WAC7C;;;;;;;;;;;;;;;;;;;wIAoBCT,SAASU,SAAS,EAAC;;;sCAIQ;KAAAnB,gBAC5BJ,mBAAiBoB,WAAKlB,OAAK;MAAYW;MAAoBV;MAAQ,CAAA,CAAA;KAAA;;GAAA,CAAA;EAAAC,gBAErER,SAAO,EAAA,CAAA;EAAA"}
|
|
@@ -5,7 +5,7 @@ const require_components_command_entry = require('./command-entry.cjs');
|
|
|
5
5
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
6
|
let __alloy_js_core = require("@alloy-js/core");
|
|
7
7
|
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
|
-
let
|
|
8
|
+
let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
9
9
|
let __stryke_path_join = require("@stryke/path/join");
|
|
10
10
|
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
11
11
|
let defu = require("defu");
|
|
@@ -20,7 +20,7 @@ let __shell_shock_preset_script_components_virtual_command_entry = require("@she
|
|
|
20
20
|
function VirtualCommandEntry(props) {
|
|
21
21
|
const { command, imports, builtinImports, ...rest } = props;
|
|
22
22
|
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
23
|
-
const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0,
|
|
23
|
+
const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
|
|
24
24
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
25
25
|
get path() {
|
|
26
26
|
return filePath.value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
2
|
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
|
-
import { CommandTree } from "@shell-shock/core
|
|
3
|
+
import { CommandTree } from "@shell-shock/core";
|
|
4
4
|
|
|
5
5
|
//#region src/components/virtual-command-entry.d.ts
|
|
6
6
|
interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinition"> {
|
|
@@ -9,7 +9,7 @@ interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDe
|
|
|
9
9
|
/**
|
|
10
10
|
* The virtual command entry point for the Shell Shock project.
|
|
11
11
|
*/
|
|
12
|
-
declare function VirtualCommandEntry(props: VirtualCommandEntryProps):
|
|
12
|
+
declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core0.Children;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { VirtualCommandEntry, VirtualCommandEntryProps };
|
|
15
15
|
//# sourceMappingURL=virtual-command-entry.d.cts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
2
|
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
|
-
import { CommandTree } from "@shell-shock/core
|
|
3
|
+
import { CommandTree } from "@shell-shock/core";
|
|
4
4
|
|
|
5
5
|
//#region src/components/virtual-command-entry.d.ts
|
|
6
6
|
interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinition"> {
|
|
@@ -9,7 +9,7 @@ interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDe
|
|
|
9
9
|
/**
|
|
10
10
|
* The virtual command entry point for the Shell Shock project.
|
|
11
11
|
*/
|
|
12
|
-
declare function VirtualCommandEntry(props: VirtualCommandEntryProps):
|
|
12
|
+
declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core1.Children;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { VirtualCommandEntry, VirtualCommandEntryProps };
|
|
15
15
|
//# sourceMappingURL=virtual-command-entry.d.mts.map
|
|
@@ -4,7 +4,7 @@ import { CommandEntry } from "./command-entry.mjs";
|
|
|
4
4
|
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { For, Show, computed } from "@alloy-js/core";
|
|
6
6
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
7
|
-
import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils
|
|
7
|
+
import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
8
8
|
import { joinPaths } from "@stryke/path/join";
|
|
9
9
|
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
10
10
|
import defu from "defu";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","segments","filter","segment","join","_$createComponent","_$mergeProps","path","value","Object","entries","children","child","isVirtual","reduce","ret","name","alias","env","console","utils","prompts","_$createIntrinsic","commands","each","values","when","fallback"],"sources":["../../src/components/virtual-command-entry.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 { computed, For, Show } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","segments","filter","segment","join","_$createComponent","_$mergeProps","path","value","Object","entries","children","child","isVirtual","reduce","ret","name","alias","env","console","utils","prompts","_$createIntrinsic","commands","each","values","when","fallback"],"sources":["../../src/components/virtual-command-entry.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 { computed, For, Show } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils\";\nimport { VirtualCommandHandlerDeclaration } from \"@shell-shock/preset-script/components/virtual-command-entry\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\n \"warn\",\n \"error\",\n \"info\",\n \"help\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"isInteractive\",\n \"isHelp\",\n \"findSuggestions\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,SAAgBa,oBAAoBC,OAAiC;CACnE,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUhB,eAAiC;CACjD,MAAMiB,WAAWpB,eACfO,UACEY,QAAQE,WACRN,QAAQO,SACLC,QAAOC,YAAW,CAACnB,qBAAqBmB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;AAED,QAAA,CAAAC,gBAEKtB,gBAAcuB,WACTT,MAAI;EAAA,IACRU,OAAI;AAAA,UAAER,SAASS;;EAAK,IACpBb,UAAO;AAAA,UAAEP,KACPO,WAAW,EAAE,EACbc,OAAOC,QAAQhB,QAAQiB,SAAS,CAC7BT,QAAQ,GAAGU,WAAWA,MAAMC,UAAU,CACtCC,QAAQC,KAAK,CAACC,MAAMJ,WAAW;AAC9BG,QAAI,KAAKH,MAAMI,UAAU,CACvB;KAAEA,MAAM;KAAWC,OAAO,SAAS9B,WAAW6B,KAAK;KAAI,CACxD;AAED,WAAOD;MACN,EAA2B,CAClC,CAAC;;EAAA,IACDnB,iBAAc;AAAA,UAAER,KAAKQ,kBAAkB,EAAE,EAAE;IACzCsB,KAAK,CAAC,iBAAiB,UAAU;IACjCC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,SAAS;KAAC;KAAQ;KAAW;KAAU;KAAU;KAAY;KAAO;IACrE,CAAC;;EAAA,IAAAV,WAAA;AAAA,UAAA;IAAAN,gBACDhB,2BAAyB,EAAUK,SAAO,CAAA;IAAA4B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAjB,gBAG1CpB,kCAAgC;KAAUS;KAAO,IAAAiB,WAAA;AAAA,aAAAN,gBAC/Cd,eAAa;OAAA,IACZU,WAAQ;AAAA,eAAEP,QAAQO;;OAAQ,IAC1BsB,WAAQ;AAAA,eAAE7B,QAAQiB;;OAAQ,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAN,gBAI/BzB,KAAG;EAAA,IAAC4C,OAAI;AAAA,UAAEf,OAAOgB,OAAO/B,QAAQiB,SAAS;;EAAAA,WACvCC,UAAKP,gBACHxB,MAAI;GAAA,IACH6C,OAAI;AAAA,WAAEd,MAAMC;;GAAS,IACrBc,WAAQ;AAAA,WAAAtB,gBAAGf,cAAY,EAACI,SAASkB,OAAK,CAAA;;GAAA,IAAAD,WAAA;AAAA,WAAAN,gBACrCb,qBAAmB,EAACE,SAASkB,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let __shell_shock_core = require("@shell-shock/core");
|
|
3
3
|
let __shell_shock_preset_script_helpers_get_default_options = require("@shell-shock/preset-script/helpers/get-default-options");
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/get-default-options.ts
|
|
@@ -18,7 +18,7 @@ function getDefaultOptions(context, _) {
|
|
|
18
18
|
title: "Interactive",
|
|
19
19
|
description: "Enable interactive mode - will be set to false if running in a CI pipeline.",
|
|
20
20
|
alias: ["i", "interact"],
|
|
21
|
-
kind:
|
|
21
|
+
kind: __shell_shock_core.CommandParameterKinds.boolean,
|
|
22
22
|
optional: true,
|
|
23
23
|
default: context.config.interactive !== false
|
|
24
24
|
},
|
|
@@ -27,7 +27,7 @@ function getDefaultOptions(context, _) {
|
|
|
27
27
|
title: "Non-Interactive",
|
|
28
28
|
description: "Disable interactive mode - will be set to true if running in a CI pipeline.",
|
|
29
29
|
alias: ["no-interactive"],
|
|
30
|
-
kind:
|
|
30
|
+
kind: __shell_shock_core.CommandParameterKinds.boolean,
|
|
31
31
|
optional: true,
|
|
32
32
|
default: false,
|
|
33
33
|
isNegativeOf: "interactive"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandParameterKinds } from "@shell-shock/core";
|
|
2
2
|
import { getDefaultOptions } from "@shell-shock/preset-script/helpers/get-default-options";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/get-default-options.ts
|
|
@@ -17,7 +17,7 @@ function getDefaultOptions$1(context, _) {
|
|
|
17
17
|
title: "Interactive",
|
|
18
18
|
description: "Enable interactive mode - will be set to false if running in a CI pipeline.",
|
|
19
19
|
alias: ["i", "interact"],
|
|
20
|
-
kind:
|
|
20
|
+
kind: CommandParameterKinds.boolean,
|
|
21
21
|
optional: true,
|
|
22
22
|
default: context.config.interactive !== false
|
|
23
23
|
},
|
|
@@ -26,7 +26,7 @@ function getDefaultOptions$1(context, _) {
|
|
|
26
26
|
title: "Non-Interactive",
|
|
27
27
|
description: "Disable interactive mode - will be set to true if running in a CI pipeline.",
|
|
28
28
|
alias: ["no-interactive"],
|
|
29
|
-
kind:
|
|
29
|
+
kind: CommandParameterKinds.boolean,
|
|
30
30
|
optional: true,
|
|
31
31
|
default: false,
|
|
32
32
|
isNegativeOf: "interactive"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.mjs","names":["
|
|
1
|
+
{"version":3,"file":"get-default-options.mjs","names":["CommandParameterKinds","getDefaultOptions","getDefaultOptionsBase","context","_","config","interactive","name","title","description","alias","kind","boolean","optional","default","isNegativeOf","filter","Boolean"],"sources":["../../src/helpers/get-default-options.ts"],"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 type { CommandBase, CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { getDefaultOptions as getDefaultOptionsBase } from \"@shell-shock/preset-script/helpers/get-default-options\";\nimport type { CLIPresetContext } from \"../types\";\n\n/**\n * Get the default command options.\n *\n * @param context - The build context.\n * @param _ - The command input.\n * @returns The default command options.\n */\nexport function getDefaultOptions(\n context: CLIPresetContext,\n _: CommandBase\n): CommandOption[] {\n return [\n ...getDefaultOptionsBase(),\n context.config.interactive !== \"never\" &&\n context.config.interactive !== true && {\n name: \"interactive\",\n title: \"Interactive\",\n description:\n \"Enable interactive mode - will be set to false if running in a CI pipeline.\",\n alias: [\"i\", \"interact\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: context.config.interactive !== false\n },\n context.config.interactive !== \"never\" &&\n context.config.interactive !== false && {\n name: \"non-interactive\",\n title: \"Non-Interactive\",\n description:\n \"Disable interactive mode - will be set to true if running in a CI pipeline.\",\n alias: [\"no-interactive\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n isNegativeOf: \"interactive\"\n }\n ].filter(Boolean) as CommandOption[];\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgBC,oBACdE,SACAC,GACiB;AACjB,QAAO;EACL,GAAGF,mBAAuB;EAC1BC,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,QAAQ;GACrCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,KAAK,WAAW;GACxBC,MAAMX,sBAAsBY;GAC5BC,UAAU;GACVC,SAASX,QAAQE,OAAOC,gBAAgB;GACzC;EACHH,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,SAAS;GACtCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,iBAAiB;GACzBC,MAAMX,sBAAsBY;GAC5BC,UAAU;GACVC,SAAS;GACTC,cAAc;GACf;EACJ,CAACC,OAAOC,QAAQ"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CommandBase, CommandOption } from "@shell-shock/core
|
|
2
|
-
import { Context } from "@shell-shock/core/types/context";
|
|
1
|
+
import { CommandBase, CommandOption, Context } from "@shell-shock/core";
|
|
3
2
|
import { PromptsPluginContext } from "@shell-shock/plugin-prompts/types/plugin";
|
|
4
3
|
import { ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
5
4
|
import { UpgradePluginOptions } from "@shell-shock/plugin-upgrade/types/plugin";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;KAgCY,WAAA;UAEK,uBAAA,SAAgC;EAFrC;AAEZ;AAeA;;;;;;;;;EA0CY,IAAA,CAAA,EA7CH,WA6CG;;AACV,KA3CU,gBAAA,GAAmB,IA2C7B,CA3CkC,mBA2ClC,EAAA,gBAAA,CAAA,GAAA;EACA;;AAEF;;;;;;;;;EAYY,WAAA,CAAA,EAAA,OAAgB,GAAA,OAAA;EACF;;;;;;;;;;;;;;mBA9BpB,6BACW,gBAAgB,gBAAgB;;;;;;;YASrC;;KAGA,mBAAA,GAAsB,yBAChC,wBACA;KAEU,uBAAA,GAA0B,6BACpC,4BACA,SAAS,KAAK;;;;;;;WAOH,SAAS;;KAGV,yCACc,0BAA0B,2BAChD,uBAAuB,oBAAoB"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CommandBase, CommandOption } from "@shell-shock/core
|
|
2
|
-
import { Context } from "@shell-shock/core/types/context";
|
|
1
|
+
import { CommandBase, CommandOption, Context } from "@shell-shock/core";
|
|
3
2
|
import { PromptsPluginContext } from "@shell-shock/plugin-prompts/types/plugin";
|
|
4
3
|
import { ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
5
4
|
import { UpgradePluginOptions } from "@shell-shock/plugin-upgrade/types/plugin";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;KAgCY,WAAA;UAEK,uBAAA,SAAgC;EAFrC;AAEZ;AAeA;;;;;;;;;EA0CY,IAAA,CAAA,EA7CH,WA6CG;;AACV,KA3CU,gBAAA,GAAmB,IA2C7B,CA3CkC,mBA2ClC,EAAA,gBAAA,CAAA,GAAA;EACA;;AAEF;;;;;;;;;EAYY,WAAA,CAAA,EAAA,OAAgB,GAAA,OAAA;EACF;;;;;;;;;;;;;;mBA9BpB,6BACW,gBAAgB,gBAAgB;;;;;;;YASrC;;KAGA,mBAAA,GAAsB,yBAChC,wBACA;KAEU,uBAAA,GAA0B,6BACpC,4BACA,SAAS,KAAK;;;;;;;WAOH,SAAS;;KAGV,yCACc,0BAA0B,2BAChD,uBAAuB,oBAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"keywords": [
|
|
@@ -167,20 +167,20 @@
|
|
|
167
167
|
"dependencies": {
|
|
168
168
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
169
169
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
170
|
-
"@powerlines/deepkit": "^0.6.
|
|
171
|
-
"@powerlines/plugin-alloy": "^0.
|
|
172
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
173
|
-
"@shell-shock/core": "^0.
|
|
174
|
-
"@shell-shock/plugin-console": "^0.1.
|
|
175
|
-
"@shell-shock/plugin-prompts": "^0.3.
|
|
176
|
-
"@shell-shock/plugin-theme": "^0.3.
|
|
177
|
-
"@shell-shock/plugin-upgrade": "^0.1.
|
|
178
|
-
"@shell-shock/preset-script": "^0.6.
|
|
179
|
-
"@stryke/path": "^0.26.
|
|
180
|
-
"@stryke/string-format": "^0.14.
|
|
170
|
+
"@powerlines/deepkit": "^0.6.90",
|
|
171
|
+
"@powerlines/plugin-alloy": "^0.24.2",
|
|
172
|
+
"@powerlines/plugin-plugin": "^0.12.262",
|
|
173
|
+
"@shell-shock/core": "^0.12.0",
|
|
174
|
+
"@shell-shock/plugin-console": "^0.1.8",
|
|
175
|
+
"@shell-shock/plugin-prompts": "^0.3.9",
|
|
176
|
+
"@shell-shock/plugin-theme": "^0.3.12",
|
|
177
|
+
"@shell-shock/plugin-upgrade": "^0.1.14",
|
|
178
|
+
"@shell-shock/preset-script": "^0.6.23",
|
|
179
|
+
"@stryke/path": "^0.26.12",
|
|
180
|
+
"@stryke/string-format": "^0.14.8",
|
|
181
181
|
"cfonts": "^3.3.1",
|
|
182
182
|
"defu": "^6.1.4",
|
|
183
|
-
"powerlines": "^0.39.
|
|
183
|
+
"powerlines": "^0.39.19"
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
186
|
"@babel/core": "^7.29.0",
|
|
@@ -210,5 +210,5 @@
|
|
|
210
210
|
"./package.json": "./package.json"
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
|
-
"gitHead": "
|
|
213
|
+
"gitHead": "c38d304433a296936fb8ca58aa138a0039918931"
|
|
214
214
|
}
|