@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,113 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
2
|
+
import { writeEnv } from "@powerlines/plugin-env/helpers";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/persistence.ts
|
|
5
|
+
function __assignType(fn, args) {
|
|
6
|
+
fn.__type = args;
|
|
7
|
+
return fn;
|
|
8
|
+
}
|
|
9
|
+
function serialize(command) {
|
|
10
|
+
return {
|
|
11
|
+
...command,
|
|
12
|
+
parent: command.parent?.name ? command.parent.name : null,
|
|
13
|
+
children: Object.fromEntries(Object.entries(command.children || {}).map(__assignType(([name, child]) => [name, serialize(child)], [
|
|
14
|
+
"param0",
|
|
15
|
+
"",
|
|
16
|
+
"P\"2!\"/\""
|
|
17
|
+
])))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
serialize.__type = [
|
|
21
|
+
"CommandTree",
|
|
22
|
+
"command",
|
|
23
|
+
"SerializedCommandTree",
|
|
24
|
+
"serialize",
|
|
25
|
+
"P\"w!2\"\"w#/$"
|
|
26
|
+
];
|
|
27
|
+
function deserialize(command, parent = null) {
|
|
28
|
+
const result = {
|
|
29
|
+
...command,
|
|
30
|
+
parent: parent ?? null,
|
|
31
|
+
children: {}
|
|
32
|
+
};
|
|
33
|
+
result.children = Object.fromEntries(Object.entries(command.children || {}).map(__assignType(([name, child]) => [name, deserialize(child, result)], [
|
|
34
|
+
"param0",
|
|
35
|
+
"",
|
|
36
|
+
"P\"2!\"/\""
|
|
37
|
+
])));
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
deserialize.__type = [
|
|
41
|
+
"SerializedCommandTree",
|
|
42
|
+
"command",
|
|
43
|
+
"CommandTree",
|
|
44
|
+
"parent",
|
|
45
|
+
() => null,
|
|
46
|
+
"deserialize",
|
|
47
|
+
"P\"w!2\"P\"w#,J2$>%\"w#/&"
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* Gets the file path for persisting CLI command reflections.
|
|
51
|
+
*
|
|
52
|
+
* @param context - The Shell Shock context.
|
|
53
|
+
* @returns The file path for persisting CLI command reflections.
|
|
54
|
+
*/
|
|
55
|
+
function getCommandsPersistencePath(context) {
|
|
56
|
+
return joinPaths(context.dataPath, "reflections", "commands.json");
|
|
57
|
+
}
|
|
58
|
+
getCommandsPersistencePath.__type = [
|
|
59
|
+
"Context",
|
|
60
|
+
"context",
|
|
61
|
+
"getCommandsPersistencePath",
|
|
62
|
+
"Gets the file path for persisting CLI command reflections.",
|
|
63
|
+
"P\"w!2\"&/#?$"
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Reads the persisted CLI command reflections from the file system and populates the context's commands.
|
|
67
|
+
*
|
|
68
|
+
* @param context - The Shell Shock context.
|
|
69
|
+
* @throws Will throw an error if the reflections file is empty or cannot be read.
|
|
70
|
+
*/
|
|
71
|
+
async function readCommandsPersistence(context) {
|
|
72
|
+
const reflections = await context.fs.read(getCommandsPersistencePath(context));
|
|
73
|
+
if (!reflections || !reflections.length) throw new Error(`CLI Command reflection file ${getCommandsPersistencePath(context)} is empty`);
|
|
74
|
+
context.commands = Object.fromEntries(Object.entries(JSON.parse(reflections) ?? {}).map(__assignType(([name, command]) => [name, deserialize(command)], [
|
|
75
|
+
"param0",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
])));
|
|
79
|
+
}
|
|
80
|
+
readCommandsPersistence.__type = [
|
|
81
|
+
"Context",
|
|
82
|
+
"context",
|
|
83
|
+
"readCommandsPersistence",
|
|
84
|
+
"Reads the persisted CLI command reflections from the file system and populates the context's commands.",
|
|
85
|
+
"P\"w!2\"\"/#?$"
|
|
86
|
+
];
|
|
87
|
+
/**
|
|
88
|
+
* Writes the current CLI command reflections from the context to the file system for persistence.
|
|
89
|
+
*
|
|
90
|
+
* @param context - The Shell Shock context.
|
|
91
|
+
* @returns A promise that resolves when the reflections have been successfully written to the file system.
|
|
92
|
+
* @throws Will throw an error if there is an issue writing the reflections to the file system.
|
|
93
|
+
*/
|
|
94
|
+
async function writeCommandsPersistence(context) {
|
|
95
|
+
const filePath = getCommandsPersistencePath(context);
|
|
96
|
+
await writeEnv(context);
|
|
97
|
+
await context.fs.write(filePath, JSON.stringify(Object.fromEntries(Object.entries(context.commands).map(__assignType(([name, command]) => [name, serialize(command)], [
|
|
98
|
+
"param0",
|
|
99
|
+
"",
|
|
100
|
+
"P\"2!\"/\""
|
|
101
|
+
]))), null, context.config.mode === "production" ? 0 : 2));
|
|
102
|
+
}
|
|
103
|
+
writeCommandsPersistence.__type = [
|
|
104
|
+
"Context",
|
|
105
|
+
"context",
|
|
106
|
+
"writeCommandsPersistence",
|
|
107
|
+
"Writes the current CLI command reflections from the context to the file system for persistence.",
|
|
108
|
+
"P\"w!2\"\"/#?$"
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
export { writeCommandsPersistence };
|
|
2
113
|
//# sourceMappingURL=persistence.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"persistence.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
2
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
3
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
5
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
6
|
+
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
7
|
+
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
8
|
+
|
|
9
|
+
//#region src/helpers/update-package-json.ts
|
|
10
|
+
function __assignType(fn, args) {
|
|
11
|
+
fn.__type = args;
|
|
12
|
+
return fn;
|
|
13
|
+
}
|
|
14
|
+
function formatBinaryPath(format) {
|
|
15
|
+
return `./dist/bin.${format === "cjs" || Array.isArray(format) && format.includes("cjs") ? "cjs" : "mjs"}`;
|
|
16
|
+
}
|
|
17
|
+
formatBinaryPath.__type = [
|
|
18
|
+
"format",
|
|
19
|
+
"formatBinaryPath",
|
|
20
|
+
"PP&&F-J2!&/\""
|
|
21
|
+
];
|
|
22
|
+
async function updatePackageJsonBinary(context) {
|
|
23
|
+
const packageJsonPath = (0, _stryke_path_join_paths.joinPaths)(context.config.cwd, context.config.root, "package.json");
|
|
24
|
+
if (!context.packageJson) {
|
|
25
|
+
const packageJson = await context.fs.read(packageJsonPath);
|
|
26
|
+
if (packageJson) context.packageJson ??= JSON.parse(packageJson);
|
|
27
|
+
}
|
|
28
|
+
if (context.packageJson) {
|
|
29
|
+
if (context.config.bin && Array.isArray(context.config.bin) && context.config.bin.length > 0) {
|
|
30
|
+
context.packageJson.bin = Object.fromEntries((0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(context.config.bin)).map(__assignType((bin) => [bin, formatBinaryPath(context.config.output.format)], [
|
|
31
|
+
"bin",
|
|
32
|
+
"",
|
|
33
|
+
"P\"2!\"/\""
|
|
34
|
+
])));
|
|
35
|
+
await context.fs.write(packageJsonPath, _stryke_json_storm_json.StormJSON.stringify(context.packageJson));
|
|
36
|
+
} else {
|
|
37
|
+
if (Array.isArray(context.config.output.format) && context.config.output.format.length > 1) {
|
|
38
|
+
context.packageJson.bin = { [(0, _stryke_string_format_kebab_case.kebabCase)(require_context_helpers.getAppName(context))]: formatBinaryPath((0, _stryke_convert_to_array.toArray)(context.config.output.format)[0]) };
|
|
39
|
+
context.packageJson.bin = (0, _stryke_convert_to_array.toArray)(context.config.output.format).reduce(__assignType((ret, format) => {
|
|
40
|
+
ret[`${(0, _stryke_string_format_kebab_case.kebabCase)(require_context_helpers.getAppName(context))}-${format}`] = formatBinaryPath(format);
|
|
41
|
+
return ret;
|
|
42
|
+
}, [
|
|
43
|
+
"ret",
|
|
44
|
+
"format",
|
|
45
|
+
"",
|
|
46
|
+
"P\"2!\"2\"\"/#"
|
|
47
|
+
]), context.packageJson.bin);
|
|
48
|
+
} else context.packageJson.bin = { [(0, _stryke_string_format_kebab_case.kebabCase)(require_context_helpers.getAppName(context))]: formatBinaryPath(context.config.output.format) };
|
|
49
|
+
await context.fs.write(packageJsonPath, _stryke_json_storm_json.StormJSON.stringify(context.packageJson));
|
|
50
|
+
}
|
|
51
|
+
if (!(0, _stryke_type_checks_is_set_object.isSetObject)(context.packageJson.bin)) throw new Error("Unable to determine the CLI binary name. Please specify the `bin` option in your Shell Shock configuration or ensure that the `name` field is set in your package.json.");
|
|
52
|
+
context.config.bin = context.packageJson.bin;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
updatePackageJsonBinary.__type = [
|
|
56
|
+
"Context",
|
|
57
|
+
"context",
|
|
58
|
+
"updatePackageJsonBinary",
|
|
59
|
+
"P\"w!2\"$`/#"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.formatBinaryPath = formatBinaryPath;
|
|
64
|
+
exports.updatePackageJsonBinary = updatePackageJsonBinary;
|
|
65
|
+
//# sourceMappingURL=update-package-json.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package-json.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,2 +1,64 @@
|
|
|
1
|
-
import{getAppName
|
|
1
|
+
import { getAppName } from "../plugin-utils/context-helpers.mjs";
|
|
2
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
3
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
5
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
6
|
+
import { getUnique } from "@stryke/helpers/get-unique";
|
|
7
|
+
import { StormJSON } from "@stryke/json/storm-json";
|
|
8
|
+
|
|
9
|
+
//#region src/helpers/update-package-json.ts
|
|
10
|
+
function __assignType(fn, args) {
|
|
11
|
+
fn.__type = args;
|
|
12
|
+
return fn;
|
|
13
|
+
}
|
|
14
|
+
function formatBinaryPath(format) {
|
|
15
|
+
return `./dist/bin.${format === "cjs" || Array.isArray(format) && format.includes("cjs") ? "cjs" : "mjs"}`;
|
|
16
|
+
}
|
|
17
|
+
formatBinaryPath.__type = [
|
|
18
|
+
"format",
|
|
19
|
+
"formatBinaryPath",
|
|
20
|
+
"PP&&F-J2!&/\""
|
|
21
|
+
];
|
|
22
|
+
async function updatePackageJsonBinary(context) {
|
|
23
|
+
const packageJsonPath = joinPaths(context.config.cwd, context.config.root, "package.json");
|
|
24
|
+
if (!context.packageJson) {
|
|
25
|
+
const packageJson = await context.fs.read(packageJsonPath);
|
|
26
|
+
if (packageJson) context.packageJson ??= JSON.parse(packageJson);
|
|
27
|
+
}
|
|
28
|
+
if (context.packageJson) {
|
|
29
|
+
if (context.config.bin && Array.isArray(context.config.bin) && context.config.bin.length > 0) {
|
|
30
|
+
context.packageJson.bin = Object.fromEntries(getUnique(toArray(context.config.bin)).map(__assignType((bin) => [bin, formatBinaryPath(context.config.output.format)], [
|
|
31
|
+
"bin",
|
|
32
|
+
"",
|
|
33
|
+
"P\"2!\"/\""
|
|
34
|
+
])));
|
|
35
|
+
await context.fs.write(packageJsonPath, StormJSON.stringify(context.packageJson));
|
|
36
|
+
} else {
|
|
37
|
+
if (Array.isArray(context.config.output.format) && context.config.output.format.length > 1) {
|
|
38
|
+
context.packageJson.bin = { [kebabCase(getAppName(context))]: formatBinaryPath(toArray(context.config.output.format)[0]) };
|
|
39
|
+
context.packageJson.bin = toArray(context.config.output.format).reduce(__assignType((ret, format) => {
|
|
40
|
+
ret[`${kebabCase(getAppName(context))}-${format}`] = formatBinaryPath(format);
|
|
41
|
+
return ret;
|
|
42
|
+
}, [
|
|
43
|
+
"ret",
|
|
44
|
+
"format",
|
|
45
|
+
"",
|
|
46
|
+
"P\"2!\"2\"\"/#"
|
|
47
|
+
]), context.packageJson.bin);
|
|
48
|
+
} else context.packageJson.bin = { [kebabCase(getAppName(context))]: formatBinaryPath(context.config.output.format) };
|
|
49
|
+
await context.fs.write(packageJsonPath, StormJSON.stringify(context.packageJson));
|
|
50
|
+
}
|
|
51
|
+
if (!isSetObject(context.packageJson.bin)) throw new Error("Unable to determine the CLI binary name. Please specify the `bin` option in your Shell Shock configuration or ensure that the `name` field is set in your package.json.");
|
|
52
|
+
context.config.bin = context.packageJson.bin;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
updatePackageJsonBinary.__type = [
|
|
56
|
+
"Context",
|
|
57
|
+
"context",
|
|
58
|
+
"updatePackageJsonBinary",
|
|
59
|
+
"P\"w!2\"$`/#"
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { formatBinaryPath, updatePackageJsonBinary };
|
|
2
64
|
//# sourceMappingURL=update-package-json.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-package-json.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"update-package-json.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
2
|
+
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
3
|
+
let _stryke_cli_utils_tree = require("@stryke/cli/utils/tree");
|
|
4
|
+
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
5
|
+
|
|
6
|
+
//#region src/helpers/utilities.ts
|
|
7
|
+
const __ΩRecord = [
|
|
8
|
+
"K",
|
|
9
|
+
"T",
|
|
10
|
+
"Record",
|
|
11
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
12
|
+
];
|
|
13
|
+
function __assignType(fn, args) {
|
|
14
|
+
fn.__type = args;
|
|
15
|
+
return fn;
|
|
16
|
+
}
|
|
17
|
+
function innerFormatCommandTree(command) {
|
|
18
|
+
return {
|
|
19
|
+
name: `${command.name}${command.virtual ? " (virtual)" : ""}`,
|
|
20
|
+
children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
innerFormatCommandTree.__type = [
|
|
24
|
+
"CommandTree",
|
|
25
|
+
"command",
|
|
26
|
+
"innerFormatCommandTree",
|
|
27
|
+
"P\"w!2\"!/#"
|
|
28
|
+
];
|
|
29
|
+
function formatCommandTree(context) {
|
|
30
|
+
return (0, _stryke_cli_utils_tree.formatTree)({
|
|
31
|
+
name: context.config.name,
|
|
32
|
+
children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
formatCommandTree.__type = [
|
|
36
|
+
"Context",
|
|
37
|
+
"context",
|
|
38
|
+
"formatCommandTree",
|
|
39
|
+
"P\"w!2\"&/#"
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the global command options based on the context configuration.
|
|
43
|
+
*
|
|
44
|
+
* @param context - The build context.
|
|
45
|
+
* @param command - The command for which to retrieve global options.
|
|
46
|
+
* @returns A record of global command options.
|
|
47
|
+
*/
|
|
48
|
+
function getGlobalOptions(context, command) {
|
|
49
|
+
let options;
|
|
50
|
+
if (Array.isArray(context.config.globalOptions)) options = Object.fromEntries((0, _stryke_helpers_get_unique.getUniqueBy)(context.config.globalOptions, __assignType((item) => item.name, [
|
|
51
|
+
"CommandOption",
|
|
52
|
+
"item",
|
|
53
|
+
"",
|
|
54
|
+
"P\"w!2\"\"/#"
|
|
55
|
+
])).map(__assignType((option) => [option.name, option], [
|
|
56
|
+
"option",
|
|
57
|
+
"",
|
|
58
|
+
"P\"2!\"/\""
|
|
59
|
+
])));
|
|
60
|
+
else if ((0, _stryke_type_checks_is_function.isFunction)(context.config.globalOptions)) options = Object.fromEntries((0, _stryke_helpers_get_unique.getUniqueBy)(context.config.globalOptions(context, command), __assignType((item) => item.name, [
|
|
61
|
+
"CommandOption",
|
|
62
|
+
"item",
|
|
63
|
+
"",
|
|
64
|
+
"P\"w!2\"\"/#"
|
|
65
|
+
])).map(__assignType((option) => [option.name, option], [
|
|
66
|
+
"option",
|
|
67
|
+
"",
|
|
68
|
+
"P\"2!\"/\""
|
|
69
|
+
])));
|
|
70
|
+
else options = {};
|
|
71
|
+
return Object.fromEntries(Object.entries(options).map(__assignType(([key, value]) => [key, {
|
|
72
|
+
...value,
|
|
73
|
+
env: value.env ?? (0, _stryke_string_format_constant_case.constantCase)(key)
|
|
74
|
+
}], [
|
|
75
|
+
"param0",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
])));
|
|
79
|
+
}
|
|
80
|
+
getGlobalOptions.__type = [
|
|
81
|
+
"Context",
|
|
82
|
+
"context",
|
|
83
|
+
"CommandBase",
|
|
84
|
+
"command",
|
|
85
|
+
() => __ΩRecord,
|
|
86
|
+
"CommandOption",
|
|
87
|
+
"getGlobalOptions",
|
|
88
|
+
"Retrieves the global command options based on the context configuration.",
|
|
89
|
+
"P\"w!2\"\"w#2$&\"w&o%#/'?("
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
exports.formatCommandTree = formatCommandTree;
|
|
94
|
+
exports.getGlobalOptions = getGlobalOptions;
|
|
95
|
+
//# sourceMappingURL=utilities.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,2 +1,94 @@
|
|
|
1
|
-
import{constantCase
|
|
1
|
+
import { constantCase } from "@stryke/string-format/constant-case";
|
|
2
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
3
|
+
import { formatTree } from "@stryke/cli/utils/tree";
|
|
4
|
+
import { isFunction } from "@stryke/type-checks/is-function";
|
|
5
|
+
|
|
6
|
+
//#region src/helpers/utilities.ts
|
|
7
|
+
const __ΩRecord = [
|
|
8
|
+
"K",
|
|
9
|
+
"T",
|
|
10
|
+
"Record",
|
|
11
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
12
|
+
];
|
|
13
|
+
function __assignType(fn, args) {
|
|
14
|
+
fn.__type = args;
|
|
15
|
+
return fn;
|
|
16
|
+
}
|
|
17
|
+
function innerFormatCommandTree(command) {
|
|
18
|
+
return {
|
|
19
|
+
name: `${command.name}${command.virtual ? " (virtual)" : ""}`,
|
|
20
|
+
children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
innerFormatCommandTree.__type = [
|
|
24
|
+
"CommandTree",
|
|
25
|
+
"command",
|
|
26
|
+
"innerFormatCommandTree",
|
|
27
|
+
"P\"w!2\"!/#"
|
|
28
|
+
];
|
|
29
|
+
function formatCommandTree(context) {
|
|
30
|
+
return formatTree({
|
|
31
|
+
name: context.config.name,
|
|
32
|
+
children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
formatCommandTree.__type = [
|
|
36
|
+
"Context",
|
|
37
|
+
"context",
|
|
38
|
+
"formatCommandTree",
|
|
39
|
+
"P\"w!2\"&/#"
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the global command options based on the context configuration.
|
|
43
|
+
*
|
|
44
|
+
* @param context - The build context.
|
|
45
|
+
* @param command - The command for which to retrieve global options.
|
|
46
|
+
* @returns A record of global command options.
|
|
47
|
+
*/
|
|
48
|
+
function getGlobalOptions(context, command) {
|
|
49
|
+
let options;
|
|
50
|
+
if (Array.isArray(context.config.globalOptions)) options = Object.fromEntries(getUniqueBy(context.config.globalOptions, __assignType((item) => item.name, [
|
|
51
|
+
"CommandOption",
|
|
52
|
+
"item",
|
|
53
|
+
"",
|
|
54
|
+
"P\"w!2\"\"/#"
|
|
55
|
+
])).map(__assignType((option) => [option.name, option], [
|
|
56
|
+
"option",
|
|
57
|
+
"",
|
|
58
|
+
"P\"2!\"/\""
|
|
59
|
+
])));
|
|
60
|
+
else if (isFunction(context.config.globalOptions)) options = Object.fromEntries(getUniqueBy(context.config.globalOptions(context, command), __assignType((item) => item.name, [
|
|
61
|
+
"CommandOption",
|
|
62
|
+
"item",
|
|
63
|
+
"",
|
|
64
|
+
"P\"w!2\"\"/#"
|
|
65
|
+
])).map(__assignType((option) => [option.name, option], [
|
|
66
|
+
"option",
|
|
67
|
+
"",
|
|
68
|
+
"P\"2!\"/\""
|
|
69
|
+
])));
|
|
70
|
+
else options = {};
|
|
71
|
+
return Object.fromEntries(Object.entries(options).map(__assignType(([key, value]) => [key, {
|
|
72
|
+
...value,
|
|
73
|
+
env: value.env ?? constantCase(key)
|
|
74
|
+
}], [
|
|
75
|
+
"param0",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
])));
|
|
79
|
+
}
|
|
80
|
+
getGlobalOptions.__type = [
|
|
81
|
+
"Context",
|
|
82
|
+
"context",
|
|
83
|
+
"CommandBase",
|
|
84
|
+
"command",
|
|
85
|
+
() => __ΩRecord,
|
|
86
|
+
"CommandOption",
|
|
87
|
+
"getGlobalOptions",
|
|
88
|
+
"Retrieves the global command options based on the context configuration.",
|
|
89
|
+
"P\"w!2\"\"w#2$&\"w&o%#/'?("
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { formatCommandTree, getGlobalOptions };
|
|
2
94
|
//# sourceMappingURL=utilities.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"utilities.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
//#region src/helpers/validations.ts
|
|
3
|
+
const __ΩValidationFailure = [
|
|
4
|
+
"code",
|
|
5
|
+
"details",
|
|
6
|
+
"ValidationFailure",
|
|
7
|
+
"P&4!&4\"Mw#y"
|
|
8
|
+
];
|
|
9
|
+
function validateArguments(command) {
|
|
10
|
+
const failures = [];
|
|
11
|
+
let sequential = false;
|
|
12
|
+
for (const argument of command.args ?? []) if ((argument.type === "string" || argument.type === "number") && argument.variadic) if (!sequential) sequential = true;
|
|
13
|
+
else failures.push({
|
|
14
|
+
code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
|
|
15
|
+
details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
|
|
16
|
+
});
|
|
17
|
+
else sequential = false;
|
|
18
|
+
return failures;
|
|
19
|
+
}
|
|
20
|
+
validateArguments.__type = [
|
|
21
|
+
"CommandTree",
|
|
22
|
+
"command",
|
|
23
|
+
() => __ΩValidationFailure,
|
|
24
|
+
"validateArguments",
|
|
25
|
+
"P\"w!2\"n#F/$"
|
|
26
|
+
];
|
|
27
|
+
function validateOptions(command) {
|
|
28
|
+
const failures = [];
|
|
29
|
+
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
30
|
+
for (const option of Object.values(command.options ?? {})) {
|
|
31
|
+
if (optionNames.has(option.name)) failures.push({
|
|
32
|
+
code: "DUPLICATE_OPTION_NAME",
|
|
33
|
+
details: `Duplicate option name "${option.name}" found in command.`
|
|
34
|
+
});
|
|
35
|
+
optionNames.add(option.name);
|
|
36
|
+
for (const alias of option.alias) {
|
|
37
|
+
if (optionNames.has(alias)) failures.push({
|
|
38
|
+
code: "DUPLICATE_OPTION_ALIAS",
|
|
39
|
+
details: `Duplicate option name "${alias}" (an alias of "${option.name}") found in command.`
|
|
40
|
+
});
|
|
41
|
+
optionNames.add(alias);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return failures;
|
|
45
|
+
}
|
|
46
|
+
validateOptions.__type = [
|
|
47
|
+
"CommandTree",
|
|
48
|
+
"command",
|
|
49
|
+
() => __ΩValidationFailure,
|
|
50
|
+
"validateOptions",
|
|
51
|
+
"P\"w!2\"n#F/$"
|
|
52
|
+
];
|
|
53
|
+
function validateCommand(command) {
|
|
54
|
+
const results = [];
|
|
55
|
+
let failures = validateOptions(command);
|
|
56
|
+
if (failures.length > 0) results.push(...failures);
|
|
57
|
+
failures = validateArguments(command);
|
|
58
|
+
if (failures.length > 0) results.push(...failures);
|
|
59
|
+
return results;
|
|
60
|
+
}
|
|
61
|
+
validateCommand.__type = [
|
|
62
|
+
"CommandTree",
|
|
63
|
+
"command",
|
|
64
|
+
() => __ΩValidationFailure,
|
|
65
|
+
"validateCommand",
|
|
66
|
+
"P\"w!2\"n#F/$"
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.validateCommand = validateCommand;
|
|
71
|
+
//# sourceMappingURL=validations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/helpers/validations.ts
|
|
2
|
+
const __ΩValidationFailure = [
|
|
3
|
+
"code",
|
|
4
|
+
"details",
|
|
5
|
+
"ValidationFailure",
|
|
6
|
+
"P&4!&4\"Mw#y"
|
|
7
|
+
];
|
|
8
|
+
function validateArguments(command) {
|
|
9
|
+
const failures = [];
|
|
10
|
+
let sequential = false;
|
|
11
|
+
for (const argument of command.args ?? []) if ((argument.type === "string" || argument.type === "number") && argument.variadic) if (!sequential) sequential = true;
|
|
12
|
+
else failures.push({
|
|
13
|
+
code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
|
|
14
|
+
details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
|
|
15
|
+
});
|
|
16
|
+
else sequential = false;
|
|
17
|
+
return failures;
|
|
18
|
+
}
|
|
19
|
+
validateArguments.__type = [
|
|
20
|
+
"CommandTree",
|
|
21
|
+
"command",
|
|
22
|
+
() => __ΩValidationFailure,
|
|
23
|
+
"validateArguments",
|
|
24
|
+
"P\"w!2\"n#F/$"
|
|
25
|
+
];
|
|
26
|
+
function validateOptions(command) {
|
|
27
|
+
const failures = [];
|
|
28
|
+
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
29
|
+
for (const option of Object.values(command.options ?? {})) {
|
|
30
|
+
if (optionNames.has(option.name)) failures.push({
|
|
31
|
+
code: "DUPLICATE_OPTION_NAME",
|
|
32
|
+
details: `Duplicate option name "${option.name}" found in command.`
|
|
33
|
+
});
|
|
34
|
+
optionNames.add(option.name);
|
|
35
|
+
for (const alias of option.alias) {
|
|
36
|
+
if (optionNames.has(alias)) failures.push({
|
|
37
|
+
code: "DUPLICATE_OPTION_ALIAS",
|
|
38
|
+
details: `Duplicate option name "${alias}" (an alias of "${option.name}") found in command.`
|
|
39
|
+
});
|
|
40
|
+
optionNames.add(alias);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return failures;
|
|
44
|
+
}
|
|
45
|
+
validateOptions.__type = [
|
|
46
|
+
"CommandTree",
|
|
47
|
+
"command",
|
|
48
|
+
() => __ΩValidationFailure,
|
|
49
|
+
"validateOptions",
|
|
50
|
+
"P\"w!2\"n#F/$"
|
|
51
|
+
];
|
|
52
|
+
function validateCommand(command) {
|
|
53
|
+
const results = [];
|
|
54
|
+
let failures = validateOptions(command);
|
|
55
|
+
if (failures.length > 0) results.push(...failures);
|
|
56
|
+
failures = validateArguments(command);
|
|
57
|
+
if (failures.length > 0) results.push(...failures);
|
|
58
|
+
return results;
|
|
59
|
+
}
|
|
60
|
+
validateCommand.__type = [
|
|
61
|
+
"CommandTree",
|
|
62
|
+
"command",
|
|
63
|
+
() => __ΩValidationFailure,
|
|
64
|
+
"validateCommand",
|
|
65
|
+
"P\"w!2\"n#F/$"
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { validateCommand };
|
|
2
70
|
//# sourceMappingURL=validations.mjs.map
|