@shell-shock/preset-cli 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.0.6-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.1.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core1 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 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): _alloy_js_core1.Children;
8
+ declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core1 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 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): _alloy_js_core1.Children;
8
+ declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.mts.map
@@ -22,7 +22,7 @@ defu = require_rolldown_runtime.__toESM(defu);
22
22
  function CommandEntry(props) {
23
23
  const { command, imports, builtinImports, ...rest } = props;
24
24
  const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
25
- const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(command.path.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils_context_helpers.isPositionalCommandOption)(segment)).join("/"), "index.ts"));
25
+ const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(command.path.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils_context_helpers.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
26
26
  const commandSourcePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_replace.replaceExtension)((0, __stryke_path_find.relativePath)((0, __stryke_path_join.joinPaths)(context.entryPath, (0, __stryke_path_find.findFilePath)(filePath.value)), command.entry.input?.file || command.entry.file)));
27
27
  const typeDefinition = (0, __alloy_js_core.computed)(() => ({
28
28
  ...command.entry,
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
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 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): _alloy_js_core0.Children;
12
+ declare function CommandEntry(props: CommandEntryProps): _alloy_js_core1.Children;
13
13
  //#endregion
14
14
  export { CommandEntry, CommandEntryProps };
15
15
  //# sourceMappingURL=command-entry.d.mts.map
@@ -3,7 +3,7 @@ import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
3
3
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
4
4
  import { For, Show, computed } from "@alloy-js/core";
5
5
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
- import { isPositionalCommandOption } from "@shell-shock/core/plugin-utils/context-helpers";
6
+ import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
7
7
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
8
8
  import { OptionsInterfaceDeclaration } from "@shell-shock/core/components/options-parser-logic";
9
9
  import { CommandHandlerDeclaration } from "@shell-shock/preset-script/components/command-entry";
@@ -20,7 +20,7 @@ import defu from "defu";
20
20
  function CommandEntry(props) {
21
21
  const { command, imports, builtinImports, ...rest } = props;
22
22
  const context = usePowerlines();
23
- const filePath = computed(() => joinPaths(command.path.segments.filter((segment) => !isPositionalCommandOption(segment)).join("/"), "index.ts"));
23
+ const filePath = computed(() => joinPaths(command.path.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
24
24
  const commandSourcePath = computed(() => replaceExtension(relativePath(joinPaths(context.entryPath, findFilePath(filePath.value)), command.entry.input?.file || command.entry.file)));
25
25
  const typeDefinition = computed(() => ({
26
26
  ...command.entry,
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.mjs","names":["computed","For","Show","usePowerlines","EntryFile","OptionsInterfaceDeclaration","isPositionalCommandOption","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\";\nimport { OptionsInterfaceDeclaration } from \"@shell-shock/core/components/options-parser-logic\";\nimport { isPositionalCommandOption } 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 => !isPositionalCommandOption(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\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <OptionsInterfaceDeclaration 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,SAAgBgB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUnB,eAAiC;CACjD,MAAMoB,WAAWvB,eACfU,UACEQ,QAAQM,KAAKC,SACVC,QAAOC,YAAW,CAACrB,0BAA0BqB,QAAQ,CAAC,CACtDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoB7B,eACxBW,iBACEF,aACEC,UAAUY,QAAQQ,WAAWtB,aAAae,SAASQ,MAAM,CAAC,EAC1Db,QAAQc,MAAMC,OAAOC,QAAQhB,QAAQc,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBnC,gBAAgB;EACrC,GAAGkB,QAAQc;EACXI,QAAQlB,QAAQmB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,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;KAAW;IAC1C,CAAC;;EAAA,IAAAC,WAAA;AAAA,UAAA;IAAAN,gBACDxB,2BAAyB,EAAUI,SAAO,CAAA;IAAA2B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAP,gBAG1CjC,6BAA2B,EAAUa,SAAO,CAAA;IAAA2B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAP,gBAG5C/B,2BAAyB,EAAUW,SAAO,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoB,gBAE5CrC,KAAG;EAAA,IAAC6C,OAAI;AAAA,UAAEC,OAAOC,OAAO9B,QAAQ0B,SAAS;;EAAAA,WACvCK,UAAKX,gBACHpC,MAAI;GAAA,IACHgD,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
+ {"version":3,"file":"command-entry.mjs","names":["computed","For","Show","usePowerlines","EntryFile","OptionsInterfaceDeclaration","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\";\nimport { OptionsInterfaceDeclaration } from \"@shell-shock/core/components/options-parser-logic\";\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\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <OptionsInterfaceDeclaration 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,SAAgBgB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUnB,eAAiC;CACjD,MAAMoB,WAAWvB,eACfU,UACEQ,QAAQM,KAAKC,SACVC,QAAOC,YAAW,CAACrB,qBAAqBqB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoB7B,eACxBW,iBACEF,aACEC,UAAUY,QAAQQ,WAAWtB,aAAae,SAASQ,MAAM,CAAC,EAC1Db,QAAQc,MAAMC,OAAOC,QAAQhB,QAAQc,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBnC,gBAAgB;EACrC,GAAGkB,QAAQc;EACXI,QAAQlB,QAAQmB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,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;KAAW;IAC1C,CAAC;;EAAA,IAAAC,WAAA;AAAA,UAAA;IAAAN,gBACDxB,2BAAyB,EAAUI,SAAO,CAAA;IAAA2B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAP,gBAG1CjC,6BAA2B,EAAUa,SAAO,CAAA;IAAA2B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAP,gBAG5C/B,2BAAyB,EAAUW,SAAO,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoB,gBAE5CrC,KAAG;EAAA,IAAC6C,OAAI;AAAA,UAAEC,OAAOC,OAAO9B,QAAQ0B,SAAS;;EAAAA,WACvCK,UAAKX,gBACHpC,MAAI;GAAA,IACHgD,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"}
@@ -19,7 +19,7 @@ let __shell_shock_preset_script_components_virtual_command_entry = require("@she
19
19
  function VirtualCommandEntry(props) {
20
20
  const { command, imports, builtinImports, ...rest } = props;
21
21
  const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
22
- const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.path.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils_context_helpers.isPositionalCommandOption)(segment)).join("/"), "index.ts"));
22
+ const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.path.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils_context_helpers.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
23
23
  return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
24
24
  get path() {
25
25
  return filePath.value;
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
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): _alloy_js_core0.Children;
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.cts.map
@@ -3,7 +3,7 @@ import { CommandEntry } from "./command-entry.mjs";
3
3
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
4
4
  import { For, Show, computed } from "@alloy-js/core";
5
5
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
- import { isPositionalCommandOption } from "@shell-shock/core/plugin-utils/context-helpers";
6
+ import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
7
7
  import { joinPaths } from "@stryke/path/join";
8
8
  import { pascalCase } from "@stryke/string-format/pascal-case";
9
9
  import defu from "defu";
@@ -17,7 +17,7 @@ import { VirtualCommandHandlerDeclaration } from "@shell-shock/preset-script/com
17
17
  function VirtualCommandEntry(props) {
18
18
  const { command, imports, builtinImports, ...rest } = props;
19
19
  const context = usePowerlines();
20
- const filePath = computed(() => joinPaths(context.entryPath, command.path.segments.filter((segment) => !isPositionalCommandOption(segment)).join("/"), "index.ts"));
20
+ const filePath = computed(() => joinPaths(context.entryPath, command.path.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
21
21
  return [createComponent(TypescriptFile, mergeProps(rest, {
22
22
  get path() {
23
23
  return filePath.value;
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isPositionalCommandOption","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 { isPositionalCommandOption } 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 => !isPositionalCommandOption(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;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,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"}
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,SAA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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.2",
3
+ "version": "0.1.3",
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.5.1",
160
- "@shell-shock/plugin-theme": "^0.0.14",
161
- "@shell-shock/preset-script": "^0.4.0",
159
+ "@shell-shock/core": "^0.6.0",
160
+ "@shell-shock/plugin-theme": "^0.0.15",
161
+ "@shell-shock/preset-script": "^0.4.1",
162
162
  "@stryke/path": "0.26.4",
163
163
  "@stryke/string-format": "0.13.7",
164
164
  "cfonts": "^3.3.1",
@@ -193,5 +193,5 @@
193
193
  "./package.json": "./package.json"
194
194
  }
195
195
  },
196
- "gitHead": "b2c853aae1d2d29bd12900d7850f8742382816ed"
196
+ "gitHead": "56bc5ad6b21f20ec50ff934e8227f8b21751fc66"
197
197
  }