@shell-shock/core 0.17.8 → 0.17.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/api.cjs +36 -1
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +2 -77
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +2 -76
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +35 -1
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +291 -1
- package/dist/components/command-validation-logic.cjs.map +1 -0
- package/dist/components/command-validation-logic.d.cts +1 -3
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +1 -3
- package/dist/components/command-validation-logic.d.mts.map +1 -1
- package/dist/components/command-validation-logic.mjs +288 -1
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +265 -1
- package/dist/components/docs.cjs.map +1 -0
- package/dist/components/docs.d.cts +4 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +4 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +256 -1
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +429 -15
- package/dist/components/exec-builtin.cjs.map +1 -0
- package/dist/components/exec-builtin.d.cts +1 -2
- package/dist/components/exec-builtin.d.cts.map +1 -1
- package/dist/components/exec-builtin.d.mts +1 -2
- package/dist/components/exec-builtin.d.mts.map +1 -1
- package/dist/components/exec-builtin.mjs +424 -15
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +119 -1
- package/dist/components/helpers.cjs.map +1 -0
- package/dist/components/helpers.d.cts +6 -8
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -8
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs +111 -1
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +58 -1
- package/dist/components/index.mjs +10 -1
- package/dist/components/options-parser-logic.cjs +959 -5
- package/dist/components/options-parser-logic.cjs.map +1 -0
- package/dist/components/options-parser-logic.d.cts +8 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +8 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +944 -5
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +630 -8
- package/dist/components/state-builtin.cjs.map +1 -0
- package/dist/components/state-builtin.d.cts +4 -5
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +4 -5
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +622 -8
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +116 -1
- package/dist/components/usage.cjs.map +1 -0
- package/dist/components/usage.d.cts +1 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +1 -2
- package/dist/components/usage.d.mts.map +1 -1
- package/dist/components/usage.mjs +113 -1
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +839 -33
- package/dist/components/utils-builtin.cjs.map +1 -0
- package/dist/components/utils-builtin.d.cts +7 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +7 -8
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +828 -33
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +65 -1
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +29 -8
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +29 -8
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +62 -1
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +26 -1
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts.map +1 -1
- package/dist/contexts/command.mjs +23 -1
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/index.cjs +9 -1
- package/dist/contexts/index.mjs +4 -1
- package/dist/contexts/options.cjs +63 -1
- package/dist/contexts/options.cjs.map +1 -0
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +57 -1
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/engine.cjs +138 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +79 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +79 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +136 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/helpers/automd.cjs +70 -1
- package/dist/helpers/automd.cjs.map +1 -0
- package/dist/helpers/automd.mjs +69 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +23 -1
- package/dist/helpers/docs-helpers.cjs.map +1 -0
- package/dist/helpers/docs-helpers.mjs +22 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/get-framework.cjs +24 -0
- package/dist/helpers/get-framework.cjs.map +1 -0
- package/dist/helpers/get-framework.mjs +24 -0
- package/dist/helpers/get-framework.mjs.map +1 -0
- package/dist/helpers/paths.cjs +137 -1
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +133 -1
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +113 -1
- package/dist/helpers/persistence.cjs.map +1 -0
- package/dist/helpers/persistence.mjs +112 -1
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +65 -1
- package/dist/helpers/update-package-json.cjs.map +1 -0
- package/dist/helpers/update-package-json.mjs +63 -1
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +95 -1
- package/dist/helpers/utilities.cjs.map +1 -0
- package/dist/helpers/utilities.mjs +93 -1
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +71 -1
- package/dist/helpers/validations.cjs.map +1 -0
- package/dist/helpers/validations.mjs +69 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +123 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +80 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +80 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +119 -1
- package/dist/index.mjs.map +1 -0
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/dist/plugin-utils/compute-bin.cjs +48 -1
- package/dist/plugin-utils/compute-bin.cjs.map +1 -0
- package/dist/plugin-utils/compute-bin.d.cts +2 -2
- package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
- package/dist/plugin-utils/compute-bin.d.mts +2 -2
- package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
- package/dist/plugin-utils/compute-bin.mjs +47 -1
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +224 -1
- package/dist/plugin-utils/context-helpers.cjs.map +1 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -4
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +4 -4
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +214 -1
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +70 -1
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +5 -5
- package/dist/plugin-utils/deepkit.d.cts.map +1 -1
- package/dist/plugin-utils/deepkit.d.mts +5 -5
- package/dist/plugin-utils/deepkit.d.mts.map +1 -1
- package/dist/plugin-utils/deepkit.mjs +68 -1
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +112 -2
- package/dist/plugin-utils/description-helpers.cjs.map +1 -0
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/description-helpers.mjs +107 -2
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +118 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs +114 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +39 -1
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +10 -1
- package/dist/plugin-utils/reflect.cjs +52 -1
- package/dist/plugin-utils/reflect.cjs.map +1 -0
- package/dist/plugin-utils/reflect.d.cts.map +1 -1
- package/dist/plugin-utils/reflect.d.mts.map +1 -1
- package/dist/plugin-utils/reflect.mjs +50 -1
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +222 -1
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +5 -5
- package/dist/plugin-utils/type-checks.d.cts.map +1 -1
- package/dist/plugin-utils/type-checks.d.mts +5 -5
- package/dist/plugin-utils/type-checks.d.mts.map +1 -1
- package/dist/plugin-utils/type-checks.mjs +217 -1
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +495 -4
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +488 -4
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +182 -1
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +178 -1
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +479 -1
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +478 -1
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +402 -1
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.d.cts +61 -119
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +61 -119
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +367 -1
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +175 -1
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +19 -12
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +19 -12
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +163 -1
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +45 -1
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.d.cts +3 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +40 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +53 -1
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts +1 -1
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts +1 -1
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/env.mjs +50 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +53 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +6 -1
- package/dist/types/options.cjs +13 -1
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.cts.map +1 -1
- package/dist/types/options.d.mts.map +1 -1
- package/dist/types/options.mjs +10 -1
- package/dist/types/options.mjs.map +1 -1
- package/package.json +43 -34
- package/dist/resolver/deepkit.cjs +0 -1
- package/dist/resolver/deepkit.mjs +0 -2
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/module.cjs +0 -1
- package/dist/resolver/module.mjs +0 -2
- package/dist/resolver/module.mjs.map +0 -1
|
@@ -1,2 +1,115 @@
|
|
|
1
|
-
import{isDynamicPathSegment
|
|
1
|
+
import { isDynamicPathSegment } from "./context-helpers.mjs";
|
|
2
|
+
import { traverseCommands } from "./traverse-command-tree.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin-utils/get-command-tree.ts
|
|
5
|
+
function __assignType(fn, args) {
|
|
6
|
+
fn.__type = args;
|
|
7
|
+
return fn;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves a specific command tree based on the provided path.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The build context containing the command definitions.
|
|
13
|
+
* @param path - An array of strings representing the command path.
|
|
14
|
+
* @returns The command tree at the specified path, or null if not found.
|
|
15
|
+
*/
|
|
16
|
+
function getCommandTree(context, path = []) {
|
|
17
|
+
if (path.length === 0) return null;
|
|
18
|
+
let currentTree = context.commands[path[0]] ?? null;
|
|
19
|
+
if (path.length > 1) {
|
|
20
|
+
const segments = path.slice(1).filter(__assignType((segment) => !isDynamicPathSegment(segment), [
|
|
21
|
+
"segment",
|
|
22
|
+
"",
|
|
23
|
+
"P\"2!\"/\""
|
|
24
|
+
]));
|
|
25
|
+
for (const segment of segments) if (currentTree?.children && Object.prototype.hasOwnProperty.call(currentTree.children, segment)) currentTree = currentTree.children[segment] ?? null;
|
|
26
|
+
else return null;
|
|
27
|
+
}
|
|
28
|
+
return currentTree;
|
|
29
|
+
}
|
|
30
|
+
getCommandTree.__type = [
|
|
31
|
+
"Context",
|
|
32
|
+
"context",
|
|
33
|
+
"path",
|
|
34
|
+
"CommandTree",
|
|
35
|
+
"getCommandTree",
|
|
36
|
+
"Retrieves a specific command tree based on the provided path.",
|
|
37
|
+
"P\"w!2\"\"2#P\"w$,J/%?&"
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a list of all command trees defined in the context.
|
|
41
|
+
*
|
|
42
|
+
* @param context - The build context containing the command definitions.
|
|
43
|
+
* @returns A promise that resolves to an array of all command trees in the context.
|
|
44
|
+
*/
|
|
45
|
+
async function getCommandList(context) {
|
|
46
|
+
const commandList = [];
|
|
47
|
+
await traverseCommands(context, __assignType((commandTree) => {
|
|
48
|
+
commandList.push(commandTree);
|
|
49
|
+
}, [
|
|
50
|
+
"commandTree",
|
|
51
|
+
"",
|
|
52
|
+
"P\"2!\"/\""
|
|
53
|
+
]));
|
|
54
|
+
return commandList;
|
|
55
|
+
}
|
|
56
|
+
getCommandList.__type = [
|
|
57
|
+
"Context",
|
|
58
|
+
"context",
|
|
59
|
+
"CommandTree",
|
|
60
|
+
"getCommandList",
|
|
61
|
+
"Retrieves a list of all command trees defined in the context.",
|
|
62
|
+
"P\"w!2\"\"w#F`/$?%"
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves a list of all command paths defined in the context.
|
|
66
|
+
*
|
|
67
|
+
* @param context - The build context containing the command definitions.
|
|
68
|
+
* @returns A promise that resolves to an array of all command paths in the context.
|
|
69
|
+
*/
|
|
70
|
+
async function getCommandPaths(context) {
|
|
71
|
+
const commandPaths = [];
|
|
72
|
+
await traverseCommands(context, __assignType((commandTree) => {
|
|
73
|
+
if (commandTree.path) commandPaths.push(commandTree.path);
|
|
74
|
+
}, [
|
|
75
|
+
"commandTree",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
]));
|
|
79
|
+
return commandPaths;
|
|
80
|
+
}
|
|
81
|
+
getCommandPaths.__type = [
|
|
82
|
+
"Context",
|
|
83
|
+
"context",
|
|
84
|
+
"getCommandPaths",
|
|
85
|
+
"Retrieves a list of all command paths defined in the context.",
|
|
86
|
+
"P\"w!2\"&F`/#?$"
|
|
87
|
+
];
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves a list of all command segments defined in the context.
|
|
90
|
+
*
|
|
91
|
+
* @param context - The build context containing the command definitions.
|
|
92
|
+
* @returns A promise that resolves to an array of all command segments in the context.
|
|
93
|
+
*/
|
|
94
|
+
async function getCommandSegments(context) {
|
|
95
|
+
const commandSegments = [];
|
|
96
|
+
await traverseCommands(context, __assignType((commandTree) => {
|
|
97
|
+
if (commandTree.path) commandSegments.push(commandTree.segments);
|
|
98
|
+
}, [
|
|
99
|
+
"commandTree",
|
|
100
|
+
"",
|
|
101
|
+
"P\"2!\"/\""
|
|
102
|
+
]));
|
|
103
|
+
return commandSegments;
|
|
104
|
+
}
|
|
105
|
+
getCommandSegments.__type = [
|
|
106
|
+
"Context",
|
|
107
|
+
"context",
|
|
108
|
+
"getCommandSegments",
|
|
109
|
+
"Retrieves a list of all command segments defined in the context.",
|
|
110
|
+
"P\"w!2\"&FF`/#?$"
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { getCommandList, getCommandPaths, getCommandSegments, getCommandTree };
|
|
2
115
|
//# sourceMappingURL=get-command-tree.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-command-tree.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"get-command-tree.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_context_helpers = require('./context-helpers.cjs');
|
|
3
|
+
const require_reflect = require('./reflect.cjs');
|
|
4
|
+
const require_compute_bin = require('./compute-bin.cjs');
|
|
5
|
+
const require_type_checks = require('./type-checks.cjs');
|
|
6
|
+
const require_deepkit = require('./deepkit.cjs');
|
|
7
|
+
const require_description_helpers = require('./description-helpers.cjs');
|
|
8
|
+
const require_traverse_command_tree = require('./traverse-command-tree.cjs');
|
|
9
|
+
const require_get_command_tree = require('./get-command-tree.cjs');
|
|
10
|
+
|
|
11
|
+
exports.__ΩFormatDescriptionOptions = require_description_helpers.__ΩFormatDescriptionOptions;
|
|
12
|
+
exports.__ΩFormatShortDescriptionOptions = require_description_helpers.__ΩFormatShortDescriptionOptions;
|
|
13
|
+
exports.computeBin = require_compute_bin.computeBin;
|
|
14
|
+
exports.extractReflectionKind = require_deepkit.extractReflectionKind;
|
|
15
|
+
exports.extractType = require_deepkit.extractType;
|
|
16
|
+
exports.formatDescription = require_description_helpers.formatDescription;
|
|
17
|
+
exports.formatShortDescription = require_description_helpers.formatShortDescription;
|
|
18
|
+
exports.getAppBin = require_context_helpers.getAppBin;
|
|
19
|
+
exports.getAppDescription = require_context_helpers.getAppDescription;
|
|
20
|
+
exports.getAppName = require_context_helpers.getAppName;
|
|
21
|
+
exports.getAppTitle = require_context_helpers.getAppTitle;
|
|
22
|
+
exports.getCommandList = require_get_command_tree.getCommandList;
|
|
23
|
+
exports.getCommandPaths = require_get_command_tree.getCommandPaths;
|
|
24
|
+
exports.getCommandSegments = require_get_command_tree.getCommandSegments;
|
|
25
|
+
exports.getCommandTree = require_get_command_tree.getCommandTree;
|
|
26
|
+
exports.getDynamicPathSegmentName = require_context_helpers.getDynamicPathSegmentName;
|
|
27
|
+
exports.getPathSegmentGroupName = require_context_helpers.getPathSegmentGroupName;
|
|
28
|
+
exports.getPathSegmentName = require_context_helpers.getPathSegmentName;
|
|
29
|
+
exports.isCommandArgument = require_type_checks.isCommandArgument;
|
|
30
|
+
exports.isCommandOption = require_type_checks.isCommandOption;
|
|
31
|
+
exports.isCommandParameter = require_type_checks.isCommandParameter;
|
|
32
|
+
exports.isCommandParameterConfig = require_type_checks.isCommandParameterConfig;
|
|
33
|
+
exports.isCommandParameterType = require_type_checks.isCommandParameterType;
|
|
34
|
+
exports.isDynamicPathSegment = require_context_helpers.isDynamicPathSegment;
|
|
35
|
+
exports.isPathSegmentGroup = require_context_helpers.isPathSegmentGroup;
|
|
36
|
+
exports.sortArgAliases = require_context_helpers.sortArgAliases;
|
|
37
|
+
exports.sortOptions = require_reflect.sortOptions;
|
|
38
|
+
exports.traverseCommandTree = require_traverse_command_tree.traverseCommandTree;
|
|
39
|
+
exports.traverseCommands = require_traverse_command_tree.traverseCommands;
|
|
@@ -5,5 +5,5 @@ import { FormatDescriptionOptions, FormatShortDescriptionOptions, formatDescript
|
|
|
5
5
|
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.cjs";
|
|
6
6
|
import { sortOptions } from "./reflect.cjs";
|
|
7
7
|
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.cjs";
|
|
8
|
-
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
9
|
-
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
8
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.cjs";
|
|
9
|
+
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -5,5 +5,5 @@ import { FormatDescriptionOptions, FormatShortDescriptionOptions, formatDescript
|
|
|
5
5
|
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.mjs";
|
|
6
6
|
import { sortOptions } from "./reflect.mjs";
|
|
7
7
|
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.mjs";
|
|
8
|
-
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
9
|
-
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
8
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.mjs";
|
|
9
|
+
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getAppBin, getAppDescription, getAppName, getAppTitle, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases } from "./context-helpers.mjs";
|
|
2
|
+
import { sortOptions } from "./reflect.mjs";
|
|
3
|
+
import { computeBin } from "./compute-bin.mjs";
|
|
4
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.mjs";
|
|
5
|
+
import { extractReflectionKind, extractType } from "./deepkit.mjs";
|
|
6
|
+
import { __ΩFormatDescriptionOptions, __ΩFormatShortDescriptionOptions, formatDescription, formatShortDescription } from "./description-helpers.mjs";
|
|
7
|
+
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.mjs";
|
|
8
|
+
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.mjs";
|
|
9
|
+
|
|
10
|
+
export { __ΩFormatDescriptionOptions, __ΩFormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/plugin-utils/reflect.ts
|
|
3
|
+
function __assignType(fn, args) {
|
|
4
|
+
fn.__type = args;
|
|
5
|
+
return fn;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Sort command options alphabetically by name, placing boolean options with negatives appropriately.
|
|
9
|
+
*
|
|
10
|
+
* @param options - The array of command options to sort.
|
|
11
|
+
* @returns A new array of sorted command options.
|
|
12
|
+
*/
|
|
13
|
+
function sortOptions(options) {
|
|
14
|
+
if (!options || options.length === 0) return [];
|
|
15
|
+
return options.filter(__assignType((arg) => arg.type !== "boolean" || arg.variadic || !arg.isNegativeOf, [
|
|
16
|
+
"arg",
|
|
17
|
+
"",
|
|
18
|
+
"P\"2!\"/\""
|
|
19
|
+
])).sort(__assignType((a, b) => a.name.localeCompare(b.name), [
|
|
20
|
+
"a",
|
|
21
|
+
"b",
|
|
22
|
+
"",
|
|
23
|
+
"P\"2!\"2\"\"/#"
|
|
24
|
+
])).reduce(__assignType((ret, arg) => {
|
|
25
|
+
ret.push(arg);
|
|
26
|
+
if (arg.type === "boolean") {
|
|
27
|
+
const negativeArg = options.find(__assignType((a) => a.type === "boolean" && !a.variadic && a.isNegativeOf === arg.name, [
|
|
28
|
+
"a",
|
|
29
|
+
"",
|
|
30
|
+
"P\"2!\"/\""
|
|
31
|
+
]));
|
|
32
|
+
if (negativeArg) ret.push(negativeArg);
|
|
33
|
+
}
|
|
34
|
+
return ret;
|
|
35
|
+
}, [
|
|
36
|
+
"ret",
|
|
37
|
+
"arg",
|
|
38
|
+
"",
|
|
39
|
+
"P\"2!\"2\"\"/#"
|
|
40
|
+
]), []);
|
|
41
|
+
}
|
|
42
|
+
sortOptions.__type = [
|
|
43
|
+
"CommandOption",
|
|
44
|
+
"options",
|
|
45
|
+
"sortOptions",
|
|
46
|
+
"Sort command options alphabetically by name, placing boolean options with negatives appropriately.",
|
|
47
|
+
"P\"w!F2\"\"w!F/#?$"
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.sortOptions = sortOptions;
|
|
52
|
+
//# sourceMappingURL=reflect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflect.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.cts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"reflect.d.cts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,WAAA,CAAY,OAAA,EAAS,aAAA,KAAkB,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.mts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reflect.d.mts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":""}
|
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/plugin-utils/reflect.ts
|
|
2
|
+
function __assignType(fn, args) {
|
|
3
|
+
fn.__type = args;
|
|
4
|
+
return fn;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Sort command options alphabetically by name, placing boolean options with negatives appropriately.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The array of command options to sort.
|
|
10
|
+
* @returns A new array of sorted command options.
|
|
11
|
+
*/
|
|
12
|
+
function sortOptions(options) {
|
|
13
|
+
if (!options || options.length === 0) return [];
|
|
14
|
+
return options.filter(__assignType((arg) => arg.type !== "boolean" || arg.variadic || !arg.isNegativeOf, [
|
|
15
|
+
"arg",
|
|
16
|
+
"",
|
|
17
|
+
"P\"2!\"/\""
|
|
18
|
+
])).sort(__assignType((a, b) => a.name.localeCompare(b.name), [
|
|
19
|
+
"a",
|
|
20
|
+
"b",
|
|
21
|
+
"",
|
|
22
|
+
"P\"2!\"2\"\"/#"
|
|
23
|
+
])).reduce(__assignType((ret, arg) => {
|
|
24
|
+
ret.push(arg);
|
|
25
|
+
if (arg.type === "boolean") {
|
|
26
|
+
const negativeArg = options.find(__assignType((a) => a.type === "boolean" && !a.variadic && a.isNegativeOf === arg.name, [
|
|
27
|
+
"a",
|
|
28
|
+
"",
|
|
29
|
+
"P\"2!\"/\""
|
|
30
|
+
]));
|
|
31
|
+
if (negativeArg) ret.push(negativeArg);
|
|
32
|
+
}
|
|
33
|
+
return ret;
|
|
34
|
+
}, [
|
|
35
|
+
"ret",
|
|
36
|
+
"arg",
|
|
37
|
+
"",
|
|
38
|
+
"P\"2!\"2\"\"/#"
|
|
39
|
+
]), []);
|
|
40
|
+
}
|
|
41
|
+
sortOptions.__type = [
|
|
42
|
+
"CommandOption",
|
|
43
|
+
"options",
|
|
44
|
+
"sortOptions",
|
|
45
|
+
"Sort command options alphabetically by name, placing boolean options with negatives appropriately.",
|
|
46
|
+
"P\"w!F2\"\"w!F/#?$"
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { sortOptions };
|
|
2
51
|
//# sourceMappingURL=reflect.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"reflect.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/plugin-utils/traverse-command-tree.ts
|
|
3
|
+
function __assignType(fn, args) {
|
|
4
|
+
fn.__type = args;
|
|
5
|
+
return fn;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Traverses a command tree and applies a visitor function to each node.
|
|
9
|
+
*
|
|
10
|
+
* @param commandTree - The command tree to traverse.
|
|
11
|
+
* @param visitor - The visitor function to apply to each node.
|
|
12
|
+
*/
|
|
13
|
+
async function traverseCommandTree(commandTree, visitor) {
|
|
14
|
+
if (!commandTree.children) return;
|
|
15
|
+
await Promise.all(Object.values(commandTree.children).map(__assignType(async (childTree) => {
|
|
16
|
+
await Promise.resolve(visitor(childTree));
|
|
17
|
+
await traverseCommandTree(childTree, visitor);
|
|
18
|
+
}, [
|
|
19
|
+
"childTree",
|
|
20
|
+
"",
|
|
21
|
+
"P\"2!\"/\""
|
|
22
|
+
])));
|
|
23
|
+
}
|
|
24
|
+
traverseCommandTree.__type = [
|
|
25
|
+
"CommandTree",
|
|
26
|
+
"commandTree",
|
|
27
|
+
"node",
|
|
28
|
+
"",
|
|
29
|
+
"visitor",
|
|
30
|
+
"traverseCommandTree",
|
|
31
|
+
"Traverses a command tree and applies a visitor function to each node.",
|
|
32
|
+
"P\"w!2\"P\"w!2#!/$2%$`/&?'"
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Traverses all commands in the context and applies a visitor function to each command tree.
|
|
36
|
+
*
|
|
37
|
+
* @param context - The build context containing the command definitions.
|
|
38
|
+
* @param visitor - The visitor function to apply to each command tree.
|
|
39
|
+
*/
|
|
40
|
+
async function traverseCommands(context, visitor) {
|
|
41
|
+
if (!context.commands) return;
|
|
42
|
+
await Promise.all(Object.values(context.commands).map(__assignType(async (childTree) => {
|
|
43
|
+
await Promise.resolve(visitor(childTree));
|
|
44
|
+
await traverseCommandTree(childTree, visitor);
|
|
45
|
+
}, [
|
|
46
|
+
"childTree",
|
|
47
|
+
"",
|
|
48
|
+
"P\"2!\"/\""
|
|
49
|
+
])));
|
|
50
|
+
}
|
|
51
|
+
traverseCommands.__type = [
|
|
52
|
+
"context",
|
|
53
|
+
"CommandTree",
|
|
54
|
+
"node",
|
|
55
|
+
"",
|
|
56
|
+
"visitor",
|
|
57
|
+
"traverseCommands",
|
|
58
|
+
"Traverses all commands in the context and applies a visitor function to each command tree.",
|
|
59
|
+
"P\"2!P\"w\"2#!/$2%$`/&?'"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.traverseCommandTree = traverseCommandTree;
|
|
64
|
+
exports.traverseCommands = traverseCommands;
|
|
65
|
+
//# sourceMappingURL=traverse-command-tree.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":";;;;;;;AA4BA;;;;iBAAsB,mBAAA,CACpB,WAAA,EAAa,WAAA,EACb,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA;;;;;;;iBAmBmB,gBAAA,kBAAkC,OAAA,
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":";;;;;;;AA4BA;;;;iBAAsB,mBAAA,CACpB,WAAA,EAAa,WAAA,EACb,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA;;;;;;;iBAmBmB,gBAAA,kBAAkC,OAAA,EACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":""}
|
|
@@ -1,2 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/plugin-utils/traverse-command-tree.ts
|
|
2
|
+
function __assignType(fn, args) {
|
|
3
|
+
fn.__type = args;
|
|
4
|
+
return fn;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Traverses a command tree and applies a visitor function to each node.
|
|
8
|
+
*
|
|
9
|
+
* @param commandTree - The command tree to traverse.
|
|
10
|
+
* @param visitor - The visitor function to apply to each node.
|
|
11
|
+
*/
|
|
12
|
+
async function traverseCommandTree(commandTree, visitor) {
|
|
13
|
+
if (!commandTree.children) return;
|
|
14
|
+
await Promise.all(Object.values(commandTree.children).map(__assignType(async (childTree) => {
|
|
15
|
+
await Promise.resolve(visitor(childTree));
|
|
16
|
+
await traverseCommandTree(childTree, visitor);
|
|
17
|
+
}, [
|
|
18
|
+
"childTree",
|
|
19
|
+
"",
|
|
20
|
+
"P\"2!\"/\""
|
|
21
|
+
])));
|
|
22
|
+
}
|
|
23
|
+
traverseCommandTree.__type = [
|
|
24
|
+
"CommandTree",
|
|
25
|
+
"commandTree",
|
|
26
|
+
"node",
|
|
27
|
+
"",
|
|
28
|
+
"visitor",
|
|
29
|
+
"traverseCommandTree",
|
|
30
|
+
"Traverses a command tree and applies a visitor function to each node.",
|
|
31
|
+
"P\"w!2\"P\"w!2#!/$2%$`/&?'"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Traverses all commands in the context and applies a visitor function to each command tree.
|
|
35
|
+
*
|
|
36
|
+
* @param context - The build context containing the command definitions.
|
|
37
|
+
* @param visitor - The visitor function to apply to each command tree.
|
|
38
|
+
*/
|
|
39
|
+
async function traverseCommands(context, visitor) {
|
|
40
|
+
if (!context.commands) return;
|
|
41
|
+
await Promise.all(Object.values(context.commands).map(__assignType(async (childTree) => {
|
|
42
|
+
await Promise.resolve(visitor(childTree));
|
|
43
|
+
await traverseCommandTree(childTree, visitor);
|
|
44
|
+
}, [
|
|
45
|
+
"childTree",
|
|
46
|
+
"",
|
|
47
|
+
"P\"2!\"/\""
|
|
48
|
+
])));
|
|
49
|
+
}
|
|
50
|
+
traverseCommands.__type = [
|
|
51
|
+
"context",
|
|
52
|
+
"CommandTree",
|
|
53
|
+
"node",
|
|
54
|
+
"",
|
|
55
|
+
"visitor",
|
|
56
|
+
"traverseCommands",
|
|
57
|
+
"Traverses all commands in the context and applies a visitor function to each command tree.",
|
|
58
|
+
"P\"2!P\"w\"2#!/$2%$`/&?'"
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
export { traverseCommandTree, traverseCommands };
|
|
2
63
|
//# sourceMappingURL=traverse-command-tree.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.mjs","names":[],"sources":[],"mappings":""}
|