@shell-shock/preset-cli 0.1.3 → 0.1.4
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.d.cts +2 -2
- package/dist/components/command-entry.cjs +2 -5
- package/dist/components/command-entry.d.mts +2 -2
- package/dist/components/command-entry.mjs +2 -5
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/virtual-command-entry.cjs +2 -1
- package/dist/components/virtual-command-entry.d.cts +2 -2
- package/dist/components/virtual-command-entry.d.mts +2 -2
- package/dist/components/virtual-command-entry.mjs +2 -1
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
2
|
import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
|
|
3
3
|
|
|
4
4
|
//#region src/components/banner-function-declaration.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
7
7
|
*/
|
|
8
|
-
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps):
|
|
8
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core1.Children;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { BannerFunctionDeclaration };
|
|
11
11
|
//# sourceMappingURL=banner-function-declaration.d.cts.map
|
|
@@ -6,7 +6,6 @@ let __alloy_js_core = require("@alloy-js/core");
|
|
|
6
6
|
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
7
7
|
let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
|
|
8
8
|
let __powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
9
|
-
let __shell_shock_core_components_options_parser_logic = require("@shell-shock/core/components/options-parser-logic");
|
|
10
9
|
let __shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
|
|
11
10
|
let __stryke_path_find = require("@stryke/path/find");
|
|
12
11
|
let __stryke_path_join = require("@stryke/path/join");
|
|
@@ -53,7 +52,8 @@ function CommandEntry(props) {
|
|
|
53
52
|
utils: [
|
|
54
53
|
"getArgs",
|
|
55
54
|
"hasFlag",
|
|
56
|
-
"isMinimal"
|
|
55
|
+
"isMinimal",
|
|
56
|
+
"isUnicodeSupported"
|
|
57
57
|
]
|
|
58
58
|
});
|
|
59
59
|
},
|
|
@@ -62,9 +62,6 @@ function CommandEntry(props) {
|
|
|
62
62
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, { command }),
|
|
63
63
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
64
64
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
65
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_core_components_options_parser_logic.OptionsInterfaceDeclaration, { command }),
|
|
66
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
67
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
68
65
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_entry.CommandHandlerDeclaration, { command })
|
|
69
66
|
];
|
|
70
67
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
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
3
|
import { CommandTree } from "@shell-shock/core/types/command";
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinitio
|
|
|
9
9
|
/**
|
|
10
10
|
* The command entry point for the Shell Shock project.
|
|
11
11
|
*/
|
|
12
|
-
declare function CommandEntry(props: CommandEntryProps):
|
|
12
|
+
declare function CommandEntry(props: CommandEntryProps): _alloy_js_core0.Children;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { CommandEntry, CommandEntryProps };
|
|
15
15
|
//# sourceMappingURL=command-entry.d.mts.map
|
|
@@ -5,7 +5,6 @@ import { For, Show, computed } from "@alloy-js/core";
|
|
|
5
5
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
6
6
|
import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
|
|
7
7
|
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
8
|
-
import { OptionsInterfaceDeclaration } from "@shell-shock/core/components/options-parser-logic";
|
|
9
8
|
import { CommandHandlerDeclaration } from "@shell-shock/preset-script/components/command-entry";
|
|
10
9
|
import { findFilePath, relativePath } from "@stryke/path/find";
|
|
11
10
|
import { joinPaths } from "@stryke/path/join";
|
|
@@ -51,7 +50,8 @@ function CommandEntry(props) {
|
|
|
51
50
|
utils: [
|
|
52
51
|
"getArgs",
|
|
53
52
|
"hasFlag",
|
|
54
|
-
"isMinimal"
|
|
53
|
+
"isMinimal",
|
|
54
|
+
"isUnicodeSupported"
|
|
55
55
|
]
|
|
56
56
|
});
|
|
57
57
|
},
|
|
@@ -60,9 +60,6 @@ function CommandEntry(props) {
|
|
|
60
60
|
createComponent(BannerFunctionDeclaration, { command }),
|
|
61
61
|
createIntrinsic("hbr", {}),
|
|
62
62
|
createIntrinsic("hbr", {}),
|
|
63
|
-
createComponent(OptionsInterfaceDeclaration, { command }),
|
|
64
|
-
createIntrinsic("hbr", {}),
|
|
65
|
-
createIntrinsic("hbr", {}),
|
|
66
63
|
createComponent(CommandHandlerDeclaration, { command })
|
|
67
64
|
];
|
|
68
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.mjs","names":["computed","For","Show","usePowerlines","EntryFile","
|
|
1
|
+
{"version":3,"file":"command-entry.mjs","names":["computed","For","Show","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","findFilePath","relativePath","joinPaths","replaceExtension","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","path","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","name","env","console","utils","children","_$createIntrinsic","each","Object","values","child","when","isVirtual","fallback"],"sources":["../../src/components/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 { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\n\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { CommandHandlerDeclaration } from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\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 { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.path.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value]: `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isCI\"],\n console: [\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\"getArgs\", \"hasFlag\", \"isMinimal\", \"isUnicodeSupported\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration command={command} />\n </EntryFile>\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":";;;;;;;;;;;;;;;;;;AA6CA,SAAgBe,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUlB,eAAiC;CACjD,MAAMmB,WAAWtB,eACfS,UACEQ,QAAQM,KAAKC,SACVC,QAAOC,YAAW,CAACrB,qBAAqBqB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoB5B,eACxBU,iBACEF,aACEC,UAAUY,QAAQQ,WAAWtB,aAAae,SAASQ,MAAM,CAAC,EAC1Db,QAAQc,MAAMC,OAAOC,QAAQhB,QAAQc,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBlC,gBAAgB;EACrC,GAAGiB,QAAQc;EACXI,QAAQlB,QAAQmB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKjC,WAASkC,WACJlB,MAAI;EAAA,IACRG,OAAI;AAAA,UAAED,SAASQ;;EAAK,IACpBI,iBAAc;AAAA,UAAEA,eAAeJ;;EAAK,IACpCZ,UAAO;AAAA,UAAEN,KAAKM,WAAW,EAAE,EAAE,GAC1BU,kBAAkBE,QAAQ,SAASnB,WAAWM,QAAQsB,KAAK,IAC7D,CAAC;;EAAA,IACFpB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCqB,KAAK,CAAC,OAAO,OAAO;IACpBC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KAAC;KAAW;KAAW;KAAa;KAAoB;IAChE,CAAC;;EAAA,IAAAC,WAAA;AAAA,UAAA;IAAAN,gBACDxB,2BAAyB,EAAUI,SAAO,CAAA;IAAA2B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAP,gBAG1C/B,2BAAyB,EAAUW,SAAO,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoB,gBAE5CpC,KAAG;EAAA,IAAC4C,OAAI;AAAA,UAAEC,OAAOC,OAAO9B,QAAQ0B,SAAS;;EAAAA,WACvCK,UAAKX,gBACHnC,MAAI;GAAA,IACH+C,OAAI;AAAA,WAAED,MAAME;;GAAS,IACrBC,WAAQ;AAAA,WAAAd,gBAAGtB,cAAY,EAACE,SAAS+B,OAAK,CAAA;;GAAA,IAAAL,WAAA;AAAA,WAAAN,gBACrCvB,qBAAmB,EAACG,SAAS+B,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
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
3
|
import { CommandTree } from "@shell-shock/core/types/command";
|
|
4
4
|
|
|
@@ -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,4 +1,4 @@
|
|
|
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
3
|
import { CommandTree } from "@shell-shock/core/types/command";
|
|
4
4
|
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","path","segments","filter","segment","join","_$createComponent","_$mergeProps","value","didyoumean2","name","default","Object","entries","children","child","isVirtual","reduce","ret","alias","console","utils","_$createIntrinsic","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 { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\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\";\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.path.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 {\n didyoumean2: [\n { name: \"didYouMean\", default: true },\n { name: \"ReturnTypeEnums\" },\n { name: \"ThresholdTypeEnums\" }\n ]\n },\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 console: [\"warn\", \"error\", \"table\", \"colors\", \"writeLine\"],\n utils: [\"getArgs\", \"hasFlag\", \"isMinimal\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command} />\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":";;;;;;;;;;;;;;;;AA2CA,SAAgBY,oBAAoBC,OAAiC;CACnE,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUf,eAAiC;CACjD,MAAMgB,WAAWnB,eACfO,UACEW,QAAQE,WACRN,QAAQO,KAAKC,SACVC,QAAOC,YAAW,CAACnB,qBAAqBmB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;AAED,QAAA,CAAAC,gBAEKtB,gBAAcuB,WACTV,MAAI;EAAA,IACRI,OAAI;AAAA,UAAEF,SAASS;;EAAK,IACpBb,UAAO;AAAA,UAAEN,KACP,EACEoB,aAAa;IACX;KAAEC,MAAM;KAAcC,SAAS;KAAM;IACrC,EAAED,MAAM,mBAAmB;IAC3B,EAAEA,MAAM,sBAAsB;IAAA,EAEjC,EACDf,WAAW,EAAE,EACbiB,OAAOC,QAAQnB,QAAQoB,SAAS,CAC7BX,QAAQ,GAAGY,WAAWA,MAAMC,UAAU,CACtCC,QAAQC,KAAK,CAACR,MAAMK,WAAW;AAC9BG,QAAI,KAAKH,MAAML,UAAU,CACvB;KAAEA,MAAM;KAAWS,OAAO,SAAS/B,WAAWsB,KAAK;KAAI,CACxD;AAED,WAAOQ;MACN,EAA2B,CAClC,CAAC;;EAAA,IACDtB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCwB,SAAS;KAAC;KAAQ;KAAS;KAAS;KAAU;KAAY;IAC1DC,OAAO;KAAC;KAAW;KAAW;
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","path","segments","filter","segment","join","_$createComponent","_$mergeProps","value","didyoumean2","name","default","Object","entries","children","child","isVirtual","reduce","ret","alias","console","utils","_$createIntrinsic","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 { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\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\";\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.path.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 {\n didyoumean2: [\n { name: \"didYouMean\", default: true },\n { name: \"ReturnTypeEnums\" },\n { name: \"ThresholdTypeEnums\" }\n ]\n },\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 console: [\"warn\", \"error\", \"table\", \"colors\", \"writeLine\"],\n utils: [\"getArgs\", \"hasFlag\", \"isMinimal\", \"isUnicodeSupported\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command} />\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":";;;;;;;;;;;;;;;;AA2CA,SAAgBY,oBAAoBC,OAAiC;CACnE,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUf,eAAiC;CACjD,MAAMgB,WAAWnB,eACfO,UACEW,QAAQE,WACRN,QAAQO,KAAKC,SACVC,QAAOC,YAAW,CAACnB,qBAAqBmB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;AAED,QAAA,CAAAC,gBAEKtB,gBAAcuB,WACTV,MAAI;EAAA,IACRI,OAAI;AAAA,UAAEF,SAASS;;EAAK,IACpBb,UAAO;AAAA,UAAEN,KACP,EACEoB,aAAa;IACX;KAAEC,MAAM;KAAcC,SAAS;KAAM;IACrC,EAAED,MAAM,mBAAmB;IAC3B,EAAEA,MAAM,sBAAsB;IAAA,EAEjC,EACDf,WAAW,EAAE,EACbiB,OAAOC,QAAQnB,QAAQoB,SAAS,CAC7BX,QAAQ,GAAGY,WAAWA,MAAMC,UAAU,CACtCC,QAAQC,KAAK,CAACR,MAAMK,WAAW;AAC9BG,QAAI,KAAKH,MAAML,UAAU,CACvB;KAAEA,MAAM;KAAWS,OAAO,SAAS/B,WAAWsB,KAAK;KAAI,CACxD;AAED,WAAOQ;MACN,EAA2B,CAClC,CAAC;;EAAA,IACDtB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCwB,SAAS;KAAC;KAAQ;KAAS;KAAS;KAAU;KAAY;IAC1DC,OAAO;KAAC;KAAW;KAAW;KAAa;KAAoB;IAChE,CAAC;;EAAA,IAAAP,WAAA;AAAA,UAAA;IAAAR,gBACDhB,2BAAyB,EAAUI,SAAO,CAAA;IAAA4B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAhB,gBAG1CpB,kCAAgC,EAAUQ,SAAO,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAY,gBAEnDzB,KAAG;EAAA,IAAC0C,OAAI;AAAA,UAAEX,OAAOY,OAAO9B,QAAQoB,SAAS;;EAAAA,WACvCC,UAAKT,gBACHxB,MAAI;GAAA,IACH2C,OAAI;AAAA,WAAEV,MAAMC;;GAAS,IACrBU,WAAQ;AAAA,WAAApB,gBAAGf,cAAY,EAACG,SAASqB,OAAK,CAAA;;GAAA,IAAAD,WAAA;AAAA,WAAAR,gBACrCd,qBAAmB,EAACE,SAASqB,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -156,9 +156,9 @@
|
|
|
156
156
|
"@powerlines/deepkit": "^0.6.50",
|
|
157
157
|
"@powerlines/plugin-alloy": "^0.20.14",
|
|
158
158
|
"@powerlines/plugin-plugin": "^0.12.221",
|
|
159
|
-
"@shell-shock/core": "^0.
|
|
160
|
-
"@shell-shock/plugin-theme": "^0.0.
|
|
161
|
-
"@shell-shock/preset-script": "^0.4.
|
|
159
|
+
"@shell-shock/core": "^0.7.0",
|
|
160
|
+
"@shell-shock/plugin-theme": "^0.0.16",
|
|
161
|
+
"@shell-shock/preset-script": "^0.4.2",
|
|
162
162
|
"@stryke/path": "0.26.4",
|
|
163
163
|
"@stryke/string-format": "0.13.7",
|
|
164
164
|
"cfonts": "^3.3.1",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@babel/core": "^7.29.0",
|
|
170
|
-
"@types/node": "^22.19.
|
|
170
|
+
"@types/node": "^22.19.10",
|
|
171
171
|
"@types/react": "^19.2.13"
|
|
172
172
|
},
|
|
173
173
|
"publishConfig": {
|
|
@@ -193,5 +193,5 @@
|
|
|
193
193
|
"./package.json": "./package.json"
|
|
194
194
|
}
|
|
195
195
|
},
|
|
196
|
-
"gitHead": "
|
|
196
|
+
"gitHead": "b7429d401477d60e5e8ff9daa437ccd748732ca4"
|
|
197
197
|
}
|