@shell-shock/core 0.8.13 → 0.9.1
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/api.cjs +34 -0
- package/dist/api.cjs.map +1 -1
- package/dist/api.mjs +34 -0
- package/dist/api.mjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/helpers.d.cts +6 -6
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -6
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/options-parser-logic.d.cts +9 -9
- package/dist/components/options-parser-logic.d.mts +9 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.mts +2 -2
- package/dist/components/utils-builtin.cjs +341 -0
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +12 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +5 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +342 -2
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +12 -0
- package/dist/config.cjs.map +1 -1
- package/dist/config.mjs +12 -0
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +3 -2
- package/dist/contexts/command.cjs.map +1 -1
- package/dist/contexts/command.mjs +3 -2
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/options.cjs +20 -4
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.mjs +20 -4
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +6 -0
- package/dist/helpers/docs-helpers.cjs.map +1 -1
- package/dist/helpers/docs-helpers.mjs +6 -0
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +92 -11
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs +92 -11
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/resolve-command.cjs +200 -18
- package/dist/helpers/resolve-command.cjs.map +1 -1
- package/dist/helpers/resolve-command.mjs +201 -19
- package/dist/helpers/resolve-command.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +27 -3
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/update-package-json.mjs +27 -3
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +58 -4
- package/dist/helpers/utilities.cjs.map +1 -1
- package/dist/helpers/utilities.mjs +58 -4
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +28 -1
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +28 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +78 -3
- package/dist/plugin-utils/context-helpers.cjs.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +78 -3
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +17 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs +17 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/reflect.cjs +31 -3
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.mjs +31 -3
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +34 -4
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +34 -4
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin.cjs +5 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +5 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/types/command.cjs +241 -0
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.mjs +221 -1
- package/dist/types/command.mjs.map +1 -0
- package/dist/types/config.cjs +114 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +11 -10
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +11 -10
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +110 -1
- package/dist/types/config.mjs.map +1 -0
- package/dist/types/context.cjs +33 -0
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.mjs +31 -1
- package/dist/types/context.mjs.map +1 -0
- package/dist/types/env.cjs +12 -0
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts +17 -0
- package/dist/types/env.d.cts.map +1 -0
- package/dist/types/env.d.mts +17 -0
- package/dist/types/env.d.mts.map +1 -0
- package/dist/types/env.mjs +11 -0
- package/dist/types/env.mjs.map +1 -0
- package/dist/types/index.cjs +34 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +7 -1
- package/dist/types/options.cjs +12 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.mjs +11 -1
- package/dist/types/options.mjs.map +1 -0
- package/dist/types/runtime.cjs +12 -0
- package/dist/types/runtime.cjs.map +1 -0
- package/dist/types/runtime.mjs +11 -1
- package/dist/types/runtime.mjs.map +1 -0
- package/package.json +25 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-package-json.mjs","names":[
|
|
1
|
+
{"version":3,"file":"update-package-json.mjs","names":[],"sources":["../../src/helpers/update-package-json.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 { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getAppName } from \"../plugin-utils/context-helpers\";\nimport type { UnresolvedContext } from \"../types/context\";\n\nexport function formatBinaryPath(\n format: string | string[] | undefined\n): string {\n return `./dist/bin.${\n format === \"cjs\" || (Array.isArray(format) && format.includes(\"cjs\"))\n ? \"cjs\"\n : \"mjs\"\n }`;\n}\n\nexport async function updatePackageJsonBinary(\n context: UnresolvedContext\n): Promise<void> {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.projectRoot,\n \"package.json\"\n );\n if (\n context.config.bin &&\n Array.isArray(context.config.bin) &&\n context.config.bin.length > 0\n ) {\n context.packageJson.bin = Object.fromEntries(\n getUnique(toArray(context.config.bin)).map(bin => [\n bin,\n formatBinaryPath(context.config.output.format)\n ])\n );\n\n await context.fs.write(\n packageJsonPath,\n StormJSON.stringify(context.packageJson)\n );\n } else {\n if (\n Array.isArray(context.config.output.format) &&\n context.config.output.format.length > 1\n ) {\n context.packageJson.bin = {\n [kebabCase(getAppName(context))]: formatBinaryPath(\n toArray(context.config.output.format)[0]\n )\n };\n context.packageJson.bin = toArray(context.config.output.format).reduce(\n (ret, format) => {\n ret[`${kebabCase(getAppName(context))}-${format}`] =\n formatBinaryPath(format);\n\n return ret;\n },\n context.packageJson.bin\n );\n } else {\n context.packageJson.bin = {\n [kebabCase(getAppName(context))]: formatBinaryPath(\n context.config.output.format\n )\n };\n }\n\n await context.fs.write(\n packageJsonPath,\n StormJSON.stringify(context.packageJson)\n );\n }\n\n if (!isSetObject(context.packageJson.bin)) {\n throw new Error(\n \"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.\"\n );\n }\n\n context.config.bin = Object.keys(context.packageJson.bin);\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE5B,QAAO;;AA0BX,SAAgB,iBAAiB,QAAK;AAClC,QAAM,cAAA,WAAA,SAAA,MAAA,QAAA,OAAA,IAAA,OAAA,SAAA,MAAA,GACA,QACA;;AAEV,iBAAY,SAAA;CAAA;CAAA;CAAA;CAAA;AACZ,eAAI,wBAAA,SAAA;CACJ,MAAA,kBAAA,UAAA,QAAA,gBAAA,eAAA,QAAA,OAAA,aAAA,eAAA;2BAEQ,MAAM,QAAQ,QAAQ,OAAO,IAAI,IACjC,QAAQ,OAAO,IAAI,SAAA,GAAA;AACnB,UAAQ,YAAC,MAAA,OAAA,YAAA,UAAA,QAAA,QAAA,OAAA,IAAA,CAAA,CAAA,IAAA,cAAA,QAAA,CACL,KACA,iBAAiB,QAAQ,OAAI,OAAA,OAAA,CAChC,EAAE;GAAC;GAAO;GAAI;GAAO,CAAA,CAAA,CAAA;AACtB,QAAM,QAAG,GAAA,MAAA,iBAAA,UAAA,UAAA,QAAA,YAAA,CAAA;QAEZ;AACG,MAAI,MAAM,QAAM,QAAA,OAAA,OAAA,OAAA,IACZ,QAAQ,OAAO,OAAO,OAAK,SAAA,GAAA;AAC3B,WAAQ,YAAY,MAAA,GAC5B,UAAA,WAAA,QAAA,CAAA,GAAA,iBAAA,QAAA,QAAA,OAAA,OAAA,OAAA,CAAA,GAAA,EACS;AACD,WAAQ,YAAY,MAAM,QAAQ,QAAQ,OAAE,OAAA,OAAA,CAAA,OAAA,cAAA,KAAA,WAAA;AAC7C,QAAA,GAAA,UAAA,WAAA,QAAA,CAAA,CAAA,GAAA,YACS,iBAAiB,OAAO;AACrC,WAAA;MACF;IAAA;IAAA;IAAA;IAAA;IAAA,CAAA,EAAA,QAAA,YAAA,IAAA;QAGO,SAAQ,YAAC,MAAA,GACJ,UAAU,WAAW,QAAO,CAAA,GAAA,iBAAA,QAAA,OAAA,OAAA,OAAA,EACxC;AAEE,QAAA,QAAA,GAAA,MAAA,iBAAA,UAAA,UAAA,QAAA,YAAA,CAAA;;AAEH,KAAI,CAAC,YAAY,QAAQ,YAAY,IAAG,CACtC,OAAA,IAAA,MAAA,0KAAA;AAEF,SAAQ,OAAO,MAAM,OAAO,KAAK,QAAQ,YAAY,IAAC;;AAE1D,wBAAQ,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -5,18 +5,40 @@ let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
|
5
5
|
let __stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
6
6
|
|
|
7
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
|
+
}
|
|
8
18
|
function innerFormatCommandTree(command) {
|
|
9
19
|
return {
|
|
10
20
|
name: `${command.name}${command.isVirtual ? " (virtual)" : ""}`,
|
|
11
21
|
children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
|
|
12
22
|
};
|
|
13
23
|
}
|
|
24
|
+
innerFormatCommandTree.__type = [
|
|
25
|
+
"CommandTree",
|
|
26
|
+
"command",
|
|
27
|
+
"innerFormatCommandTree",
|
|
28
|
+
"P\"w!2\"!/#"
|
|
29
|
+
];
|
|
14
30
|
function formatCommandTree(context) {
|
|
15
31
|
return (0, __stryke_cli_utils_tree.formatTree)({
|
|
16
32
|
name: context.config.name,
|
|
17
33
|
children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)
|
|
18
34
|
});
|
|
19
35
|
}
|
|
36
|
+
formatCommandTree.__type = [
|
|
37
|
+
"Context",
|
|
38
|
+
"context",
|
|
39
|
+
"formatCommandTree",
|
|
40
|
+
"P\"w!2\"&/#"
|
|
41
|
+
];
|
|
20
42
|
/**
|
|
21
43
|
* Retrieves the default command options based on the context configuration.
|
|
22
44
|
*
|
|
@@ -26,14 +48,46 @@ function formatCommandTree(context) {
|
|
|
26
48
|
*/
|
|
27
49
|
function getDefaultOptions(context, command) {
|
|
28
50
|
let options;
|
|
29
|
-
if (Array.isArray(context.config.defaultOptions)) options = Object.fromEntries((0, __stryke_helpers_get_unique.getUniqueBy)(context.config.defaultOptions, (item) => item.name
|
|
30
|
-
|
|
51
|
+
if (Array.isArray(context.config.defaultOptions)) options = Object.fromEntries((0, __stryke_helpers_get_unique.getUniqueBy)(context.config.defaultOptions, __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.defaultOptions)) options = Object.fromEntries((0, __stryke_helpers_get_unique.getUniqueBy)(context.config.defaultOptions(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
|
+
])));
|
|
31
71
|
else options = {};
|
|
32
|
-
return Object.fromEntries(Object.entries(options).map(([key, value]) => [key, {
|
|
72
|
+
return Object.fromEntries(Object.entries(options).map(__assignType(([key, value]) => [key, {
|
|
33
73
|
...value,
|
|
34
74
|
env: value.env ?? (0, __stryke_string_format_constant_case.constantCase)(key)
|
|
35
|
-
}]
|
|
75
|
+
}], [
|
|
76
|
+
"param0",
|
|
77
|
+
"",
|
|
78
|
+
"P\"2!\"/\""
|
|
79
|
+
])));
|
|
36
80
|
}
|
|
81
|
+
getDefaultOptions.__type = [
|
|
82
|
+
"Context",
|
|
83
|
+
"context",
|
|
84
|
+
"CommandBase",
|
|
85
|
+
"command",
|
|
86
|
+
() => __ΩRecord,
|
|
87
|
+
"CommandOption",
|
|
88
|
+
"getDefaultOptions",
|
|
89
|
+
"P\"w!2\"\"w#2$&\"w&o%#/'"
|
|
90
|
+
];
|
|
37
91
|
|
|
38
92
|
//#endregion
|
|
39
93
|
exports.formatCommandTree = formatCommandTree;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.cjs","names":[
|
|
1
|
+
{"version":3,"file":"utilities.cjs","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 default command options based on the context configuration.\n *\n * @param context - The build context.\n * @param command - The command for which to retrieve default options.\n * @returns A record of default command options.\n */\nexport function getDefaultOptions(\n context: Context,\n command: CommandBase\n): Record<string, CommandOption> {\n let options!: Record<string, CommandOption>;\n if (Array.isArray(context.config.defaultOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.defaultOptions,\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else if (isFunction(context.config.defaultOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.defaultOptions(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":";;;;;;;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;AAE5D,IAAG,SAAS;;;AAOhB,SAAS,uBAAuB,SAAS;AACrC,QAAO;EACH,MAAM,GAAG,QAAQ,OAAO,QAAQ,YAAY,eAAe;EAC3D,UAAU,OAAO,OAAO,QAAQ,YAAY,EAAE,CAAC,CAAC,IAAG,uBAAA;;;;;;;;;AAI3D,SAAgB,kBAAkB,SAAS;;EAEnC,MAAM,QAAQ,OAAO;EACrB,UAAU,OAAO,OAAO,QAAQ,YAAW,EAAA,CAAA,CAAA,IAAA,uBAAA;EAC9C,CAAC;;AAEN,kBAAkB,SAAS;CAAC;CAAW;CAAW;CAAU;CAAA;;;;;;;;AAQ5D,SAAG,kBAAA,SAAA,SAAA;CACH,IAAA;kDAEQ,WAAU,OAAO,yDAAwB,QAAQ,OAAG,gBAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;2DAEpC,QAAK,OAAA,eAAA,CACrB,WAAU,OAAO,yDAAwB,QAAQ,OAAO,eAAc,SAAA,QAAA,EAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;;AAK1E,QAAO,OAAO,YAAY,OAAO,QAAQ,QAAQ,CAAC,IAAI,cAAc,CAAC,KAAE,WAAA,CAC1E,KACO;EAAE,GAAG;EAAO,KAAK,MAAM,8DAAM,IAAA;EAAA,CAChC,EAAE;EAAC;EAAU;EAAI;EAAU,CAAC,CAAC,CAAC;;AAEnC,kBAAE,SAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -4,18 +4,40 @@ import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
|
4
4
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
5
5
|
|
|
6
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
|
+
}
|
|
7
17
|
function innerFormatCommandTree(command) {
|
|
8
18
|
return {
|
|
9
19
|
name: `${command.name}${command.isVirtual ? " (virtual)" : ""}`,
|
|
10
20
|
children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
|
|
11
21
|
};
|
|
12
22
|
}
|
|
23
|
+
innerFormatCommandTree.__type = [
|
|
24
|
+
"CommandTree",
|
|
25
|
+
"command",
|
|
26
|
+
"innerFormatCommandTree",
|
|
27
|
+
"P\"w!2\"!/#"
|
|
28
|
+
];
|
|
13
29
|
function formatCommandTree(context) {
|
|
14
30
|
return formatTree({
|
|
15
31
|
name: context.config.name,
|
|
16
32
|
children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)
|
|
17
33
|
});
|
|
18
34
|
}
|
|
35
|
+
formatCommandTree.__type = [
|
|
36
|
+
"Context",
|
|
37
|
+
"context",
|
|
38
|
+
"formatCommandTree",
|
|
39
|
+
"P\"w!2\"&/#"
|
|
40
|
+
];
|
|
19
41
|
/**
|
|
20
42
|
* Retrieves the default command options based on the context configuration.
|
|
21
43
|
*
|
|
@@ -25,14 +47,46 @@ function formatCommandTree(context) {
|
|
|
25
47
|
*/
|
|
26
48
|
function getDefaultOptions(context, command) {
|
|
27
49
|
let options;
|
|
28
|
-
if (Array.isArray(context.config.defaultOptions)) options = Object.fromEntries(getUniqueBy(context.config.defaultOptions, (item) => item.name
|
|
29
|
-
|
|
50
|
+
if (Array.isArray(context.config.defaultOptions)) options = Object.fromEntries(getUniqueBy(context.config.defaultOptions, __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.defaultOptions)) options = Object.fromEntries(getUniqueBy(context.config.defaultOptions(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
|
+
])));
|
|
30
70
|
else options = {};
|
|
31
|
-
return Object.fromEntries(Object.entries(options).map(([key, value]) => [key, {
|
|
71
|
+
return Object.fromEntries(Object.entries(options).map(__assignType(([key, value]) => [key, {
|
|
32
72
|
...value,
|
|
33
73
|
env: value.env ?? constantCase(key)
|
|
34
|
-
}]
|
|
74
|
+
}], [
|
|
75
|
+
"param0",
|
|
76
|
+
"",
|
|
77
|
+
"P\"2!\"/\""
|
|
78
|
+
])));
|
|
35
79
|
}
|
|
80
|
+
getDefaultOptions.__type = [
|
|
81
|
+
"Context",
|
|
82
|
+
"context",
|
|
83
|
+
"CommandBase",
|
|
84
|
+
"command",
|
|
85
|
+
() => __ΩRecord,
|
|
86
|
+
"CommandOption",
|
|
87
|
+
"getDefaultOptions",
|
|
88
|
+
"P\"w!2\"\"w#2$&\"w&o%#/'"
|
|
89
|
+
];
|
|
36
90
|
|
|
37
91
|
//#endregion
|
|
38
92
|
export { formatCommandTree, getDefaultOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.mjs","names":[
|
|
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 default command options based on the context configuration.\n *\n * @param context - The build context.\n * @param command - The command for which to retrieve default options.\n * @returns A record of default command options.\n */\nexport function getDefaultOptions(\n context: Context,\n command: CommandBase\n): Record<string, CommandOption> {\n let options!: Record<string, CommandOption>;\n if (Array.isArray(context.config.defaultOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.defaultOptions,\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else if (isFunction(context.config.defaultOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.defaultOptions(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":";;;;;;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;AAE5D,IAAG,SAAS;;;AAOhB,SAAS,uBAAuB,SAAS;AACrC,QAAO;EACH,MAAM,GAAG,QAAQ,OAAO,QAAQ,YAAY,eAAe;EAC3D,UAAU,OAAO,OAAO,QAAQ,YAAY,EAAE,CAAC,CAAC,IAAG,uBAAA;;;;;;;;;AAI3D,SAAgB,kBAAkB,SAAS;;EAEnC,MAAM,QAAQ,OAAO;EACrB,UAAU,OAAO,OAAO,QAAQ,YAAW,EAAA,CAAA,CAAA,IAAA,uBAAA;EAC9C,CAAC;;AAEN,kBAAkB,SAAS;CAAC;CAAW;CAAW;CAAU;CAAA;;;;;;;;AAQ5D,SAAG,kBAAA,SAAA,SAAA;CACH,IAAA;kDAEQ,WAAU,OAAO,YAAY,YAAY,QAAQ,OAAG,gBAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;UAE/C,WAAW,QAAK,OAAA,eAAA,CACrB,WAAU,OAAO,YAAY,YAAY,QAAQ,OAAO,eAAc,SAAA,QAAA,EAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;;AAK1E,QAAO,OAAO,YAAY,OAAO,QAAQ,QAAQ,CAAC,IAAI,cAAc,CAAC,KAAE,WAAA,CAC1E,KACO;EAAE,GAAG;EAAO,KAAK,MAAM,OAAM,aAAA,IAAA;EAAA,CAChC,EAAE;EAAC;EAAU;EAAI;EAAU,CAAC,CAAC,CAAC;;AAEnC,kBAAE,SAAA;CAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
@@ -2,6 +2,12 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/validations.ts
|
|
5
|
+
const __ΩValidationFailure = [
|
|
6
|
+
"code",
|
|
7
|
+
"details",
|
|
8
|
+
"ValidationFailure",
|
|
9
|
+
"P&4!&4\"Mw#y"
|
|
10
|
+
];
|
|
5
11
|
function validateArguments(command) {
|
|
6
12
|
const failures = [];
|
|
7
13
|
let sequential = false;
|
|
@@ -13,9 +19,16 @@ function validateArguments(command) {
|
|
|
13
19
|
else sequential = false;
|
|
14
20
|
return failures;
|
|
15
21
|
}
|
|
22
|
+
validateArguments.__type = [
|
|
23
|
+
"CommandTree",
|
|
24
|
+
"command",
|
|
25
|
+
() => __ΩValidationFailure,
|
|
26
|
+
"validateArguments",
|
|
27
|
+
"P\"w!2\"n#F/$"
|
|
28
|
+
];
|
|
16
29
|
function validateOptions(command) {
|
|
17
30
|
const failures = [];
|
|
18
|
-
const optionNames = /* @__PURE__ */ new Set();
|
|
31
|
+
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
19
32
|
for (const option of Object.values(command.options ?? {})) {
|
|
20
33
|
if (optionNames.has(option.name)) failures.push({
|
|
21
34
|
code: "DUPLICATE_OPTION_NAME",
|
|
@@ -32,6 +45,13 @@ function validateOptions(command) {
|
|
|
32
45
|
}
|
|
33
46
|
return failures;
|
|
34
47
|
}
|
|
48
|
+
validateOptions.__type = [
|
|
49
|
+
"CommandTree",
|
|
50
|
+
"command",
|
|
51
|
+
() => __ΩValidationFailure,
|
|
52
|
+
"validateOptions",
|
|
53
|
+
"P\"w!2\"n#F/$"
|
|
54
|
+
];
|
|
35
55
|
function validateCommand(command) {
|
|
36
56
|
const results = [];
|
|
37
57
|
let failures = validateOptions(command);
|
|
@@ -40,6 +60,13 @@ function validateCommand(command) {
|
|
|
40
60
|
if (failures.length > 0) results.push(...failures);
|
|
41
61
|
return results;
|
|
42
62
|
}
|
|
63
|
+
validateCommand.__type = [
|
|
64
|
+
"CommandTree",
|
|
65
|
+
"command",
|
|
66
|
+
() => __ΩValidationFailure,
|
|
67
|
+
"validateCommand",
|
|
68
|
+
"P\"w!2\"n#F/$"
|
|
69
|
+
];
|
|
43
70
|
|
|
44
71
|
//#endregion
|
|
45
72
|
exports.validateCommand = validateCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.cjs","names":[
|
|
1
|
+
{"version":3,"file":"validations.cjs","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 { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport type { CommandTree } 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.arguments ?? []) {\n if (\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.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":";;;;AAkBA,MAAM,uBAAuB;CAAC;CAAQ;CAAW;CAAe;CAAA;;CAG5D,MAAM,WAAW,EAAE;CACnB,IAAI,aAAM;AACV,MAAK,MAAM,YAAE,QAAA,aAAA,EAAA,CACjB,MAAA,SAAA,SAAA,gDAAA,uFAEY,SAAS,SACT,KAAI,CAAC;KAIV,UAAA,KAAA;EACa,MAAM;EACN,SAAS,gFAAqB,SAAA,KAAA;EACjC,CAAC;KAIN,cAAC;AAGT,QAAO;;AAEX,kBAAM,SAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACN,SAAW,gBAAA,SAAA;CACP,MAAM,WAAW,EAAE;CACnB,MAAA,eAAA,IAAA,IAAA,CAAA,CAAA,IAAA,CAAA,kBAAA,IAAA,KAAA;AACF,MAAA,MAAA,UAAA,OAAA,OAAA,QAAA,WAAA,EAAA,CAAA,EAAA;mCAEU,UAAK,KAAA;GACjB,MAAA;;GAEa,CAAC;;AAGN,OAAK,MAAM,SAAS,OAAO,OAAI;AAC3B,OAAI,YAAY,IAAI,MAAM,CACtB,UAAS,KAAK;IACV,MAAA;IACA,SAAS,0BAAQ,MAAA,kBAAA,OAAA,KAAA;IACpB,CAAC;AAEd,eAAA,IAAA,MAAA;;;AAGA,QAAO;;AAEX,gBAAgB,SAAM;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACtB,SAAgB,gBAAgB,SAAQ;CACpC,MAAM,UAAU,EAAE;CAClB,IAAI,WAAW,gBAAG,QAAA;AAClB,KAAI,SAAS,SAAS,EAClB,SAAE,KAAA,GAAA,SAAA;AAEN,YAAW,kBAAa,QAAA;AACxB,KAAA,SAAA,SAAA,EACF,SAAA,KAAA,GAAA,SAAA;AAEE,QAAO"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
2
2
|
|
|
3
3
|
//#region src/helpers/validations.ts
|
|
4
|
+
const __ΩValidationFailure = [
|
|
5
|
+
"code",
|
|
6
|
+
"details",
|
|
7
|
+
"ValidationFailure",
|
|
8
|
+
"P&4!&4\"Mw#y"
|
|
9
|
+
];
|
|
4
10
|
function validateArguments(command) {
|
|
5
11
|
const failures = [];
|
|
6
12
|
let sequential = false;
|
|
@@ -12,9 +18,16 @@ function validateArguments(command) {
|
|
|
12
18
|
else sequential = false;
|
|
13
19
|
return failures;
|
|
14
20
|
}
|
|
21
|
+
validateArguments.__type = [
|
|
22
|
+
"CommandTree",
|
|
23
|
+
"command",
|
|
24
|
+
() => __ΩValidationFailure,
|
|
25
|
+
"validateArguments",
|
|
26
|
+
"P\"w!2\"n#F/$"
|
|
27
|
+
];
|
|
15
28
|
function validateOptions(command) {
|
|
16
29
|
const failures = [];
|
|
17
|
-
const optionNames = /* @__PURE__ */ new Set();
|
|
30
|
+
const optionNames = (Set.Ω = [["&"]], /* @__PURE__ */ new Set());
|
|
18
31
|
for (const option of Object.values(command.options ?? {})) {
|
|
19
32
|
if (optionNames.has(option.name)) failures.push({
|
|
20
33
|
code: "DUPLICATE_OPTION_NAME",
|
|
@@ -31,6 +44,13 @@ function validateOptions(command) {
|
|
|
31
44
|
}
|
|
32
45
|
return failures;
|
|
33
46
|
}
|
|
47
|
+
validateOptions.__type = [
|
|
48
|
+
"CommandTree",
|
|
49
|
+
"command",
|
|
50
|
+
() => __ΩValidationFailure,
|
|
51
|
+
"validateOptions",
|
|
52
|
+
"P\"w!2\"n#F/$"
|
|
53
|
+
];
|
|
34
54
|
function validateCommand(command) {
|
|
35
55
|
const results = [];
|
|
36
56
|
let failures = validateOptions(command);
|
|
@@ -39,6 +59,13 @@ function validateCommand(command) {
|
|
|
39
59
|
if (failures.length > 0) results.push(...failures);
|
|
40
60
|
return results;
|
|
41
61
|
}
|
|
62
|
+
validateCommand.__type = [
|
|
63
|
+
"CommandTree",
|
|
64
|
+
"command",
|
|
65
|
+
() => __ΩValidationFailure,
|
|
66
|
+
"validateCommand",
|
|
67
|
+
"P\"w!2\"n#F/$"
|
|
68
|
+
];
|
|
42
69
|
|
|
43
70
|
//#endregion
|
|
44
71
|
export { validateCommand };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.mjs","names":[
|
|
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 { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport type { CommandTree } 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.arguments ?? []) {\n if (\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.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":";;;AAkBA,MAAM,uBAAuB;CAAC;CAAQ;CAAW;CAAe;CAAA;;CAG5D,MAAM,WAAW,EAAE;CACnB,IAAI,aAAM;AACV,MAAK,MAAM,YAAE,QAAA,aAAA,EAAA,CACjB,MAAA,SAAA,SAAA,eAAA,sDAEY,SAAS,SACT,KAAI,CAAC;KAIV,UAAA,KAAA;EACa,MAAM;EACN,SAAS,gFAAqB,SAAA,KAAA;EACjC,CAAC;KAIN,cAAC;AAGT,QAAO;;AAEX,kBAAM,SAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACN,SAAW,gBAAA,SAAA;CACP,MAAM,WAAW,EAAE;CACnB,MAAA,eAAA,IAAA,IAAA,CAAA,CAAA,IAAA,CAAA,kBAAA,IAAA,KAAA;AACF,MAAA,MAAA,UAAA,OAAA,OAAA,QAAA,WAAA,EAAA,CAAA,EAAA;mCAEU,UAAK,KAAA;GACjB,MAAA;;GAEa,CAAC;;AAGN,OAAK,MAAM,SAAS,OAAO,OAAI;AAC3B,OAAI,YAAY,IAAI,MAAM,CACtB,UAAS,KAAK;IACV,MAAA;IACA,SAAS,0BAAQ,MAAA,kBAAA,OAAA,KAAA;IACpB,CAAC;AAEd,eAAA,IAAA,MAAA;;;AAGA,QAAO;;AAEX,gBAAgB,SAAM;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACtB,SAAgB,gBAAgB,SAAQ;CACpC,MAAM,UAAU,EAAE;CAClB,IAAI,WAAW,gBAAG,QAAA;AAClB,KAAI,SAAS,SAAS,EAClB,SAAE,KAAA,GAAA,SAAA;AAEN,YAAW,kBAAa,QAAA;AACxB,KAAA,SAAA,SAAA,EACF,SAAA,KAAA,GAAA,SAAA;AAEE,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,12 +2,45 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
const require_plugin = require('./plugin.cjs');
|
|
3
3
|
const require_api = require('./api.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
|
+
const require_types_command = require('./types/command.cjs');
|
|
6
|
+
const require_types_config = require('./types/config.cjs');
|
|
7
|
+
const require_types_context = require('./types/context.cjs');
|
|
8
|
+
const require_types_options = require('./types/options.cjs');
|
|
9
|
+
const require_types_runtime = require('./types/runtime.cjs');
|
|
5
10
|
|
|
6
11
|
//#region src/index.ts
|
|
7
12
|
var src_default = require_api.ShellShockAPI;
|
|
8
13
|
|
|
9
14
|
//#endregion
|
|
10
15
|
exports.ShellShockAPI = require_api.ShellShockAPI;
|
|
16
|
+
exports.__ΩBaseCommandOptions = require_types_options.__ΩBaseCommandOptions;
|
|
17
|
+
exports.__ΩBaseCommandParameter = require_types_command.__ΩBaseCommandParameter;
|
|
18
|
+
exports.__ΩBooleanCommandArgument = require_types_command.__ΩBooleanCommandArgument;
|
|
19
|
+
exports.__ΩBooleanCommandOption = require_types_command.__ΩBooleanCommandOption;
|
|
20
|
+
exports.__ΩBooleanCommandParameter = require_types_command.__ΩBooleanCommandParameter;
|
|
21
|
+
exports.__ΩCommandArgument = require_types_command.__ΩCommandArgument;
|
|
22
|
+
exports.__ΩCommandBase = require_types_command.__ΩCommandBase;
|
|
23
|
+
exports.__ΩCommandContext = require_types_runtime.__ΩCommandContext;
|
|
24
|
+
exports.__ΩCommandInput = require_types_command.__ΩCommandInput;
|
|
25
|
+
exports.__ΩCommandModule = require_types_command.__ΩCommandModule;
|
|
26
|
+
exports.__ΩCommandOption = require_types_command.__ΩCommandOption;
|
|
27
|
+
exports.__ΩCommandTree = require_types_command.__ΩCommandTree;
|
|
28
|
+
exports.__ΩContext = require_types_context.__ΩContext;
|
|
29
|
+
exports.__ΩMetadata = require_types_command.__ΩMetadata;
|
|
30
|
+
exports.__ΩNumberCommandArgument = require_types_command.__ΩNumberCommandArgument;
|
|
31
|
+
exports.__ΩNumberCommandOption = require_types_command.__ΩNumberCommandOption;
|
|
32
|
+
exports.__ΩNumberCommandParameter = require_types_command.__ΩNumberCommandParameter;
|
|
33
|
+
exports.__ΩOptions = require_types_config.__ΩOptions;
|
|
34
|
+
exports.__ΩOutputConfig = require_types_config.__ΩOutputConfig;
|
|
35
|
+
exports.__ΩResolvedConfig = require_types_config.__ΩResolvedConfig;
|
|
36
|
+
exports.__ΩSerializedCommandArgument = require_types_command.__ΩSerializedCommandArgument;
|
|
37
|
+
exports.__ΩSerializedCommandOption = require_types_command.__ΩSerializedCommandOption;
|
|
38
|
+
exports.__ΩSerializedCommandTree = require_types_command.__ΩSerializedCommandTree;
|
|
39
|
+
exports.__ΩStringCommandArgument = require_types_command.__ΩStringCommandArgument;
|
|
40
|
+
exports.__ΩStringCommandOption = require_types_command.__ΩStringCommandOption;
|
|
41
|
+
exports.__ΩStringCommandParameter = require_types_command.__ΩStringCommandParameter;
|
|
42
|
+
exports.__ΩUnresolvedContext = require_types_context.__ΩUnresolvedContext;
|
|
43
|
+
exports.__ΩUserConfig = require_types_config.__ΩUserConfig;
|
|
11
44
|
exports.createShellShock = require_api.createShellShock;
|
|
12
45
|
exports.default = src_default;
|
|
13
46
|
exports.defineConfig = require_config.defineConfig;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.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 { ShellShockAPI, createShellShock } from \"./api\";\n\nexport * from \"./config\";\n\nexport { plugin, shellShock } from \"./plugin\";\nexport * from \"./types\";\n\n// eslint-disable-next-line perfectionist/sort-named-exports\nexport { ShellShockAPI, createShellShock };\nexport default ShellShockAPI;\n"],"mappings":";;;;;;;;;;;AAuBA,kBAAe"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseCommandParameter, BooleanCommandArgument, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandInput, CommandModule, CommandOption, CommandTree, Metadata, NumberCommandArgument, NumberCommandOption, NumberCommandParameter, SerializedCommandArgument, SerializedCommandOption, SerializedCommandTree, StringCommandArgument, StringCommandOption, StringCommandParameter } from "./types/command.cjs";
|
|
2
2
|
import { Context, UnresolvedContext } from "./types/context.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./types/config.cjs";
|
|
4
4
|
import { ShellShockAPI, createShellShock } from "./api.cjs";
|
|
5
5
|
import { defineConfig } from "./config.cjs";
|
|
6
6
|
import { BaseCommandOptions } from "./types/options.cjs";
|
|
7
7
|
import { CommandContext } from "./types/runtime.cjs";
|
|
8
8
|
import "./types/index.cjs";
|
|
9
9
|
import plugin from "./plugin.cjs";
|
|
10
|
-
export { BaseCommandOptions, BaseCommandParameter,
|
|
10
|
+
export { BaseCommandOptions, BaseCommandParameter, BooleanCommandArgument, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandContext, CommandInput, CommandModule, CommandOption, CommandTree, Context, Metadata, NumberCommandArgument, NumberCommandOption, NumberCommandParameter, Options, OutputConfig, ResolvedConfig, SerializedCommandArgument, SerializedCommandOption, SerializedCommandTree, ShellShockAPI, ShellShockAPI as default, StringCommandArgument, StringCommandOption, StringCommandParameter, UnresolvedContext, UserConfig, createShellShock, defineConfig, plugin, plugin as shellShock };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseCommandParameter, BooleanCommandArgument, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandInput, CommandModule, CommandOption, CommandTree, Metadata, NumberCommandArgument, NumberCommandOption, NumberCommandParameter, SerializedCommandArgument, SerializedCommandOption, SerializedCommandTree, StringCommandArgument, StringCommandOption, StringCommandParameter } from "./types/command.mjs";
|
|
2
2
|
import { Context, UnresolvedContext } from "./types/context.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./types/config.mjs";
|
|
4
4
|
import { ShellShockAPI, createShellShock } from "./api.mjs";
|
|
5
5
|
import { defineConfig } from "./config.mjs";
|
|
6
6
|
import { BaseCommandOptions } from "./types/options.mjs";
|
|
7
7
|
import { CommandContext } from "./types/runtime.mjs";
|
|
8
8
|
import "./types/index.mjs";
|
|
9
9
|
import plugin from "./plugin.mjs";
|
|
10
|
-
export { BaseCommandOptions, BaseCommandParameter,
|
|
10
|
+
export { BaseCommandOptions, BaseCommandParameter, BooleanCommandArgument, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandContext, CommandInput, CommandModule, CommandOption, CommandTree, Context, Metadata, NumberCommandArgument, NumberCommandOption, NumberCommandParameter, Options, OutputConfig, ResolvedConfig, SerializedCommandArgument, SerializedCommandOption, SerializedCommandTree, ShellShockAPI, ShellShockAPI as default, StringCommandArgument, StringCommandOption, StringCommandParameter, UnresolvedContext, UserConfig, createShellShock, defineConfig, plugin, plugin as shellShock };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { plugin } from "./plugin.mjs";
|
|
2
2
|
import { ShellShockAPI, createShellShock } from "./api.mjs";
|
|
3
3
|
import { defineConfig } from "./config.mjs";
|
|
4
|
+
import { __ΩBaseCommandParameter, __ΩBooleanCommandArgument, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩCommandArgument, __ΩCommandBase, __ΩCommandInput, __ΩCommandModule, __ΩCommandOption, __ΩCommandTree, __ΩMetadata, __ΩNumberCommandArgument, __ΩNumberCommandOption, __ΩNumberCommandParameter, __ΩSerializedCommandArgument, __ΩSerializedCommandOption, __ΩSerializedCommandTree, __ΩStringCommandArgument, __ΩStringCommandOption, __ΩStringCommandParameter } from "./types/command.mjs";
|
|
5
|
+
import { __ΩOptions, __ΩOutputConfig, __ΩResolvedConfig, __ΩUserConfig } from "./types/config.mjs";
|
|
6
|
+
import { __ΩContext, __ΩUnresolvedContext } from "./types/context.mjs";
|
|
7
|
+
import { __ΩBaseCommandOptions } from "./types/options.mjs";
|
|
8
|
+
import { __ΩCommandContext } from "./types/runtime.mjs";
|
|
4
9
|
|
|
5
10
|
//#region src/index.ts
|
|
6
11
|
var src_default = ShellShockAPI;
|
|
7
12
|
|
|
8
13
|
//#endregion
|
|
9
|
-
export { ShellShockAPI, createShellShock, src_default as default, defineConfig, plugin, plugin as shellShock };
|
|
14
|
+
export { ShellShockAPI, __ΩBaseCommandOptions, __ΩBaseCommandParameter, __ΩBooleanCommandArgument, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩCommandArgument, __ΩCommandBase, __ΩCommandContext, __ΩCommandInput, __ΩCommandModule, __ΩCommandOption, __ΩCommandTree, __ΩContext, __ΩMetadata, __ΩNumberCommandArgument, __ΩNumberCommandOption, __ΩNumberCommandParameter, __ΩOptions, __ΩOutputConfig, __ΩResolvedConfig, __ΩSerializedCommandArgument, __ΩSerializedCommandOption, __ΩSerializedCommandTree, __ΩStringCommandArgument, __ΩStringCommandOption, __ΩStringCommandParameter, __ΩUnresolvedContext, __ΩUserConfig, createShellShock, src_default as default, defineConfig, plugin, plugin as shellShock };
|
|
10
15
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { ShellShockAPI, createShellShock } from \"./api\";\n\nexport * from \"./config\";\n\nexport { plugin, shellShock } from \"./plugin\";\nexport * from \"./types\";\n\n// eslint-disable-next-line perfectionist/sort-named-exports\nexport { ShellShockAPI, createShellShock };\nexport default ShellShockAPI;\n"],"mappings":";;;;;;;;;;AAuBA,kBAAe"}
|