@shell-shock/core 0.17.8 → 0.17.11
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/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/api.cjs +36 -1
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +2 -77
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +2 -76
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +35 -1
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +291 -1
- package/dist/components/command-validation-logic.cjs.map +1 -0
- package/dist/components/command-validation-logic.d.cts +1 -3
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +1 -3
- package/dist/components/command-validation-logic.d.mts.map +1 -1
- package/dist/components/command-validation-logic.mjs +288 -1
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +265 -1
- package/dist/components/docs.cjs.map +1 -0
- package/dist/components/docs.d.cts +4 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +4 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +256 -1
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +429 -15
- package/dist/components/exec-builtin.cjs.map +1 -0
- package/dist/components/exec-builtin.d.cts +1 -2
- package/dist/components/exec-builtin.d.cts.map +1 -1
- package/dist/components/exec-builtin.d.mts +1 -2
- package/dist/components/exec-builtin.d.mts.map +1 -1
- package/dist/components/exec-builtin.mjs +424 -15
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +119 -1
- package/dist/components/helpers.cjs.map +1 -0
- package/dist/components/helpers.d.cts +6 -8
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -8
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs +111 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +58 -1
- package/dist/components/index.mjs +10 -1
- package/dist/components/options-parser-logic.cjs +959 -5
- package/dist/components/options-parser-logic.cjs.map +1 -0
- package/dist/components/options-parser-logic.d.cts +8 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +8 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +944 -5
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +630 -8
- package/dist/components/state-builtin.cjs.map +1 -0
- package/dist/components/state-builtin.d.cts +4 -5
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +4 -5
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +622 -8
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +116 -1
- package/dist/components/usage.cjs.map +1 -0
- package/dist/components/usage.d.cts +1 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +1 -2
- package/dist/components/usage.d.mts.map +1 -1
- package/dist/components/usage.mjs +113 -1
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +839 -33
- package/dist/components/utils-builtin.cjs.map +1 -0
- package/dist/components/utils-builtin.d.cts +7 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +7 -8
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +828 -33
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +65 -1
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +29 -8
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +29 -8
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +62 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +26 -1
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts.map +1 -1
- package/dist/contexts/command.mjs +23 -1
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/index.cjs +9 -1
- package/dist/contexts/index.mjs +4 -1
- package/dist/contexts/options.cjs +63 -1
- package/dist/contexts/options.cjs.map +1 -0
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +57 -1
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/engine.cjs +138 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +79 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +79 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +136 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/helpers/automd.cjs +70 -1
- package/dist/helpers/automd.cjs.map +1 -0
- package/dist/helpers/automd.mjs +69 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +23 -1
- package/dist/helpers/docs-helpers.cjs.map +1 -0
- package/dist/helpers/docs-helpers.mjs +22 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/get-framework.cjs +24 -0
- package/dist/helpers/get-framework.cjs.map +1 -0
- package/dist/helpers/get-framework.mjs +24 -0
- package/dist/helpers/get-framework.mjs.map +1 -0
- package/dist/helpers/paths.cjs +137 -1
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +133 -1
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +113 -1
- package/dist/helpers/persistence.cjs.map +1 -0
- package/dist/helpers/persistence.mjs +112 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +65 -1
- package/dist/helpers/update-package-json.cjs.map +1 -0
- package/dist/helpers/update-package-json.mjs +63 -1
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +95 -1
- package/dist/helpers/utilities.cjs.map +1 -0
- package/dist/helpers/utilities.mjs +93 -1
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +71 -1
- package/dist/helpers/validations.cjs.map +1 -0
- package/dist/helpers/validations.mjs +69 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +123 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +80 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +80 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +119 -1
- package/dist/index.mjs.map +1 -0
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/dist/plugin-utils/compute-bin.cjs +48 -1
- package/dist/plugin-utils/compute-bin.cjs.map +1 -0
- package/dist/plugin-utils/compute-bin.d.cts +2 -2
- package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
- package/dist/plugin-utils/compute-bin.d.mts +2 -2
- package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
- package/dist/plugin-utils/compute-bin.mjs +47 -1
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +224 -1
- package/dist/plugin-utils/context-helpers.cjs.map +1 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -4
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +4 -4
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +214 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +70 -1
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +5 -5
- package/dist/plugin-utils/deepkit.d.cts.map +1 -1
- package/dist/plugin-utils/deepkit.d.mts +5 -5
- package/dist/plugin-utils/deepkit.d.mts.map +1 -1
- package/dist/plugin-utils/deepkit.mjs +68 -1
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +112 -2
- package/dist/plugin-utils/description-helpers.cjs.map +1 -0
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/description-helpers.mjs +107 -2
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +118 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs +114 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +39 -1
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +10 -1
- package/dist/plugin-utils/reflect.cjs +52 -1
- package/dist/plugin-utils/reflect.cjs.map +1 -0
- package/dist/plugin-utils/reflect.d.cts.map +1 -1
- package/dist/plugin-utils/reflect.d.mts.map +1 -1
- package/dist/plugin-utils/reflect.mjs +50 -1
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +222 -1
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +5 -5
- package/dist/plugin-utils/type-checks.d.cts.map +1 -1
- package/dist/plugin-utils/type-checks.d.mts +5 -5
- package/dist/plugin-utils/type-checks.d.mts.map +1 -1
- package/dist/plugin-utils/type-checks.mjs +217 -1
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +495 -4
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +488 -4
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +182 -1
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +178 -1
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +479 -1
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +478 -1
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +402 -1
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.d.cts +61 -119
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +61 -119
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +367 -1
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +175 -1
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +19 -12
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +19 -12
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +163 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +45 -1
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.d.cts +3 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +40 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +53 -1
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts +1 -1
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts +1 -1
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/env.mjs +50 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +53 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +6 -1
- package/dist/types/options.cjs +13 -1
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.cts.map +1 -1
- package/dist/types/options.d.mts.map +1 -1
- package/dist/types/options.mjs +10 -1
- package/dist/types/options.mjs.map +1 -1
- package/package.json +43 -34
- package/dist/resolver/deepkit.cjs +0 -1
- package/dist/resolver/deepkit.mjs +0 -2
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/module.cjs +0 -1
- package/dist/resolver/module.mjs +0 -2
- package/dist/resolver/module.mjs.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CommandTree } from "../types/command.cjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
4
3
|
|
|
5
4
|
//#region src/components/docs.d.ts
|
|
@@ -12,7 +11,7 @@ interface CommandOptionsDocsProps {
|
|
|
12
11
|
/**
|
|
13
12
|
* Generates the options markdown documentation for a command.
|
|
14
13
|
*/
|
|
15
|
-
declare function CommandOptionsDocs(props: CommandOptionsDocsProps):
|
|
14
|
+
declare function CommandOptionsDocs(props: CommandOptionsDocsProps): import("@alloy-js/core").Children;
|
|
16
15
|
interface CommandDocsUsageExampleProps {
|
|
17
16
|
/**
|
|
18
17
|
* The package manager to generate the usage example for.
|
|
@@ -31,7 +30,7 @@ interface CommandDocsUsageExampleProps {
|
|
|
31
30
|
/**
|
|
32
31
|
* Generates the markdown documentation for a command.
|
|
33
32
|
*/
|
|
34
|
-
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps):
|
|
33
|
+
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps): import("@alloy-js/core").Children;
|
|
35
34
|
interface CommandDocsProps {
|
|
36
35
|
/**
|
|
37
36
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -56,7 +55,7 @@ interface CommandDocsProps {
|
|
|
56
55
|
/**
|
|
57
56
|
* Generates the markdown documentation for a command.
|
|
58
57
|
*/
|
|
59
|
-
declare function CommandDocs(props: CommandDocsProps):
|
|
58
|
+
declare function CommandDocs(props: CommandDocsProps): import("@alloy-js/core").Children;
|
|
60
59
|
interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
61
60
|
/**
|
|
62
61
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -75,7 +74,7 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
|
75
74
|
/**
|
|
76
75
|
* Generates the markdown documentation file for a command.
|
|
77
76
|
*/
|
|
78
|
-
declare function CommandDocsFile(props: CommandDocsFileProps):
|
|
77
|
+
declare function CommandDocsFile(props: CommandDocsFileProps): import("@alloy-js/core").Children;
|
|
79
78
|
//#endregion
|
|
80
79
|
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
|
|
81
80
|
//# sourceMappingURL=docs.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":";;;;UAmCiB,uBAAA;;AAAjB;;EAIE,OAAA,EAAS,WAAW;AAAA;AAAA;AAMtB;;AANsB,iBAMN,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA;AAAA,UA4BhD,4BAAA;EA5ByB;;;;AAAuB;AA4BjE;;;EASE,cAAA;EAAA;;;EAKA,OAAA,EAAS,WAAW;AAAA;AAMtB;;;AAAA,iBAAgB,uBAAA,CAAwB,KAAA,EAAO,4BAA4B,4BAAA,QAAA;AAAA,UAsB1D,gBAAA;EAtBuB;;;AAAmC;AAsB3E;;;;EASE,WAAA;EAYgB;;;EAPhB,OAAA,EAAS,WAAA;EAAT;;;;;EAOA,aAAA,GAAgB,QAAA,CAAS,4BAAA;AAAA;AAM3B;;;AAAA,iBAAgB,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA;AAAA,UAwClC,oBAAA,SAA6B,OAAA,CAAQ,iBAAA;EAxC1B;;;AAAuB;AAwCnD;;;;EASE,WAAA;EAT4C;;;EAc5C,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CommandTree } from "../types/command.mjs";
|
|
2
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
3
2
|
import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
4
3
|
|
|
5
4
|
//#region src/components/docs.d.ts
|
|
@@ -12,7 +11,7 @@ interface CommandOptionsDocsProps {
|
|
|
12
11
|
/**
|
|
13
12
|
* Generates the options markdown documentation for a command.
|
|
14
13
|
*/
|
|
15
|
-
declare function CommandOptionsDocs(props: CommandOptionsDocsProps):
|
|
14
|
+
declare function CommandOptionsDocs(props: CommandOptionsDocsProps): import("@alloy-js/core").Children;
|
|
16
15
|
interface CommandDocsUsageExampleProps {
|
|
17
16
|
/**
|
|
18
17
|
* The package manager to generate the usage example for.
|
|
@@ -31,7 +30,7 @@ interface CommandDocsUsageExampleProps {
|
|
|
31
30
|
/**
|
|
32
31
|
* Generates the markdown documentation for a command.
|
|
33
32
|
*/
|
|
34
|
-
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps):
|
|
33
|
+
declare function CommandDocsUsageExample(props: CommandDocsUsageExampleProps): import("@alloy-js/core").Children;
|
|
35
34
|
interface CommandDocsProps {
|
|
36
35
|
/**
|
|
37
36
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -56,7 +55,7 @@ interface CommandDocsProps {
|
|
|
56
55
|
/**
|
|
57
56
|
* Generates the markdown documentation for a command.
|
|
58
57
|
*/
|
|
59
|
-
declare function CommandDocs(props: CommandDocsProps):
|
|
58
|
+
declare function CommandDocs(props: CommandDocsProps): import("@alloy-js/core").Children;
|
|
60
59
|
interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
61
60
|
/**
|
|
62
61
|
* The heading level offset to apply to the generated documentation.
|
|
@@ -75,7 +74,7 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
|
75
74
|
/**
|
|
76
75
|
* Generates the markdown documentation file for a command.
|
|
77
76
|
*/
|
|
78
|
-
declare function CommandDocsFile(props: CommandDocsFileProps):
|
|
77
|
+
declare function CommandDocsFile(props: CommandDocsFileProps): import("@alloy-js/core").Children;
|
|
79
78
|
//#endregion
|
|
80
79
|
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
|
|
81
80
|
//# sourceMappingURL=docs.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.mts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.d.mts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":""}
|
package/dist/components/docs.mjs
CHANGED
|
@@ -1,2 +1,257 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CommandContext } from "../contexts/command.mjs";
|
|
2
|
+
import { getDocsOutputPath } from "../helpers/docs-helpers.mjs";
|
|
3
|
+
import { getAppBin } from "../plugin-utils/context-helpers.mjs";
|
|
4
|
+
import { sortOptions } from "../plugin-utils/reflect.mjs";
|
|
5
|
+
import { Usage } from "./usage.mjs";
|
|
6
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
7
|
+
import { For, Show, code, memo as memo$1 } from "@alloy-js/core";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { Heading } from "@alloy-js/markdown";
|
|
10
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
11
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
12
|
+
import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
13
|
+
import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
|
|
14
|
+
import { joinPaths } from "@stryke/path/join";
|
|
15
|
+
|
|
16
|
+
//#region src/components/docs.tsx
|
|
17
|
+
const __ΩRequired = [
|
|
18
|
+
"T",
|
|
19
|
+
"Required",
|
|
20
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
21
|
+
];
|
|
22
|
+
const __ΩPartial = [
|
|
23
|
+
"T",
|
|
24
|
+
"Partial",
|
|
25
|
+
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
26
|
+
];
|
|
27
|
+
function __assignType(fn, args) {
|
|
28
|
+
fn.__type = args;
|
|
29
|
+
return fn;
|
|
30
|
+
}
|
|
31
|
+
const __ΩCommandOptionsDocsProps = [
|
|
32
|
+
"CommandTree",
|
|
33
|
+
"command",
|
|
34
|
+
"The command to generate options documentation for.",
|
|
35
|
+
"CommandOptionsDocsProps",
|
|
36
|
+
"P\"w!4\"?#Mw$y"
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Generates the options markdown documentation for a command.
|
|
40
|
+
*/
|
|
41
|
+
function CommandOptionsDocs(props) {
|
|
42
|
+
const { command } = props;
|
|
43
|
+
if (Object.keys(command.options).length === 0) return code`This command does not have any options.`;
|
|
44
|
+
return createComponent(MarkdownTable, { get data() {
|
|
45
|
+
return sortOptions(Object.values(command.options)).map(__assignType((option) => {
|
|
46
|
+
return {
|
|
47
|
+
name: option.name.trim(),
|
|
48
|
+
description: option.description.trim(),
|
|
49
|
+
defaultValue: option.default ? String(option.default)?.includes("\"") ? option.default : `\`${Array.isArray(option.default) ? option.default.join(", ") : option.default}\`` : "",
|
|
50
|
+
required: !option.required || option.default ? "" : "✔"
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
"option",
|
|
54
|
+
"",
|
|
55
|
+
"P\"2!\"/\""
|
|
56
|
+
]));
|
|
57
|
+
} });
|
|
58
|
+
}
|
|
59
|
+
CommandOptionsDocs.__type = [
|
|
60
|
+
() => __ΩCommandOptionsDocsProps,
|
|
61
|
+
"props",
|
|
62
|
+
"CommandOptionsDocs",
|
|
63
|
+
"Generates the options markdown documentation for a command.",
|
|
64
|
+
"Pn!2\"\"/#?$"
|
|
65
|
+
];
|
|
66
|
+
const __ΩCommandDocsUsageExampleProps = [
|
|
67
|
+
"npm",
|
|
68
|
+
"yarn",
|
|
69
|
+
"pnpm",
|
|
70
|
+
"bun",
|
|
71
|
+
"packageManager",
|
|
72
|
+
"npm",
|
|
73
|
+
"The package manager to generate the usage example for.",
|
|
74
|
+
"CommandTree",
|
|
75
|
+
"command",
|
|
76
|
+
"The command to generate the usage example for.",
|
|
77
|
+
"CommandDocsUsageExampleProps",
|
|
78
|
+
"PP.!.\".#.$J4%8>&?'\"w(4)?*Mw+y"
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* Generates the markdown documentation for a command.
|
|
82
|
+
*/
|
|
83
|
+
function CommandDocsUsageExample(props) {
|
|
84
|
+
const { packageManager = "npm", command } = props;
|
|
85
|
+
const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
|
|
86
|
+
return [
|
|
87
|
+
createIntrinsic("hbr", {}),
|
|
88
|
+
code`\`\`\`bash `,
|
|
89
|
+
createIntrinsic("hbr", {}),
|
|
90
|
+
createComponent(Usage, {
|
|
91
|
+
command,
|
|
92
|
+
get bin() {
|
|
93
|
+
return getAppBin(context);
|
|
94
|
+
},
|
|
95
|
+
packageManager
|
|
96
|
+
}),
|
|
97
|
+
createIntrinsic("hbr", {}),
|
|
98
|
+
code`\`\`\``,
|
|
99
|
+
createIntrinsic("hbr", {})
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
CommandDocsUsageExample.__type = [
|
|
103
|
+
() => __ΩCommandDocsUsageExampleProps,
|
|
104
|
+
"props",
|
|
105
|
+
"CommandDocsUsageExample",
|
|
106
|
+
"Generates the markdown documentation for a command.",
|
|
107
|
+
"Pn!2\"\"/#?$"
|
|
108
|
+
];
|
|
109
|
+
const __ΩCommandDocsProps = [
|
|
110
|
+
"levelOffset",
|
|
111
|
+
0,
|
|
112
|
+
"The heading level offset to apply to the generated documentation.",
|
|
113
|
+
"CommandTree",
|
|
114
|
+
"command",
|
|
115
|
+
"The command to generate options documentation for.",
|
|
116
|
+
() => __ΩRequired,
|
|
117
|
+
() => __ΩCommandDocsUsageExampleProps,
|
|
118
|
+
"packageManager",
|
|
119
|
+
"usageExamples",
|
|
120
|
+
"`[\"npm\"]`",
|
|
121
|
+
"Optional usage examples to include in the documentation.",
|
|
122
|
+
"CommandDocsProps",
|
|
123
|
+
"P'4!8>\"?#\"w$4%?&n(o'\".)fF4*8>+?,Mw-y"
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* Generates the markdown documentation for a command.
|
|
127
|
+
*/
|
|
128
|
+
function CommandDocs(props) {
|
|
129
|
+
const { levelOffset = 0, command, usageExamples } = props;
|
|
130
|
+
return [
|
|
131
|
+
createComponent(Heading, {
|
|
132
|
+
level: 1 + levelOffset,
|
|
133
|
+
get children() {
|
|
134
|
+
return command.title;
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
createComponent(Spacing, {}),
|
|
138
|
+
memo(() => code`${command.description}`),
|
|
139
|
+
createComponent(Spacing, {}),
|
|
140
|
+
createComponent(Heading, {
|
|
141
|
+
level: 2 + levelOffset,
|
|
142
|
+
children: "Usage"
|
|
143
|
+
}),
|
|
144
|
+
createComponent(Spacing, {}),
|
|
145
|
+
memo(() => code`The ${command.name} command can be executed using the following syntax: `),
|
|
146
|
+
createComponent(Spacing, {}),
|
|
147
|
+
createComponent(Show, {
|
|
148
|
+
get when() {
|
|
149
|
+
return usageExamples && usageExamples.length > 0;
|
|
150
|
+
},
|
|
151
|
+
get fallback() {
|
|
152
|
+
return createComponent(CommandDocsUsageExample, {
|
|
153
|
+
packageManager: "npm",
|
|
154
|
+
command
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
get children() {
|
|
158
|
+
return createComponent(For, {
|
|
159
|
+
each: usageExamples,
|
|
160
|
+
hardline: true,
|
|
161
|
+
get children() {
|
|
162
|
+
return __assignType((packageManager) => createComponent(CommandDocsUsageExample, {
|
|
163
|
+
packageManager,
|
|
164
|
+
command
|
|
165
|
+
}), [
|
|
166
|
+
"packageManager",
|
|
167
|
+
"",
|
|
168
|
+
"P\"2!\"/\""
|
|
169
|
+
]);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}),
|
|
174
|
+
createComponent(Spacing, {}),
|
|
175
|
+
createComponent(Heading, {
|
|
176
|
+
level: 2 + levelOffset,
|
|
177
|
+
children: "Options"
|
|
178
|
+
}),
|
|
179
|
+
createComponent(Spacing, {}),
|
|
180
|
+
memo(() => code`The following options are available for the ${command.name} command:`),
|
|
181
|
+
createComponent(Spacing, {}),
|
|
182
|
+
createComponent(CommandOptionsDocs, { command }),
|
|
183
|
+
createComponent(Spacing, {})
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
CommandDocs.__type = [
|
|
187
|
+
() => __ΩCommandDocsProps,
|
|
188
|
+
"props",
|
|
189
|
+
"CommandDocs",
|
|
190
|
+
"Generates the markdown documentation for a command.",
|
|
191
|
+
"Pn!2\"\"/#?$"
|
|
192
|
+
];
|
|
193
|
+
const __ΩCommandDocsFileProps = [
|
|
194
|
+
() => __ΩPartial,
|
|
195
|
+
"levelOffset",
|
|
196
|
+
0,
|
|
197
|
+
"The heading level offset to apply to the generated documentation.",
|
|
198
|
+
"CommandTree",
|
|
199
|
+
"command",
|
|
200
|
+
"The command to generate documentation for.",
|
|
201
|
+
"CommandDocsFileProps",
|
|
202
|
+
"P!o!\"'4\"8>#?$\"w%4&?'Mw(y"
|
|
203
|
+
];
|
|
204
|
+
/**
|
|
205
|
+
* Generates the markdown documentation file for a command.
|
|
206
|
+
*/
|
|
207
|
+
function CommandDocsFile(props) {
|
|
208
|
+
const { levelOffset = 0, command, frontMatter, ...rest } = props;
|
|
209
|
+
const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
|
|
210
|
+
const usageExamples = memo$1(() => [
|
|
211
|
+
"npm",
|
|
212
|
+
"yarn",
|
|
213
|
+
"pnpm",
|
|
214
|
+
"bun"
|
|
215
|
+
]);
|
|
216
|
+
return createComponent(CommandContext.Provider, {
|
|
217
|
+
value: command,
|
|
218
|
+
get children() {
|
|
219
|
+
return createComponent(MarkdownFile, mergeProps({ get path() {
|
|
220
|
+
return joinPaths(getDocsOutputPath(context), `${command.path}.md`);
|
|
221
|
+
} }, rest, {
|
|
222
|
+
get frontMatter() {
|
|
223
|
+
return defu(frontMatter ?? {}, {
|
|
224
|
+
id: command.id,
|
|
225
|
+
name: command.name,
|
|
226
|
+
path: command.path,
|
|
227
|
+
reference: command.docs,
|
|
228
|
+
virtual: command.virtual,
|
|
229
|
+
title: command.title,
|
|
230
|
+
description: command.description,
|
|
231
|
+
tags: command.tags
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
get children() {
|
|
235
|
+
return createComponent(CommandDocs, {
|
|
236
|
+
levelOffset,
|
|
237
|
+
command,
|
|
238
|
+
get usageExamples() {
|
|
239
|
+
return usageExamples();
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
CommandDocsFile.__type = [
|
|
248
|
+
() => __ΩCommandDocsFileProps,
|
|
249
|
+
"props",
|
|
250
|
+
"CommandDocsFile",
|
|
251
|
+
"Generates the markdown documentation file for a command.",
|
|
252
|
+
"Pn!2\"\"/#?$"
|
|
253
|
+
];
|
|
254
|
+
|
|
255
|
+
//#endregion
|
|
256
|
+
export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __ΩCommandOptionsDocsProps };
|
|
2
257
|
//# sourceMappingURL=docs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"docs.mjs","names":[],"sources":[],"mappings":""}
|