@shell-shock/core 0.17.7 → 0.17.8
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 +1 -29
- package/dist/api.cjs +1 -95
- package/dist/api.d.cts +52 -4
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +52 -4
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +1 -92
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +1 -292
- package/dist/components/command-validation-logic.mjs +1 -289
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +1 -265
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +1 -256
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +13 -429
- package/dist/components/exec-builtin.mjs +13 -425
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +1 -120
- package/dist/components/helpers.mjs +1 -112
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +1 -58
- package/dist/components/index.mjs +1 -10
- package/dist/components/options-parser-logic.cjs +5 -960
- package/dist/components/options-parser-logic.d.cts +1 -1
- package/dist/components/options-parser-logic.mjs +5 -945
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +8 -629
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +8 -622
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +1 -117
- package/dist/components/usage.mjs +1 -114
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +33 -838
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +33 -828
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +1 -31
- package/dist/config.mjs +1 -29
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +1 -26
- package/dist/contexts/command.mjs +1 -23
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/index.cjs +1 -9
- package/dist/contexts/index.mjs +1 -4
- package/dist/contexts/options.cjs +1 -63
- package/dist/contexts/options.mjs +1 -58
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +1 -71
- package/dist/helpers/automd.mjs +1 -70
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +1 -23
- package/dist/helpers/docs-helpers.mjs +1 -22
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/paths.cjs +1 -137
- package/dist/helpers/paths.mjs +1 -133
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +1 -113
- package/dist/helpers/persistence.mjs +1 -110
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +1 -59
- package/dist/helpers/update-package-json.mjs +1 -57
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +1 -95
- package/dist/helpers/utilities.mjs +1 -93
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +1 -71
- package/dist/helpers/validations.mjs +1 -71
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +1 -52
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -7
- package/dist/plugin-utils/compute-bin.cjs +1 -50
- package/dist/plugin-utils/compute-bin.mjs +1 -49
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +1 -231
- package/dist/plugin-utils/context-helpers.mjs +1 -221
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +1 -71
- package/dist/plugin-utils/deepkit.mjs +1 -69
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +2 -111
- package/dist/plugin-utils/description-helpers.mjs +2 -107
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +1 -117
- package/dist/plugin-utils/get-command-tree.mjs +1 -114
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +1 -39
- package/dist/plugin-utils/index.mjs +1 -10
- package/dist/plugin-utils/reflect.cjs +1 -52
- package/dist/plugin-utils/reflect.mjs +1 -52
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +1 -64
- package/dist/plugin-utils/traverse-command-tree.mjs +1 -62
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +1 -93
- package/dist/plugin-utils/type-checks.mjs +1 -88
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +4 -429
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +4 -423
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +1 -135
- package/dist/resolver/deepkit.mjs +1 -134
- package/dist/resolver/deepkit.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +1 -173
- package/dist/resolver/helpers.mjs +1 -168
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/module.cjs +1 -145
- package/dist/resolver/module.mjs +1 -144
- package/dist/resolver/module.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +1 -222
- package/dist/resolver/resolve.mjs +1 -221
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +1 -441
- package/dist/types/command.mjs +1 -405
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +1 -144
- package/dist/types/config.d.cts +3 -2
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +3 -2
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +1 -138
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +1 -37
- 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 +1 -34
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +1 -52
- package/dist/types/env.mjs +1 -50
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +1 -49
- package/dist/types/index.mjs +1 -6
- package/dist/types/options.cjs +1 -12
- package/dist/types/options.mjs +1 -10
- package/package.json +23 -23
|
@@ -1,95 +1 @@
|
|
|
1
|
-
|
|
2
|
-
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
3
|
-
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
4
|
-
let _stryke_cli_utils_tree = require("@stryke/cli/utils/tree");
|
|
5
|
-
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
6
|
-
|
|
7
|
-
//#region src/helpers/utilities.ts
|
|
8
|
-
const __ΩRecord = [
|
|
9
|
-
"K",
|
|
10
|
-
"T",
|
|
11
|
-
"Record",
|
|
12
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
13
|
-
];
|
|
14
|
-
function __assignType(fn, args) {
|
|
15
|
-
fn.__type = args;
|
|
16
|
-
return fn;
|
|
17
|
-
}
|
|
18
|
-
function innerFormatCommandTree(command) {
|
|
19
|
-
return {
|
|
20
|
-
name: `${command.name}${command.isVirtual ? " (virtual)" : ""}`,
|
|
21
|
-
children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
innerFormatCommandTree.__type = [
|
|
25
|
-
"CommandTree",
|
|
26
|
-
"command",
|
|
27
|
-
"innerFormatCommandTree",
|
|
28
|
-
"P\"w!2\"!/#"
|
|
29
|
-
];
|
|
30
|
-
function formatCommandTree(context) {
|
|
31
|
-
return (0, _stryke_cli_utils_tree.formatTree)({
|
|
32
|
-
name: context.config.name,
|
|
33
|
-
children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
formatCommandTree.__type = [
|
|
37
|
-
"Context",
|
|
38
|
-
"context",
|
|
39
|
-
"formatCommandTree",
|
|
40
|
-
"P\"w!2\"&/#"
|
|
41
|
-
];
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves the global command options based on the context configuration.
|
|
44
|
-
*
|
|
45
|
-
* @param context - The build context.
|
|
46
|
-
* @param command - The command for which to retrieve global options.
|
|
47
|
-
* @returns A record of global command options.
|
|
48
|
-
*/
|
|
49
|
-
function getGlobalOptions(context, command) {
|
|
50
|
-
let options;
|
|
51
|
-
if (Array.isArray(context.config.globalOptions)) options = Object.fromEntries((0, _stryke_helpers_get_unique.getUniqueBy)(context.config.globalOptions, __assignType((item) => item.name, [
|
|
52
|
-
"CommandOption",
|
|
53
|
-
"item",
|
|
54
|
-
"",
|
|
55
|
-
"P\"w!2\"\"/#"
|
|
56
|
-
])).map(__assignType((option) => [option.name, option], [
|
|
57
|
-
"option",
|
|
58
|
-
"",
|
|
59
|
-
"P\"2!\"/\""
|
|
60
|
-
])));
|
|
61
|
-
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, [
|
|
62
|
-
"CommandOption",
|
|
63
|
-
"item",
|
|
64
|
-
"",
|
|
65
|
-
"P\"w!2\"\"/#"
|
|
66
|
-
])).map(__assignType((option) => [option.name, option], [
|
|
67
|
-
"option",
|
|
68
|
-
"",
|
|
69
|
-
"P\"2!\"/\""
|
|
70
|
-
])));
|
|
71
|
-
else options = {};
|
|
72
|
-
return Object.fromEntries(Object.entries(options).map(__assignType(([key, value]) => [key, {
|
|
73
|
-
...value,
|
|
74
|
-
env: value.env ?? (0, _stryke_string_format_constant_case.constantCase)(key)
|
|
75
|
-
}], [
|
|
76
|
-
"param0",
|
|
77
|
-
"",
|
|
78
|
-
"P\"2!\"/\""
|
|
79
|
-
])));
|
|
80
|
-
}
|
|
81
|
-
getGlobalOptions.__type = [
|
|
82
|
-
"Context",
|
|
83
|
-
"context",
|
|
84
|
-
"CommandBase",
|
|
85
|
-
"command",
|
|
86
|
-
() => __ΩRecord,
|
|
87
|
-
"CommandOption",
|
|
88
|
-
"getGlobalOptions",
|
|
89
|
-
"Retrieves the global command options based on the context configuration.",
|
|
90
|
-
"P\"w!2\"\"w#2$&\"w&o%#/'?("
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
exports.formatCommandTree = formatCommandTree;
|
|
95
|
-
exports.getGlobalOptions = getGlobalOptions;
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@stryke/string-format/constant-case`),t=require(`@stryke/helpers/get-unique`),n=require(`@stryke/cli/utils/tree`),r=require(`@stryke/type-checks/is-function`);const i=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];function a(e,t){return e.__type=t,e}function o(e){return{name:`${e.name}${e.isVirtual?` (virtual)`:``}`,children:Object.values(e.children??{}).map(o)}}o.__type=[`CommandTree`,`command`,`innerFormatCommandTree`,`P"w!2"!/#`];function s(e){return(0,n.formatTree)({name:e.config.name,children:Object.values(e.commands??{}).map(o)})}s.__type=[`Context`,`context`,`formatCommandTree`,`P"w!2"&/#`];function c(n,i){let o;return o=Array.isArray(n.config.globalOptions)?Object.fromEntries((0,t.getUniqueBy)(n.config.globalOptions,a(e=>e.name,[`CommandOption`,`item`,``,`P"w!2""/#`])).map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))):(0,r.isFunction)(n.config.globalOptions)?Object.fromEntries((0,t.getUniqueBy)(n.config.globalOptions(n,i),a(e=>e.name,[`CommandOption`,`item`,``,`P"w!2""/#`])).map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))):{},Object.fromEntries(Object.entries(o).map(a(([t,n])=>[t,{...n,env:n.env??(0,e.constantCase)(t)}],[`param0`,``,`P"2!"/"`])))}c.__type=[`Context`,`context`,`CommandBase`,`command`,()=>i,`CommandOption`,`getGlobalOptions`,`Retrieves the global command options based on the context configuration.`,`P"w!2""w#2$&"w&o%#/'?(`],exports.formatCommandTree=s,exports.getGlobalOptions=c;
|
|
@@ -1,94 +1,2 @@
|
|
|
1
|
-
import
|
|
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.isVirtual ? " (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 };
|
|
1
|
+
import{constantCase as e}from"@stryke/string-format/constant-case";import{getUniqueBy as t}from"@stryke/helpers/get-unique";import{formatTree as n}from"@stryke/cli/utils/tree";import{isFunction as r}from"@stryke/type-checks/is-function";const i=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];function a(e,t){return e.__type=t,e}function o(e){return{name:`${e.name}${e.isVirtual?` (virtual)`:``}`,children:Object.values(e.children??{}).map(o)}}o.__type=[`CommandTree`,`command`,`innerFormatCommandTree`,`P"w!2"!/#`];function s(e){return n({name:e.config.name,children:Object.values(e.commands??{}).map(o)})}s.__type=[`Context`,`context`,`formatCommandTree`,`P"w!2"&/#`];function c(n,i){let o;return o=Array.isArray(n.config.globalOptions)?Object.fromEntries(t(n.config.globalOptions,a(e=>e.name,[`CommandOption`,`item`,``,`P"w!2""/#`])).map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))):r(n.config.globalOptions)?Object.fromEntries(t(n.config.globalOptions(n,i),a(e=>e.name,[`CommandOption`,`item`,``,`P"w!2""/#`])).map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))):{},Object.fromEntries(Object.entries(o).map(a(([t,n])=>[t,{...n,env:n.env??e(t)}],[`param0`,``,`P"2!"/"`])))}c.__type=[`Context`,`context`,`CommandBase`,`command`,()=>i,`CommandOption`,`getGlobalOptions`,`Retrieves the global command options based on the context configuration.`,`P"w!2""w#2$&"w&o%#/'?(`];export{s as formatCommandTree,c as getGlobalOptions};
|
|
94
2
|
//# sourceMappingURL=utilities.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[],"sources":["../../src/helpers/utilities.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TreeItem } from \"@stryke/cli/utils/tree\";\nimport { formatTree } from \"@stryke/cli/utils/tree\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport type { CommandBase, CommandOption, CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nfunction innerFormatCommandTree(command: CommandTree): TreeItem {\n return {\n name: `${command.name}${command.isVirtual ? \" (virtual)\" : \"\"}`,\n children: Object.values(command.children ?? {}).map(innerFormatCommandTree)\n };\n}\n\nexport function formatCommandTree(context: Context): string {\n return formatTree({\n name: context.config.name,\n children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)\n });\n}\n\n/**\n * Retrieves the global command options based on the context configuration.\n *\n * @param context - The build context.\n * @param command - The command for which to retrieve global options.\n * @returns A record of global command options.\n */\nexport function getGlobalOptions(\n context: Context,\n command: CommandBase\n): Record<string, CommandOption> {\n let options!: Record<string, CommandOption>;\n if (Array.isArray(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions,\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else if (isFunction(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions(context, command),\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else {\n options = {};\n }\n\n return Object.fromEntries(\n Object.entries(options).map(([key, value]) => [\n key,\n { ...value, env: value.env ?? constantCase(key) }\n ])\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.mjs","names":[],"sources":["../../src/helpers/utilities.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { TreeItem } from \"@stryke/cli/utils/tree\";\nimport { formatTree } from \"@stryke/cli/utils/tree\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport type { CommandBase, CommandOption, CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nfunction innerFormatCommandTree(command: CommandTree): TreeItem {\n return {\n name: `${command.name}${command.isVirtual ? \" (virtual)\" : \"\"}`,\n children: Object.values(command.children ?? {}).map(innerFormatCommandTree)\n };\n}\n\nexport function formatCommandTree(context: Context): string {\n return formatTree({\n name: context.config.name,\n children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)\n });\n}\n\n/**\n * Retrieves the global command options based on the context configuration.\n *\n * @param context - The build context.\n * @param command - The command for which to retrieve global options.\n * @returns A record of global command options.\n */\nexport function getGlobalOptions(\n context: Context,\n command: CommandBase\n): Record<string, CommandOption> {\n let options!: Record<string, CommandOption>;\n if (Array.isArray(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions,\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else if (isFunction(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions(context, command),\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else {\n options = {};\n }\n\n return Object.fromEntries(\n Object.entries(options).map(([key, value]) => [\n key,\n { ...value, env: value.env ?? constantCase(key) }\n ])\n );\n}\n"],"mappings":"6OAAA,MAAM,EAAY,CAAC,IAAK,IAAK,SAAU,wBAAyB,uBAE9D,GAAG,OAAS,IAOd,SAAS,EAAuB,EAAG,CAClC,MAAA,CACA,KAAA,GAAA,EAAoB,OAAM,EAAQ,UAAK,aAAkB,KACzD,SAAa,OAAO,OAAM,EAAQ,UAAa,EAAC,CAAA,CAAG,IAAC,EAAA,0EAIrD,SAAgB,EAAkB,EAAS,WAE3C,KAAO,EAAO,OAAW,KACzB,SAAS,OAAY,OAAO,EAAQ,UAAU,EAAI,CAAC,CAAA,IAAA,EAAA,CACnD,CAAA,CAEA,EAAS,OAAkB,CAAC,UAAQ,UAAc,oBAAU,YAAA,CAQ5D,SAAG,EAAA,EAAA,EAAA,CACH,IAAA,SAMI,wCAJG,OAAS,YAAiB,EAAU,EAAU,OAAO,cAAA,EAAA,GAAA,EAAA,KAAA,CAAA,gBAAA,OAAA,GAAA,YAAA,CAAA,CAAA,CAAA,IAAA,EAAA,GAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CACnD,EAAW,EAAA,OAAA,cAAA,CACV,OAAQ,YAAW,EAAA,EAAA,OAAA,cAAA,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,KAAA,CAAA,gBAAA,OAAA,GAAA,YAAA,CAAA,CAAA,CAAA,IAAA,EAAA,GAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CAEzB,EAAA,yDAGF,GAAA,EACC,IAAA,EAAU,KAAI,EAAe,EAAO,CACtC,CAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CAED,EAAiB,OAAO,CAAA,UAAY,UAAS,cAAgB,cAAO,EAAA,gBAAA,mBAAA,2EAAA,yBAAA"}
|
|
@@ -1,71 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/validations.ts
|
|
4
|
-
const __ΩValidationFailure = [
|
|
5
|
-
"code",
|
|
6
|
-
"details",
|
|
7
|
-
"ValidationFailure",
|
|
8
|
-
"P&4!&4\"Mw#y"
|
|
9
|
-
];
|
|
10
|
-
function validateArguments(command) {
|
|
11
|
-
const failures = [];
|
|
12
|
-
let sequential = false;
|
|
13
|
-
for (const argument of command.args ?? []) if ((argument.kind === require_types_command.CommandParameterKinds.string || argument.kind === require_types_command.CommandParameterKinds.number) && argument.variadic) if (!sequential) sequential = true;
|
|
14
|
-
else failures.push({
|
|
15
|
-
code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
|
|
16
|
-
details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
|
|
17
|
-
});
|
|
18
|
-
else sequential = false;
|
|
19
|
-
return failures;
|
|
20
|
-
}
|
|
21
|
-
validateArguments.__type = [
|
|
22
|
-
"CommandTree",
|
|
23
|
-
"command",
|
|
24
|
-
() => __ΩValidationFailure,
|
|
25
|
-
"validateArguments",
|
|
26
|
-
"P\"w!2\"n#F/$"
|
|
27
|
-
];
|
|
28
|
-
function validateOptions(command) {
|
|
29
|
-
const failures = [];
|
|
30
|
-
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
31
|
-
for (const option of Object.values(command.options ?? {})) {
|
|
32
|
-
if (optionNames.has(option.name)) failures.push({
|
|
33
|
-
code: "DUPLICATE_OPTION_NAME",
|
|
34
|
-
details: `Duplicate option name "${option.name}" found in command.`
|
|
35
|
-
});
|
|
36
|
-
optionNames.add(option.name);
|
|
37
|
-
for (const alias of option.alias) {
|
|
38
|
-
if (optionNames.has(alias)) failures.push({
|
|
39
|
-
code: "DUPLICATE_OPTION_ALIAS",
|
|
40
|
-
details: `Duplicate option name "${alias}" (an alias of "${option.name}") found in command.`
|
|
41
|
-
});
|
|
42
|
-
optionNames.add(alias);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return failures;
|
|
46
|
-
}
|
|
47
|
-
validateOptions.__type = [
|
|
48
|
-
"CommandTree",
|
|
49
|
-
"command",
|
|
50
|
-
() => __ΩValidationFailure,
|
|
51
|
-
"validateOptions",
|
|
52
|
-
"P\"w!2\"n#F/$"
|
|
53
|
-
];
|
|
54
|
-
function validateCommand(command) {
|
|
55
|
-
const results = [];
|
|
56
|
-
let failures = validateOptions(command);
|
|
57
|
-
if (failures.length > 0) results.push(...failures);
|
|
58
|
-
failures = validateArguments(command);
|
|
59
|
-
if (failures.length > 0) results.push(...failures);
|
|
60
|
-
return results;
|
|
61
|
-
}
|
|
62
|
-
validateCommand.__type = [
|
|
63
|
-
"CommandTree",
|
|
64
|
-
"command",
|
|
65
|
-
() => __ΩValidationFailure,
|
|
66
|
-
"validateCommand",
|
|
67
|
-
"P\"w!2\"n#F/$"
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
exports.validateCommand = validateCommand;
|
|
1
|
+
const e=require(`../types/command.cjs`),t=[`code`,`details`,`ValidationFailure`,`P&4!&4"Mw#y`];function n(t){let n=[],r=!1;for(let i of t.args??[])(i.kind===e.CommandParameterKinds.string||i.kind===e.CommandParameterKinds.number)&&i.variadic?r?n.push({code:`SEQUENTIAL_VARIADIC_ARGUMENTS`,details:`Sequential variadic arguments are not allowed - since the argument preceding ${i.name} is variadic, it must not also be variadic.`}):r=!0:r=!1;return n}n.__type=[`CommandTree`,`command`,()=>t,`validateArguments`,`P"w!2"n#F/$`];function r(e){let t=[],n=(Set.Ω=[[`&`]],new Set);for(let r of Object.values(e.options??{})){n.has(r.name)&&t.push({code:`DUPLICATE_OPTION_NAME`,details:`Duplicate option name "${r.name}" found in command.`}),n.add(r.name);for(let e of r.alias)n.has(e)&&t.push({code:`DUPLICATE_OPTION_ALIAS`,details:`Duplicate option name "${e}" (an alias of "${r.name}") found in command.`}),n.add(e)}return t}r.__type=[`CommandTree`,`command`,()=>t,`validateOptions`,`P"w!2"n#F/$`];function i(e){let t=[],i=r(e);return i.length>0&&t.push(...i),i=n(e),i.length>0&&t.push(...i),t}i.__type=[`CommandTree`,`command`,()=>t,`validateCommand`,`P"w!2"n#F/$`],exports.validateCommand=i;
|
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/validations.ts
|
|
4
|
-
const __ΩValidationFailure = [
|
|
5
|
-
"code",
|
|
6
|
-
"details",
|
|
7
|
-
"ValidationFailure",
|
|
8
|
-
"P&4!&4\"Mw#y"
|
|
9
|
-
];
|
|
10
|
-
function validateArguments(command) {
|
|
11
|
-
const failures = [];
|
|
12
|
-
let sequential = false;
|
|
13
|
-
for (const argument of command.args ?? []) if ((argument.kind === CommandParameterKinds.string || argument.kind === CommandParameterKinds.number) && argument.variadic) if (!sequential) sequential = true;
|
|
14
|
-
else failures.push({
|
|
15
|
-
code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
|
|
16
|
-
details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
|
|
17
|
-
});
|
|
18
|
-
else sequential = false;
|
|
19
|
-
return failures;
|
|
20
|
-
}
|
|
21
|
-
validateArguments.__type = [
|
|
22
|
-
"CommandTree",
|
|
23
|
-
"command",
|
|
24
|
-
() => __ΩValidationFailure,
|
|
25
|
-
"validateArguments",
|
|
26
|
-
"P\"w!2\"n#F/$"
|
|
27
|
-
];
|
|
28
|
-
function validateOptions(command) {
|
|
29
|
-
const failures = [];
|
|
30
|
-
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
31
|
-
for (const option of Object.values(command.options ?? {})) {
|
|
32
|
-
if (optionNames.has(option.name)) failures.push({
|
|
33
|
-
code: "DUPLICATE_OPTION_NAME",
|
|
34
|
-
details: `Duplicate option name "${option.name}" found in command.`
|
|
35
|
-
});
|
|
36
|
-
optionNames.add(option.name);
|
|
37
|
-
for (const alias of option.alias) {
|
|
38
|
-
if (optionNames.has(alias)) failures.push({
|
|
39
|
-
code: "DUPLICATE_OPTION_ALIAS",
|
|
40
|
-
details: `Duplicate option name "${alias}" (an alias of "${option.name}") found in command.`
|
|
41
|
-
});
|
|
42
|
-
optionNames.add(alias);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return failures;
|
|
46
|
-
}
|
|
47
|
-
validateOptions.__type = [
|
|
48
|
-
"CommandTree",
|
|
49
|
-
"command",
|
|
50
|
-
() => __ΩValidationFailure,
|
|
51
|
-
"validateOptions",
|
|
52
|
-
"P\"w!2\"n#F/$"
|
|
53
|
-
];
|
|
54
|
-
function validateCommand(command) {
|
|
55
|
-
const results = [];
|
|
56
|
-
let failures = validateOptions(command);
|
|
57
|
-
if (failures.length > 0) results.push(...failures);
|
|
58
|
-
failures = validateArguments(command);
|
|
59
|
-
if (failures.length > 0) results.push(...failures);
|
|
60
|
-
return results;
|
|
61
|
-
}
|
|
62
|
-
validateCommand.__type = [
|
|
63
|
-
"CommandTree",
|
|
64
|
-
"command",
|
|
65
|
-
() => __ΩValidationFailure,
|
|
66
|
-
"validateCommand",
|
|
67
|
-
"P\"w!2\"n#F/$"
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
export { validateCommand };
|
|
1
|
+
import{CommandParameterKinds as e}from"../types/command.mjs";const t=[`code`,`details`,`ValidationFailure`,`P&4!&4"Mw#y`];function n(t){let n=[],r=!1;for(let i of t.args??[])(i.kind===e.string||i.kind===e.number)&&i.variadic?r?n.push({code:`SEQUENTIAL_VARIADIC_ARGUMENTS`,details:`Sequential variadic arguments are not allowed - since the argument preceding ${i.name} is variadic, it must not also be variadic.`}):r=!0:r=!1;return n}n.__type=[`CommandTree`,`command`,()=>t,`validateArguments`,`P"w!2"n#F/$`];function r(e){let t=[],n=(Set.Ω=[[`&`]],new Set);for(let r of Object.values(e.options??{})){n.has(r.name)&&t.push({code:`DUPLICATE_OPTION_NAME`,details:`Duplicate option name "${r.name}" found in command.`}),n.add(r.name);for(let e of r.alias)n.has(e)&&t.push({code:`DUPLICATE_OPTION_ALIAS`,details:`Duplicate option name "${e}" (an alias of "${r.name}") found in command.`}),n.add(e)}return t}r.__type=[`CommandTree`,`command`,()=>t,`validateOptions`,`P"w!2"n#F/$`];function i(e){let t=[],i=r(e);return i.length>0&&t.push(...i),i=n(e),i.length>0&&t.push(...i),t}i.__type=[`CommandTree`,`command`,()=>t,`validateCommand`,`P"w!2"n#F/$`];export{i as validateCommand};
|
|
72
2
|
//# sourceMappingURL=validations.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.mjs","names":[],"sources":["../../src/helpers/validations.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandTree } from \"../types\";\nimport { CommandParameterKinds } from \"../types\";\n\nexport interface ValidationFailure {\n code: string;\n details: string;\n}\n\nexport function validateArguments(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n let sequential = false;\n for (const argument of command.args ?? []) {\n if (\n (argument.kind === CommandParameterKinds.string ||\n argument.kind === CommandParameterKinds.number) &&\n argument.variadic\n ) {\n if (!sequential) {\n sequential = true;\n } else {\n failures.push({\n code: \"SEQUENTIAL_VARIADIC_ARGUMENTS\",\n details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`\n });\n }\n } else {\n sequential = false;\n }\n }\n\n return failures;\n}\n\nexport function validateOptions(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n const optionNames = new Set<string>();\n for (const option of Object.values(command.options ?? {})) {\n if (optionNames.has(option.name)) {\n failures.push({\n code: \"DUPLICATE_OPTION_NAME\",\n details: `Duplicate option name \"${option.name}\" found in command.`\n });\n }\n optionNames.add(option.name);\n\n for (const alias of option.alias) {\n if (optionNames.has(alias)) {\n failures.push({\n code: \"DUPLICATE_OPTION_ALIAS\",\n details: `Duplicate option name \"${alias}\" (an alias of \"${\n option.name\n }\") found in command.`\n });\n }\n optionNames.add(alias);\n }\n }\n\n return failures;\n}\n\nexport function validateCommand(command: CommandTree): ValidationFailure[] {\n const results: ValidationFailure[] = [];\n\n let failures = validateOptions(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n failures = validateArguments(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n return results;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.mjs","names":[],"sources":["../../src/helpers/validations.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { CommandTree } from \"../types\";\nimport { CommandParameterKinds } from \"../types\";\n\nexport interface ValidationFailure {\n code: string;\n details: string;\n}\n\nexport function validateArguments(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n let sequential = false;\n for (const argument of command.args ?? []) {\n if (\n (argument.kind === CommandParameterKinds.string ||\n argument.kind === CommandParameterKinds.number) &&\n argument.variadic\n ) {\n if (!sequential) {\n sequential = true;\n } else {\n failures.push({\n code: \"SEQUENTIAL_VARIADIC_ARGUMENTS\",\n details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`\n });\n }\n } else {\n sequential = false;\n }\n }\n\n return failures;\n}\n\nexport function validateOptions(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n const optionNames = new Set<string>();\n for (const option of Object.values(command.options ?? {})) {\n if (optionNames.has(option.name)) {\n failures.push({\n code: \"DUPLICATE_OPTION_NAME\",\n details: `Duplicate option name \"${option.name}\" found in command.`\n });\n }\n optionNames.add(option.name);\n\n for (const alias of option.alias) {\n if (optionNames.has(alias)) {\n failures.push({\n code: \"DUPLICATE_OPTION_ALIAS\",\n details: `Duplicate option name \"${alias}\" (an alias of \"${\n option.name\n }\") found in command.`\n });\n }\n optionNames.add(alias);\n }\n }\n\n return failures;\n}\n\nexport function validateCommand(command: CommandTree): ValidationFailure[] {\n const results: ValidationFailure[] = [];\n\n let failures = validateOptions(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n failures = validateArguments(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n return results;\n}\n"],"mappings":"6DAkBA,MAAM,EAAsB,CAAA,OAAS,UAAM,oBAAA,cAAA,eAG3C,IAAO,EAAU,EAAA,CACX,EAAQ,GACZ,IAAA,IAAS,KAAM,EAAA,MAAA,EAAA,EACjB,EAAA,OAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,UAKM,KAAU,gCACT,QAAM,gFAAgC,EAAA,KAAA,6CACtC,CAAA,CALA,EAAS,GAQV,EAAS,GAGb,OAAM,EAER,EAAiB,OAAK,CAAA,cAAA,cAAA,EAAA,oBAAA,cAAA,CACtB,SAAgB,EAAC,EAAA,CACf,IAAM,EAAW,EAAC,CACZ,GAAE,IAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KACR,IAAI,IAAA,KAAA,OAAA,OAAA,EAAA,SAAA,EAAA,CAAA,CAAA,CACA,EAAK,IAAA,EAAA,KAAA,EACL,EAAA,KAAa,CACf,KAAA,wBACF,QAAA,0BAAA,EAAA,KAAA,uBAGF,EAAA,IAAA,EAAA,KAAA,sBAEO,EAAS,IAAA,EAAgB,EACxB,EAAS,KAAC,+BAEV,QAAW,0BAAoB,EAAA,kBAAA,EAAA,KAAA,sBAChC,CAAA,CAED,EAAS,IAAK,EAAA,CAGlB,OAAM,EAER,EAAgB,OAAI,CAAM,cAAM,cAAA,EAAA,kBAAA,cAAA,eAE9B,IAAM,EAAO,EAAK,CACd,EAAI,EAAuB,EAAC,CAQhC,OAPI,EAAE,OAAc,GAClB,EAAM,KAAO,GAAA,EAAA,CAEf,EAAU,EAAO,EAAA,CACb,EAAQ,OAAS,GACnB,EAAM,KAAA,GAAA,EAAA,CAEJ,EAEN,EAAE,OAAA,CAAA,cAAA,cAAA,EAAA,kBAAA,cAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,52 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_types_command = require('./types/command.cjs');
|
|
3
|
-
const require_types_config = require('./types/config.cjs');
|
|
4
|
-
const require_types_context = require('./types/context.cjs');
|
|
5
|
-
const require_types_options = require('./types/options.cjs');
|
|
6
|
-
const require_api = require('./api.cjs');
|
|
7
|
-
|
|
8
|
-
exports.CommandParameterKinds = require_types_command.CommandParameterKinds;
|
|
9
|
-
exports.ShellShockAPI = require_api.ShellShockAPI;
|
|
10
|
-
exports.__ΩAsCommandParameterConfig = require_types_command.__ΩAsCommandParameterConfig;
|
|
11
|
-
exports.__ΩBaseBooleanCommandParameter = require_types_command.__ΩBaseBooleanCommandParameter;
|
|
12
|
-
exports.__ΩBaseCommandOptions = require_types_options.__ΩBaseCommandOptions;
|
|
13
|
-
exports.__ΩBaseCommandParameter = require_types_command.__ΩBaseCommandParameter;
|
|
14
|
-
exports.__ΩBaseNumberCommandParameter = require_types_command.__ΩBaseNumberCommandParameter;
|
|
15
|
-
exports.__ΩBaseSingleCommandParameter = require_types_command.__ΩBaseSingleCommandParameter;
|
|
16
|
-
exports.__ΩBaseStringCommandParameter = require_types_command.__ΩBaseStringCommandParameter;
|
|
17
|
-
exports.__ΩBaseVariadicCommandParameter = require_types_command.__ΩBaseVariadicCommandParameter;
|
|
18
|
-
exports.__ΩBooleanCommandOption = require_types_command.__ΩBooleanCommandOption;
|
|
19
|
-
exports.__ΩBooleanCommandParameter = require_types_command.__ΩBooleanCommandParameter;
|
|
20
|
-
exports.__ΩBooleanCommandParameterConfig = require_types_command.__ΩBooleanCommandParameterConfig;
|
|
21
|
-
exports.__ΩCommandArgument = require_types_command.__ΩCommandArgument;
|
|
22
|
-
exports.__ΩCommandArgumentConfig = require_types_command.__ΩCommandArgumentConfig;
|
|
23
|
-
exports.__ΩCommandBase = require_types_command.__ΩCommandBase;
|
|
24
|
-
exports.__ΩCommandConfig = require_types_command.__ΩCommandConfig;
|
|
25
|
-
exports.__ΩCommandMetadata = require_types_command.__ΩCommandMetadata;
|
|
26
|
-
exports.__ΩCommandModule = require_types_command.__ΩCommandModule;
|
|
27
|
-
exports.__ΩCommandOption = require_types_command.__ΩCommandOption;
|
|
28
|
-
exports.__ΩCommandOptionConfig = require_types_command.__ΩCommandOptionConfig;
|
|
29
|
-
exports.__ΩCommandParameter = require_types_command.__ΩCommandParameter;
|
|
30
|
-
exports.__ΩCommandParameterConfig = require_types_command.__ΩCommandParameterConfig;
|
|
31
|
-
exports.__ΩCommandParameterKind = require_types_command.__ΩCommandParameterKind;
|
|
32
|
-
exports.__ΩCommandParameterType = require_types_command.__ΩCommandParameterType;
|
|
33
|
-
exports.__ΩCommandTree = require_types_command.__ΩCommandTree;
|
|
34
|
-
exports.__ΩContext = require_types_context.__ΩContext;
|
|
35
|
-
exports.__ΩNumberCommandParameter = require_types_command.__ΩNumberCommandParameter;
|
|
36
|
-
exports.__ΩNumberCommandParameterConfig = require_types_command.__ΩNumberCommandParameterConfig;
|
|
37
|
-
exports.__ΩOptions = require_types_config.__ΩOptions;
|
|
38
|
-
exports.__ΩOutputConfig = require_types_config.__ΩOutputConfig;
|
|
39
|
-
exports.__ΩReferenceOptions = require_types_config.__ΩReferenceOptions;
|
|
40
|
-
exports.__ΩResolvedConfig = require_types_config.__ΩResolvedConfig;
|
|
41
|
-
exports.__ΩSerializedCommandTree = require_types_command.__ΩSerializedCommandTree;
|
|
42
|
-
exports.__ΩSingleBooleanCommandParameter = require_types_command.__ΩSingleBooleanCommandParameter;
|
|
43
|
-
exports.__ΩSingleNumberCommandParameter = require_types_command.__ΩSingleNumberCommandParameter;
|
|
44
|
-
exports.__ΩSingleStringCommandParameter = require_types_command.__ΩSingleStringCommandParameter;
|
|
45
|
-
exports.__ΩStringCommandParameter = require_types_command.__ΩStringCommandParameter;
|
|
46
|
-
exports.__ΩStringCommandParameterConfig = require_types_command.__ΩStringCommandParameterConfig;
|
|
47
|
-
exports.__ΩUnresolvedContext = require_types_context.__ΩUnresolvedContext;
|
|
48
|
-
exports.__ΩUserConfig = require_types_config.__ΩUserConfig;
|
|
49
|
-
exports.__ΩVariadicBooleanCommandParameter = require_types_command.__ΩVariadicBooleanCommandParameter;
|
|
50
|
-
exports.__ΩVariadicNumberCommandParameter = require_types_command.__ΩVariadicNumberCommandParameter;
|
|
51
|
-
exports.__ΩVariadicStringCommandParameter = require_types_command.__ΩVariadicStringCommandParameter;
|
|
52
|
-
exports.createShellShock = require_api.createShellShock;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./types/command.cjs`),t=require(`./types/config.cjs`),n=require(`./types/context.cjs`),r=require(`./types/options.cjs`),i=require(`./api.cjs`);exports.CommandParameterKinds=e.CommandParameterKinds,exports.ShellShockAPI=i.ShellShockAPI,exports.__ΩAsCommandParameterConfig=e.__ΩAsCommandParameterConfig,exports.__ΩBaseBooleanCommandParameter=e.__ΩBaseBooleanCommandParameter,exports.__ΩBaseCommandOptions=r.__ΩBaseCommandOptions,exports.__ΩBaseCommandParameter=e.__ΩBaseCommandParameter,exports.__ΩBaseNumberCommandParameter=e.__ΩBaseNumberCommandParameter,exports.__ΩBaseSingleCommandParameter=e.__ΩBaseSingleCommandParameter,exports.__ΩBaseStringCommandParameter=e.__ΩBaseStringCommandParameter,exports.__ΩBaseVariadicCommandParameter=e.__ΩBaseVariadicCommandParameter,exports.__ΩBooleanCommandOption=e.__ΩBooleanCommandOption,exports.__ΩBooleanCommandParameter=e.__ΩBooleanCommandParameter,exports.__ΩBooleanCommandParameterConfig=e.__ΩBooleanCommandParameterConfig,exports.__ΩCommandArgument=e.__ΩCommandArgument,exports.__ΩCommandArgumentConfig=e.__ΩCommandArgumentConfig,exports.__ΩCommandBase=e.__ΩCommandBase,exports.__ΩCommandConfig=e.__ΩCommandConfig,exports.__ΩCommandMetadata=e.__ΩCommandMetadata,exports.__ΩCommandModule=e.__ΩCommandModule,exports.__ΩCommandOption=e.__ΩCommandOption,exports.__ΩCommandOptionConfig=e.__ΩCommandOptionConfig,exports.__ΩCommandParameter=e.__ΩCommandParameter,exports.__ΩCommandParameterConfig=e.__ΩCommandParameterConfig,exports.__ΩCommandParameterKind=e.__ΩCommandParameterKind,exports.__ΩCommandParameterType=e.__ΩCommandParameterType,exports.__ΩCommandTree=e.__ΩCommandTree,exports.__ΩContext=n.__ΩContext,exports.__ΩNumberCommandParameter=e.__ΩNumberCommandParameter,exports.__ΩNumberCommandParameterConfig=e.__ΩNumberCommandParameterConfig,exports.__ΩOptions=t.__ΩOptions,exports.__ΩOutputConfig=t.__ΩOutputConfig,exports.__ΩReferenceOptions=t.__ΩReferenceOptions,exports.__ΩResolvedConfig=t.__ΩResolvedConfig,exports.__ΩSerializedCommandTree=e.__ΩSerializedCommandTree,exports.__ΩSingleBooleanCommandParameter=e.__ΩSingleBooleanCommandParameter,exports.__ΩSingleNumberCommandParameter=e.__ΩSingleNumberCommandParameter,exports.__ΩSingleStringCommandParameter=e.__ΩSingleStringCommandParameter,exports.__ΩStringCommandParameter=e.__ΩStringCommandParameter,exports.__ΩStringCommandParameterConfig=e.__ΩStringCommandParameterConfig,exports.__ΩUnresolvedContext=n.__ΩUnresolvedContext,exports.__ΩUserConfig=t.__ΩUserConfig,exports.__ΩVariadicBooleanCommandParameter=e.__ΩVariadicBooleanCommandParameter,exports.__ΩVariadicNumberCommandParameter=e.__ΩVariadicNumberCommandParameter,exports.__ΩVariadicStringCommandParameter=e.__ΩVariadicStringCommandParameter,exports.createShellShock=i.createShellShock;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ShellShockAPI, createShellShock } from "./api.cjs";
|
|
1
2
|
import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.cjs";
|
|
2
3
|
import { Context, UnresolvedContext } from "./types/context.cjs";
|
|
3
4
|
import { Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig } from "./types/config.cjs";
|
|
4
|
-
import { ShellShockAPI, createShellShock } from "./api.cjs";
|
|
5
5
|
import { BaseCommandOptions } from "./types/options.cjs";
|
|
6
6
|
export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandOptions, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ReferenceOptions, ResolvedConfig, SerializedCommandTree, ShellShockAPI, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter, createShellShock };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ShellShockAPI, createShellShock } from "./api.mjs";
|
|
1
2
|
import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.mjs";
|
|
2
3
|
import { Context, UnresolvedContext } from "./types/context.mjs";
|
|
3
4
|
import { Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig } from "./types/config.mjs";
|
|
4
|
-
import { ShellShockAPI, createShellShock } from "./api.mjs";
|
|
5
5
|
import { BaseCommandOptions } from "./types/options.mjs";
|
|
6
6
|
export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandOptions, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ReferenceOptions, ResolvedConfig, SerializedCommandTree, ShellShockAPI, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter, createShellShock };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import { CommandParameterKinds, __ΩAsCommandParameterConfig, __ΩBaseBooleanCommandParameter, __ΩBaseCommandParameter, __ΩBaseNumberCommandParameter, __ΩBaseSingleCommandParameter, __ΩBaseStringCommandParameter, __ΩBaseVariadicCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩSerializedCommandTree, __ΩSingleBooleanCommandParameter, __ΩSingleNumberCommandParameter, __ΩSingleStringCommandParameter, __ΩStringCommandParameter, __ΩStringCommandParameterConfig, __ΩVariadicBooleanCommandParameter, __ΩVariadicNumberCommandParameter, __ΩVariadicStringCommandParameter }
|
|
2
|
-
import { __ΩOptions, __ΩOutputConfig, __ΩReferenceOptions, __ΩResolvedConfig, __ΩUserConfig } from "./types/config.mjs";
|
|
3
|
-
import { __ΩContext, __ΩUnresolvedContext } from "./types/context.mjs";
|
|
4
|
-
import { __ΩBaseCommandOptions } from "./types/options.mjs";
|
|
5
|
-
import { ShellShockAPI, createShellShock } from "./api.mjs";
|
|
6
|
-
|
|
7
|
-
export { CommandParameterKinds, ShellShockAPI, __ΩAsCommandParameterConfig, __ΩBaseBooleanCommandParameter, __ΩBaseCommandOptions, __ΩBaseCommandParameter, __ΩBaseNumberCommandParameter, __ΩBaseSingleCommandParameter, __ΩBaseStringCommandParameter, __ΩBaseVariadicCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩContext, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩOptions, __ΩOutputConfig, __ΩReferenceOptions, __ΩResolvedConfig, __ΩSerializedCommandTree, __ΩSingleBooleanCommandParameter, __ΩSingleNumberCommandParameter, __ΩSingleStringCommandParameter, __ΩStringCommandParameter, __ΩStringCommandParameterConfig, __ΩUnresolvedContext, __ΩUserConfig, __ΩVariadicBooleanCommandParameter, __ΩVariadicNumberCommandParameter, __ΩVariadicStringCommandParameter, createShellShock };
|
|
1
|
+
import{CommandParameterKinds as e,__ΩAsCommandParameterConfig as t,__ΩBaseBooleanCommandParameter as n,__ΩBaseCommandParameter as r,__ΩBaseNumberCommandParameter as i,__ΩBaseSingleCommandParameter as a,__ΩBaseStringCommandParameter as o,__ΩBaseVariadicCommandParameter as s,__ΩBooleanCommandOption as c,__ΩBooleanCommandParameter as l,__ΩBooleanCommandParameterConfig as u,__ΩCommandArgument as d,__ΩCommandArgumentConfig as f,__ΩCommandBase as p,__ΩCommandConfig as m,__ΩCommandMetadata as h,__ΩCommandModule as g,__ΩCommandOption as _,__ΩCommandOptionConfig as v,__ΩCommandParameter as y,__ΩCommandParameterConfig as b,__ΩCommandParameterKind as x,__ΩCommandParameterType as S,__ΩCommandTree as C,__ΩNumberCommandParameter as w,__ΩNumberCommandParameterConfig as T,__ΩSerializedCommandTree as E,__ΩSingleBooleanCommandParameter as D,__ΩSingleNumberCommandParameter as O,__ΩSingleStringCommandParameter as k,__ΩStringCommandParameter as A,__ΩStringCommandParameterConfig as j,__ΩVariadicBooleanCommandParameter as M,__ΩVariadicNumberCommandParameter as N,__ΩVariadicStringCommandParameter as P}from"./types/command.mjs";import{__ΩOptions as F,__ΩOutputConfig as I,__ΩReferenceOptions as L,__ΩResolvedConfig as R,__ΩUserConfig as z}from"./types/config.mjs";import{__ΩContext as B,__ΩUnresolvedContext as V}from"./types/context.mjs";import{__ΩBaseCommandOptions as H}from"./types/options.mjs";import{ShellShockAPI as U,createShellShock as W}from"./api.mjs";export{e as CommandParameterKinds,U as ShellShockAPI,t as __ΩAsCommandParameterConfig,n as __ΩBaseBooleanCommandParameter,H as __ΩBaseCommandOptions,r as __ΩBaseCommandParameter,i as __ΩBaseNumberCommandParameter,a as __ΩBaseSingleCommandParameter,o as __ΩBaseStringCommandParameter,s as __ΩBaseVariadicCommandParameter,c as __ΩBooleanCommandOption,l as __ΩBooleanCommandParameter,u as __ΩBooleanCommandParameterConfig,d as __ΩCommandArgument,f as __ΩCommandArgumentConfig,p as __ΩCommandBase,m as __ΩCommandConfig,h as __ΩCommandMetadata,g as __ΩCommandModule,_ as __ΩCommandOption,v as __ΩCommandOptionConfig,y as __ΩCommandParameter,b as __ΩCommandParameterConfig,x as __ΩCommandParameterKind,S as __ΩCommandParameterType,C as __ΩCommandTree,B as __ΩContext,w as __ΩNumberCommandParameter,T as __ΩNumberCommandParameterConfig,F as __ΩOptions,I as __ΩOutputConfig,L as __ΩReferenceOptions,R as __ΩResolvedConfig,E as __ΩSerializedCommandTree,D as __ΩSingleBooleanCommandParameter,O as __ΩSingleNumberCommandParameter,k as __ΩSingleStringCommandParameter,A as __ΩStringCommandParameter,j as __ΩStringCommandParameterConfig,V as __ΩUnresolvedContext,z as __ΩUserConfig,M as __ΩVariadicBooleanCommandParameter,N as __ΩVariadicNumberCommandParameter,P as __ΩVariadicStringCommandParameter,W as createShellShock};
|
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const require_context_helpers = require('./context-helpers.cjs');
|
|
3
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
4
|
-
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
|
|
6
|
-
//#region src/plugin-utils/compute-bin.ts
|
|
7
|
-
function __assignType(fn, args) {
|
|
8
|
-
fn.__type = args;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.
|
|
13
|
-
*
|
|
14
|
-
* @param context - The plugin context containing the necessary information to compute the command tree.
|
|
15
|
-
* @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.
|
|
16
|
-
*/
|
|
17
|
-
function computeBin(context) {
|
|
18
|
-
return (0, _alloy_js_core.computed)(() => ({
|
|
19
|
-
id: "",
|
|
20
|
-
name: require_context_helpers.getAppName(context),
|
|
21
|
-
title: require_context_helpers.getAppTitle(context),
|
|
22
|
-
description: require_context_helpers.getAppDescription(context),
|
|
23
|
-
isVirtual: true,
|
|
24
|
-
path: null,
|
|
25
|
-
segments: [],
|
|
26
|
-
alias: [],
|
|
27
|
-
tags: [],
|
|
28
|
-
source: "file",
|
|
29
|
-
options: Object.fromEntries(context.options.map(__assignType((option) => [option.name, option], [
|
|
30
|
-
"option",
|
|
31
|
-
"",
|
|
32
|
-
"P\"2!\"/\""
|
|
33
|
-
]))),
|
|
34
|
-
args: [],
|
|
35
|
-
entry: { file: (0, _stryke_path_join_paths.joinPaths)(context.entryPath, "bin.ts") },
|
|
36
|
-
parent: null,
|
|
37
|
-
children: context.commands
|
|
38
|
-
})).value;
|
|
39
|
-
}
|
|
40
|
-
computeBin.__type = [
|
|
41
|
-
"Context",
|
|
42
|
-
"context",
|
|
43
|
-
"CommandTree",
|
|
44
|
-
"computeBin",
|
|
45
|
-
"Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.",
|
|
46
|
-
"P\"w!2\"\"w#/$?%"
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
exports.computeBin = computeBin;
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./context-helpers.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`@alloy-js/core`);function r(e,t){return e.__type=t,e}function i(i){return(0,n.computed)(()=>({id:``,name:e.getAppName(i),title:e.getAppTitle(i),description:e.getAppDescription(i),isVirtual:!0,path:null,segments:[],alias:[],tags:[],source:`file`,options:Object.fromEntries(i.globalOptions.map(r(e=>[e.name,e],[`option`,``,`P"2!"/"`]))),args:[],entry:{file:(0,t.joinPaths)(i.entryPath,`bin.ts`)},parent:null,children:i.commands})).value}i.__type=[`Context`,`context`,`CommandTree`,`computeBin`,`Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.`,`P"w!2""w#/$?%`],exports.computeBin=i;
|
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
3
|
-
import { computed } from "@alloy-js/core";
|
|
4
|
-
|
|
5
|
-
//#region src/plugin-utils/compute-bin.ts
|
|
6
|
-
function __assignType(fn, args) {
|
|
7
|
-
fn.__type = args;
|
|
8
|
-
return fn;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.
|
|
12
|
-
*
|
|
13
|
-
* @param context - The plugin context containing the necessary information to compute the command tree.
|
|
14
|
-
* @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.
|
|
15
|
-
*/
|
|
16
|
-
function computeBin(context) {
|
|
17
|
-
return computed(() => ({
|
|
18
|
-
id: "",
|
|
19
|
-
name: getAppName(context),
|
|
20
|
-
title: getAppTitle(context),
|
|
21
|
-
description: getAppDescription(context),
|
|
22
|
-
isVirtual: true,
|
|
23
|
-
path: null,
|
|
24
|
-
segments: [],
|
|
25
|
-
alias: [],
|
|
26
|
-
tags: [],
|
|
27
|
-
source: "file",
|
|
28
|
-
options: Object.fromEntries(context.options.map(__assignType((option) => [option.name, option], [
|
|
29
|
-
"option",
|
|
30
|
-
"",
|
|
31
|
-
"P\"2!\"/\""
|
|
32
|
-
]))),
|
|
33
|
-
args: [],
|
|
34
|
-
entry: { file: joinPaths(context.entryPath, "bin.ts") },
|
|
35
|
-
parent: null,
|
|
36
|
-
children: context.commands
|
|
37
|
-
})).value;
|
|
38
|
-
}
|
|
39
|
-
computeBin.__type = [
|
|
40
|
-
"Context",
|
|
41
|
-
"context",
|
|
42
|
-
"CommandTree",
|
|
43
|
-
"computeBin",
|
|
44
|
-
"Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.",
|
|
45
|
-
"P\"w!2\"\"w#/$?%"
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { computeBin };
|
|
1
|
+
import{getAppDescription as e,getAppName as t,getAppTitle as n}from"./context-helpers.mjs";import{joinPaths as r}from"@stryke/path/join-paths";import{computed as i}from"@alloy-js/core";function a(e,t){return e.__type=t,e}function o(o){return i(()=>({id:``,name:t(o),title:n(o),description:e(o),isVirtual:!0,path:null,segments:[],alias:[],tags:[],source:`file`,options:Object.fromEntries(o.globalOptions.map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))),args:[],entry:{file:r(o.entryPath,`bin.ts`)},parent:null,children:o.commands})).value}o.__type=[`Context`,`context`,`CommandTree`,`computeBin`,`Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.`,`P"w!2""w#/$?%`];export{o as computeBin};
|
|
50
2
|
//# sourceMappingURL=compute-bin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-bin.mjs","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed } from \"@alloy-js/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { CommandTree, Context } from \"../types\";\nimport { getAppDescription, getAppName, getAppTitle } from \"./context-helpers\";\n\n/**\n * Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.\n *\n * @param context - The plugin context containing the necessary information to compute the command tree.\n * @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.\n */\nexport function computeBin(context: Context): CommandTree {\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(context),\n title: getAppTitle(context),\n description: getAppDescription(context),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n source: \"file\",\n options: Object.fromEntries(\n context.
|
|
1
|
+
{"version":3,"file":"compute-bin.mjs","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed } from \"@alloy-js/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { CommandTree, Context } from \"../types\";\nimport { getAppDescription, getAppName, getAppTitle } from \"./context-helpers\";\n\n/**\n * Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.\n *\n * @param context - The plugin context containing the necessary information to compute the command tree.\n * @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.\n */\nexport function computeBin(context: Context): CommandTree {\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(context),\n title: getAppTitle(context),\n description: getAppDescription(context),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n source: \"file\",\n options: Object.fromEntries(\n context.globalOptions.map(option => [option.name, option])\n ),\n args: [],\n entry: {\n file: joinPaths(context.entryPath, \"bin.ts\")\n },\n parent: null,\n children: context.commands\n }));\n\n return bin.value;\n}\n"],"mappings":"yLAAA,SAAS,EAAa,EAAI,EAAM,CAE9B,kBAAO,EA4BT,SAAc,EAAa,EAAG,CAoB5B,OAnBQ,OAAA,CACN,GAAI,GACJ,KAAM,EAAC,EAAY,CACnB,MAAA,EAAa,EAAA,CACb,YAAW,EAAI,EAAA,CACf,UAAU,GACV,KAAA,KACA,SAAS,EAAA,CACT,MAAO,EAAC,CACR,KAAM,EAAE,CACR,OAAQ,OACR,QAAS,OAAC,YAAkB,EAAQ,cAAc,IAAE,EAAO,GAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CAC3D,KAAC,EAAA,CACD,MAAO,CACP,KAAO,EAAA,EAAA,UAAA,SAAA,CACN,CACD,OAAC,KACD,SAAQ,EAAI,SACb,EACE,CAAA,MAEL,EAAS,OAAS,CAAA,UAAA,UAAA,cAAA,aAAA,yMAAA,gBAAA"}
|