@shell-shock/core 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/docs.cjs +4 -4
- package/dist/components/docs.cjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/helpers.d.cts +6 -6
- package/dist/components/helpers.d.mts +6 -6
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/options-parser-logic.cjs +31 -31
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts +9 -9
- 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 +26 -26
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/usage.cjs +5 -5
- package/dist/components/usage.cjs.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +2 -2
- package/dist/components/usage.mjs +4 -4
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +2 -2
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.mjs +5 -5
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/contexts/options.cjs +2 -2
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.d.cts +1 -1
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +4 -4
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +2 -2
- package/dist/helpers/automd.cjs.map +1 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/paths.cjs +125 -0
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +121 -0
- package/dist/helpers/paths.mjs.map +1 -0
- package/dist/helpers/persistence.cjs +68 -116
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs +68 -116
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +4 -4
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/utilities.cjs +1 -1
- package/dist/helpers/utilities.mjs +1 -1
- package/dist/helpers/validations.cjs +2 -3
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +2 -2
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +14 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/plugin-utils/deepkit.cjs +72 -0
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +24 -0
- package/dist/plugin-utils/deepkit.d.cts.map +1 -0
- package/dist/plugin-utils/deepkit.d.mts +24 -0
- package/dist/plugin-utils/deepkit.d.mts.map +1 -0
- package/dist/plugin-utils/deepkit.mjs +70 -0
- package/dist/plugin-utils/deepkit.mjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.cjs +2 -2
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/index.cjs +27 -18
- package/dist/plugin-utils/index.d.cts +3 -1
- package/dist/plugin-utils/index.d.mts +3 -1
- package/dist/plugin-utils/index.mjs +3 -1
- package/dist/plugin-utils/reflect.cjs +4 -5
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.mjs +4 -4
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +89 -0
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +42 -0
- package/dist/plugin-utils/type-checks.d.cts.map +1 -0
- package/dist/plugin-utils/type-checks.d.mts +42 -0
- package/dist/plugin-utils/type-checks.d.mts.map +1 -0
- package/dist/plugin-utils/type-checks.mjs +84 -0
- package/dist/plugin-utils/type-checks.mjs.map +1 -0
- package/dist/plugin.cjs +28 -24
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +12 -8
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +129 -0
- package/dist/resolver/deepkit.cjs.map +1 -0
- package/dist/resolver/deepkit.mjs +128 -0
- package/dist/resolver/deepkit.mjs.map +1 -0
- package/dist/resolver/helpers.cjs +173 -0
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +168 -0
- package/dist/resolver/helpers.mjs.map +1 -0
- package/dist/resolver/module.cjs +144 -0
- package/dist/resolver/module.cjs.map +1 -0
- package/dist/resolver/module.mjs +143 -0
- package/dist/resolver/module.mjs.map +1 -0
- package/dist/resolver/resolve.cjs +209 -0
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +208 -0
- package/dist/resolver/resolve.mjs.map +1 -0
- package/dist/types/command.cjs +127 -104
- package/dist/types/command.cjs.map +1 -1
- package/dist/types/command.d.cts +39 -78
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +39 -78
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +115 -95
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/context.cjs +1 -1
- package/dist/types/context.cjs.map +1 -1
- package/dist/types/context.d.cts +2 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +2 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +1 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/index.cjs +13 -10
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/package.json +24 -75
- package/dist/helpers/resolve-command.cjs +0 -430
- package/dist/helpers/resolve-command.cjs.map +0 -1
- package/dist/helpers/resolve-command.mjs +0 -425
- package/dist/helpers/resolve-command.mjs.map +0 -1
package/dist/components/docs.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_contexts_command = require('../contexts/command.cjs');
|
|
3
3
|
const require_docs_helpers = require('../helpers/docs-helpers.cjs');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
5
|
+
const require_reflect = require('../plugin-utils/reflect.cjs');
|
|
6
6
|
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");
|
|
@@ -21,7 +21,7 @@ function CommandOptionsDocs(props) {
|
|
|
21
21
|
const { command } = props;
|
|
22
22
|
if (Object.keys(command.options).length === 0) return __alloy_js_core.code`This command does not have any options.`;
|
|
23
23
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
24
|
-
return
|
|
24
|
+
return require_reflect.sortOptions(Object.values(command.options)).map((option) => {
|
|
25
25
|
return {
|
|
26
26
|
name: option.name.trim(),
|
|
27
27
|
description: option.description.trim(),
|
|
@@ -44,7 +44,7 @@ function CommandDocsUsageExample(props) {
|
|
|
44
44
|
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_usage.Usage, {
|
|
45
45
|
command,
|
|
46
46
|
get bin() {
|
|
47
|
-
return
|
|
47
|
+
return require_context_helpers.getAppBin(context);
|
|
48
48
|
},
|
|
49
49
|
packageManager
|
|
50
50
|
}),
|
|
@@ -1 +1 @@
|
|
|
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>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CA,SAAgBe,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOrB,oBAAI;AAGb,yDACGQ,4EAAa,EAAA,IACZe,OAAI;AAAA,SAAEV,
|
|
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>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandTree } from "../types/command.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core7 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_core7.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_core7.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_core7.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_core7.Children;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
|
|
81
81
|
//# sourceMappingURL=docs.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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_core16 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_core16.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_core16.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_core16.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_core16.Children;
|
|
79
79
|
//#endregion
|
|
80
80
|
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
|
|
81
81
|
//# sourceMappingURL=docs.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core19 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/helpers.d.ts
|
|
4
4
|
interface BooleanInputParserLogicProps {
|
|
@@ -7,29 +7,29 @@ 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_core19.Children;
|
|
11
11
|
/**
|
|
12
12
|
* Write the logic to determine if the application is running in debug mode.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* This is used to conditionally include debug-only logic in the generated application, such as additional logging or development tools. The logic should check for common indicators of debug mode, such as environment variables or the presence of a debugger.
|
|
16
16
|
*/
|
|
17
|
-
declare function IsDebug():
|
|
17
|
+
declare function IsDebug(): _alloy_js_core19.Children;
|
|
18
18
|
/**
|
|
19
19
|
* Write the logic to determine if the application is **not** running in debug mode.
|
|
20
20
|
*/
|
|
21
|
-
declare function IsNotDebug():
|
|
21
|
+
declare function IsNotDebug(): _alloy_js_core19.Children;
|
|
22
22
|
/**
|
|
23
23
|
* Write the logic to determine if the application is running in verbose mode.
|
|
24
24
|
*
|
|
25
25
|
* @remarks
|
|
26
26
|
* This is used to conditionally include verbose-only logic in the generated application, such as additional logging or detailed output. The logic should check for common indicators of verbose mode, such as environment variables or command-line flags.
|
|
27
27
|
*/
|
|
28
|
-
declare function IsVerbose():
|
|
28
|
+
declare function IsVerbose(): _alloy_js_core19.Children;
|
|
29
29
|
/**
|
|
30
30
|
* Write the logic to determine if the application is **not** running in verbose mode.
|
|
31
31
|
*/
|
|
32
|
-
declare function IsNotVerbose():
|
|
32
|
+
declare function IsNotVerbose(): _alloy_js_core19.Children;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BooleanInputParserLogic, BooleanInputParserLogicProps, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose };
|
|
35
35
|
//# sourceMappingURL=helpers.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core20 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/helpers.d.ts
|
|
4
4
|
interface BooleanInputParserLogicProps {
|
|
@@ -7,29 +7,29 @@ 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_core20.Children;
|
|
11
11
|
/**
|
|
12
12
|
* Write the logic to determine if the application is running in debug mode.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* This is used to conditionally include debug-only logic in the generated application, such as additional logging or development tools. The logic should check for common indicators of debug mode, such as environment variables or the presence of a debugger.
|
|
16
16
|
*/
|
|
17
|
-
declare function IsDebug():
|
|
17
|
+
declare function IsDebug(): _alloy_js_core20.Children;
|
|
18
18
|
/**
|
|
19
19
|
* Write the logic to determine if the application is **not** running in debug mode.
|
|
20
20
|
*/
|
|
21
|
-
declare function IsNotDebug():
|
|
21
|
+
declare function IsNotDebug(): _alloy_js_core20.Children;
|
|
22
22
|
/**
|
|
23
23
|
* Write the logic to determine if the application is running in verbose mode.
|
|
24
24
|
*
|
|
25
25
|
* @remarks
|
|
26
26
|
* This is used to conditionally include verbose-only logic in the generated application, such as additional logging or detailed output. The logic should check for common indicators of verbose mode, such as environment variables or command-line flags.
|
|
27
27
|
*/
|
|
28
|
-
declare function IsVerbose():
|
|
28
|
+
declare function IsVerbose(): _alloy_js_core20.Children;
|
|
29
29
|
/**
|
|
30
30
|
* Write the logic to determine if the application is **not** running in verbose mode.
|
|
31
31
|
*/
|
|
32
|
-
declare function IsNotVerbose():
|
|
32
|
+
declare function IsNotVerbose(): _alloy_js_core20.Children;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { BooleanInputParserLogic, BooleanInputParserLogicProps, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose };
|
|
35
35
|
//# 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;AA0BA;AAOgB,iBAjCA,uBAAA,CAiCU,KAAA,EAjCqB,4BAiCrB,CAAA,EAjCiD,
|
|
1
|
+
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/components/helpers.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,4BAAA;;;AAAjB;AAOA;AA0BA;AAOgB,iBAjCA,uBAAA,CAiCU,KAAA,EAjCqB,4BAiCrB,CAAA,EAjCiD,gBAAA,CAAA,QAiCjD;AAgB1B;AAaA;;;;;iBApCgB,OAAA,CAAA,GAAO,gBAAA,CAAA;;;;iBAOP,UAAA,CAAA,GAAU,gBAAA,CAAA;;;;;;;iBAgBV,SAAA,CAAA,GAAS,gBAAA,CAAA;;;;iBAaT,YAAA,CAAA,GAAY,gBAAA,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const
|
|
2
|
+
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
3
|
+
const require_types_command = require('../types/command.cjs');
|
|
3
4
|
const require_contexts_options = require('../contexts/options.cjs');
|
|
4
5
|
const require_components_helpers = require('./helpers.cjs');
|
|
5
6
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
@@ -8,7 +9,6 @@ let __stryke_string_format_constant_case = require("@stryke/string-format/consta
|
|
|
8
9
|
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
9
10
|
let __alloy_js_core = require("@alloy-js/core");
|
|
10
11
|
let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
11
|
-
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
12
12
|
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
13
13
|
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
14
14
|
|
|
@@ -21,14 +21,14 @@ function DynamicSegmentsParserLogic(props) {
|
|
|
21
21
|
},
|
|
22
22
|
children: (segment, index) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
23
23
|
get when() {
|
|
24
|
-
return
|
|
24
|
+
return require_context_helpers.isDynamicPathSegment(segment);
|
|
25
25
|
},
|
|
26
26
|
get children() {
|
|
27
27
|
return [
|
|
28
28
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
29
29
|
"let": true,
|
|
30
30
|
get name() {
|
|
31
|
-
return (0, __stryke_string_format_camel_case.camelCase)(
|
|
31
|
+
return (0, __stryke_string_format_camel_case.camelCase)(require_context_helpers.getDynamicPathSegmentName(segment));
|
|
32
32
|
},
|
|
33
33
|
type: "string | undefined"
|
|
34
34
|
}),
|
|
@@ -36,7 +36,7 @@ function DynamicSegmentsParserLogic(props) {
|
|
|
36
36
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
37
37
|
condition: __alloy_js_core.code`args.length > ${2 + index} && args[${2 + index}]`,
|
|
38
38
|
get children() {
|
|
39
|
-
return __alloy_js_core.code`${(0, __stryke_string_format_camel_case.camelCase)(
|
|
39
|
+
return __alloy_js_core.code`${(0, __stryke_string_format_camel_case.camelCase)(require_context_helpers.getDynamicPathSegmentName(segment))} = args[${2 + index}];`;
|
|
40
40
|
}
|
|
41
41
|
}),
|
|
42
42
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
@@ -50,7 +50,7 @@ function ArgumentsParserLogic(props) {
|
|
|
50
50
|
const { command, envPrefix, isCaseSensitive } = props;
|
|
51
51
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
52
52
|
get when() {
|
|
53
|
-
return command.
|
|
53
|
+
return command.args && command.args.length > 0;
|
|
54
54
|
},
|
|
55
55
|
get children() {
|
|
56
56
|
return [
|
|
@@ -74,7 +74,7 @@ function ArgumentsParserLogic(props) {
|
|
|
74
74
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
75
75
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
76
76
|
get each() {
|
|
77
|
-
return command.
|
|
77
|
+
return command.args ?? [];
|
|
78
78
|
},
|
|
79
79
|
hardline: true,
|
|
80
80
|
children: (arg, index) => [
|
|
@@ -84,7 +84,7 @@ function ArgumentsParserLogic(props) {
|
|
|
84
84
|
return (0, __stryke_string_format_camel_case.camelCase)(arg.name);
|
|
85
85
|
},
|
|
86
86
|
get type() {
|
|
87
|
-
return `${arg.kind ===
|
|
87
|
+
return `${arg.kind === require_types_command.CommandParameterKinds.boolean ? "boolean" : arg.kind === require_types_command.CommandParameterKinds.number ? "number" : "string"}${(arg.kind === require_types_command.CommandParameterKinds.string || arg.kind === require_types_command.CommandParameterKinds.number) && arg.variadic ? "[]" : ""}${arg.optional ? " | undefined" : ""}`;
|
|
88
88
|
},
|
|
89
89
|
get initializer() {
|
|
90
90
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -99,10 +99,10 @@ function ArgumentsParserLogic(props) {
|
|
|
99
99
|
return arg.default !== void 0;
|
|
100
100
|
},
|
|
101
101
|
get fallback() {
|
|
102
|
-
return (arg.kind ===
|
|
102
|
+
return (arg.kind === require_types_command.CommandParameterKinds.string || arg.kind === require_types_command.CommandParameterKinds.number) && arg.variadic ? __alloy_js_core.code`[]` : __alloy_js_core.code`undefined;`;
|
|
103
103
|
},
|
|
104
104
|
get children() {
|
|
105
|
-
return arg.kind ===
|
|
105
|
+
return arg.kind === require_types_command.CommandParameterKinds.string ? __alloy_js_core.code`"${arg.default}"` : __alloy_js_core.code`${arg.default}`;
|
|
106
106
|
}
|
|
107
107
|
})];
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ function ArgumentsParserLogic(props) {
|
|
|
113
113
|
get children() {
|
|
114
114
|
return [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`${(0, __stryke_string_format_camel_case.camelCase)(arg.name)} = `), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
115
115
|
get when() {
|
|
116
|
-
return arg.kind ===
|
|
116
|
+
return arg.kind === require_types_command.CommandParameterKinds.string || arg.kind === require_types_command.CommandParameterKinds.number;
|
|
117
117
|
},
|
|
118
118
|
get fallback() {
|
|
119
119
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_helpers.BooleanInputParserLogic, { name: `args[argsIndex + ${index}] ` });
|
|
@@ -121,19 +121,19 @@ function ArgumentsParserLogic(props) {
|
|
|
121
121
|
get children() {
|
|
122
122
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
123
123
|
get when() {
|
|
124
|
-
return (arg.kind ===
|
|
124
|
+
return (arg.kind === require_types_command.CommandParameterKinds.string || arg.kind === require_types_command.CommandParameterKinds.number) && arg.variadic;
|
|
125
125
|
},
|
|
126
126
|
get fallback() {
|
|
127
127
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
128
128
|
get when() {
|
|
129
|
-
return arg.kind ===
|
|
129
|
+
return arg.kind === require_types_command.CommandParameterKinds.number;
|
|
130
130
|
},
|
|
131
131
|
fallback: __alloy_js_core.code`args[argsIndex + ${index}]; `,
|
|
132
132
|
children: __alloy_js_core.code`Number(args[argsIndex + ${index}]); `
|
|
133
133
|
});
|
|
134
134
|
},
|
|
135
135
|
get children() {
|
|
136
|
-
return __alloy_js_core.code`args.slice(argsIndex + ${index}, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${command.
|
|
136
|
+
return __alloy_js_core.code`args.slice(argsIndex + ${index}, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${command.args.length - index}).join(" ").split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean)`;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -160,7 +160,7 @@ function OptionsMember({ option }) {
|
|
|
160
160
|
return [
|
|
161
161
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
162
162
|
get when() {
|
|
163
|
-
return option.kind ===
|
|
163
|
+
return option.kind === require_types_command.CommandParameterKinds.string;
|
|
164
164
|
},
|
|
165
165
|
get children() {
|
|
166
166
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
@@ -179,7 +179,7 @@ function OptionsMember({ option }) {
|
|
|
179
179
|
}),
|
|
180
180
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
181
181
|
get when() {
|
|
182
|
-
return option.kind ===
|
|
182
|
+
return option.kind === require_types_command.CommandParameterKinds.number;
|
|
183
183
|
},
|
|
184
184
|
get children() {
|
|
185
185
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
@@ -198,7 +198,7 @@ function OptionsMember({ option }) {
|
|
|
198
198
|
}),
|
|
199
199
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
200
200
|
get when() {
|
|
201
|
-
return option.kind ===
|
|
201
|
+
return option.kind === require_types_command.CommandParameterKinds.boolean;
|
|
202
202
|
},
|
|
203
203
|
get children() {
|
|
204
204
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
@@ -225,7 +225,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
225
225
|
const equalsRegex = `/^--?(${isCaseSensitive || name.length === 1 ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")})=/`;
|
|
226
226
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
227
227
|
get when() {
|
|
228
|
-
return option.kind ===
|
|
228
|
+
return option.kind === require_types_command.CommandParameterKinds.string || option.kind === require_types_command.CommandParameterKinds.number;
|
|
229
229
|
},
|
|
230
230
|
get children() {
|
|
231
231
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -255,13 +255,13 @@ function OptionsMemberParserLogic(props) {
|
|
|
255
255
|
}),
|
|
256
256
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
257
257
|
get when() {
|
|
258
|
-
return option.kind ===
|
|
258
|
+
return option.kind === require_types_command.CommandParameterKinds.string;
|
|
259
259
|
},
|
|
260
260
|
children: __alloy_js_core.code`...arg.replace(${equalsRegex}, "").split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean) `
|
|
261
261
|
}),
|
|
262
262
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
263
263
|
get when() {
|
|
264
|
-
return option.kind ===
|
|
264
|
+
return option.kind === require_types_command.CommandParameterKinds.number;
|
|
265
265
|
},
|
|
266
266
|
children: __alloy_js_core.code`...arg.replace(${equalsRegex}, "").split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `
|
|
267
267
|
}),
|
|
@@ -282,13 +282,13 @@ function OptionsMemberParserLogic(props) {
|
|
|
282
282
|
}),
|
|
283
283
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
284
284
|
get when() {
|
|
285
|
-
return option.kind ===
|
|
285
|
+
return option.kind === require_types_command.CommandParameterKinds.string;
|
|
286
286
|
},
|
|
287
287
|
children: __alloy_js_core.code`...args[++i].split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean) `
|
|
288
288
|
}),
|
|
289
289
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
290
290
|
get when() {
|
|
291
|
-
return option.kind ===
|
|
291
|
+
return option.kind === require_types_command.CommandParameterKinds.number;
|
|
292
292
|
},
|
|
293
293
|
children: __alloy_js_core.code`...args[++i].split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `
|
|
294
294
|
}),
|
|
@@ -309,7 +309,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
309
309
|
get children() {
|
|
310
310
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
311
311
|
get when() {
|
|
312
|
-
return option.kind ===
|
|
312
|
+
return option.kind === require_types_command.CommandParameterKinds.string;
|
|
313
313
|
},
|
|
314
314
|
get children() {
|
|
315
315
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -322,7 +322,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
322
322
|
}
|
|
323
323
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
324
324
|
get when() {
|
|
325
|
-
return option.kind ===
|
|
325
|
+
return option.kind === require_types_command.CommandParameterKinds.number;
|
|
326
326
|
},
|
|
327
327
|
get children() {
|
|
328
328
|
return [
|
|
@@ -354,7 +354,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
354
354
|
get children() {
|
|
355
355
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
356
356
|
get when() {
|
|
357
|
-
return option.kind ===
|
|
357
|
+
return option.kind === require_types_command.CommandParameterKinds.string;
|
|
358
358
|
},
|
|
359
359
|
get children() {
|
|
360
360
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -367,7 +367,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
367
367
|
}
|
|
368
368
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
369
369
|
get when() {
|
|
370
|
-
return option.kind ===
|
|
370
|
+
return option.kind === require_types_command.CommandParameterKinds.number;
|
|
371
371
|
},
|
|
372
372
|
get children() {
|
|
373
373
|
return [
|
|
@@ -401,7 +401,7 @@ function OptionsMemberParserLogic(props) {
|
|
|
401
401
|
}
|
|
402
402
|
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
403
403
|
get when() {
|
|
404
|
-
return option.kind ===
|
|
404
|
+
return option.kind === require_types_command.CommandParameterKinds.boolean;
|
|
405
405
|
},
|
|
406
406
|
get children() {
|
|
407
407
|
return [
|
|
@@ -503,16 +503,16 @@ function OptionsParserLogic(props) {
|
|
|
503
503
|
get initializer() {
|
|
504
504
|
return __alloy_js_core.code` {
|
|
505
505
|
${Object.entries(options.value).map(([name, option]) => {
|
|
506
|
-
if (option.kind ===
|
|
507
|
-
else if (option.kind ===
|
|
508
|
-
else if (option.kind ===
|
|
506
|
+
if (option.kind === require_types_command.CommandParameterKinds.string) return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${envPrefix}_${option.env}` : ""}${option.variadic ? option.default !== void 0 ? `${option.env ? " ?? " : ""}${JSON.stringify(option.default)}` : option.env ? " ?? []" : "" : option.default !== void 0 ? `${option.env ? " ?? " : ""}"${option.default}"` : ""}, `;
|
|
507
|
+
else if (option.kind === require_types_command.CommandParameterKinds.number) return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${envPrefix}_${option.env}` : ""}${option.variadic ? option.default !== void 0 ? `${option.env ? " ?? " : ""}${JSON.stringify(option.default)}` : option.env ? " ?? []" : "" : option.default !== void 0 ? `${option.env ? " ?? " : ""}${option.default}` : ""}, `;
|
|
508
|
+
else if (option.kind === require_types_command.CommandParameterKinds.boolean) return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${envPrefix}_${option.env} ?? ` : ""}${option.default ? "true" : "false"},`;
|
|
509
509
|
return "";
|
|
510
510
|
}).join("")}
|
|
511
511
|
} as ${(0, __stryke_string_format_pascal_case.pascalCase)(command.name)}Options;`;
|
|
512
512
|
}
|
|
513
513
|
}),
|
|
514
514
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
515
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`for (let i = 0; i < args.slice(${command.segments.filter((segment) =>
|
|
515
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`for (let i = 0; i < args.slice(${command.segments.filter((segment) => require_context_helpers.isDynamicPathSegment(segment)).length}).length; i++) { `),
|
|
516
516
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
517
517
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
518
518
|
"const": true,
|