@shell-shock/core 0.8.4 → 0.8.6
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 +1 -1
- package/dist/components/docs.cjs +9 -16
- package/dist/components/docs.cjs.map +1 -1
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +9 -16
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/helpers.d.cts +2 -2
- package/dist/components/helpers.d.mts +2 -2
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/options-parser-logic.cjs +9 -16
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +9 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +9 -16
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.mts +2 -2
- package/dist/helpers/automd.cjs +3 -6
- package/dist/helpers/automd.cjs.map +1 -1
- package/dist/helpers/automd.mjs +4 -7
- package/dist/helpers/automd.mjs.map +1 -1
- package/package.json +13 -13
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
|
-
[](https://stormsoftware.com/projects/shell-shock/) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
package/dist/components/docs.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const require_components_usage = require('./usage.cjs');
|
|
|
7
7
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
8
8
|
let __alloy_js_core = require("@alloy-js/core");
|
|
9
9
|
let __alloy_js_markdown = require("@alloy-js/markdown");
|
|
10
|
+
let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
10
11
|
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
11
12
|
let __powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
|
|
12
13
|
let __powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
|
|
@@ -64,20 +65,16 @@ function CommandDocs(props) {
|
|
|
64
65
|
return command.title;
|
|
65
66
|
}
|
|
66
67
|
}),
|
|
67
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
68
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
68
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
69
69
|
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`${command.description}`),
|
|
70
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
71
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
70
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
72
71
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
|
|
73
72
|
level: 2 + levelOffset,
|
|
74
73
|
children: "Usage"
|
|
75
74
|
}),
|
|
76
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
77
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
75
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
78
76
|
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The ${command.name} command can be executed using the following syntax: `),
|
|
79
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
80
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
77
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
81
78
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
82
79
|
get when() {
|
|
83
80
|
return usageExamples && usageExamples.length > 0;
|
|
@@ -99,20 +96,16 @@ function CommandDocs(props) {
|
|
|
99
96
|
});
|
|
100
97
|
}
|
|
101
98
|
}),
|
|
102
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
103
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
99
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
104
100
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
|
|
105
101
|
level: 2 + levelOffset,
|
|
106
102
|
children: "Options"
|
|
107
103
|
}),
|
|
108
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
109
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
104
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
110
105
|
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The following options are available for the ${command.name} command:`),
|
|
111
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
112
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
106
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
113
107
|
(0, __alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
|
|
114
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
115
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
108
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
116
109
|
];
|
|
117
110
|
}
|
|
118
111
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.cjs","names":["code","For","memo","Show","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","CommandContext","getDocsOutputPath","getAppBin","sortOptions","Usage","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","bin","CommandDocs","levelOffset","usageExamples","level","children","title","_$memo","when","fallback","each","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps","path"],"sources":["../../src/components/docs.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, memo, Show } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport { getAppBin } from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\nimport { Usage } from \"./usage\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return code`This command does not have any options.`;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Usage\n command={command}\n bin={getAppBin(context)}\n packageManager={packageManager}\n />\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n\n /**\n * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <
|
|
1
|
+
{"version":3,"file":"docs.cjs","names":["code","For","memo","Show","Heading","Spacing","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","CommandContext","getDocsOutputPath","getAppBin","sortOptions","Usage","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","bin","CommandDocs","levelOffset","usageExamples","level","children","title","_$memo","when","fallback","each","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps","path"],"sources":["../../src/components/docs.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, memo, Show } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport { getAppBin } from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\nimport { Usage } from \"./usage\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return code`This command does not have any options.`;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Usage\n command={command}\n bin={getAppBin(context)}\n packageManager={packageManager}\n />\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n\n /**\n * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <Spacing />\n {code`${command.description}`}\n <Spacing />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <Spacing />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <Spacing />\n <Show\n when={usageExamples && usageExamples.length > 0}\n fallback={\n <CommandDocsUsageExample packageManager=\"npm\" command={command} />\n }>\n <For each={usageExamples!} hardline>\n {packageManager => (\n <CommandDocsUsageExample\n packageManager={packageManager}\n command={command}\n />\n )}\n </For>\n </Show>\n <Spacing />\n <Heading level={2 + levelOffset}>Options</Heading>\n <Spacing />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <Spacing />\n <CommandOptionsDocs command={command} />\n <Spacing />\n </>\n );\n}\n\nexport interface CommandDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation file for a command.\n */\nexport function CommandDocsFile(props: CommandDocsFileProps) {\n const { levelOffset = 0, command, ...rest } = props;\n\n const context = usePowerlines<Context>();\n const usageExamples = memo(\n () => [\"npm\", \"yarn\", \"pnpm\", \"bun\"] as CommandDocsProps[\"usageExamples\"]\n );\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;UAkCiB,uBAAA;;;AAAjB;EAUgB,OAAA,EANL,WAMK;AAwBhB;AAoBA;AAsBA;;AAqB2B,iBAvFX,kBAAA,CAuFW,KAAA,EAvFe,uBAuFf,CAAA,EAvFsC,eAAA,CAAA,QAuFtC;AAAT,UA/DD,4BAAA,CA+DC;EAAQ;AAM1B;AAwCA;;;;;AAoBA;;;;;WAnHW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAsB1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAwClC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandTree } from "../types/command.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core8 from "@alloy-js/core";
|
|
3
3
|
import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
4
4
|
|
|
5
5
|
//#region src/components/docs.d.ts
|
|
@@ -12,7 +12,7 @@ interface CommandOptionsDocsProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Generates the options markdown documentation for a command.
|
|
14
14
|
*/
|
|
15
|
-
declare function CommandOptionsDocs(props: CommandOptionsDocsProps):
|
|
15
|
+
declare function CommandOptionsDocs(props: CommandOptionsDocsProps): _alloy_js_core8.Children;
|
|
16
16
|
interface CommandDocsUsageExampleProps {
|
|
17
17
|
/**
|
|
18
18
|
* The package manager to generate the usage example for.
|
|
@@ -31,7 +31,7 @@ interface CommandDocsUsageExampleProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Generates the markdown documentation for a command.
|
|
33
33
|
*/
|
|
34
|
-
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps):
|
|
34
|
+
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps): _alloy_js_core8.Children;
|
|
35
35
|
interface CommandDocsProps {
|
|
36
36
|
/**
|
|
37
37
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -56,7 +56,7 @@ interface CommandDocsProps {
|
|
|
56
56
|
/**
|
|
57
57
|
* Generates the markdown documentation for a command.
|
|
58
58
|
*/
|
|
59
|
-
declare function CommandDocs(props: CommandDocsProps):
|
|
59
|
+
declare function CommandDocs(props: CommandDocsProps): _alloy_js_core8.Children;
|
|
60
60
|
interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
61
61
|
/**
|
|
62
62
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -75,7 +75,7 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
|
75
75
|
/**
|
|
76
76
|
* Generates the markdown documentation file for a command.
|
|
77
77
|
*/
|
|
78
|
-
declare function CommandDocsFile(props: CommandDocsFileProps):
|
|
78
|
+
declare function CommandDocsFile(props: CommandDocsFileProps): _alloy_js_core8.Children;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
|
|
81
81
|
//# sourceMappingURL=docs.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.mts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"docs.d.mts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;UAkCiB,uBAAA;;;AAAjB;EAUgB,OAAA,EANL,WAMK;AAwBhB;AAoBA;AAsBA;;AAqB2B,iBAvFX,kBAAA,CAuFW,KAAA,EAvFe,uBAuFf,CAAA,EAvFsC,eAAA,CAAA,QAuFtC;AAAT,UA/DD,4BAAA,CA+DC;EAAQ;AAM1B;AAwCA;;;;;AAoBA;;;;;WAnHW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAsB1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAwClC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
|
package/dist/components/docs.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { Usage } from "./usage.mjs";
|
|
|
6
6
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
7
7
|
import { For, Show, code, memo as memo$1 } from "@alloy-js/core";
|
|
8
8
|
import { Heading } from "@alloy-js/markdown";
|
|
9
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
9
10
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
10
11
|
import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
11
12
|
import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
|
|
@@ -63,20 +64,16 @@ function CommandDocs(props) {
|
|
|
63
64
|
return command.title;
|
|
64
65
|
}
|
|
65
66
|
}),
|
|
66
|
-
|
|
67
|
-
createIntrinsic("hbr", {}),
|
|
67
|
+
createComponent(Spacing, {}),
|
|
68
68
|
memo(() => code`${command.description}`),
|
|
69
|
-
|
|
70
|
-
createIntrinsic("hbr", {}),
|
|
69
|
+
createComponent(Spacing, {}),
|
|
71
70
|
createComponent(Heading, {
|
|
72
71
|
level: 2 + levelOffset,
|
|
73
72
|
children: "Usage"
|
|
74
73
|
}),
|
|
75
|
-
|
|
76
|
-
createIntrinsic("hbr", {}),
|
|
74
|
+
createComponent(Spacing, {}),
|
|
77
75
|
memo(() => code`The ${command.name} command can be executed using the following syntax: `),
|
|
78
|
-
|
|
79
|
-
createIntrinsic("hbr", {}),
|
|
76
|
+
createComponent(Spacing, {}),
|
|
80
77
|
createComponent(Show, {
|
|
81
78
|
get when() {
|
|
82
79
|
return usageExamples && usageExamples.length > 0;
|
|
@@ -98,20 +95,16 @@ function CommandDocs(props) {
|
|
|
98
95
|
});
|
|
99
96
|
}
|
|
100
97
|
}),
|
|
101
|
-
|
|
102
|
-
createIntrinsic("hbr", {}),
|
|
98
|
+
createComponent(Spacing, {}),
|
|
103
99
|
createComponent(Heading, {
|
|
104
100
|
level: 2 + levelOffset,
|
|
105
101
|
children: "Options"
|
|
106
102
|
}),
|
|
107
|
-
|
|
108
|
-
createIntrinsic("hbr", {}),
|
|
103
|
+
createComponent(Spacing, {}),
|
|
109
104
|
memo(() => code`The following options are available for the ${command.name} command:`),
|
|
110
|
-
|
|
111
|
-
createIntrinsic("hbr", {}),
|
|
105
|
+
createComponent(Spacing, {}),
|
|
112
106
|
createComponent(CommandOptionsDocs, { command }),
|
|
113
|
-
|
|
114
|
-
createIntrinsic("hbr", {})
|
|
107
|
+
createComponent(Spacing, {})
|
|
115
108
|
];
|
|
116
109
|
}
|
|
117
110
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.mjs","names":["code","For","memo","Show","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","CommandContext","getDocsOutputPath","getAppBin","sortOptions","Usage","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","bin","CommandDocs","levelOffset","usageExamples","level","children","title","_$memo","when","fallback","each","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps","path"],"sources":["../../src/components/docs.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, memo, Show } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport { getAppBin } from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\nimport { Usage } from \"./usage\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return code`This command does not have any options.`;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Usage\n command={command}\n bin={getAppBin(context)}\n packageManager={packageManager}\n />\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n\n /**\n * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <
|
|
1
|
+
{"version":3,"file":"docs.mjs","names":["code","For","memo","Show","Heading","Spacing","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","CommandContext","getDocsOutputPath","getAppBin","sortOptions","Usage","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","bin","CommandDocs","levelOffset","usageExamples","level","children","title","_$memo","when","fallback","each","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps","path"],"sources":["../../src/components/docs.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, memo, Show } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport { getAppBin } from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\nimport { Usage } from \"./usage\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return code`This command does not have any options.`;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Usage\n command={command}\n bin={getAppBin(context)}\n packageManager={packageManager}\n />\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n\n /**\n * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <Spacing />\n {code`${command.description}`}\n <Spacing />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <Spacing />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <Spacing />\n <Show\n when={usageExamples && usageExamples.length > 0}\n fallback={\n <CommandDocsUsageExample packageManager=\"npm\" command={command} />\n }>\n <For each={usageExamples!} hardline>\n {packageManager => (\n <CommandDocsUsageExample\n packageManager={packageManager}\n command={command}\n />\n )}\n </For>\n </Show>\n <Spacing />\n <Heading level={2 + levelOffset}>Options</Heading>\n <Spacing />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <Spacing />\n <CommandOptionsDocs command={command} />\n <Spacing />\n </>\n );\n}\n\nexport interface CommandDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation file for a command.\n */\nexport function CommandDocsFile(props: CommandDocsFileProps) {\n const { levelOffset = 0, command, ...rest } = props;\n\n const context = usePowerlines<Context>();\n const usageExamples = memo(\n () => [\"npm\", \"yarn\", \"pnpm\", \"bun\"] as CommandDocsProps[\"usageExamples\"]\n );\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,SAAgBe,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOrB,IAAI;AAGb,QAAAsB,gBACGd,eAAa,EAAA,IACZe,OAAI;AAAA,SAAEV,YAAYK,OAAOM,OAAOP,QAAQG,QAAQ,CAAC,CAACK,KAAIC,WAAU;AAC9D,UAAO;IACLC,MAAMD,OAAOC,KAAKC,MAAM;IACxBC,aAAaH,OAAOG,YAAYD,MAAM;IACtCE,cAAcJ,OAAOK,UACjBC,OAAON,OAAOK,QAAQ,EAAEE,SAAS,KAAI,GACnCP,OAAOK,UACP,KAAKL,OAAOK,QAAO,MACrB;IACJG,UAAUR,OAAOS,YAAYT,OAAOK,UAAU,KAAK;IACpD;IACD;IAAA,CAAA;;;;;AAyBR,SAAgBK,wBAAwBpB,OAAqC;CAC3E,MAAM,E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;EAAAiB,gBACPlB,SAAO;GAACwC,OAAO,IAAIF;GAAWG,UAAA;GAAA,CAAA;EAAAvB,gBAC9BjB,SAAO,EAAA,CAAA;EAAA0C,WACP/C,IAAI,+CACHiB,QAAQU,KAAI,WACH;EAAAL,gBACVjB,SAAO,EAAA,CAAA;EAAAiB,gBACPP,oBAAkB,EAAUE,SAAO,CAAA;EAAAK,gBACnCjB,SAAO,EAAA,CAAA;EAAA;;;;;AAyBd,SAAgB+C,gBAAgBpC,OAA6B;CAC3D,MAAM,EAAE0B,cAAc,GAAGzB,SAAS,GAAGoC,SAASrC;CAE9C,MAAMsB,UAAUhC,eAAwB;CACxC,MAAMqC,gBAAgBzC,aACd;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,QAAAoB,gBACGZ,eAAe4C,UAAQ;EAACC,OAAOtC;EAAO,IAAA4B,WAAA;AAAA,UAAAvB,gBACpCf,cAAYiD,WAAA,EAAA,IACXC,OAAI;AAAA,WAAEhD,UAAUE,kBAAkB2B,QAAQ,EAAE,GAAGrB,QAAQwC,KAAI,KAAM;MAAA,EAC7DJ,MAAI,EAAA,IAAAR,WAAA;AAAA,WAAAvB,gBACPmB,aAAW;KACGC;KACJzB;KAAO,IAChB0B,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core4 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/helpers.d.ts
|
|
4
4
|
interface BooleanInputParserLogicProps {
|
|
@@ -7,7 +7,7 @@ interface BooleanInputParserLogicProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Parses a string input into a boolean value, interpreting common truthy and falsy string representations.
|
|
9
9
|
*/
|
|
10
|
-
declare function BooleanInputParserLogic(props: BooleanInputParserLogicProps):
|
|
10
|
+
declare function BooleanInputParserLogic(props: BooleanInputParserLogicProps): _alloy_js_core4.Children;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { BooleanInputParserLogic, BooleanInputParserLogicProps };
|
|
13
13
|
//# sourceMappingURL=helpers.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core12 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/helpers.d.ts
|
|
4
4
|
interface BooleanInputParserLogicProps {
|
|
@@ -7,7 +7,7 @@ interface BooleanInputParserLogicProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Parses a string input into a boolean value, interpreting common truthy and falsy string representations.
|
|
9
9
|
*/
|
|
10
|
-
declare function BooleanInputParserLogic(props: BooleanInputParserLogicProps):
|
|
10
|
+
declare function BooleanInputParserLogic(props: BooleanInputParserLogicProps): _alloy_js_core12.Children;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { BooleanInputParserLogic, BooleanInputParserLogicProps };
|
|
13
13
|
//# sourceMappingURL=helpers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/components/helpers.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,4BAAA;;;AAAjB;AAOA;;iBAAgB,uBAAA,QAA+B,+BAA4B,
|
|
1
|
+
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/components/helpers.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,4BAAA;;;AAAjB;AAOA;;iBAAgB,uBAAA,QAA+B,+BAA4B,gBAAA,CAAA"}
|
|
@@ -7,6 +7,7 @@ let __stryke_string_format_camel_case = require("@stryke/string-format/camel-cas
|
|
|
7
7
|
let __stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
8
8
|
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
9
9
|
let __alloy_js_core = require("@alloy-js/core");
|
|
10
|
+
let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
10
11
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
11
12
|
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
12
13
|
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
@@ -61,8 +62,7 @@ function ArgumentsParserLogic(props) {
|
|
|
61
62
|
return __alloy_js_core.code`Math.max(0, args.slice(${command.segments.length + 1}).findIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")}`).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1};`;
|
|
62
63
|
}
|
|
63
64
|
}),
|
|
64
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
65
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
65
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
66
66
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
67
67
|
"let": true,
|
|
68
68
|
name: "argsIndex",
|
|
@@ -71,8 +71,7 @@ function ArgumentsParserLogic(props) {
|
|
|
71
71
|
return __alloy_js_core.code`optionsIndex > ${command.segments.length + 1} ? ${command.segments.length + 1} : (Math.max(0, args.slice(optionsIndex).findLastIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")}`).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1});`;
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
75
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
74
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
76
75
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
77
76
|
get each() {
|
|
78
77
|
return command.arguments ?? [];
|
|
@@ -108,8 +107,7 @@ function ArgumentsParserLogic(props) {
|
|
|
108
107
|
})];
|
|
109
108
|
}
|
|
110
109
|
}),
|
|
111
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
112
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
110
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
113
111
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
114
112
|
condition: __alloy_js_core.code`argsIndex + ${index} < args.length && argsIndex + ${index} !== optionsIndex`,
|
|
115
113
|
get children() {
|
|
@@ -142,8 +140,7 @@ function ArgumentsParserLogic(props) {
|
|
|
142
140
|
})];
|
|
143
141
|
}
|
|
144
142
|
}),
|
|
145
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
146
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
143
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
147
144
|
]
|
|
148
145
|
})
|
|
149
146
|
];
|
|
@@ -514,8 +511,7 @@ function OptionsParserLogic(props) {
|
|
|
514
511
|
} as ${(0, __stryke_string_format_pascal_case.pascalCase)(command.name)}Options;`;
|
|
515
512
|
}
|
|
516
513
|
}),
|
|
517
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
518
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
514
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
519
515
|
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`for (let i = 0; i < args.slice(${command.segments.filter((segment) => require_plugin_utils_context_helpers.isDynamicPathSegment(segment)).length}).length; i++) { `),
|
|
520
516
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
521
517
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
@@ -593,22 +589,19 @@ function CommandParserLogic(props) {
|
|
|
593
589
|
command,
|
|
594
590
|
isCaseSensitive
|
|
595
591
|
}),
|
|
596
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
597
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
592
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
598
593
|
(0, __alloy_js_core_jsx_runtime.createComponent)(OptionsParserLogic, {
|
|
599
594
|
command,
|
|
600
595
|
envPrefix,
|
|
601
596
|
isCaseSensitive
|
|
602
597
|
}),
|
|
603
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
604
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
598
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
605
599
|
(0, __alloy_js_core_jsx_runtime.createComponent)(ArgumentsParserLogic, {
|
|
606
600
|
command,
|
|
607
601
|
envPrefix,
|
|
608
602
|
isCaseSensitive
|
|
609
603
|
}),
|
|
610
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
611
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
604
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
612
605
|
];
|
|
613
606
|
}
|
|
614
607
|
|