@shell-shock/core 0.4.3 → 0.5.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/README.md +1 -1
- package/dist/components/docs.cjs +6 -28
- 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/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +8 -30
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/index.cjs +10 -1
- package/dist/components/index.d.cts +3 -1
- package/dist/components/index.d.mts +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/options-parser-logic.cjs +504 -0
- package/dist/components/options-parser-logic.cjs.map +1 -0
- package/dist/components/options-parser-logic.d.cts +86 -0
- package/dist/components/options-parser-logic.d.cts.map +1 -0
- package/dist/components/options-parser-logic.d.mts +86 -0
- package/dist/components/options-parser-logic.d.mts.map +1 -0
- package/dist/components/options-parser-logic.mjs +498 -0
- package/dist/components/options-parser-logic.mjs.map +1 -0
- package/dist/components/usage.cjs +41 -0
- package/dist/components/usage.cjs.map +1 -0
- package/dist/components/usage.d.cts +30 -0
- package/dist/components/usage.d.cts.map +1 -0
- package/dist/components/usage.d.mts +30 -0
- package/dist/components/usage.d.mts.map +1 -0
- package/dist/components/usage.mjs +40 -0
- package/dist/components/usage.mjs.map +1 -0
- package/dist/contexts/index.cjs +5 -1
- package/dist/contexts/index.d.cts +2 -1
- package/dist/contexts/index.d.mts +2 -1
- package/dist/contexts/index.mjs +2 -1
- package/dist/contexts/options.cjs +43 -0
- package/dist/contexts/options.cjs.map +1 -0
- package/dist/contexts/options.d.cts +22 -0
- package/dist/contexts/options.d.cts.map +1 -0
- package/dist/contexts/options.d.mts +22 -0
- package/dist/contexts/options.d.mts.map +1 -0
- package/dist/contexts/options.mjs +39 -0
- package/dist/contexts/options.mjs.map +1 -0
- package/dist/helpers/resolve-command.cjs +91 -61
- package/dist/helpers/resolve-command.cjs.map +1 -1
- package/dist/helpers/resolve-command.mjs +93 -63
- package/dist/helpers/resolve-command.mjs.map +1 -1
- package/dist/helpers/validations.cjs +20 -48
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +21 -49
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/plugin-utils/context-helpers.cjs +5 -5
- package/dist/plugin-utils/context-helpers.cjs.map +1 -1
- package/dist/plugin-utils/context-helpers.d.cts +3 -3
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +3 -3
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +4 -4
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +1 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs +2 -2
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +2 -2
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +2 -2
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/plugin.mjs.map +1 -1
- package/dist/types/command.d.cts +14 -10
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +14 -10
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/package.json +57 -28
- package/dist/types/internal.cjs +0 -0
- package/dist/types/internal.d.cts +0 -24
- package/dist/types/internal.d.cts.map +0 -1
- package/dist/types/internal.d.mts +0 -24
- package/dist/types/internal.d.mts.map +0 -1
- package/dist/types/internal.mjs +0 -1
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
|
@@ -3,8 +3,8 @@ const require_contexts_command = require('../contexts/command.cjs');
|
|
|
3
3
|
const require_docs_helpers = require('../helpers/docs-helpers.cjs');
|
|
4
4
|
const require_plugin_utils_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
5
5
|
const require_plugin_utils_reflect = require('../plugin-utils/reflect.cjs');
|
|
6
|
+
const require_components_usage = require('./usage.cjs');
|
|
6
7
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
8
8
|
let __alloy_js_core = require("@alloy-js/core");
|
|
9
9
|
let __alloy_js_markdown = require("@alloy-js/markdown");
|
|
10
10
|
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
@@ -40,35 +40,13 @@ function CommandDocsUsageExample(props) {
|
|
|
40
40
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
41
41
|
__alloy_js_core.code`\`\`\`bash `,
|
|
42
42
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
43
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
children: `yarn exec `
|
|
48
|
-
}),
|
|
49
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
50
|
-
when: packageManager === "pnpm",
|
|
51
|
-
children: `pnpm exec `
|
|
52
|
-
}),
|
|
53
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
54
|
-
when: packageManager === "bun",
|
|
55
|
-
children: `bun x `
|
|
56
|
-
}),
|
|
57
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
58
|
-
"else": true,
|
|
59
|
-
children: `npx `
|
|
60
|
-
})
|
|
61
|
-
];
|
|
62
|
-
} }),
|
|
63
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => `${require_plugin_utils_context_helpers.getAppBin(context)} `),
|
|
64
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
65
|
-
get each() {
|
|
66
|
-
return command.path.segments;
|
|
43
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_usage.Usage, {
|
|
44
|
+
command,
|
|
45
|
+
get bin() {
|
|
46
|
+
return require_plugin_utils_context_helpers.getAppBin(context);
|
|
67
47
|
},
|
|
68
|
-
|
|
69
|
-
children: (segment) => require_plugin_utils_context_helpers.isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${(0, __stryke_string_format_kebab_case.kebabCase)(require_plugin_utils_context_helpers.getVariableCommandPathName(segment))}>` : segment
|
|
48
|
+
packageManager
|
|
70
49
|
}),
|
|
71
|
-
__alloy_js_core.code` [options] `,
|
|
72
50
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
73
51
|
__alloy_js_core.code`\`\`\``,
|
|
74
52
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.cjs","names":["code","For","Match","memo","Show","Switch","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","kebabCase","CommandContext","getDocsOutputPath","getAppBin","getVariableCommandPathName","isVariableCommandPath","sortOptions","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","children","when","_$memo","each","path","segments","joiner","segment","variables","variadic","CommandDocs","levelOffset","usageExamples","level","title","fallback","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps"],"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, Match, memo, Show, Switch } 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 { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport {\n getAppBin,\n getVariableCommandPathName,\n isVariableCommandPath\n} from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\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 <Switch>\n <Match when={packageManager === \"yarn\"}>{`yarn exec `}</Match>\n <Match when={packageManager === \"pnpm\"}>{`pnpm exec `}</Match>\n <Match when={packageManager === \"bun\"}>{`bun x `}</Match>\n <Match else>{`npx `}</Match>\n </Switch>\n {`${getAppBin(context)} `}\n <For each={command.path.segments} joiner=\" \">\n {segment =>\n isVariableCommandPath(segment)\n ? `<${command.path.variables[segment]?.variadic ? \"...\" : \"\"}${kebabCase(\n getVariableCommandPathName(segment)\n )}>`\n : segment\n }\n </For>\n {code` [options] `}\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 <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\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 <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\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.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\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AAA,CAAA;mDAAA,OAAA,EAAA,CAAA;8CAG9B3C,oBAAI,+CACHoB,QAAQU,KAAI,WACH;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGVZ,oBAAkB,EAAUE,SAAO,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBwC,gBAAgBzC,OAA6B;CAC3D,MAAM,EAAEmC,cAAc,GAAGlC,SAAS,GAAGyC,SAAS1C;CAE9C,MAAMsB,8EAAkC;CACxC,MAAMc,gDACE;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,yDACG3C,wCAAekD,UAAQ;EAACC,OAAO3C;EAAO,IAAAuB,WAAA;AAAA,2DACpCnC,sHAAY,EAAA,IACXuC,OAAI;AAAA,6CAAYlC,uCAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKgB,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAlB,WAAA;AAAA,4DACPU,aAAW;KACGC;KACJlC;KAAO,IAChBmC,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
|
|
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 <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\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 <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\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.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,SAAgBc,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOpB,oBAAI;AAGb,yDACGO,4EAAa,EAAA,IACZe,OAAI;AAAA,SAAEV,yCAAYK,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,EAAEqB,iBAAiB,OAAOpB,YAAYD;CAE5C,MAAMsB,8EAAkC;AAExC,QAAA;mDAAA,OAAA,E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A,EAAA,CAAA;8CAG9B5C,oBAAI,+CACHgB,QAAQU,KAAI,WACH;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGVZ,oBAAkB,EAAUE,SAAO,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBmC,gBAAgBpC,OAA6B;CAC3D,MAAM,EAAE0B,cAAc,GAAGzB,SAAS,GAAGoC,SAASrC;CAE9C,MAAMsB,8EAAkC;CACxC,MAAMK,gDACE;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,yDACGjC,wCAAe4C,UAAQ;EAACC,OAAOtC;EAAO,IAAA4B,WAAA;AAAA,2DACpCtC,sHAAY,EAAA,IACXkD,OAAI;AAAA,6CAAY9C,uCAAkB2B,QAAQ,EAAE,GAAGrB,QAAQwC,KAAKF,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAR,WAAA;AAAA,4DACPJ,aAAW;KACGC;KACJzB;KAAO,IAChB0B,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandTree } from "../types/command.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core6 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_core6.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_core6.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_core6.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_core6.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":";;;;;
|
|
1
|
+
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"sourcesContent":[],"mappings":";;;;;UAiCiB,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;AAgDA;;;;;AAoBA;;;;;WA3HW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAsB1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAgDlC,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_core6 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_core6.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_core6.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_core6.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_core6.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":";;;;;UAiCiB,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;AAgDA;;;;;AAoBA;;;;;WA3HW;;;;;iBAMK,uBAAA,QAA+B,+BAA4B,eAAA,CAAA;UAsB1D,gBAAA;;;;;;;;;;;;;WAcN;;;;;;kBAOO,SAAS;;;;;iBAMX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAgDlC,oBAAA,SAA6B,QAAQ;;;;;;;;;;;;;WAc3C;;;;;iBAMK,eAAA,QAAuB,uBAAoB,eAAA,CAAA"}
|
package/dist/components/docs.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CommandContext } from "../contexts/command.mjs";
|
|
2
2
|
import { getDocsOutputPath } from "../helpers/docs-helpers.mjs";
|
|
3
|
-
import { getAppBin
|
|
3
|
+
import { getAppBin } from "../plugin-utils/context-helpers.mjs";
|
|
4
4
|
import { sortOptions } from "../plugin-utils/reflect.mjs";
|
|
5
|
+
import { Usage } from "./usage.mjs";
|
|
5
6
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
|
-
import {
|
|
7
|
-
import { For, Match, Show, Switch, code, memo as memo$1 } from "@alloy-js/core";
|
|
7
|
+
import { For, Show, code, memo as memo$1 } from "@alloy-js/core";
|
|
8
8
|
import { Heading } from "@alloy-js/markdown";
|
|
9
9
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
10
10
|
import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
@@ -39,35 +39,13 @@ function CommandDocsUsageExample(props) {
|
|
|
39
39
|
createIntrinsic("hbr", {}),
|
|
40
40
|
code`\`\`\`bash `,
|
|
41
41
|
createIntrinsic("hbr", {}),
|
|
42
|
-
createComponent(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
children: `yarn exec `
|
|
47
|
-
}),
|
|
48
|
-
createComponent(Match, {
|
|
49
|
-
when: packageManager === "pnpm",
|
|
50
|
-
children: `pnpm exec `
|
|
51
|
-
}),
|
|
52
|
-
createComponent(Match, {
|
|
53
|
-
when: packageManager === "bun",
|
|
54
|
-
children: `bun x `
|
|
55
|
-
}),
|
|
56
|
-
createComponent(Match, {
|
|
57
|
-
"else": true,
|
|
58
|
-
children: `npx `
|
|
59
|
-
})
|
|
60
|
-
];
|
|
61
|
-
} }),
|
|
62
|
-
memo(() => `${getAppBin(context)} `),
|
|
63
|
-
createComponent(For, {
|
|
64
|
-
get each() {
|
|
65
|
-
return command.path.segments;
|
|
42
|
+
createComponent(Usage, {
|
|
43
|
+
command,
|
|
44
|
+
get bin() {
|
|
45
|
+
return getAppBin(context);
|
|
66
46
|
},
|
|
67
|
-
|
|
68
|
-
children: (segment) => isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${kebabCase(getVariableCommandPathName(segment))}>` : segment
|
|
47
|
+
packageManager
|
|
69
48
|
}),
|
|
70
|
-
code` [options] `,
|
|
71
49
|
createIntrinsic("hbr", {}),
|
|
72
50
|
code`\`\`\``,
|
|
73
51
|
createIntrinsic("hbr", {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.mjs","names":["code","For","Match","memo","Show","Switch","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","kebabCase","CommandContext","getDocsOutputPath","getAppBin","getVariableCommandPathName","isVariableCommandPath","sortOptions","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","children","when","_$memo","each","path","segments","joiner","segment","variables","variadic","CommandDocs","levelOffset","usageExamples","level","title","fallback","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps"],"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, Match, memo, Show, Switch } 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 { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport {\n getAppBin,\n getVariableCommandPathName,\n isVariableCommandPath\n} from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\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 <Switch>\n <Match when={packageManager === \"yarn\"}>{`yarn exec `}</Match>\n <Match when={packageManager === \"pnpm\"}>{`pnpm exec `}</Match>\n <Match when={packageManager === \"bun\"}>{`bun x `}</Match>\n <Match else>{`npx `}</Match>\n </Switch>\n {`${getAppBin(context)} `}\n <For each={command.path.segments} joiner=\" \">\n {segment =>\n isVariableCommandPath(segment)\n ? `<${command.path.variables[segment]?.variadic ? \"...\" : \"\"}${kebabCase(\n getVariableCommandPathName(segment)\n )}>`\n : segment\n }\n </For>\n {code` [options] `}\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 <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\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 <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\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.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,SAAgBkB,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOxB,IAAI;AAGb,QAAAyB,gBACGhB,eAAa,EAAA,IACZiB,OAAI;AAAA,SAAET,YAAYI,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,KA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,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBkB,gBAAgBzC,OAA6B;CAC3D,MAAM,EAAEmC,cAAc,GAAGlC,SAAS,GAAGyC,SAAS1C;CAE9C,MAAMsB,UAAUlC,eAAwB;CACxC,MAAMgD,gBAAgBpD,aACd;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,QAAAsB,gBACGb,eAAekD,UAAQ;EAACC,OAAO3C;EAAO,IAAAuB,WAAA;AAAA,UAAAlB,gBACpCjB,cAAYwD,WAAA,EAAA,IACXjB,OAAI;AAAA,WAAErC,UAAUG,kBAAkB4B,QAAQ,EAAE,GAAGrB,QAAQ2B,KAAKgB,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAlB,WAAA;AAAA,WAAAlB,gBACP4B,aAAW;KACGC;KACJlC;KAAO,IAChBmC,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
|
|
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 <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\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 <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\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.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,SAAgBc,mBAAmBC,OAAgC;CACjE,MAAM,EAAEC,YAAYD;AACpB,KAAIE,OAAOC,KAAKF,QAAQG,QAAQ,CAACC,WAAW,EAC1C,QAAOpB,IAAI;AAGb,QAAAqB,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,EAAEqB,iBAAiB,OAAOpB,YAAYD;CAE5C,MAAMsB,UAAUhC,eAAwB;AAExC,QAAA;EAAAiC,gBAAA,OAAA,EAAA,CAAA;EAGKtC,IAAI;EAAasC,gBAAA,OAAA,EAAA,CAAA;EAAAjB,gBAEjBR,OAAK;GACKG;GAAO,IAChBuB,MAA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WG,UAAA;GAAA,CAAA;EAAAN,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAQ,WAG9B9C,IAAI,+CACHgB,QAAQU,KAAI,WACH;EAAAY,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAAjB,gBAGVP,oBAAkB,EAAUE,SAAO,CAAA;EAAAsB,gBAAA,OAAA,EAAA,CAAA;EAAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;AA2B1C,SAAgBa,gBAAgBpC,OAA6B;CAC3D,MAAM,EAAE0B,cAAc,GAAGzB,SAAS,GAAGoC,SAASrC;CAE9C,MAAMsB,UAAUhC,eAAwB;CACxC,MAAMqC,gBAAgBxC,aACd;EAAC;EAAO;EAAQ;EAAQ;EAChC,CAAC;AAED,QAAAmB,gBACGZ,eAAe4C,UAAQ;EAACC,OAAOtC;EAAO,IAAA4B,WAAA;AAAA,UAAAvB,gBACpCf,cAAYiD,WAAA,EAAA,IACXC,OAAI;AAAA,WAAEhD,UAAUE,kBAAkB2B,QAAQ,EAAE,GAAGrB,QAAQwC,KAAKF,MAAK,KAAM;MAAA,EACnEF,MAAI,EAAA,IAAAR,WAAA;AAAA,WAAAvB,gBACPmB,aAAW;KACGC;KACJzB;KAAO,IAChB0B,gBAAa;AAAA,aAAEA,eAAe;;KAAA,CAAA;MAAA,CAAA,CAAA;;EAAA,CAAA"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
const require_components_usage = require('./usage.cjs');
|
|
1
2
|
const require_components_docs = require('./docs.cjs');
|
|
3
|
+
const require_components_options_parser_logic = require('./options-parser-logic.cjs');
|
|
2
4
|
|
|
3
5
|
exports.CommandDocs = require_components_docs.CommandDocs;
|
|
4
6
|
exports.CommandDocsFile = require_components_docs.CommandDocsFile;
|
|
5
7
|
exports.CommandDocsUsageExample = require_components_docs.CommandDocsUsageExample;
|
|
6
|
-
exports.CommandOptionsDocs = require_components_docs.CommandOptionsDocs;
|
|
8
|
+
exports.CommandOptionsDocs = require_components_docs.CommandOptionsDocs;
|
|
9
|
+
exports.OptionsInterfaceDeclaration = require_components_options_parser_logic.OptionsInterfaceDeclaration;
|
|
10
|
+
exports.OptionsMember = require_components_options_parser_logic.OptionsMember;
|
|
11
|
+
exports.OptionsMemberParserCondition = require_components_options_parser_logic.OptionsMemberParserCondition;
|
|
12
|
+
exports.OptionsMemberParserLogic = require_components_options_parser_logic.OptionsMemberParserLogic;
|
|
13
|
+
exports.OptionsParserLogic = require_components_options_parser_logic.OptionsParserLogic;
|
|
14
|
+
exports.PositionalOptionsParserLogic = require_components_options_parser_logic.PositionalOptionsParserLogic;
|
|
15
|
+
exports.Usage = require_components_usage.Usage;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.cjs";
|
|
2
|
-
|
|
2
|
+
import { OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, PositionalOptionsParserLogic, PositionalOptionsParserLogicProps } from "./options-parser-logic.cjs";
|
|
3
|
+
import { Usage, UsageProps } from "./usage.cjs";
|
|
4
|
+
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, PositionalOptionsParserLogic, PositionalOptionsParserLogicProps, Usage, UsageProps };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.mjs";
|
|
2
|
-
|
|
2
|
+
import { OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, PositionalOptionsParserLogic, PositionalOptionsParserLogicProps } from "./options-parser-logic.mjs";
|
|
3
|
+
import { Usage, UsageProps } from "./usage.mjs";
|
|
4
|
+
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, PositionalOptionsParserLogic, PositionalOptionsParserLogicProps, Usage, UsageProps };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Usage } from "./usage.mjs";
|
|
1
2
|
import { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs } from "./docs.mjs";
|
|
3
|
+
import { OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, PositionalOptionsParserLogic } from "./options-parser-logic.mjs";
|
|
2
4
|
|
|
3
|
-
export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };
|
|
5
|
+
export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, PositionalOptionsParserLogic, Usage };
|