@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/helpers/automd.cjs
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
2
|
-
const require_components_docs = require('../components/docs.cjs');
|
|
3
|
-
require('../plugin-utils/index.cjs');
|
|
4
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
6
|
-
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
7
|
-
let _alloy_js_markdown = require("@alloy-js/markdown");
|
|
8
|
-
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
9
|
-
let automd = require("automd");
|
|
10
|
-
|
|
11
|
-
//#region src/helpers/automd.tsx
|
|
12
|
-
function __assignType(fn, args) {
|
|
13
|
-
fn.__type = args;
|
|
14
|
-
return fn;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* AutoMD generator to generate CLI command documentation
|
|
18
|
-
*
|
|
19
|
-
* @see https://automd.unjs.io/
|
|
20
|
-
*
|
|
21
|
-
* @param context - The generator context.
|
|
22
|
-
* @returns The generated documentation content.
|
|
23
|
-
*/
|
|
24
|
-
const commands = __assignType((context) => (0, automd.defineGenerator)({
|
|
25
|
-
name: "commands",
|
|
26
|
-
async generate(ctx) {
|
|
27
|
-
let commands = Object.values(context.commands).filter(__assignType((cmd) => !cmd.virtual, [
|
|
28
|
-
"cmd",
|
|
29
|
-
"",
|
|
30
|
-
"P\"2!\"/\""
|
|
31
|
-
]));
|
|
32
|
-
if (ctx.args.command) {
|
|
33
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
34
|
-
commands = [context.commands[ctx.args.command]];
|
|
35
|
-
}
|
|
36
|
-
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, [
|
|
37
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
38
|
-
get when() {
|
|
39
|
-
return !ctx.args.command;
|
|
40
|
-
},
|
|
41
|
-
get children() {
|
|
42
|
-
return [
|
|
43
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
44
|
-
level: 2,
|
|
45
|
-
children: "Commands"
|
|
46
|
-
}),
|
|
47
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
48
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following commands are available in the ${require_context_helpers.getAppTitle(context, true)} command-line interface application:`),
|
|
49
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
54
|
-
each: commands,
|
|
55
|
-
doubleHardline: true,
|
|
56
|
-
get children() {
|
|
57
|
-
return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
58
|
-
get when() {
|
|
59
|
-
return !child.virtual;
|
|
60
|
-
},
|
|
61
|
-
get children() {
|
|
62
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocs, {
|
|
63
|
-
command: child,
|
|
64
|
-
levelOffset: 2
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}), [
|
|
68
|
-
"child",
|
|
69
|
-
"",
|
|
70
|
-
"P\"2!\"/\""
|
|
71
|
-
]);
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
75
|
-
]) };
|
|
76
|
-
}
|
|
77
|
-
}), [
|
|
78
|
-
"Context",
|
|
79
|
-
"context",
|
|
80
|
-
"",
|
|
81
|
-
"P\"w!2\"\"/#"
|
|
82
|
-
]);
|
|
83
|
-
/**
|
|
84
|
-
* AutoMD generator to generate usage examples for a specific command.
|
|
85
|
-
*
|
|
86
|
-
* @param context - The generator context.
|
|
87
|
-
* @returns The generated usage content.
|
|
88
|
-
*/
|
|
89
|
-
const usage = __assignType((context) => (0, automd.defineGenerator)({
|
|
90
|
-
name: "usage",
|
|
91
|
-
async generate(ctx) {
|
|
92
|
-
if (!ctx.args.command) throw new Error("The 'usage' generator requires the \"command\" argument.");
|
|
93
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
94
|
-
let packageManagers = [
|
|
95
|
-
"npm",
|
|
96
|
-
"yarn",
|
|
97
|
-
"pnpm",
|
|
98
|
-
"bun"
|
|
99
|
-
];
|
|
100
|
-
if (ctx.args.packageManager) packageManagers = [String(ctx.args.packageManager)];
|
|
101
|
-
if (packageManagers.some(__assignType((pm) => ![
|
|
102
|
-
"npm",
|
|
103
|
-
"yarn",
|
|
104
|
-
"pnpm",
|
|
105
|
-
"bun"
|
|
106
|
-
].includes(pm), [
|
|
107
|
-
"pm",
|
|
108
|
-
"",
|
|
109
|
-
"P\"2!\"/\""
|
|
110
|
-
]))) throw new Error(`Invalid package manager specified. Supported package managers are: npm, yarn, pnpm, and bun.`);
|
|
111
|
-
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
112
|
-
each: packageManagers,
|
|
113
|
-
doubleHardline: true,
|
|
114
|
-
get children() {
|
|
115
|
-
return __assignType((packageManager) => [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocsUsageExample, {
|
|
116
|
-
packageManager,
|
|
117
|
-
get command() {
|
|
118
|
-
return context.commands[ctx.args.command];
|
|
119
|
-
},
|
|
120
|
-
get expand() {
|
|
121
|
-
return packageManagers && packageManagers.length > 1;
|
|
122
|
-
}
|
|
123
|
-
})], [
|
|
124
|
-
"packageManager",
|
|
125
|
-
"",
|
|
126
|
-
"P\"2!\"/\""
|
|
127
|
-
]);
|
|
128
|
-
}
|
|
129
|
-
})]) };
|
|
130
|
-
}
|
|
131
|
-
}), [
|
|
132
|
-
"Context",
|
|
133
|
-
"context",
|
|
134
|
-
"",
|
|
135
|
-
"P\"w!2\"\"/#"
|
|
136
|
-
]);
|
|
137
|
-
/**
|
|
138
|
-
* AutoMD generator to generate options for a specific command.
|
|
139
|
-
*
|
|
140
|
-
* @param context - The generator context.
|
|
141
|
-
* @returns The generated options content.
|
|
142
|
-
*/
|
|
143
|
-
const options = __assignType((context) => (0, automd.defineGenerator)({
|
|
144
|
-
name: "options",
|
|
145
|
-
generate: __assignType(async function generate(ctx) {
|
|
146
|
-
if (!ctx.args.command) throw new Error("The 'options' generator requires the \"command\" argument.");
|
|
147
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
148
|
-
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandOptionsDocs, { get command() {
|
|
149
|
-
return context.commands[ctx.args.command];
|
|
150
|
-
} })) };
|
|
151
|
-
}, [
|
|
152
|
-
"ctx",
|
|
153
|
-
"generate",
|
|
154
|
-
"P\"2!\"/\""
|
|
155
|
-
])
|
|
156
|
-
}), [
|
|
157
|
-
"Context",
|
|
158
|
-
"context",
|
|
159
|
-
"",
|
|
160
|
-
"P\"w!2\"\"/#"
|
|
161
|
-
]);
|
|
162
|
-
/**
|
|
163
|
-
* AutoMD generator to generate arguments for a specific command.
|
|
164
|
-
*
|
|
165
|
-
* @param context - The generator context.
|
|
166
|
-
* @returns The generated arguments content.
|
|
167
|
-
*/
|
|
168
|
-
const args = __assignType((context) => (0, automd.defineGenerator)({
|
|
169
|
-
name: "args",
|
|
170
|
-
generate: __assignType(async function generate(ctx) {
|
|
171
|
-
if (!ctx.args.command) throw new Error("The 'args' generator requires the \"command\" argument.");
|
|
172
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
173
|
-
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandArgumentDocs, { get command() {
|
|
174
|
-
return context.commands[ctx.args.command];
|
|
175
|
-
} })) };
|
|
176
|
-
}, [
|
|
177
|
-
"ctx",
|
|
178
|
-
"generate",
|
|
179
|
-
"P\"2!\"/\""
|
|
180
|
-
])
|
|
181
|
-
}), [
|
|
182
|
-
"Context",
|
|
183
|
-
"context",
|
|
184
|
-
"",
|
|
185
|
-
"P\"w!2\"\"/#"
|
|
186
|
-
]);
|
|
187
|
-
|
|
188
|
-
//#endregion
|
|
189
|
-
exports.args = args;
|
|
190
|
-
exports.commands = commands;
|
|
191
|
-
exports.options = options;
|
|
192
|
-
exports.usage = usage;
|
|
193
|
-
//# sourceMappingURL=automd.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automd.cjs","names":[],"sources":[],"mappings":""}
|
package/dist/helpers/automd.mjs
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
|
|
2
|
-
import { CommandArgumentDocs, CommandDocs, CommandDocsUsageExample, CommandOptionsDocs } from "../components/docs.mjs";
|
|
3
|
-
import "../plugin-utils/index.mjs";
|
|
4
|
-
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
import { For, Show, code } from "@alloy-js/core";
|
|
6
|
-
import { renderString } from "@powerlines/plugin-alloy/render";
|
|
7
|
-
import { Heading } from "@alloy-js/markdown";
|
|
8
|
-
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
9
|
-
import { defineGenerator } from "automd";
|
|
10
|
-
|
|
11
|
-
//#region src/helpers/automd.tsx
|
|
12
|
-
function __assignType(fn, args) {
|
|
13
|
-
fn.__type = args;
|
|
14
|
-
return fn;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* AutoMD generator to generate CLI command documentation
|
|
18
|
-
*
|
|
19
|
-
* @see https://automd.unjs.io/
|
|
20
|
-
*
|
|
21
|
-
* @param context - The generator context.
|
|
22
|
-
* @returns The generated documentation content.
|
|
23
|
-
*/
|
|
24
|
-
const commands = __assignType((context) => defineGenerator({
|
|
25
|
-
name: "commands",
|
|
26
|
-
async generate(ctx) {
|
|
27
|
-
let commands = Object.values(context.commands).filter(__assignType((cmd) => !cmd.virtual, [
|
|
28
|
-
"cmd",
|
|
29
|
-
"",
|
|
30
|
-
"P\"2!\"/\""
|
|
31
|
-
]));
|
|
32
|
-
if (ctx.args.command) {
|
|
33
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
34
|
-
commands = [context.commands[ctx.args.command]];
|
|
35
|
-
}
|
|
36
|
-
return { contents: renderString(context, [
|
|
37
|
-
createComponent(Show, {
|
|
38
|
-
get when() {
|
|
39
|
-
return !ctx.args.command;
|
|
40
|
-
},
|
|
41
|
-
get children() {
|
|
42
|
-
return [
|
|
43
|
-
createComponent(Heading, {
|
|
44
|
-
level: 2,
|
|
45
|
-
children: "Commands"
|
|
46
|
-
}),
|
|
47
|
-
createComponent(Spacing, {}),
|
|
48
|
-
memo(() => code`The following commands are available in the ${getAppTitle(context, true)} command-line interface application:`),
|
|
49
|
-
createComponent(Spacing, {})
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
createComponent(For, {
|
|
54
|
-
each: commands,
|
|
55
|
-
doubleHardline: true,
|
|
56
|
-
get children() {
|
|
57
|
-
return __assignType((child) => createComponent(Show, {
|
|
58
|
-
get when() {
|
|
59
|
-
return !child.virtual;
|
|
60
|
-
},
|
|
61
|
-
get children() {
|
|
62
|
-
return createComponent(CommandDocs, {
|
|
63
|
-
command: child,
|
|
64
|
-
levelOffset: 2
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}), [
|
|
68
|
-
"child",
|
|
69
|
-
"",
|
|
70
|
-
"P\"2!\"/\""
|
|
71
|
-
]);
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
createComponent(Spacing, {})
|
|
75
|
-
]) };
|
|
76
|
-
}
|
|
77
|
-
}), [
|
|
78
|
-
"Context",
|
|
79
|
-
"context",
|
|
80
|
-
"",
|
|
81
|
-
"P\"w!2\"\"/#"
|
|
82
|
-
]);
|
|
83
|
-
/**
|
|
84
|
-
* AutoMD generator to generate usage examples for a specific command.
|
|
85
|
-
*
|
|
86
|
-
* @param context - The generator context.
|
|
87
|
-
* @returns The generated usage content.
|
|
88
|
-
*/
|
|
89
|
-
const usage = __assignType((context) => defineGenerator({
|
|
90
|
-
name: "usage",
|
|
91
|
-
async generate(ctx) {
|
|
92
|
-
if (!ctx.args.command) throw new Error("The 'usage' generator requires the \"command\" argument.");
|
|
93
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
94
|
-
let packageManagers = [
|
|
95
|
-
"npm",
|
|
96
|
-
"yarn",
|
|
97
|
-
"pnpm",
|
|
98
|
-
"bun"
|
|
99
|
-
];
|
|
100
|
-
if (ctx.args.packageManager) packageManagers = [String(ctx.args.packageManager)];
|
|
101
|
-
if (packageManagers.some(__assignType((pm) => ![
|
|
102
|
-
"npm",
|
|
103
|
-
"yarn",
|
|
104
|
-
"pnpm",
|
|
105
|
-
"bun"
|
|
106
|
-
].includes(pm), [
|
|
107
|
-
"pm",
|
|
108
|
-
"",
|
|
109
|
-
"P\"2!\"/\""
|
|
110
|
-
]))) throw new Error(`Invalid package manager specified. Supported package managers are: npm, yarn, pnpm, and bun.`);
|
|
111
|
-
return { contents: renderString(context, [createComponent(For, {
|
|
112
|
-
each: packageManagers,
|
|
113
|
-
doubleHardline: true,
|
|
114
|
-
get children() {
|
|
115
|
-
return __assignType((packageManager) => [createComponent(CommandDocsUsageExample, {
|
|
116
|
-
packageManager,
|
|
117
|
-
get command() {
|
|
118
|
-
return context.commands[ctx.args.command];
|
|
119
|
-
},
|
|
120
|
-
get expand() {
|
|
121
|
-
return packageManagers && packageManagers.length > 1;
|
|
122
|
-
}
|
|
123
|
-
})], [
|
|
124
|
-
"packageManager",
|
|
125
|
-
"",
|
|
126
|
-
"P\"2!\"/\""
|
|
127
|
-
]);
|
|
128
|
-
}
|
|
129
|
-
})]) };
|
|
130
|
-
}
|
|
131
|
-
}), [
|
|
132
|
-
"Context",
|
|
133
|
-
"context",
|
|
134
|
-
"",
|
|
135
|
-
"P\"w!2\"\"/#"
|
|
136
|
-
]);
|
|
137
|
-
/**
|
|
138
|
-
* AutoMD generator to generate options for a specific command.
|
|
139
|
-
*
|
|
140
|
-
* @param context - The generator context.
|
|
141
|
-
* @returns The generated options content.
|
|
142
|
-
*/
|
|
143
|
-
const options = __assignType((context) => defineGenerator({
|
|
144
|
-
name: "options",
|
|
145
|
-
generate: __assignType(async function generate(ctx) {
|
|
146
|
-
if (!ctx.args.command) throw new Error("The 'options' generator requires the \"command\" argument.");
|
|
147
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
148
|
-
return { contents: renderString(context, createComponent(CommandOptionsDocs, { get command() {
|
|
149
|
-
return context.commands[ctx.args.command];
|
|
150
|
-
} })) };
|
|
151
|
-
}, [
|
|
152
|
-
"ctx",
|
|
153
|
-
"generate",
|
|
154
|
-
"P\"2!\"/\""
|
|
155
|
-
])
|
|
156
|
-
}), [
|
|
157
|
-
"Context",
|
|
158
|
-
"context",
|
|
159
|
-
"",
|
|
160
|
-
"P\"w!2\"\"/#"
|
|
161
|
-
]);
|
|
162
|
-
/**
|
|
163
|
-
* AutoMD generator to generate arguments for a specific command.
|
|
164
|
-
*
|
|
165
|
-
* @param context - The generator context.
|
|
166
|
-
* @returns The generated arguments content.
|
|
167
|
-
*/
|
|
168
|
-
const args = __assignType((context) => defineGenerator({
|
|
169
|
-
name: "args",
|
|
170
|
-
generate: __assignType(async function generate(ctx) {
|
|
171
|
-
if (!ctx.args.command) throw new Error("The 'args' generator requires the \"command\" argument.");
|
|
172
|
-
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
173
|
-
return { contents: renderString(context, createComponent(CommandArgumentDocs, { get command() {
|
|
174
|
-
return context.commands[ctx.args.command];
|
|
175
|
-
} })) };
|
|
176
|
-
}, [
|
|
177
|
-
"ctx",
|
|
178
|
-
"generate",
|
|
179
|
-
"P\"2!\"/\""
|
|
180
|
-
])
|
|
181
|
-
}), [
|
|
182
|
-
"Context",
|
|
183
|
-
"context",
|
|
184
|
-
"",
|
|
185
|
-
"P\"w!2\"\"/#"
|
|
186
|
-
]);
|
|
187
|
-
|
|
188
|
-
//#endregion
|
|
189
|
-
export { args, commands, options, usage };
|
|
190
|
-
//# sourceMappingURL=automd.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automd.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
2
|
-
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/docs-helpers.ts
|
|
5
|
-
/**
|
|
6
|
-
* Gets the output path for the generated documentation.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Shell Shock context.
|
|
9
|
-
* @returns The output path for the generated documentation.
|
|
10
|
-
*/
|
|
11
|
-
function getDocsOutputPath(context) {
|
|
12
|
-
return (0, _stryke_path_join.joinPaths)((0, powerlines_plugin_utils.getDocsOutputPath)(context.config.root), "cli");
|
|
13
|
-
}
|
|
14
|
-
getDocsOutputPath.__type = [
|
|
15
|
-
"Context",
|
|
16
|
-
"context",
|
|
17
|
-
"getDocsOutputPath",
|
|
18
|
-
"Gets the output path for the generated documentation.",
|
|
19
|
-
"P\"w!2\"&/#?$"
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.getDocsOutputPath = getDocsOutputPath;
|
|
24
|
-
//# sourceMappingURL=docs-helpers.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-helpers.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { joinPaths } from "@stryke/path/join";
|
|
2
|
-
import { getDocsOutputPath } from "powerlines/plugin-utils";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/docs-helpers.ts
|
|
5
|
-
/**
|
|
6
|
-
* Gets the output path for the generated documentation.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The Shell Shock context.
|
|
9
|
-
* @returns The output path for the generated documentation.
|
|
10
|
-
*/
|
|
11
|
-
function getDocsOutputPath$1(context) {
|
|
12
|
-
return joinPaths(getDocsOutputPath(context.config.root), "cli");
|
|
13
|
-
}
|
|
14
|
-
getDocsOutputPath$1.__type = [
|
|
15
|
-
"Context",
|
|
16
|
-
"context",
|
|
17
|
-
"getDocsOutputPath",
|
|
18
|
-
"Gets the output path for the generated documentation.",
|
|
19
|
-
"P\"w!2\"&/#?$"
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { getDocsOutputPath$1 as getDocsOutputPath };
|
|
24
|
-
//# sourceMappingURL=docs-helpers.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docs-helpers.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-framework.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-framework.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/helpers/paths.cjs
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
2
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
3
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
|
-
let _stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
-
let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
|
|
6
|
-
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
7
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
8
|
-
let powerlines_utils = require("powerlines/utils");
|
|
9
|
-
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
10
|
-
let _stryke_path_common = require("@stryke/path/common");
|
|
11
|
-
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
12
|
-
let node_fs = require("node:fs");
|
|
13
|
-
|
|
14
|
-
//#region src/helpers/paths.ts
|
|
15
|
-
function __assignType(fn, args) {
|
|
16
|
-
fn.__type = args;
|
|
17
|
-
return fn;
|
|
18
|
-
}
|
|
19
|
-
function resolveCommandId(context, file) {
|
|
20
|
-
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((p) => Boolean(p) && !require_context_helpers.isDynamicPathSegment(p), [
|
|
21
|
-
"p",
|
|
22
|
-
"",
|
|
23
|
-
"P\"2!\"/\""
|
|
24
|
-
])).join("/").replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").replaceAll("/", "-");
|
|
25
|
-
}
|
|
26
|
-
resolveCommandId.__type = [
|
|
27
|
-
"Context",
|
|
28
|
-
"context",
|
|
29
|
-
"file",
|
|
30
|
-
"resolveCommandId",
|
|
31
|
-
"P\"w!2\"&2#&/$"
|
|
32
|
-
];
|
|
33
|
-
/**
|
|
34
|
-
* Finds the command name from the given file path.
|
|
35
|
-
*
|
|
36
|
-
* @param file - The file path to extract the command name from.
|
|
37
|
-
* @returns The command name.
|
|
38
|
-
*/
|
|
39
|
-
function resolveCommandName(file) {
|
|
40
|
-
let path = (0, _stryke_path_file_path_fns.findFilePath)(file);
|
|
41
|
-
let name = (0, _stryke_path_file_path_fns.findFolderName)(file, { requireExtension: true });
|
|
42
|
-
while (require_context_helpers.isDynamicPathSegment(name)) {
|
|
43
|
-
path = (0, _stryke_path_resolve_parent_path.resolveParentPath)(path);
|
|
44
|
-
name = (0, _stryke_path_file_path_fns.findFolderName)(path, { requireExtension: true });
|
|
45
|
-
}
|
|
46
|
-
return name;
|
|
47
|
-
}
|
|
48
|
-
resolveCommandName.__type = [
|
|
49
|
-
"file",
|
|
50
|
-
"resolveCommandName",
|
|
51
|
-
"Finds the command name from the given file path.",
|
|
52
|
-
"P&2!\"/\"?#"
|
|
53
|
-
];
|
|
54
|
-
function resolveCommandPath(context, file) {
|
|
55
|
-
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").split("/").filter(__assignType((path) => path && !require_context_helpers.isPathSegmentGroup(path), [
|
|
56
|
-
"path",
|
|
57
|
-
"",
|
|
58
|
-
"P\"2!\"/\""
|
|
59
|
-
])).join("/");
|
|
60
|
-
}
|
|
61
|
-
resolveCommandPath.__type = [
|
|
62
|
-
"Context",
|
|
63
|
-
"context",
|
|
64
|
-
"file",
|
|
65
|
-
"resolveCommandPath",
|
|
66
|
-
"P\"w!2\"&2#&/$"
|
|
67
|
-
];
|
|
68
|
-
function resolveCommandDynamicPathSegments(context, file) {
|
|
69
|
-
return (0, _stryke_path_replace.replacePath)((0, _stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((path) => Boolean(path) && require_context_helpers.isDynamicPathSegment(path), [
|
|
70
|
-
"path",
|
|
71
|
-
"",
|
|
72
|
-
"P\"2!\"/\""
|
|
73
|
-
])).map(__assignType((path) => require_context_helpers.getDynamicPathSegmentName(path), [
|
|
74
|
-
"path",
|
|
75
|
-
"",
|
|
76
|
-
"P\"2!\"/\""
|
|
77
|
-
]));
|
|
78
|
-
}
|
|
79
|
-
resolveCommandDynamicPathSegments.__type = [
|
|
80
|
-
"Context",
|
|
81
|
-
"context",
|
|
82
|
-
"file",
|
|
83
|
-
"resolveCommandDynamicPathSegments",
|
|
84
|
-
"P\"w!2\"&2#&F/$"
|
|
85
|
-
];
|
|
86
|
-
async function findCommandsRoot(context) {
|
|
87
|
-
let paths = [];
|
|
88
|
-
if ((0, _stryke_type_checks_is_set_string.isSetString)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input, context.config.root), context.config.cwd));
|
|
89
|
-
else if ((0, powerlines_utils.isFileReference)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input.file, context.config.root), context.config.cwd));
|
|
90
|
-
else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
91
|
-
"input",
|
|
92
|
-
"",
|
|
93
|
-
"P\"2!\"/\""
|
|
94
|
-
])))).flat();
|
|
95
|
-
else if ((0, _stryke_type_checks_is_set_object.isSetObject)(context.config.input)) paths = (await Promise.all(Object.values(context.config.input).map(__assignType(async (input) => Array.isArray(input) ? (await Promise.all(input.map(__assignType(async (i) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(i) ? i : i.file, context.config.root), context.config.cwd)), [
|
|
96
|
-
"i",
|
|
97
|
-
"",
|
|
98
|
-
"P\"2!\"/\""
|
|
99
|
-
])))).flat() : (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.config.cwd)), [
|
|
100
|
-
"input",
|
|
101
|
-
"",
|
|
102
|
-
"P\"2!\"/\""
|
|
103
|
-
])))).flat();
|
|
104
|
-
if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
|
|
105
|
-
"p",
|
|
106
|
-
"",
|
|
107
|
-
"P\"2!\"/\""
|
|
108
|
-
])));
|
|
109
|
-
let commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src/commands");
|
|
110
|
-
if (!(0, node_fs.existsSync)(commandsPath)) {
|
|
111
|
-
commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "commands");
|
|
112
|
-
if (!(0, node_fs.existsSync)(commandsPath)) {
|
|
113
|
-
commandsPath = (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src");
|
|
114
|
-
if (!(0, node_fs.existsSync)(commandsPath)) commandsPath = context.config.root;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
paths = (await Promise.all([(0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd), "**/command.ts")), (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd), "**/command.tsx"))])).flat();
|
|
118
|
-
if (paths.length > 0) return (0, _stryke_path_common.commonPath)(paths.map(__assignType((p) => (0, _stryke_path_file_path_fns.findFilePath)(p), [
|
|
119
|
-
"p",
|
|
120
|
-
"",
|
|
121
|
-
"P\"2!\"/\""
|
|
122
|
-
])));
|
|
123
|
-
return (0, _stryke_path_append.appendPath)(commandsPath, context.config.cwd);
|
|
124
|
-
}
|
|
125
|
-
findCommandsRoot.__type = [
|
|
126
|
-
"Context",
|
|
127
|
-
"context",
|
|
128
|
-
"findCommandsRoot",
|
|
129
|
-
"P\"w!2\"&`/#"
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
//#endregion
|
|
133
|
-
exports.findCommandsRoot = findCommandsRoot;
|
|
134
|
-
exports.resolveCommandId = resolveCommandId;
|
|
135
|
-
exports.resolveCommandName = resolveCommandName;
|
|
136
|
-
exports.resolveCommandPath = resolveCommandPath;
|
|
137
|
-
//# sourceMappingURL=paths.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.cjs","names":[],"sources":[],"mappings":""}
|