@shell-shock/core 0.17.21 → 0.17.23
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 +16 -7
- package/dist/api.cjs +4 -5
- package/dist/api.d.cts +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +2 -2
- package/dist/command-B6KYexlV.d.mts +308 -0
- package/dist/command-B6KYexlV.d.mts.map +1 -0
- package/dist/command-CtfR7hKM.d.cts +308 -0
- package/dist/command-CtfR7hKM.d.cts.map +1 -0
- package/dist/components/command-validation-logic.cjs +153 -216
- package/dist/components/command-validation-logic.d.cts +2 -1
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +2 -1
- package/dist/components/command-validation-logic.mjs +153 -214
- package/dist/components/docs.cjs +6 -364
- package/dist/components/docs.d.cts +2 -3
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +2 -3
- package/dist/components/docs.mjs +2 -356
- package/dist/components/exec-builtin.cjs +63 -100
- 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.mjs +7 -41
- package/dist/components/helpers.cjs +2 -52
- package/dist/components/helpers.d.cts +2 -1
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +2 -1
- package/dist/components/helpers.mjs +2 -50
- package/dist/components/index.cjs +7 -23
- package/dist/components/index.mjs +9 -9
- package/dist/components/options-parser-logic.cjs +198 -420
- package/dist/components/options-parser-logic.d.cts +2 -5
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +2 -5
- package/dist/components/options-parser-logic.mjs +192 -407
- package/dist/components/state-builtin.cjs +106 -164
- package/dist/components/state-builtin.d.cts +1 -2
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +1 -2
- package/dist/components/state-builtin.mjs +12 -68
- package/dist/components/usage.cjs +4 -48
- 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.mjs +4 -46
- package/dist/components/utils-builtin.cjs +77 -144
- package/dist/components/utils-builtin.d.cts +1 -2
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +1 -2
- package/dist/components/utils-builtin.mjs +9 -74
- package/dist/config-BIF9mEz0.d.cts +157 -0
- package/dist/config-BIF9mEz0.d.cts.map +1 -0
- package/dist/config-CnNYdfsL.d.mts +157 -0
- package/dist/config-CnNYdfsL.d.mts.map +1 -0
- package/dist/config.cjs +24 -58
- package/dist/config.d.cts +1 -2
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +23 -55
- package/dist/{plugin-utils/context-helpers.mjs → context-helpers-D3EJxwbq.mjs} +5 -83
- package/dist/context-helpers-D3EJxwbq.mjs.map +1 -0
- package/dist/{plugin-utils/context-helpers.cjs → context-helpers-_wUuFRB8.cjs} +63 -92
- package/dist/contexts/command.cjs +3 -9
- package/dist/contexts/command.d.cts +1 -2
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts +1 -2
- package/dist/contexts/command.mjs +2 -7
- package/dist/contexts/index.cjs +19 -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 +7 -30
- package/dist/contexts/options.d.cts +1 -2
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -2
- package/dist/contexts/options.mjs +7 -27
- package/dist/contexts/power-plant.cjs +19 -0
- package/dist/contexts/power-plant.d.cts +2 -0
- package/dist/contexts/power-plant.d.mts +2 -0
- package/dist/contexts/power-plant.mjs +5 -0
- package/dist/docs-C6ZvsVMu.cjs +278 -0
- package/dist/docs-CGQ2HtEY.mjs +249 -0
- package/dist/docs-CGQ2HtEY.mjs.map +1 -0
- package/dist/engine.cjs +5 -39
- package/dist/engine.d.cts +1 -2
- package/dist/engine.d.cts.map +1 -1
- package/dist/engine.d.mts +1 -2
- package/dist/engine.mjs +4 -37
- package/dist/generator.cjs +68 -0
- package/dist/generator.d.cts +15 -0
- package/dist/generator.d.cts.map +1 -0
- package/dist/generator.d.mts +15 -0
- package/dist/generator.d.mts.map +1 -0
- package/dist/generator.mjs +66 -0
- package/dist/generator.mjs.map +1 -0
- package/dist/{helpers/get-framework.cjs → get-framework-CxZc2krd.cjs} +7 -8
- package/dist/{helpers/get-framework.mjs → get-framework-Dlqz2hVZ.mjs} +3 -8
- package/dist/get-framework-Dlqz2hVZ.mjs.map +1 -0
- package/dist/helpers/power-plant.cjs +102 -0
- package/dist/helpers/power-plant.d.cts +61 -0
- package/dist/helpers/power-plant.d.cts.map +1 -0
- package/dist/helpers/power-plant.d.mts +61 -0
- package/dist/helpers/power-plant.d.mts.map +1 -0
- package/dist/helpers/power-plant.mjs +99 -0
- package/dist/helpers/power-plant.mjs.map +1 -0
- package/dist/index-D4klH_pj.d.mts +2 -0
- package/dist/index-DYOBadKY.d.cts +2 -0
- package/dist/index.cjs +1 -37
- package/dist/index.d.cts +4 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +0 -35
- package/dist/package-B7Vu265G.mjs +6 -0
- package/dist/package-B7Vu265G.mjs.map +1 -0
- package/dist/{package.cjs → package-BLC4qc8t.cjs} +2 -4
- package/dist/plugin-B-hM2twc.mjs +1458 -0
- package/dist/plugin-B-hM2twc.mjs.map +1 -0
- package/dist/plugin-Bhfq0DMC.cjs +1490 -0
- package/dist/plugin-utils/index.cjs +359 -26
- package/dist/plugin-utils/index.d.cts +273 -9
- package/dist/plugin-utils/index.d.cts.map +1 -0
- package/dist/plugin-utils/index.d.mts +273 -9
- package/dist/plugin-utils/index.d.mts.map +1 -0
- package/dist/plugin-utils/index.mjs +346 -10
- package/dist/plugin-utils/index.mjs.map +1 -0
- package/dist/plugin.cjs +3 -496
- package/dist/plugin.d.cts +1 -3
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +1 -3
- package/dist/plugin.mjs +2 -491
- package/dist/power-plant-LgxcvlMN.d.cts +4 -0
- package/dist/power-plant-LgxcvlMN.d.mts +4 -0
- package/dist/reflect-CSiffeL9.cjs +27 -0
- package/dist/reflect-DXKSFgvS.mjs +23 -0
- package/dist/reflect-DXKSFgvS.mjs.map +1 -0
- package/dist/schemas/env.cjs +91 -0
- package/dist/schemas/env.d.cts +145 -0
- package/dist/schemas/env.d.cts.map +1 -0
- package/dist/schemas/env.d.mts +145 -0
- package/dist/{types → schemas}/env.d.mts.map +1 -1
- package/dist/schemas/env.mjs +91 -0
- package/dist/schemas/index.cjs +4 -0
- package/dist/schemas/index.d.cts +2 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/types/command.cjs +0 -402
- package/dist/types/command.d.cts +2 -309
- package/dist/types/command.d.mts +2 -309
- package/dist/types/command.mjs +1 -368
- package/dist/types/config.cjs +0 -175
- package/dist/types/config.d.cts +2 -126
- package/dist/types/config.d.mts +2 -126
- package/dist/types/config.mjs +1 -164
- package/dist/types/context.cjs +0 -45
- package/dist/types/context.d.cts +2 -31
- package/dist/types/context.d.mts +2 -31
- package/dist/types/context.mjs +1 -41
- package/dist/types/index.cjs +3 -53
- package/dist/types/index.d.cts +4 -5
- package/dist/types/index.d.mts +4 -5
- package/dist/types/index.mjs +4 -5
- package/package.json +106 -42
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/api.cjs.map +0 -1
- package/dist/components/command-validation-logic.cjs.map +0 -1
- package/dist/components/docs.cjs.map +0 -1
- package/dist/components/docs.mjs.map +0 -1
- package/dist/components/exec-builtin.cjs.map +0 -1
- package/dist/components/helpers.cjs.map +0 -1
- package/dist/components/options-parser-logic.cjs.map +0 -1
- package/dist/components/state-builtin.cjs.map +0 -1
- package/dist/components/usage.cjs.map +0 -1
- package/dist/components/utils-builtin.cjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/contexts/command.cjs.map +0 -1
- package/dist/contexts/options.cjs.map +0 -1
- package/dist/engine.cjs.map +0 -1
- package/dist/helpers/automd.cjs +0 -193
- package/dist/helpers/automd.cjs.map +0 -1
- package/dist/helpers/automd.mjs +0 -190
- package/dist/helpers/automd.mjs.map +0 -1
- package/dist/helpers/docs-helpers.cjs +0 -24
- package/dist/helpers/docs-helpers.cjs.map +0 -1
- package/dist/helpers/docs-helpers.mjs +0 -24
- package/dist/helpers/docs-helpers.mjs.map +0 -1
- package/dist/helpers/get-framework.cjs.map +0 -1
- package/dist/helpers/get-framework.mjs.map +0 -1
- package/dist/helpers/paths.cjs +0 -137
- package/dist/helpers/paths.cjs.map +0 -1
- package/dist/helpers/paths.mjs +0 -134
- package/dist/helpers/paths.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -114
- package/dist/helpers/persistence.cjs.map +0 -1
- package/dist/helpers/persistence.mjs +0 -113
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/update-package-json.cjs +0 -65
- package/dist/helpers/update-package-json.cjs.map +0 -1
- package/dist/helpers/update-package-json.mjs +0 -64
- package/dist/helpers/update-package-json.mjs.map +0 -1
- package/dist/helpers/utilities.cjs +0 -95
- package/dist/helpers/utilities.cjs.map +0 -1
- package/dist/helpers/utilities.mjs +0 -94
- package/dist/helpers/utilities.mjs.map +0 -1
- package/dist/helpers/validations.cjs +0 -71
- package/dist/helpers/validations.cjs.map +0 -1
- package/dist/helpers/validations.mjs +0 -70
- package/dist/helpers/validations.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/package.cjs.map +0 -1
- package/dist/package.mjs +0 -6
- package/dist/package.mjs.map +0 -1
- package/dist/plugin-utils/compute-bin.cjs +0 -49
- package/dist/plugin-utils/compute-bin.cjs.map +0 -1
- package/dist/plugin-utils/compute-bin.d.cts +0 -13
- package/dist/plugin-utils/compute-bin.d.cts.map +0 -1
- package/dist/plugin-utils/compute-bin.d.mts +0 -13
- package/dist/plugin-utils/compute-bin.d.mts.map +0 -1
- package/dist/plugin-utils/compute-bin.mjs +0 -49
- package/dist/plugin-utils/compute-bin.mjs.map +0 -1
- package/dist/plugin-utils/context-helpers.cjs.map +0 -1
- package/dist/plugin-utils/context-helpers.d.cts +0 -106
- package/dist/plugin-utils/context-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/context-helpers.d.mts +0 -106
- package/dist/plugin-utils/context-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/context-helpers.mjs.map +0 -1
- package/dist/plugin-utils/deepkit.cjs +0 -70
- package/dist/plugin-utils/deepkit.cjs.map +0 -1
- package/dist/plugin-utils/deepkit.d.cts +0 -23
- package/dist/plugin-utils/deepkit.d.cts.map +0 -1
- package/dist/plugin-utils/deepkit.d.mts +0 -23
- package/dist/plugin-utils/deepkit.d.mts.map +0 -1
- package/dist/plugin-utils/deepkit.mjs +0 -69
- package/dist/plugin-utils/deepkit.mjs.map +0 -1
- package/dist/plugin-utils/description-helpers.cjs +0 -112
- package/dist/plugin-utils/description-helpers.cjs.map +0 -1
- package/dist/plugin-utils/description-helpers.d.cts +0 -44
- package/dist/plugin-utils/description-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/description-helpers.d.mts +0 -44
- package/dist/plugin-utils/description-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/description-helpers.mjs +0 -108
- package/dist/plugin-utils/description-helpers.mjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.cjs +0 -118
- package/dist/plugin-utils/get-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.cts +0 -36
- package/dist/plugin-utils/get-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.mts +0 -36
- package/dist/plugin-utils/get-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/get-command-tree.mjs +0 -115
- package/dist/plugin-utils/get-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/reflect.cjs +0 -54
- package/dist/plugin-utils/reflect.cjs.map +0 -1
- package/dist/plugin-utils/reflect.d.cts +0 -14
- package/dist/plugin-utils/reflect.d.cts.map +0 -1
- package/dist/plugin-utils/reflect.d.mts +0 -14
- package/dist/plugin-utils/reflect.d.mts.map +0 -1
- package/dist/plugin-utils/reflect.mjs +0 -53
- package/dist/plugin-utils/reflect.mjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +0 -65
- package/dist/plugin-utils/traverse-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.cts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +0 -63
- package/dist/plugin-utils/traverse-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/type-checks.cjs +0 -222
- package/dist/plugin-utils/type-checks.cjs.map +0 -1
- package/dist/plugin-utils/type-checks.d.cts +0 -41
- package/dist/plugin-utils/type-checks.d.cts.map +0 -1
- package/dist/plugin-utils/type-checks.d.mts +0 -41
- package/dist/plugin-utils/type-checks.d.mts.map +0 -1
- package/dist/plugin-utils/type-checks.mjs +0 -218
- package/dist/plugin-utils/type-checks.mjs.map +0 -1
- package/dist/plugin.cjs.map +0 -1
- package/dist/plugin.mjs.map +0 -1
- package/dist/resolver/deepkit.cjs +0 -110
- package/dist/resolver/deepkit.cjs.map +0 -1
- package/dist/resolver/deepkit.mjs +0 -109
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/helpers.cjs +0 -184
- package/dist/resolver/helpers.cjs.map +0 -1
- package/dist/resolver/helpers.mjs +0 -180
- package/dist/resolver/helpers.mjs.map +0 -1
- package/dist/resolver/resolve.cjs +0 -473
- package/dist/resolver/resolve.cjs.map +0 -1
- package/dist/resolver/resolve.mjs +0 -473
- package/dist/resolver/resolve.mjs.map +0 -1
- package/dist/types/command.cjs.map +0 -1
- package/dist/types/command.d.cts.map +0 -1
- package/dist/types/command.d.mts.map +0 -1
- package/dist/types/command.mjs.map +0 -1
- package/dist/types/config.cjs.map +0 -1
- package/dist/types/config.d.cts.map +0 -1
- package/dist/types/config.d.mts.map +0 -1
- package/dist/types/config.mjs.map +0 -1
- package/dist/types/context.cjs.map +0 -1
- package/dist/types/context.d.cts.map +0 -1
- package/dist/types/context.d.mts.map +0 -1
- package/dist/types/context.mjs.map +0 -1
- package/dist/types/env.cjs +0 -53
- package/dist/types/env.cjs.map +0 -1
- package/dist/types/env.d.cts +0 -71
- package/dist/types/env.d.cts.map +0 -1
- package/dist/types/env.d.mts +0 -71
- package/dist/types/env.mjs +0 -51
- /package/dist/{types → schemas}/env.mjs.map +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CommandOption } from "../
|
|
1
|
+
import { _ as CommandOption } from "../command-CtfR7hKM.cjs";
|
|
2
2
|
import { ComponentContext } from "@alloy-js/core";
|
|
3
|
-
|
|
4
3
|
//#region src/contexts/options.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The reflection parameter context used in template rendering.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.cts","names":[],"sources":["../../src/contexts/options.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"options.d.cts","names":[],"sources":["../../src/contexts/options.ts"],"mappings":";;;;;;cA4Ba,wBAAwB;;;;;;;;;iBAWrB;iBAIA,gBAAgB,SAAS,kBAAe,eAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CommandOption } from "../
|
|
1
|
+
import { _ as CommandOption } from "../command-B6KYexlV.mjs";
|
|
2
2
|
import { ComponentContext } from "@alloy-js/core";
|
|
3
|
-
|
|
4
3
|
//#region src/contexts/options.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The reflection parameter context used in template rendering.
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { createNamedContext, useContext } from "@alloy-js/core";
|
|
2
2
|
import { camelCase } from "@stryke/string-format/camel-case";
|
|
3
3
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
4
|
-
import defu
|
|
4
|
+
import { defu } from "defu";
|
|
5
5
|
|
|
6
6
|
//#region src/contexts/options.ts
|
|
7
|
-
function __assignType(fn, args) {
|
|
8
|
-
fn.__type = args;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
7
|
/**
|
|
12
8
|
* The reflection parameter context used in template rendering.
|
|
13
9
|
*/
|
|
14
|
-
const ExistingOptionsContext =
|
|
10
|
+
const ExistingOptionsContext = createNamedContext("ExistingOptions", []);
|
|
15
11
|
/**
|
|
16
12
|
* Hook to access the ExistingOptions context.
|
|
17
13
|
*
|
|
@@ -21,17 +17,12 @@ const ExistingOptionsContext = (createNamedContext.Ω = [["&F"]], createNamedCon
|
|
|
21
17
|
* @returns A reactive version of the current reflection.
|
|
22
18
|
*/
|
|
23
19
|
function useExistingOptions() {
|
|
24
|
-
return useContext
|
|
20
|
+
return useContext(ExistingOptionsContext);
|
|
25
21
|
}
|
|
26
|
-
useExistingOptions.__type = [
|
|
27
|
-
"useExistingOptions",
|
|
28
|
-
"Hook to access the ExistingOptions context.",
|
|
29
|
-
"P\"/!?\""
|
|
30
|
-
];
|
|
31
22
|
function computedOptions(options) {
|
|
32
|
-
return options.reduce(
|
|
33
|
-
ret[camelCase(option.name)] ??= defu
|
|
34
|
-
if (option.type === "boolean" && !option.variadic && option.isNegativeOf) ret[camelCase(option.isNegativeOf)] = defu
|
|
23
|
+
return options.reduce((ret, option) => {
|
|
24
|
+
ret[camelCase(option.name)] ??= defu({ name: camelCase(option.name) }, ret[option.name] ?? {}, option);
|
|
25
|
+
if (option.type === "boolean" && !option.variadic && option.isNegativeOf) ret[camelCase(option.isNegativeOf)] = defu({ name: camelCase(option.isNegativeOf) }, ret[option.isNegativeOf] ?? {}, {
|
|
35
26
|
...option,
|
|
36
27
|
env: isSetString(option.env) ? `NO_${option.env}` : false,
|
|
37
28
|
description: `${option.description.replace(/\.+$/, "")}. This property is the negative form of ${option.name}.`,
|
|
@@ -39,19 +30,8 @@ function computedOptions(options) {
|
|
|
39
30
|
default: !option.default
|
|
40
31
|
});
|
|
41
32
|
return ret;
|
|
42
|
-
},
|
|
43
|
-
"ret",
|
|
44
|
-
"option",
|
|
45
|
-
"",
|
|
46
|
-
"P\"2!\"2\"\"/#"
|
|
47
|
-
]), {});
|
|
33
|
+
}, {});
|
|
48
34
|
}
|
|
49
|
-
computedOptions.__type = [
|
|
50
|
-
"CommandOption",
|
|
51
|
-
"options",
|
|
52
|
-
"computedOptions",
|
|
53
|
-
"P\"w!F2\"\"/#"
|
|
54
|
-
];
|
|
55
35
|
|
|
56
36
|
//#endregion
|
|
57
37
|
export { ExistingOptionsContext, computedOptions, useExistingOptions };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
3
|
+
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
4
|
+
let _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, 'BuiltinFile', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'EntryFile', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _powerlines_plugin_alloy_typescript_components_entry_file.EntryFile;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.usePowerlines = _powerlines_plugin_alloy_core_contexts_context.usePowerlines;
|
|
19
|
+
exports.usePowerlinesSafe = _powerlines_plugin_alloy_core_contexts_context.usePowerlinesSafe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as usePowerlines, i as EntryFileProps, n as BuiltinFileProps, o as usePowerlinesSafe, r as EntryFile, t as BuiltinFile } from "../power-plant-LgxcvlMN.cjs";
|
|
2
|
+
export { BuiltinFile, type BuiltinFileProps, EntryFile, type EntryFileProps, usePowerlines, usePowerlinesSafe };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as usePowerlines, i as EntryFileProps, n as BuiltinFileProps, o as usePowerlinesSafe, r as EntryFile, t as BuiltinFile } from "../power-plant-LgxcvlMN.mjs";
|
|
2
|
+
export { BuiltinFile, type BuiltinFileProps, EntryFile, type EntryFileProps, usePowerlines, usePowerlinesSafe };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { usePowerlines, usePowerlinesSafe } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
2
|
+
import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
+
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
4
|
+
|
|
5
|
+
export { BuiltinFile, EntryFile, usePowerlines, usePowerlinesSafe };
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
const require_contexts_command = require('./contexts/command.cjs');
|
|
2
|
+
require('./contexts/power-plant.cjs');
|
|
3
|
+
const require_context_helpers = require('./context-helpers-_wUuFRB8.cjs');
|
|
4
|
+
const require_reflect = require('./reflect-CSiffeL9.cjs');
|
|
5
|
+
const require_components_usage = require('./components/usage.cjs');
|
|
6
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
+
let defu = require("defu");
|
|
9
|
+
let _alloy_js_markdown = require("@alloy-js/markdown");
|
|
10
|
+
let _power_plant_alloy_js_core_components_spacing = require("@power-plant/alloy-js/core/components/spacing");
|
|
11
|
+
let _power_plant_alloy_js_markdown_components_markdown_file = require("@power-plant/alloy-js/markdown/components/markdown-file");
|
|
12
|
+
let _power_plant_alloy_js_markdown_components_markdown_table = require("@power-plant/alloy-js/markdown/components/markdown-table");
|
|
13
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
14
|
+
let _stryke_string_format_list = require("@stryke/string-format/list");
|
|
15
|
+
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
16
|
+
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
17
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
18
|
+
|
|
19
|
+
//#region src/helpers/docs-helpers.ts
|
|
20
|
+
/**
|
|
21
|
+
* Gets the output path for the generated documentation.
|
|
22
|
+
*
|
|
23
|
+
* @param context - The Shell Shock context.
|
|
24
|
+
* @returns The output path for the generated documentation.
|
|
25
|
+
*/
|
|
26
|
+
function getDocsOutputPath(context) {
|
|
27
|
+
return (0, _stryke_path_join.joinPaths)((0, powerlines_plugin_utils.getDocsOutputPath)(context.config.root), "cli");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/docs.tsx
|
|
32
|
+
/**
|
|
33
|
+
* Generates the arguments markdown documentation for a command.
|
|
34
|
+
*/
|
|
35
|
+
function CommandArgumentDocs(props) {
|
|
36
|
+
const { command } = props;
|
|
37
|
+
if (Object.keys(command.options).length === 0) return _alloy_js_core.code`This command does not have any arguments.`;
|
|
38
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
39
|
+
return require_reflect.sortOptions(Object.values(command.options)).reduce((ret, option) => {
|
|
40
|
+
ret.push({
|
|
41
|
+
name: option.name.trim(),
|
|
42
|
+
description: option.description.trim(),
|
|
43
|
+
defaultValue: (0, _stryke_type_checks_is_undefined.isUndefined)(option.default) ? "" : JSON.stringify(option.default),
|
|
44
|
+
required: !option.required || option.default ? "" : "✔"
|
|
45
|
+
});
|
|
46
|
+
return ret;
|
|
47
|
+
}, []);
|
|
48
|
+
} });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Generates the options markdown documentation for a command.
|
|
52
|
+
*/
|
|
53
|
+
function CommandOptionsDocs(props) {
|
|
54
|
+
const { command } = props;
|
|
55
|
+
if (Object.keys(command.options).length === 0) return _alloy_js_core.code`This command does not have any options.`;
|
|
56
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
57
|
+
return require_reflect.sortOptions(Object.values(command.options)).reduce((ret, option) => {
|
|
58
|
+
ret.push({
|
|
59
|
+
name: option.name.trim(),
|
|
60
|
+
description: option.description.trim(),
|
|
61
|
+
defaultValue: (0, _stryke_type_checks_is_undefined.isUndefined)(option.default) ? "" : JSON.stringify(option.default),
|
|
62
|
+
required: !option.required || option.default ? "" : "✔"
|
|
63
|
+
});
|
|
64
|
+
return ret;
|
|
65
|
+
}, []);
|
|
66
|
+
} });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Generates the markdown documentation for a command.
|
|
70
|
+
*/
|
|
71
|
+
function CommandDocsUsageExample(props) {
|
|
72
|
+
const { packageManager = "npm", command, expand = false } = props;
|
|
73
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
74
|
+
return [
|
|
75
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
76
|
+
when: expand,
|
|
77
|
+
fallback: _alloy_js_core.code`\`\`\`sh `,
|
|
78
|
+
get children() {
|
|
79
|
+
return [
|
|
80
|
+
_alloy_js_core.code`<details>
|
|
81
|
+
<summary>Using ${packageManager}:</summary>`,
|
|
82
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
83
|
+
_alloy_js_core.code`\`\`\`sh `
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
87
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
88
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_usage.Usage, {
|
|
89
|
+
command,
|
|
90
|
+
get bin() {
|
|
91
|
+
return require_context_helpers.getAppBin(context);
|
|
92
|
+
},
|
|
93
|
+
packageManager
|
|
94
|
+
}),
|
|
95
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
96
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
97
|
+
when: expand,
|
|
98
|
+
fallback: _alloy_js_core.code`\`\`\` `,
|
|
99
|
+
get children() {
|
|
100
|
+
return [
|
|
101
|
+
_alloy_js_core.code`\`\`\``,
|
|
102
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
103
|
+
_alloy_js_core.code`</details>`
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Generates the markdown documentation for a command.
|
|
111
|
+
*/
|
|
112
|
+
function CommandDocs(props) {
|
|
113
|
+
const { levelOffset = 0, command, usageExamples } = props;
|
|
114
|
+
return [
|
|
115
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
116
|
+
level: 1 + levelOffset,
|
|
117
|
+
get children() {
|
|
118
|
+
return `${command.title}${command.tags.includes("deprecated") ? " (Deprecated)" : command.tags.includes("beta") ? " (Beta)" : command.tags.includes("alpha") ? " (Alpha)" : command.tags.includes("experimental") ? " (Experimental)" : ""}`;
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
122
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`${command.description}`),
|
|
123
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
124
|
+
get when() {
|
|
125
|
+
return command.alias && command.alias.length > 0;
|
|
126
|
+
},
|
|
127
|
+
get children() {
|
|
128
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
129
|
+
get when() {
|
|
130
|
+
return command.alias.length > 1;
|
|
131
|
+
},
|
|
132
|
+
get fallback() {
|
|
133
|
+
return _alloy_js_core.code`The \`${command.name}\` command can also be invoked using the alias \`${command.alias[0]}\`.`;
|
|
134
|
+
},
|
|
135
|
+
get children() {
|
|
136
|
+
return _alloy_js_core.code`The \`${command.name}\` command can also be invoked using the following aliases: ${(0, _stryke_string_format_list.list)(command.alias.map((alias) => `\`${alias}\``), { conjunction: "or" })}.`;
|
|
137
|
+
}
|
|
138
|
+
})];
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
142
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
143
|
+
level: 2 + levelOffset,
|
|
144
|
+
children: "Usage"
|
|
145
|
+
}),
|
|
146
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
147
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The \`${command.name}\` command can be executed using the following syntax: `),
|
|
148
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
149
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
150
|
+
get when() {
|
|
151
|
+
return usageExamples && usageExamples.length > 0;
|
|
152
|
+
},
|
|
153
|
+
get fallback() {
|
|
154
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
|
|
155
|
+
packageManager: "npm",
|
|
156
|
+
command
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
get children() {
|
|
160
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
161
|
+
each: usageExamples,
|
|
162
|
+
doubleHardline: true,
|
|
163
|
+
children: (packageManager) => (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
|
|
164
|
+
packageManager,
|
|
165
|
+
command,
|
|
166
|
+
get expand() {
|
|
167
|
+
return usageExamples && usageExamples.length > 1;
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}),
|
|
173
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
174
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
175
|
+
get when() {
|
|
176
|
+
return command.args.length > 0;
|
|
177
|
+
},
|
|
178
|
+
get children() {
|
|
179
|
+
return [
|
|
180
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
181
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
182
|
+
level: 2 + levelOffset,
|
|
183
|
+
children: "Positional Arguments"
|
|
184
|
+
}),
|
|
185
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
186
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following positional arguments are available for the \`${command.name}\` command:`),
|
|
187
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
188
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandArgumentDocs, { command }),
|
|
189
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {})
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
}),
|
|
193
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
194
|
+
level: 2 + levelOffset,
|
|
195
|
+
children: "Options"
|
|
196
|
+
}),
|
|
197
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
198
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following options are available for the \`${command.name}\` command:`),
|
|
199
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
200
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
|
|
201
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {})
|
|
202
|
+
];
|
|
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 = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
210
|
+
const usageExamples = (0, _alloy_js_core.memo)(() => [
|
|
211
|
+
"npm",
|
|
212
|
+
"yarn",
|
|
213
|
+
"pnpm",
|
|
214
|
+
"bun"
|
|
215
|
+
]);
|
|
216
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_contexts_command.CommandContext.Provider, {
|
|
217
|
+
value: command,
|
|
218
|
+
get children() {
|
|
219
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_markdown_components_markdown_file.MarkdownFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get path() {
|
|
220
|
+
return (0, _stryke_path_join.joinPaths)(getDocsOutputPath(context), `${command.path}.md`);
|
|
221
|
+
} }, rest, {
|
|
222
|
+
get frontMatter() {
|
|
223
|
+
return (0, defu.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 (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocs, {
|
|
236
|
+
levelOffset,
|
|
237
|
+
command,
|
|
238
|
+
get usageExamples() {
|
|
239
|
+
return usageExamples();
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//#endregion
|
|
249
|
+
Object.defineProperty(exports, 'CommandArgumentDocs', {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function () {
|
|
252
|
+
return CommandArgumentDocs;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(exports, 'CommandDocs', {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function () {
|
|
258
|
+
return CommandDocs;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
Object.defineProperty(exports, 'CommandDocsFile', {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function () {
|
|
264
|
+
return CommandDocsFile;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
Object.defineProperty(exports, 'CommandDocsUsageExample', {
|
|
268
|
+
enumerable: true,
|
|
269
|
+
get: function () {
|
|
270
|
+
return CommandDocsUsageExample;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
Object.defineProperty(exports, 'CommandOptionsDocs', {
|
|
274
|
+
enumerable: true,
|
|
275
|
+
get: function () {
|
|
276
|
+
return CommandOptionsDocs;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { CommandContext } from "./contexts/command.mjs";
|
|
2
|
+
import { usePowerlines } from "./contexts/power-plant.mjs";
|
|
3
|
+
import { t as getAppBin } from "./context-helpers-D3EJxwbq.mjs";
|
|
4
|
+
import { t as sortOptions } from "./reflect-DXKSFgvS.mjs";
|
|
5
|
+
import { Usage } from "./components/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 "@power-plant/alloy-js/core/components/spacing";
|
|
11
|
+
import { MarkdownFile } from "@power-plant/alloy-js/markdown/components/markdown-file";
|
|
12
|
+
import { MarkdownTable } from "@power-plant/alloy-js/markdown/components/markdown-table";
|
|
13
|
+
import { joinPaths } from "@stryke/path/join";
|
|
14
|
+
import { list } from "@stryke/string-format/list";
|
|
15
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
16
|
+
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
17
|
+
|
|
18
|
+
//#region src/helpers/docs-helpers.ts
|
|
19
|
+
/**
|
|
20
|
+
* Gets the output path for the generated documentation.
|
|
21
|
+
*
|
|
22
|
+
* @param context - The Shell Shock context.
|
|
23
|
+
* @returns The output path for the generated documentation.
|
|
24
|
+
*/
|
|
25
|
+
function getDocsOutputPath$1(context) {
|
|
26
|
+
return joinPaths(getDocsOutputPath(context.config.root), "cli");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/docs.tsx
|
|
31
|
+
/**
|
|
32
|
+
* Generates the arguments markdown documentation for a command.
|
|
33
|
+
*/
|
|
34
|
+
function CommandArgumentDocs(props) {
|
|
35
|
+
const { command } = props;
|
|
36
|
+
if (Object.keys(command.options).length === 0) return code`This command does not have any arguments.`;
|
|
37
|
+
return createComponent(MarkdownTable, { get data() {
|
|
38
|
+
return sortOptions(Object.values(command.options)).reduce((ret, option) => {
|
|
39
|
+
ret.push({
|
|
40
|
+
name: option.name.trim(),
|
|
41
|
+
description: option.description.trim(),
|
|
42
|
+
defaultValue: isUndefined(option.default) ? "" : JSON.stringify(option.default),
|
|
43
|
+
required: !option.required || option.default ? "" : "✔"
|
|
44
|
+
});
|
|
45
|
+
return ret;
|
|
46
|
+
}, []);
|
|
47
|
+
} });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generates the options markdown documentation for a command.
|
|
51
|
+
*/
|
|
52
|
+
function CommandOptionsDocs(props) {
|
|
53
|
+
const { command } = props;
|
|
54
|
+
if (Object.keys(command.options).length === 0) return code`This command does not have any options.`;
|
|
55
|
+
return createComponent(MarkdownTable, { get data() {
|
|
56
|
+
return sortOptions(Object.values(command.options)).reduce((ret, option) => {
|
|
57
|
+
ret.push({
|
|
58
|
+
name: option.name.trim(),
|
|
59
|
+
description: option.description.trim(),
|
|
60
|
+
defaultValue: isUndefined(option.default) ? "" : JSON.stringify(option.default),
|
|
61
|
+
required: !option.required || option.default ? "" : "✔"
|
|
62
|
+
});
|
|
63
|
+
return ret;
|
|
64
|
+
}, []);
|
|
65
|
+
} });
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Generates the markdown documentation for a command.
|
|
69
|
+
*/
|
|
70
|
+
function CommandDocsUsageExample(props) {
|
|
71
|
+
const { packageManager = "npm", command, expand = false } = props;
|
|
72
|
+
const context = usePowerlines();
|
|
73
|
+
return [
|
|
74
|
+
createComponent(Show, {
|
|
75
|
+
when: expand,
|
|
76
|
+
fallback: code`\`\`\`sh `,
|
|
77
|
+
get children() {
|
|
78
|
+
return [
|
|
79
|
+
code`<details>
|
|
80
|
+
<summary>Using ${packageManager}:</summary>`,
|
|
81
|
+
createComponent(Spacing, {}),
|
|
82
|
+
code`\`\`\`sh `
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
createIntrinsic("hbr", {}),
|
|
87
|
+
createComponent(Usage, {
|
|
88
|
+
command,
|
|
89
|
+
get bin() {
|
|
90
|
+
return getAppBin(context);
|
|
91
|
+
},
|
|
92
|
+
packageManager
|
|
93
|
+
}),
|
|
94
|
+
createIntrinsic("hbr", {}),
|
|
95
|
+
createComponent(Show, {
|
|
96
|
+
when: expand,
|
|
97
|
+
fallback: code`\`\`\` `,
|
|
98
|
+
get children() {
|
|
99
|
+
return [
|
|
100
|
+
code`\`\`\``,
|
|
101
|
+
createComponent(Spacing, {}),
|
|
102
|
+
code`</details>`
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Generates the markdown documentation for a command.
|
|
110
|
+
*/
|
|
111
|
+
function CommandDocs(props) {
|
|
112
|
+
const { levelOffset = 0, command, usageExamples } = props;
|
|
113
|
+
return [
|
|
114
|
+
createComponent(Heading, {
|
|
115
|
+
level: 1 + levelOffset,
|
|
116
|
+
get children() {
|
|
117
|
+
return `${command.title}${command.tags.includes("deprecated") ? " (Deprecated)" : command.tags.includes("beta") ? " (Beta)" : command.tags.includes("alpha") ? " (Alpha)" : command.tags.includes("experimental") ? " (Experimental)" : ""}`;
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
createComponent(Spacing, {}),
|
|
121
|
+
memo(() => code`${command.description}`),
|
|
122
|
+
createComponent(Show, {
|
|
123
|
+
get when() {
|
|
124
|
+
return command.alias && command.alias.length > 0;
|
|
125
|
+
},
|
|
126
|
+
get children() {
|
|
127
|
+
return [createComponent(Spacing, {}), createComponent(Show, {
|
|
128
|
+
get when() {
|
|
129
|
+
return command.alias.length > 1;
|
|
130
|
+
},
|
|
131
|
+
get fallback() {
|
|
132
|
+
return code`The \`${command.name}\` command can also be invoked using the alias \`${command.alias[0]}\`.`;
|
|
133
|
+
},
|
|
134
|
+
get children() {
|
|
135
|
+
return code`The \`${command.name}\` command can also be invoked using the following aliases: ${list(command.alias.map((alias) => `\`${alias}\``), { conjunction: "or" })}.`;
|
|
136
|
+
}
|
|
137
|
+
})];
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
createComponent(Spacing, {}),
|
|
141
|
+
createComponent(Heading, {
|
|
142
|
+
level: 2 + levelOffset,
|
|
143
|
+
children: "Usage"
|
|
144
|
+
}),
|
|
145
|
+
createComponent(Spacing, {}),
|
|
146
|
+
memo(() => code`The \`${command.name}\` command can be executed using the following syntax: `),
|
|
147
|
+
createComponent(Spacing, {}),
|
|
148
|
+
createComponent(Show, {
|
|
149
|
+
get when() {
|
|
150
|
+
return usageExamples && usageExamples.length > 0;
|
|
151
|
+
},
|
|
152
|
+
get fallback() {
|
|
153
|
+
return createComponent(CommandDocsUsageExample, {
|
|
154
|
+
packageManager: "npm",
|
|
155
|
+
command
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
return createComponent(For, {
|
|
160
|
+
each: usageExamples,
|
|
161
|
+
doubleHardline: true,
|
|
162
|
+
children: (packageManager) => createComponent(CommandDocsUsageExample, {
|
|
163
|
+
packageManager,
|
|
164
|
+
command,
|
|
165
|
+
get expand() {
|
|
166
|
+
return usageExamples && usageExamples.length > 1;
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
createComponent(Spacing, {}),
|
|
173
|
+
createComponent(Show, {
|
|
174
|
+
get when() {
|
|
175
|
+
return command.args.length > 0;
|
|
176
|
+
},
|
|
177
|
+
get children() {
|
|
178
|
+
return [
|
|
179
|
+
createComponent(Spacing, {}),
|
|
180
|
+
createComponent(Heading, {
|
|
181
|
+
level: 2 + levelOffset,
|
|
182
|
+
children: "Positional Arguments"
|
|
183
|
+
}),
|
|
184
|
+
createComponent(Spacing, {}),
|
|
185
|
+
memo(() => code`The following positional arguments are available for the \`${command.name}\` command:`),
|
|
186
|
+
createComponent(Spacing, {}),
|
|
187
|
+
createComponent(CommandArgumentDocs, { command }),
|
|
188
|
+
createComponent(Spacing, {})
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
createComponent(Heading, {
|
|
193
|
+
level: 2 + levelOffset,
|
|
194
|
+
children: "Options"
|
|
195
|
+
}),
|
|
196
|
+
createComponent(Spacing, {}),
|
|
197
|
+
memo(() => code`The following options are available for the \`${command.name}\` command:`),
|
|
198
|
+
createComponent(Spacing, {}),
|
|
199
|
+
createComponent(CommandOptionsDocs, { command }),
|
|
200
|
+
createComponent(Spacing, {})
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Generates the markdown documentation file for a command.
|
|
205
|
+
*/
|
|
206
|
+
function CommandDocsFile(props) {
|
|
207
|
+
const { levelOffset = 0, command, frontMatter, ...rest } = props;
|
|
208
|
+
const context = usePowerlines();
|
|
209
|
+
const usageExamples = memo$1(() => [
|
|
210
|
+
"npm",
|
|
211
|
+
"yarn",
|
|
212
|
+
"pnpm",
|
|
213
|
+
"bun"
|
|
214
|
+
]);
|
|
215
|
+
return createComponent(CommandContext.Provider, {
|
|
216
|
+
value: command,
|
|
217
|
+
get children() {
|
|
218
|
+
return createComponent(MarkdownFile, mergeProps({ get path() {
|
|
219
|
+
return joinPaths(getDocsOutputPath$1(context), `${command.path}.md`);
|
|
220
|
+
} }, rest, {
|
|
221
|
+
get frontMatter() {
|
|
222
|
+
return defu(frontMatter ?? {}, {
|
|
223
|
+
id: command.id,
|
|
224
|
+
name: command.name,
|
|
225
|
+
path: command.path,
|
|
226
|
+
reference: command.docs,
|
|
227
|
+
virtual: command.virtual,
|
|
228
|
+
title: command.title,
|
|
229
|
+
description: command.description,
|
|
230
|
+
tags: command.tags
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
get children() {
|
|
234
|
+
return createComponent(CommandDocs, {
|
|
235
|
+
levelOffset,
|
|
236
|
+
command,
|
|
237
|
+
get usageExamples() {
|
|
238
|
+
return usageExamples();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}));
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
//#endregion
|
|
248
|
+
export { CommandOptionsDocs as a, CommandDocsUsageExample as i, CommandDocs as n, CommandDocsFile as r, CommandArgumentDocs as t };
|
|
249
|
+
//# sourceMappingURL=docs-CGQ2HtEY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-CGQ2HtEY.mjs","names":[],"sources":[],"mappings":""}
|