@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
package/dist/config.mjs
CHANGED
|
@@ -1,62 +1,30 @@
|
|
|
1
1
|
//#region src/config.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"P\"w!F`2\"\"w!F`/#"
|
|
26
|
-
];
|
|
27
|
-
defineConfig.__type = [
|
|
28
|
-
"UserConfigFnObject",
|
|
29
|
-
"config",
|
|
30
|
-
"defineConfig",
|
|
31
|
-
"P\"w!2\"\"w!/#"
|
|
32
|
-
];
|
|
33
|
-
defineConfig.__type = [
|
|
34
|
-
"UserConfigFnPromise",
|
|
35
|
-
"config",
|
|
36
|
-
"defineConfig",
|
|
37
|
-
"P\"w!2\"\"w!/#"
|
|
38
|
-
];
|
|
39
|
-
defineConfig.__type = [
|
|
40
|
-
"UserConfigFn",
|
|
41
|
-
"config",
|
|
42
|
-
"defineConfig",
|
|
43
|
-
"P\"w!2\"\"w!/#"
|
|
44
|
-
];
|
|
45
|
-
defineConfig.__type = [
|
|
46
|
-
"UserConfigExport",
|
|
47
|
-
"config",
|
|
48
|
-
"defineConfig",
|
|
49
|
-
"P\"w!2\"\"w!/#"
|
|
50
|
-
];
|
|
2
|
+
/**
|
|
3
|
+
* Type helper to make it easier to use `shell-shock.config.ts` files. Accepts a direct {@link UserConfig} object, or a function that returns it. The function receives a {@link ConfigParams} object.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { defineConfig } from '@shell-shock/core/config';
|
|
8
|
+
*
|
|
9
|
+
* export default defineConfig({
|
|
10
|
+
* // Your configuration here
|
|
11
|
+
* });
|
|
12
|
+
*
|
|
13
|
+
* // Or with a function
|
|
14
|
+
* export default defineConfig((env) => {
|
|
15
|
+
* console.log(`Running command: ${env.command} in mode: ${env.mode}`);
|
|
16
|
+
* return {
|
|
17
|
+
* // Your configuration here
|
|
18
|
+
* };
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param config - The user configuration object or a function that returns it.
|
|
23
|
+
* @returns The provided configuration, unmodified.
|
|
24
|
+
*/
|
|
51
25
|
function defineConfig(config) {
|
|
52
26
|
return config;
|
|
53
27
|
}
|
|
54
|
-
defineConfig.__type = [
|
|
55
|
-
"UserConfigExport",
|
|
56
|
-
"config",
|
|
57
|
-
"defineConfig",
|
|
58
|
-
"P\"w!2\"\"w!/#"
|
|
59
|
-
];
|
|
60
28
|
|
|
61
29
|
//#endregion
|
|
62
30
|
export { defineConfig };
|
|
@@ -4,10 +4,6 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
|
4
4
|
import { titleCase } from "@stryke/string-format/title-case";
|
|
5
5
|
|
|
6
6
|
//#region src/plugin-utils/context-helpers.ts
|
|
7
|
-
function __assignType(fn, args) {
|
|
8
|
-
fn.__type = args;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
7
|
/**
|
|
12
8
|
* Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.
|
|
13
9
|
*
|
|
@@ -16,29 +12,10 @@ function __assignType(fn, args) {
|
|
|
16
12
|
*/
|
|
17
13
|
function sortArgAliases(aliases) {
|
|
18
14
|
if (aliases.length === 0) return [];
|
|
19
|
-
const result = aliases.filter(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"P\"2!\"/\""
|
|
23
|
-
]));
|
|
24
|
-
result.push(...aliases.filter(__assignType((alias) => alias.length > 1, [
|
|
25
|
-
"alias",
|
|
26
|
-
"",
|
|
27
|
-
"P\"2!\"/\""
|
|
28
|
-
])));
|
|
29
|
-
return result.sort(__assignType((a, b) => a.localeCompare(b), [
|
|
30
|
-
"a",
|
|
31
|
-
"b",
|
|
32
|
-
"",
|
|
33
|
-
"P\"2!\"2\"\"/#"
|
|
34
|
-
]));
|
|
15
|
+
const result = aliases.filter((alias) => alias.length === 1);
|
|
16
|
+
result.push(...aliases.filter((alias) => alias.length > 1));
|
|
17
|
+
return result.sort((a, b) => a.localeCompare(b));
|
|
35
18
|
}
|
|
36
|
-
sortArgAliases.__type = [
|
|
37
|
-
"aliases",
|
|
38
|
-
"sortArgAliases",
|
|
39
|
-
"Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.",
|
|
40
|
-
"P&F2!&F/\"?#"
|
|
41
|
-
];
|
|
42
19
|
/**
|
|
43
20
|
* Retrieves the application name from the context and configuration.
|
|
44
21
|
*
|
|
@@ -51,12 +28,6 @@ function getAppName(context) {
|
|
|
51
28
|
if (!isSetString(result)) throw new Error("No application name found. Please provide a 'bin' option in the configuration or ensure the package.json has a valid 'name' field.");
|
|
52
29
|
return kebabCase(result);
|
|
53
30
|
}
|
|
54
|
-
getAppName.__type = [
|
|
55
|
-
"context",
|
|
56
|
-
"getAppName",
|
|
57
|
-
"Retrieves the application name from the context and configuration.",
|
|
58
|
-
"P\"2!&/\"?#"
|
|
59
|
-
];
|
|
60
31
|
/**
|
|
61
32
|
* Retrieves the application title from the context and configuration.
|
|
62
33
|
*
|
|
@@ -68,13 +39,6 @@ function getAppTitle(context, replaceCLI = false) {
|
|
|
68
39
|
const title = context.config.title || titleCase(context.config.name || getAppName(context));
|
|
69
40
|
return (replaceCLI ? title.replace(/(?:cli|command-line|command line)\s*(?:interface\s*)?(?:application|app)?$/gi, "") : title).trim();
|
|
70
41
|
}
|
|
71
|
-
getAppTitle.__type = [
|
|
72
|
-
"context",
|
|
73
|
-
"replaceCLI",
|
|
74
|
-
"getAppTitle",
|
|
75
|
-
"Retrieves the application title from the context and configuration.",
|
|
76
|
-
"P\"2!\"2\"&/#?$"
|
|
77
|
-
];
|
|
78
42
|
/**
|
|
79
43
|
* Retrieves the application description from the context and configuration.
|
|
80
44
|
*
|
|
@@ -84,12 +48,6 @@ getAppTitle.__type = [
|
|
|
84
48
|
function getAppDescription(context) {
|
|
85
49
|
return context.config.description || context.packageJson?.description || `The ${getAppTitle(context, true)} command-line interface application.`;
|
|
86
50
|
}
|
|
87
|
-
getAppDescription.__type = [
|
|
88
|
-
"context",
|
|
89
|
-
"getAppDescription",
|
|
90
|
-
"Retrieves the application description from the context and configuration.",
|
|
91
|
-
"P\"2!&/\"?#"
|
|
92
|
-
];
|
|
93
51
|
/**
|
|
94
52
|
* Retrieves the primary binary name for the application.
|
|
95
53
|
*
|
|
@@ -99,12 +57,6 @@ getAppDescription.__type = [
|
|
|
99
57
|
function getAppBin(context) {
|
|
100
58
|
return isSetObject(context.config.bin) ? Object.keys(context.config.bin)[0] : kebabCase(getAppName(context));
|
|
101
59
|
}
|
|
102
|
-
getAppBin.__type = [
|
|
103
|
-
"context",
|
|
104
|
-
"getAppBin",
|
|
105
|
-
"Retrieves the primary binary name for the application.",
|
|
106
|
-
"P\"2!&/\"?#"
|
|
107
|
-
];
|
|
108
60
|
/**
|
|
109
61
|
* Determines if a given command path segment is variable (enclosed in square brackets).
|
|
110
62
|
*
|
|
@@ -120,12 +72,6 @@ getAppBin.__type = [
|
|
|
120
72
|
function isDynamicPathSegment(path) {
|
|
121
73
|
return path.startsWith("[") && path.endsWith("]");
|
|
122
74
|
}
|
|
123
|
-
isDynamicPathSegment.__type = [
|
|
124
|
-
"path",
|
|
125
|
-
"isDynamicPathSegment",
|
|
126
|
-
"Determines if a given command path segment is variable (enclosed in square brackets).",
|
|
127
|
-
"P&2!)/\"?#"
|
|
128
|
-
];
|
|
129
75
|
/**
|
|
130
76
|
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
131
77
|
*
|
|
@@ -140,12 +86,6 @@ isDynamicPathSegment.__type = [
|
|
|
140
86
|
function getDynamicPathSegmentName(path) {
|
|
141
87
|
return path.replaceAll(/^\[+/g, "").replaceAll(/\]+$/g, "");
|
|
142
88
|
}
|
|
143
|
-
getDynamicPathSegmentName.__type = [
|
|
144
|
-
"path",
|
|
145
|
-
"getDynamicPathSegmentName",
|
|
146
|
-
"Extracts the variable name from a command path segment by removing enclosing square brackets.",
|
|
147
|
-
"P&2!&/\"?#"
|
|
148
|
-
];
|
|
149
89
|
/**
|
|
150
90
|
* Determines if a given command path segment is a path segment group (enclosed in parentheses).
|
|
151
91
|
*
|
|
@@ -162,12 +102,6 @@ getDynamicPathSegmentName.__type = [
|
|
|
162
102
|
function isPathSegmentGroup(path) {
|
|
163
103
|
return path.startsWith("(") && path.endsWith(")") || path.startsWith("_");
|
|
164
104
|
}
|
|
165
|
-
isPathSegmentGroup.__type = [
|
|
166
|
-
"path",
|
|
167
|
-
"isPathSegmentGroup",
|
|
168
|
-
"Determines if a given command path segment is a path segment group (enclosed in parentheses).",
|
|
169
|
-
"P&2!)/\"?#"
|
|
170
|
-
];
|
|
171
105
|
/**
|
|
172
106
|
* Extracts the group name from a command path segment by removing enclosing parentheses.
|
|
173
107
|
*
|
|
@@ -183,12 +117,6 @@ isPathSegmentGroup.__type = [
|
|
|
183
117
|
function getPathSegmentGroupName(path) {
|
|
184
118
|
return path.replaceAll(/^\(+/g, "").replaceAll(/\)+$/g, "").replaceAll(/^_+/g, "");
|
|
185
119
|
}
|
|
186
|
-
getPathSegmentGroupName.__type = [
|
|
187
|
-
"path",
|
|
188
|
-
"getPathSegmentGroupName",
|
|
189
|
-
"Extracts the group name from a command path segment by removing enclosing parentheses.",
|
|
190
|
-
"P&2!&/\"?#"
|
|
191
|
-
];
|
|
192
120
|
/**
|
|
193
121
|
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
194
122
|
*
|
|
@@ -203,13 +131,7 @@ getPathSegmentGroupName.__type = [
|
|
|
203
131
|
function getPathSegmentName(path) {
|
|
204
132
|
return getPathSegmentGroupName(getDynamicPathSegmentName(path));
|
|
205
133
|
}
|
|
206
|
-
getPathSegmentName.__type = [
|
|
207
|
-
"path",
|
|
208
|
-
"getPathSegmentName",
|
|
209
|
-
"Extracts the variable name from a command path segment by removing enclosing square brackets.",
|
|
210
|
-
"P&2!&/\"?#"
|
|
211
|
-
];
|
|
212
134
|
|
|
213
135
|
//#endregion
|
|
214
|
-
export {
|
|
215
|
-
//# sourceMappingURL=context-helpers.mjs.map
|
|
136
|
+
export { getDynamicPathSegmentName as a, isDynamicPathSegment as c, getAppTitle as i, isPathSegmentGroup as l, getAppDescription as n, getPathSegmentGroupName as o, getAppName as r, getPathSegmentName as s, getAppBin as t, sortArgAliases as u };
|
|
137
|
+
//# sourceMappingURL=context-helpers-D3EJxwbq.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-helpers-D3EJxwbq.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -4,10 +4,6 @@ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-stri
|
|
|
4
4
|
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
5
|
|
|
6
6
|
//#region src/plugin-utils/context-helpers.ts
|
|
7
|
-
function __assignType(fn, args) {
|
|
8
|
-
fn.__type = args;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
7
|
/**
|
|
12
8
|
* Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.
|
|
13
9
|
*
|
|
@@ -16,29 +12,10 @@ function __assignType(fn, args) {
|
|
|
16
12
|
*/
|
|
17
13
|
function sortArgAliases(aliases) {
|
|
18
14
|
if (aliases.length === 0) return [];
|
|
19
|
-
const result = aliases.filter(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"P\"2!\"/\""
|
|
23
|
-
]));
|
|
24
|
-
result.push(...aliases.filter(__assignType((alias) => alias.length > 1, [
|
|
25
|
-
"alias",
|
|
26
|
-
"",
|
|
27
|
-
"P\"2!\"/\""
|
|
28
|
-
])));
|
|
29
|
-
return result.sort(__assignType((a, b) => a.localeCompare(b), [
|
|
30
|
-
"a",
|
|
31
|
-
"b",
|
|
32
|
-
"",
|
|
33
|
-
"P\"2!\"2\"\"/#"
|
|
34
|
-
]));
|
|
15
|
+
const result = aliases.filter((alias) => alias.length === 1);
|
|
16
|
+
result.push(...aliases.filter((alias) => alias.length > 1));
|
|
17
|
+
return result.sort((a, b) => a.localeCompare(b));
|
|
35
18
|
}
|
|
36
|
-
sortArgAliases.__type = [
|
|
37
|
-
"aliases",
|
|
38
|
-
"sortArgAliases",
|
|
39
|
-
"Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.",
|
|
40
|
-
"P&F2!&F/\"?#"
|
|
41
|
-
];
|
|
42
19
|
/**
|
|
43
20
|
* Retrieves the application name from the context and configuration.
|
|
44
21
|
*
|
|
@@ -51,12 +28,6 @@ function getAppName(context) {
|
|
|
51
28
|
if (!(0, _stryke_type_checks_is_set_string.isSetString)(result)) throw new Error("No application name found. Please provide a 'bin' option in the configuration or ensure the package.json has a valid 'name' field.");
|
|
52
29
|
return (0, _stryke_string_format_kebab_case.kebabCase)(result);
|
|
53
30
|
}
|
|
54
|
-
getAppName.__type = [
|
|
55
|
-
"context",
|
|
56
|
-
"getAppName",
|
|
57
|
-
"Retrieves the application name from the context and configuration.",
|
|
58
|
-
"P\"2!&/\"?#"
|
|
59
|
-
];
|
|
60
31
|
/**
|
|
61
32
|
* Retrieves the application title from the context and configuration.
|
|
62
33
|
*
|
|
@@ -68,13 +39,6 @@ function getAppTitle(context, replaceCLI = false) {
|
|
|
68
39
|
const title = context.config.title || (0, _stryke_string_format_title_case.titleCase)(context.config.name || getAppName(context));
|
|
69
40
|
return (replaceCLI ? title.replace(/(?:cli|command-line|command line)\s*(?:interface\s*)?(?:application|app)?$/gi, "") : title).trim();
|
|
70
41
|
}
|
|
71
|
-
getAppTitle.__type = [
|
|
72
|
-
"context",
|
|
73
|
-
"replaceCLI",
|
|
74
|
-
"getAppTitle",
|
|
75
|
-
"Retrieves the application title from the context and configuration.",
|
|
76
|
-
"P\"2!\"2\"&/#?$"
|
|
77
|
-
];
|
|
78
42
|
/**
|
|
79
43
|
* Retrieves the application description from the context and configuration.
|
|
80
44
|
*
|
|
@@ -84,12 +48,6 @@ getAppTitle.__type = [
|
|
|
84
48
|
function getAppDescription(context) {
|
|
85
49
|
return context.config.description || context.packageJson?.description || `The ${getAppTitle(context, true)} command-line interface application.`;
|
|
86
50
|
}
|
|
87
|
-
getAppDescription.__type = [
|
|
88
|
-
"context",
|
|
89
|
-
"getAppDescription",
|
|
90
|
-
"Retrieves the application description from the context and configuration.",
|
|
91
|
-
"P\"2!&/\"?#"
|
|
92
|
-
];
|
|
93
51
|
/**
|
|
94
52
|
* Retrieves the primary binary name for the application.
|
|
95
53
|
*
|
|
@@ -99,12 +57,6 @@ getAppDescription.__type = [
|
|
|
99
57
|
function getAppBin(context) {
|
|
100
58
|
return (0, _stryke_type_checks_is_set_object.isSetObject)(context.config.bin) ? Object.keys(context.config.bin)[0] : (0, _stryke_string_format_kebab_case.kebabCase)(getAppName(context));
|
|
101
59
|
}
|
|
102
|
-
getAppBin.__type = [
|
|
103
|
-
"context",
|
|
104
|
-
"getAppBin",
|
|
105
|
-
"Retrieves the primary binary name for the application.",
|
|
106
|
-
"P\"2!&/\"?#"
|
|
107
|
-
];
|
|
108
60
|
/**
|
|
109
61
|
* Determines if a given command path segment is variable (enclosed in square brackets).
|
|
110
62
|
*
|
|
@@ -120,12 +72,6 @@ getAppBin.__type = [
|
|
|
120
72
|
function isDynamicPathSegment(path) {
|
|
121
73
|
return path.startsWith("[") && path.endsWith("]");
|
|
122
74
|
}
|
|
123
|
-
isDynamicPathSegment.__type = [
|
|
124
|
-
"path",
|
|
125
|
-
"isDynamicPathSegment",
|
|
126
|
-
"Determines if a given command path segment is variable (enclosed in square brackets).",
|
|
127
|
-
"P&2!)/\"?#"
|
|
128
|
-
];
|
|
129
75
|
/**
|
|
130
76
|
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
131
77
|
*
|
|
@@ -140,12 +86,6 @@ isDynamicPathSegment.__type = [
|
|
|
140
86
|
function getDynamicPathSegmentName(path) {
|
|
141
87
|
return path.replaceAll(/^\[+/g, "").replaceAll(/\]+$/g, "");
|
|
142
88
|
}
|
|
143
|
-
getDynamicPathSegmentName.__type = [
|
|
144
|
-
"path",
|
|
145
|
-
"getDynamicPathSegmentName",
|
|
146
|
-
"Extracts the variable name from a command path segment by removing enclosing square brackets.",
|
|
147
|
-
"P&2!&/\"?#"
|
|
148
|
-
];
|
|
149
89
|
/**
|
|
150
90
|
* Determines if a given command path segment is a path segment group (enclosed in parentheses).
|
|
151
91
|
*
|
|
@@ -162,12 +102,6 @@ getDynamicPathSegmentName.__type = [
|
|
|
162
102
|
function isPathSegmentGroup(path) {
|
|
163
103
|
return path.startsWith("(") && path.endsWith(")") || path.startsWith("_");
|
|
164
104
|
}
|
|
165
|
-
isPathSegmentGroup.__type = [
|
|
166
|
-
"path",
|
|
167
|
-
"isPathSegmentGroup",
|
|
168
|
-
"Determines if a given command path segment is a path segment group (enclosed in parentheses).",
|
|
169
|
-
"P&2!)/\"?#"
|
|
170
|
-
];
|
|
171
105
|
/**
|
|
172
106
|
* Extracts the group name from a command path segment by removing enclosing parentheses.
|
|
173
107
|
*
|
|
@@ -183,12 +117,6 @@ isPathSegmentGroup.__type = [
|
|
|
183
117
|
function getPathSegmentGroupName(path) {
|
|
184
118
|
return path.replaceAll(/^\(+/g, "").replaceAll(/\)+$/g, "").replaceAll(/^_+/g, "");
|
|
185
119
|
}
|
|
186
|
-
getPathSegmentGroupName.__type = [
|
|
187
|
-
"path",
|
|
188
|
-
"getPathSegmentGroupName",
|
|
189
|
-
"Extracts the group name from a command path segment by removing enclosing parentheses.",
|
|
190
|
-
"P&2!&/\"?#"
|
|
191
|
-
];
|
|
192
120
|
/**
|
|
193
121
|
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
194
122
|
*
|
|
@@ -203,22 +131,65 @@ getPathSegmentGroupName.__type = [
|
|
|
203
131
|
function getPathSegmentName(path) {
|
|
204
132
|
return getPathSegmentGroupName(getDynamicPathSegmentName(path));
|
|
205
133
|
}
|
|
206
|
-
getPathSegmentName.__type = [
|
|
207
|
-
"path",
|
|
208
|
-
"getPathSegmentName",
|
|
209
|
-
"Extracts the variable name from a command path segment by removing enclosing square brackets.",
|
|
210
|
-
"P&2!&/\"?#"
|
|
211
|
-
];
|
|
212
134
|
|
|
213
135
|
//#endregion
|
|
214
|
-
exports
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
exports
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
136
|
+
Object.defineProperty(exports, 'getAppBin', {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return getAppBin;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, 'getAppDescription', {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return getAppDescription;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, 'getAppName', {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return getAppName;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, 'getAppTitle', {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return getAppTitle;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, 'getDynamicPathSegmentName', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return getDynamicPathSegmentName;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, 'getPathSegmentGroupName', {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () {
|
|
169
|
+
return getPathSegmentGroupName;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, 'getPathSegmentName', {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function () {
|
|
175
|
+
return getPathSegmentName;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, 'isDynamicPathSegment', {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return isDynamicPathSegment;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(exports, 'isPathSegmentGroup', {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return isPathSegmentGroup;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, 'sortArgAliases', {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function () {
|
|
193
|
+
return sortArgAliases;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
@@ -5,22 +5,16 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
5
5
|
/**
|
|
6
6
|
* The reflection parameter context used in template rendering.
|
|
7
7
|
*/
|
|
8
|
-
const CommandContext = (
|
|
8
|
+
const CommandContext = (0, _alloy_js_core.createNamedContext)("Command");
|
|
9
9
|
/**
|
|
10
10
|
* Hook to access the Command context.
|
|
11
11
|
*
|
|
12
12
|
* @returns A reactive version of the current reflection.
|
|
13
13
|
*/
|
|
14
14
|
function useCommand() {
|
|
15
|
-
return
|
|
15
|
+
return (0, _alloy_js_core.useContext)(CommandContext);
|
|
16
16
|
}
|
|
17
|
-
useCommand.__type = [
|
|
18
|
-
"useCommand",
|
|
19
|
-
"Hook to access the Command context.",
|
|
20
|
-
"P\"/!?\""
|
|
21
|
-
];
|
|
22
17
|
|
|
23
18
|
//#endregion
|
|
24
19
|
exports.CommandContext = CommandContext;
|
|
25
|
-
exports.useCommand = useCommand;
|
|
26
|
-
//# sourceMappingURL=command.cjs.map
|
|
20
|
+
exports.useCommand = useCommand;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CommandTree } from "../
|
|
1
|
+
import { S as CommandTree } from "../command-CtfR7hKM.cjs";
|
|
2
2
|
import { ComponentContext } from "@alloy-js/core";
|
|
3
|
-
|
|
4
3
|
//#region src/contexts/command.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The reflection parameter context used in template rendering.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/contexts/command.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"command.d.cts","names":[],"sources":["../../src/contexts/command.ts"],"mappings":";;;;;;cAyBa,gBAAgB,iBAAiB;;;;;;iBAQ9B,cAAU"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CommandTree } from "../
|
|
1
|
+
import { S as CommandTree } from "../command-B6KYexlV.mjs";
|
|
2
2
|
import { ComponentContext } from "@alloy-js/core";
|
|
3
|
-
|
|
4
3
|
//#region src/contexts/command.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The reflection parameter context used in template rendering.
|
|
@@ -4,20 +4,15 @@ import { createNamedContext, useContext } from "@alloy-js/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* The reflection parameter context used in template rendering.
|
|
6
6
|
*/
|
|
7
|
-
const CommandContext =
|
|
7
|
+
const CommandContext = createNamedContext("Command");
|
|
8
8
|
/**
|
|
9
9
|
* Hook to access the Command context.
|
|
10
10
|
*
|
|
11
11
|
* @returns A reactive version of the current reflection.
|
|
12
12
|
*/
|
|
13
13
|
function useCommand() {
|
|
14
|
-
return useContext
|
|
14
|
+
return useContext(CommandContext);
|
|
15
15
|
}
|
|
16
|
-
useCommand.__type = [
|
|
17
|
-
"useCommand",
|
|
18
|
-
"Hook to access the Command context.",
|
|
19
|
-
"P\"/!?\""
|
|
20
|
-
];
|
|
21
16
|
|
|
22
17
|
//#endregion
|
|
23
18
|
export { CommandContext, useCommand };
|
package/dist/contexts/index.cjs
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_contexts_command = require('./command.cjs');
|
|
3
|
+
require('./power-plant.cjs');
|
|
3
4
|
const require_contexts_options = require('./options.cjs');
|
|
5
|
+
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
6
|
+
let _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
7
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
4
8
|
|
|
9
|
+
Object.defineProperty(exports, 'BuiltinFile', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
5
15
|
exports.CommandContext = require_contexts_command.CommandContext;
|
|
16
|
+
Object.defineProperty(exports, 'EntryFile', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _powerlines_plugin_alloy_typescript_components_entry_file.EntryFile;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
6
22
|
exports.ExistingOptionsContext = require_contexts_options.ExistingOptionsContext;
|
|
7
23
|
exports.computedOptions = require_contexts_options.computedOptions;
|
|
8
24
|
exports.useCommand = require_contexts_command.useCommand;
|
|
9
|
-
exports.useExistingOptions = require_contexts_options.useExistingOptions;
|
|
25
|
+
exports.useExistingOptions = require_contexts_options.useExistingOptions;
|
|
26
|
+
exports.usePowerlines = _powerlines_plugin_alloy_core_contexts_context.usePowerlines;
|
|
27
|
+
exports.usePowerlinesSafe = _powerlines_plugin_alloy_core_contexts_context.usePowerlinesSafe;
|
|
@@ -1,3 +1,4 @@
|
|
|
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";
|
|
1
2
|
import { CommandContext, useCommand } from "./command.cjs";
|
|
2
3
|
import { ExistingOptionsContext, computedOptions, useExistingOptions } from "./options.cjs";
|
|
3
|
-
export { CommandContext, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions };
|
|
4
|
+
export { BuiltinFile, type BuiltinFileProps, CommandContext, EntryFile, type EntryFileProps, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions, usePowerlines, usePowerlinesSafe };
|
|
@@ -1,3 +1,4 @@
|
|
|
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";
|
|
1
2
|
import { CommandContext, useCommand } from "./command.mjs";
|
|
2
3
|
import { ExistingOptionsContext, computedOptions, useExistingOptions } from "./options.mjs";
|
|
3
|
-
export { CommandContext, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions };
|
|
4
|
+
export { BuiltinFile, type BuiltinFileProps, CommandContext, EntryFile, type EntryFileProps, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions, usePowerlines, usePowerlinesSafe };
|
package/dist/contexts/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CommandContext, useCommand } from "./command.mjs";
|
|
2
|
+
import { BuiltinFile, EntryFile, usePowerlines, usePowerlinesSafe } from "./power-plant.mjs";
|
|
2
3
|
import { ExistingOptionsContext, computedOptions, useExistingOptions } from "./options.mjs";
|
|
3
4
|
|
|
4
|
-
export { CommandContext, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions };
|
|
5
|
+
export { BuiltinFile, CommandContext, EntryFile, ExistingOptionsContext, computedOptions, useCommand, useExistingOptions, usePowerlines, usePowerlinesSafe };
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
2
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
3
|
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
5
4
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
6
5
|
let defu = require("defu");
|
|
7
|
-
defu = require_runtime.__toESM(defu, 1);
|
|
8
6
|
|
|
9
7
|
//#region src/contexts/options.ts
|
|
10
|
-
function __assignType(fn, args) {
|
|
11
|
-
fn.__type = args;
|
|
12
|
-
return fn;
|
|
13
|
-
}
|
|
14
8
|
/**
|
|
15
9
|
* The reflection parameter context used in template rendering.
|
|
16
10
|
*/
|
|
17
|
-
const ExistingOptionsContext = (
|
|
11
|
+
const ExistingOptionsContext = (0, _alloy_js_core.createNamedContext)("ExistingOptions", []);
|
|
18
12
|
/**
|
|
19
13
|
* Hook to access the ExistingOptions context.
|
|
20
14
|
*
|
|
@@ -24,17 +18,12 @@ const ExistingOptionsContext = (_alloy_js_core.createNamedContext.Ω = [["&F"]],
|
|
|
24
18
|
* @returns A reactive version of the current reflection.
|
|
25
19
|
*/
|
|
26
20
|
function useExistingOptions() {
|
|
27
|
-
return
|
|
21
|
+
return (0, _alloy_js_core.useContext)(ExistingOptionsContext);
|
|
28
22
|
}
|
|
29
|
-
useExistingOptions.__type = [
|
|
30
|
-
"useExistingOptions",
|
|
31
|
-
"Hook to access the ExistingOptions context.",
|
|
32
|
-
"P\"/!?\""
|
|
33
|
-
];
|
|
34
23
|
function computedOptions(options) {
|
|
35
|
-
return options.reduce(
|
|
36
|
-
ret[(0, _stryke_string_format_camel_case.camelCase)(option.name)] ??= (0, defu.
|
|
37
|
-
if (option.type === "boolean" && !option.variadic && option.isNegativeOf) ret[(0, _stryke_string_format_camel_case.camelCase)(option.isNegativeOf)] = (0, defu.
|
|
24
|
+
return options.reduce((ret, option) => {
|
|
25
|
+
ret[(0, _stryke_string_format_camel_case.camelCase)(option.name)] ??= (0, defu.defu)({ name: (0, _stryke_string_format_camel_case.camelCase)(option.name) }, ret[option.name] ?? {}, option);
|
|
26
|
+
if (option.type === "boolean" && !option.variadic && option.isNegativeOf) ret[(0, _stryke_string_format_camel_case.camelCase)(option.isNegativeOf)] = (0, defu.defu)({ name: (0, _stryke_string_format_camel_case.camelCase)(option.isNegativeOf) }, ret[option.isNegativeOf] ?? {}, {
|
|
38
27
|
...option,
|
|
39
28
|
env: (0, _stryke_type_checks_is_set_string.isSetString)(option.env) ? `NO_${option.env}` : false,
|
|
40
29
|
description: `${option.description.replace(/\.+$/, "")}. This property is the negative form of ${option.name}.`,
|
|
@@ -42,22 +31,10 @@ function computedOptions(options) {
|
|
|
42
31
|
default: !option.default
|
|
43
32
|
});
|
|
44
33
|
return ret;
|
|
45
|
-
},
|
|
46
|
-
"ret",
|
|
47
|
-
"option",
|
|
48
|
-
"",
|
|
49
|
-
"P\"2!\"2\"\"/#"
|
|
50
|
-
]), {});
|
|
34
|
+
}, {});
|
|
51
35
|
}
|
|
52
|
-
computedOptions.__type = [
|
|
53
|
-
"CommandOption",
|
|
54
|
-
"options",
|
|
55
|
-
"computedOptions",
|
|
56
|
-
"P\"w!F2\"\"/#"
|
|
57
|
-
];
|
|
58
36
|
|
|
59
37
|
//#endregion
|
|
60
38
|
exports.ExistingOptionsContext = ExistingOptionsContext;
|
|
61
39
|
exports.computedOptions = computedOptions;
|
|
62
|
-
exports.useExistingOptions = useExistingOptions;
|
|
63
|
-
//# sourceMappingURL=options.cjs.map
|
|
40
|
+
exports.useExistingOptions = useExistingOptions;
|