@shell-shock/core 0.17.10 → 0.17.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.cjs +31 -143
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +2 -77
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +2 -76
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +30 -140
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +14 -15
- package/dist/components/command-validation-logic.cjs.map +1 -0
- package/dist/components/command-validation-logic.d.cts +1 -3
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +1 -3
- package/dist/components/command-validation-logic.d.mts.map +1 -1
- package/dist/components/command-validation-logic.mjs +12 -13
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +6 -6
- package/dist/components/docs.cjs.map +1 -0
- package/dist/components/docs.d.cts +4 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +4 -5
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +4 -4
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +9 -11
- package/dist/components/exec-builtin.cjs.map +1 -0
- package/dist/components/exec-builtin.d.cts +1 -2
- package/dist/components/exec-builtin.d.cts.map +1 -1
- package/dist/components/exec-builtin.d.mts +1 -2
- package/dist/components/exec-builtin.d.mts.map +1 -1
- package/dist/components/exec-builtin.mjs +7 -10
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +4 -5
- package/dist/components/helpers.cjs.map +1 -0
- package/dist/components/helpers.d.cts +6 -8
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -8
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/helpers.mjs +2 -3
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/options-parser-logic.cjs +29 -30
- package/dist/components/options-parser-logic.cjs.map +1 -0
- package/dist/components/options-parser-logic.d.cts +8 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +8 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +27 -28
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +3 -2
- package/dist/components/state-builtin.cjs.map +1 -0
- package/dist/components/state-builtin.d.cts +4 -5
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +4 -5
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +1 -1
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +4 -5
- package/dist/components/usage.cjs.map +1 -0
- package/dist/components/usage.d.cts +1 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.d.mts +1 -2
- package/dist/components/usage.d.mts.map +1 -1
- package/dist/components/usage.mjs +2 -3
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +5 -4
- package/dist/components/utils-builtin.cjs.map +1 -0
- package/dist/components/utils-builtin.d.cts +7 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +7 -8
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +3 -3
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +53 -19
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +29 -8
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +29 -8
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +51 -18
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +2 -2
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts.map +1 -1
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/options.cjs +4 -4
- package/dist/contexts/options.cjs.map +1 -0
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +2 -3
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/engine.cjs +138 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +79 -0
- package/dist/engine.d.cts.map +1 -0
- package/dist/engine.d.mts +79 -0
- package/dist/engine.d.mts.map +1 -0
- package/dist/engine.mjs +136 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/helpers/automd.cjs +6 -7
- package/dist/helpers/automd.cjs.map +1 -0
- package/dist/helpers/automd.mjs +2 -3
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +2 -2
- package/dist/helpers/docs-helpers.cjs.map +1 -0
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/get-framework.cjs +24 -0
- package/dist/helpers/get-framework.cjs.map +1 -0
- package/dist/helpers/get-framework.mjs +24 -0
- package/dist/helpers/get-framework.mjs.map +1 -0
- package/dist/helpers/paths.cjs +5 -5
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +4 -4
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +4 -6
- package/dist/helpers/persistence.cjs.map +1 -0
- package/dist/helpers/persistence.mjs +3 -3
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +2 -2
- package/dist/helpers/update-package-json.cjs.map +1 -0
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +3 -3
- package/dist/helpers/utilities.cjs.map +1 -0
- package/dist/helpers/utilities.mjs +1 -1
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +3 -3
- package/dist/helpers/validations.cjs.map +1 -0
- package/dist/helpers/validations.mjs +1 -3
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +121 -51
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +80 -5
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +80 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +118 -6
- package/dist/index.mjs.map +1 -0
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.mjs +6 -0
- package/dist/package.mjs.map +1 -0
- package/dist/plugin-utils/compute-bin.cjs +8 -10
- package/dist/plugin-utils/compute-bin.cjs.map +1 -0
- package/dist/plugin-utils/compute-bin.d.cts +2 -2
- package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
- package/dist/plugin-utils/compute-bin.d.mts +2 -2
- package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
- package/dist/plugin-utils/compute-bin.mjs +6 -8
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +7 -14
- package/dist/plugin-utils/context-helpers.cjs.map +1 -0
- package/dist/plugin-utils/context-helpers.d.cts +4 -4
- package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/context-helpers.d.mts +4 -4
- package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +5 -12
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +15 -16
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +5 -5
- package/dist/plugin-utils/deepkit.d.cts.map +1 -1
- package/dist/plugin-utils/deepkit.d.mts +5 -5
- package/dist/plugin-utils/deepkit.d.mts.map +1 -1
- package/dist/plugin-utils/deepkit.mjs +14 -15
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +2 -1
- package/dist/plugin-utils/description-helpers.cjs.map +1 -0
- package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
- package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +2 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +1 -1
- package/dist/plugin-utils/index.d.cts +2 -2
- package/dist/plugin-utils/index.d.mts +2 -2
- package/dist/plugin-utils/index.mjs +2 -2
- package/dist/plugin-utils/reflect.cjs +5 -5
- package/dist/plugin-utils/reflect.cjs.map +1 -0
- package/dist/plugin-utils/reflect.d.cts.map +1 -1
- package/dist/plugin-utils/reflect.d.mts.map +1 -1
- package/dist/plugin-utils/reflect.mjs +3 -5
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +2 -1
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +146 -17
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +5 -5
- package/dist/plugin-utils/type-checks.d.cts.map +1 -1
- package/dist/plugin-utils/type-checks.d.mts +5 -5
- package/dist/plugin-utils/type-checks.d.mts.map +1 -1
- package/dist/plugin-utils/type-checks.mjs +145 -16
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +80 -56
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +75 -52
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +33 -24
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +32 -22
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +316 -59
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +313 -56
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +43 -82
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.d.cts +61 -119
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +61 -119
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +42 -80
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +45 -4
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +15 -10
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +15 -10
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +40 -4
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +9 -1
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.d.cts +3 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +7 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +2 -1
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts.map +1 -1
- package/dist/types/env.d.mts.map +1 -1
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +6 -3
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +4 -4
- package/dist/types/options.cjs +2 -1
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.cts.map +1 -1
- package/dist/types/options.d.mts.map +1 -1
- package/dist/types/options.mjs.map +1 -1
- package/package.json +43 -35
- package/dist/resolver/deepkit.cjs +0 -135
- package/dist/resolver/deepkit.mjs +0 -135
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/module.cjs +0 -145
- package/dist/resolver/module.mjs +0 -145
- package/dist/resolver/module.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/get-command-tree.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/get-command-tree.ts"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-command-tree.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"get-command-tree.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -30,7 +30,7 @@ exports.isCommandArgument = require_type_checks.isCommandArgument;
|
|
|
30
30
|
exports.isCommandOption = require_type_checks.isCommandOption;
|
|
31
31
|
exports.isCommandParameter = require_type_checks.isCommandParameter;
|
|
32
32
|
exports.isCommandParameterConfig = require_type_checks.isCommandParameterConfig;
|
|
33
|
-
exports.
|
|
33
|
+
exports.isCommandParameterType = require_type_checks.isCommandParameterType;
|
|
34
34
|
exports.isDynamicPathSegment = require_context_helpers.isDynamicPathSegment;
|
|
35
35
|
exports.isPathSegmentGroup = require_context_helpers.isPathSegmentGroup;
|
|
36
36
|
exports.sortArgAliases = require_context_helpers.sortArgAliases;
|
|
@@ -5,5 +5,5 @@ import { FormatDescriptionOptions, FormatShortDescriptionOptions, formatDescript
|
|
|
5
5
|
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.cjs";
|
|
6
6
|
import { sortOptions } from "./reflect.cjs";
|
|
7
7
|
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.cjs";
|
|
8
|
-
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
9
|
-
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
8
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.cjs";
|
|
9
|
+
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -5,5 +5,5 @@ import { FormatDescriptionOptions, FormatShortDescriptionOptions, formatDescript
|
|
|
5
5
|
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.mjs";
|
|
6
6
|
import { sortOptions } from "./reflect.mjs";
|
|
7
7
|
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.mjs";
|
|
8
|
-
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
9
|
-
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
8
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.mjs";
|
|
9
|
+
export { FormatDescriptionOptions, FormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getAppBin, getAppDescription, getAppName, getAppTitle, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases } from "./context-helpers.mjs";
|
|
2
2
|
import { sortOptions } from "./reflect.mjs";
|
|
3
3
|
import { computeBin } from "./compute-bin.mjs";
|
|
4
|
-
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
4
|
+
import { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType } from "./type-checks.mjs";
|
|
5
5
|
import { extractReflectionKind, extractType } from "./deepkit.mjs";
|
|
6
6
|
import { __ΩFormatDescriptionOptions, __ΩFormatShortDescriptionOptions, formatDescription, formatShortDescription } from "./description-helpers.mjs";
|
|
7
7
|
import { traverseCommandTree, traverseCommands } from "./traverse-command-tree.mjs";
|
|
8
8
|
import { getCommandList, getCommandPaths, getCommandSegments, getCommandTree } from "./get-command-tree.mjs";
|
|
9
9
|
|
|
10
|
-
export { __ΩFormatDescriptionOptions, __ΩFormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
10
|
+
export { __ΩFormatDescriptionOptions, __ΩFormatShortDescriptionOptions, computeBin, extractReflectionKind, extractType, formatDescription, formatShortDescription, getAppBin, getAppDescription, getAppName, getAppTitle, getCommandList, getCommandPaths, getCommandSegments, getCommandTree, getDynamicPathSegmentName, getPathSegmentGroupName, getPathSegmentName, isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType, isDynamicPathSegment, isPathSegmentGroup, sortArgAliases, sortOptions, traverseCommandTree, traverseCommands };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const require_types_command = require('../types/command.cjs');
|
|
2
1
|
|
|
3
2
|
//#region src/plugin-utils/reflect.ts
|
|
4
3
|
function __assignType(fn, args) {
|
|
@@ -13,7 +12,7 @@ function __assignType(fn, args) {
|
|
|
13
12
|
*/
|
|
14
13
|
function sortOptions(options) {
|
|
15
14
|
if (!options || options.length === 0) return [];
|
|
16
|
-
return options.filter(__assignType((arg) => arg.
|
|
15
|
+
return options.filter(__assignType((arg) => arg.type !== "boolean" || arg.variadic || !arg.isNegativeOf, [
|
|
17
16
|
"arg",
|
|
18
17
|
"",
|
|
19
18
|
"P\"2!\"/\""
|
|
@@ -24,8 +23,8 @@ function sortOptions(options) {
|
|
|
24
23
|
"P\"2!\"2\"\"/#"
|
|
25
24
|
])).reduce(__assignType((ret, arg) => {
|
|
26
25
|
ret.push(arg);
|
|
27
|
-
if (arg.
|
|
28
|
-
const negativeArg = options.find(__assignType((a) => a.
|
|
26
|
+
if (arg.type === "boolean") {
|
|
27
|
+
const negativeArg = options.find(__assignType((a) => a.type === "boolean" && !a.variadic && a.isNegativeOf === arg.name, [
|
|
29
28
|
"a",
|
|
30
29
|
"",
|
|
31
30
|
"P\"2!\"/\""
|
|
@@ -49,4 +48,5 @@ sortOptions.__type = [
|
|
|
49
48
|
];
|
|
50
49
|
|
|
51
50
|
//#endregion
|
|
52
|
-
exports.sortOptions = sortOptions;
|
|
51
|
+
exports.sortOptions = sortOptions;
|
|
52
|
+
//# sourceMappingURL=reflect.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflect.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.cts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"reflect.d.cts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,WAAA,CAAY,OAAA,EAAS,aAAA,KAAkB,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.mts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reflect.d.mts","names":[],"sources":["../../src/plugin-utils/reflect.ts"],"mappings":""}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { CommandParameterKinds } from "../types/command.mjs";
|
|
2
|
-
|
|
3
1
|
//#region src/plugin-utils/reflect.ts
|
|
4
2
|
function __assignType(fn, args) {
|
|
5
3
|
fn.__type = args;
|
|
@@ -13,7 +11,7 @@ function __assignType(fn, args) {
|
|
|
13
11
|
*/
|
|
14
12
|
function sortOptions(options) {
|
|
15
13
|
if (!options || options.length === 0) return [];
|
|
16
|
-
return options.filter(__assignType((arg) => arg.
|
|
14
|
+
return options.filter(__assignType((arg) => arg.type !== "boolean" || arg.variadic || !arg.isNegativeOf, [
|
|
17
15
|
"arg",
|
|
18
16
|
"",
|
|
19
17
|
"P\"2!\"/\""
|
|
@@ -24,8 +22,8 @@ function sortOptions(options) {
|
|
|
24
22
|
"P\"2!\"2\"\"/#"
|
|
25
23
|
])).reduce(__assignType((ret, arg) => {
|
|
26
24
|
ret.push(arg);
|
|
27
|
-
if (arg.
|
|
28
|
-
const negativeArg = options.find(__assignType((a) => a.
|
|
25
|
+
if (arg.type === "boolean") {
|
|
26
|
+
const negativeArg = options.find(__assignType((a) => a.type === "boolean" && !a.variadic && a.isNegativeOf === arg.name, [
|
|
29
27
|
"a",
|
|
30
28
|
"",
|
|
31
29
|
"P\"2!\"/\""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"reflect.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":";;;;;;;AA4BA;;;;iBAAsB,mBAAA,CACpB,WAAA,EAAa,WAAA,EACb,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA;;;;;;;iBAmBmB,gBAAA,kBAAkC,OAAA,
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":";;;;;;;AA4BA;;;;iBAAsB,mBAAA,CACpB,WAAA,EAAa,WAAA,EACb,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA;;;;;;;iBAmBmB,gBAAA,kBAAkC,OAAA,EACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAU,IAAA,EAAM,WAAA,KAAgB,YAAA,SAC/B,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.d.mts","names":[],"sources":["../../src/plugin-utils/traverse-command-tree.ts"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-command-tree.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"traverse-command-tree.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,27 +1,142 @@
|
|
|
1
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
-
const require_types_command = require('../types/command.cjs');
|
|
3
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
4
1
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
2
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
5
3
|
let _stryke_type_checks_is_boolean = require("@stryke/type-checks/is-boolean");
|
|
6
4
|
|
|
7
5
|
//#region src/plugin-utils/type-checks.ts
|
|
6
|
+
const __ΩRecord = [
|
|
7
|
+
"K",
|
|
8
|
+
"T",
|
|
9
|
+
"Record",
|
|
10
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
11
|
+
];
|
|
12
|
+
function __assignType(fn, args) {
|
|
13
|
+
fn.__type = args;
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
function isStringArray(value) {
|
|
17
|
+
return Array.isArray(value) && value.every(__assignType((item) => (0, _stryke_type_checks_is_set_string.isSetString)(item), [
|
|
18
|
+
"item",
|
|
19
|
+
"",
|
|
20
|
+
"P\"2!\"/\""
|
|
21
|
+
]));
|
|
22
|
+
}
|
|
23
|
+
isStringArray.__type = [
|
|
24
|
+
"value",
|
|
25
|
+
"isStringArray",
|
|
26
|
+
"P#2!!/\""
|
|
27
|
+
];
|
|
28
|
+
function isNumberArray(value) {
|
|
29
|
+
return Array.isArray(value) && value.every(__assignType((item) => typeof item === "number" && Number.isFinite(item), [
|
|
30
|
+
"item",
|
|
31
|
+
"",
|
|
32
|
+
"P\"2!\"/\""
|
|
33
|
+
]));
|
|
34
|
+
}
|
|
35
|
+
isNumberArray.__type = [
|
|
36
|
+
"value",
|
|
37
|
+
"isNumberArray",
|
|
38
|
+
"P#2!!/\""
|
|
39
|
+
];
|
|
40
|
+
function isBooleanArray(value) {
|
|
41
|
+
return Array.isArray(value) && value.every(__assignType((item) => (0, _stryke_type_checks_is_boolean.isBoolean)(item), [
|
|
42
|
+
"item",
|
|
43
|
+
"",
|
|
44
|
+
"P\"2!\"/\""
|
|
45
|
+
]));
|
|
46
|
+
}
|
|
47
|
+
isBooleanArray.__type = [
|
|
48
|
+
"value",
|
|
49
|
+
"isBooleanArray",
|
|
50
|
+
"P#2!!/\""
|
|
51
|
+
];
|
|
52
|
+
function isAliasConfig(value) {
|
|
53
|
+
return (0, _stryke_type_checks_is_set_string.isSetString)(value) || isStringArray(value);
|
|
54
|
+
}
|
|
55
|
+
isAliasConfig.__type = [
|
|
56
|
+
"value",
|
|
57
|
+
"isAliasConfig",
|
|
58
|
+
"P#2!!/\""
|
|
59
|
+
];
|
|
60
|
+
function isTypedDefaultValue(type, value, variadic) {
|
|
61
|
+
if (type === "string") {
|
|
62
|
+
if (variadic === true) return isStringArray(value);
|
|
63
|
+
if (variadic === false) return (0, _stryke_type_checks_is_set_string.isSetString)(value);
|
|
64
|
+
return (0, _stryke_type_checks_is_set_string.isSetString)(value) || isStringArray(value);
|
|
65
|
+
}
|
|
66
|
+
if (type === "number") {
|
|
67
|
+
if (variadic === true) return isNumberArray(value);
|
|
68
|
+
if (variadic === false) return typeof value === "number" && Number.isFinite(value);
|
|
69
|
+
return typeof value === "number" && Number.isFinite(value) || isNumberArray(value);
|
|
70
|
+
}
|
|
71
|
+
if (variadic === true) return isBooleanArray(value);
|
|
72
|
+
if (variadic === false) return (0, _stryke_type_checks_is_boolean.isBoolean)(value);
|
|
73
|
+
return (0, _stryke_type_checks_is_boolean.isBoolean)(value) || isBooleanArray(value);
|
|
74
|
+
}
|
|
75
|
+
isTypedDefaultValue.__type = [
|
|
76
|
+
"CommandParameterType",
|
|
77
|
+
"type",
|
|
78
|
+
"value",
|
|
79
|
+
"variadic",
|
|
80
|
+
"isTypedDefaultValue",
|
|
81
|
+
"P\"w!2\"#2#)2$8)/%"
|
|
82
|
+
];
|
|
83
|
+
function hasValidOptionalCommonFields(obj) {
|
|
84
|
+
if ("alias" in obj && obj.alias !== void 0 && !isAliasConfig(obj.alias)) return false;
|
|
85
|
+
if ("name" in obj && obj.name !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.name)) return false;
|
|
86
|
+
if ("title" in obj && obj.title !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.title)) return false;
|
|
87
|
+
if ("description" in obj && obj.description !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.description)) return false;
|
|
88
|
+
if ("env" in obj && obj.env !== void 0 && !((0, _stryke_type_checks_is_set_string.isSetString)(obj.env) || obj.env === false)) return false;
|
|
89
|
+
if ("required" in obj && obj.required !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.required)) return false;
|
|
90
|
+
if ("variadic" in obj && obj.variadic !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic)) return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
hasValidOptionalCommonFields.__type = [
|
|
94
|
+
() => __ΩRecord,
|
|
95
|
+
"obj",
|
|
96
|
+
"hasValidOptionalCommonFields",
|
|
97
|
+
"P&#o!#2\")/#"
|
|
98
|
+
];
|
|
99
|
+
function hasValidTypeSpecificFields(obj, type) {
|
|
100
|
+
const variadic = (0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic) ? obj.variadic : void 0;
|
|
101
|
+
if ("default" in obj && obj.default !== void 0 && !isTypedDefaultValue(type, obj.default, variadic)) return false;
|
|
102
|
+
if (type === "string") {
|
|
103
|
+
if ("format" in obj && obj.format !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.format)) return false;
|
|
104
|
+
if ("choices" in obj && obj.choices !== void 0 && !isStringArray(obj.choices)) return false;
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
if (type === "number") {
|
|
108
|
+
if ("choices" in obj && obj.choices !== void 0 && !isNumberArray(obj.choices)) return false;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
if ("choices" in obj && obj.choices !== void 0) return false;
|
|
112
|
+
if ("format" in obj && obj.format !== void 0) return false;
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
hasValidTypeSpecificFields.__type = [
|
|
116
|
+
() => __ΩRecord,
|
|
117
|
+
"obj",
|
|
118
|
+
"CommandParameterType",
|
|
119
|
+
"type",
|
|
120
|
+
"hasValidTypeSpecificFields",
|
|
121
|
+
"P&#o!#2\"\"w#2$)/%"
|
|
122
|
+
];
|
|
8
123
|
/**
|
|
9
|
-
* Type guard to check if a value is a valid {@link
|
|
124
|
+
* Type guard to check if a value is a valid {@link CommandParameterType} type.
|
|
10
125
|
*
|
|
11
126
|
* @param obj - The value to check.
|
|
12
|
-
* @returns True if the value is a valid {@link
|
|
127
|
+
* @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
|
|
13
128
|
*/
|
|
14
|
-
function
|
|
129
|
+
function isCommandParameterType(obj) {
|
|
15
130
|
return (0, _stryke_type_checks_is_set_string.isSetString)(obj) && [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
131
|
+
"string",
|
|
132
|
+
"number",
|
|
133
|
+
"boolean"
|
|
19
134
|
].includes(obj);
|
|
20
135
|
}
|
|
21
|
-
|
|
136
|
+
isCommandParameterType.__type = [
|
|
22
137
|
"obj",
|
|
23
|
-
"
|
|
24
|
-
"Type guard to check if a value is a valid {@link
|
|
138
|
+
"isCommandParameterType",
|
|
139
|
+
"Type guard to check if a value is a valid {@link CommandParameterType} type.",
|
|
25
140
|
"P\"2!!/\"?#"
|
|
26
141
|
];
|
|
27
142
|
/**
|
|
@@ -31,7 +146,8 @@ isCommandParameterKind.__type = [
|
|
|
31
146
|
* @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.
|
|
32
147
|
*/
|
|
33
148
|
function isCommandParameterConfig(obj) {
|
|
34
|
-
|
|
149
|
+
if (!(0, _stryke_type_checks_is_set_object.isSetObject)(obj) || !("type" in obj) || !isCommandParameterType(obj.type)) return false;
|
|
150
|
+
return hasValidOptionalCommonFields(obj) && hasValidTypeSpecificFields(obj, obj.type);
|
|
35
151
|
}
|
|
36
152
|
isCommandParameterConfig.__type = [
|
|
37
153
|
"obj",
|
|
@@ -46,7 +162,15 @@ isCommandParameterConfig.__type = [
|
|
|
46
162
|
* @returns True if the value is a valid {@link CommandParameter} type, false otherwise.
|
|
47
163
|
*/
|
|
48
164
|
function isCommandParameter(obj) {
|
|
49
|
-
|
|
165
|
+
if (!isCommandParameterConfig(obj)) return false;
|
|
166
|
+
if (!("name" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.name)) return false;
|
|
167
|
+
if (!("title" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.title)) return false;
|
|
168
|
+
if (!("description" in obj) || !(0, _stryke_type_checks_is_set_string.isSetString)(obj.description)) return false;
|
|
169
|
+
if (!("alias" in obj) || !isStringArray(obj.alias)) return false;
|
|
170
|
+
if (!("env" in obj) || !((0, _stryke_type_checks_is_set_string.isSetString)(obj.env) || obj.env === false)) return false;
|
|
171
|
+
if (!("required" in obj) || !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.required)) return false;
|
|
172
|
+
if (!("variadic" in obj) || !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.variadic)) return false;
|
|
173
|
+
return hasValidTypeSpecificFields(obj, obj.type);
|
|
50
174
|
}
|
|
51
175
|
isCommandParameter.__type = [
|
|
52
176
|
"obj",
|
|
@@ -61,7 +185,11 @@ isCommandParameter.__type = [
|
|
|
61
185
|
* @returns True if the value is a valid {@link CommandOption} type, false otherwise.
|
|
62
186
|
*/
|
|
63
187
|
function isCommandOption(obj) {
|
|
64
|
-
|
|
188
|
+
if (!isCommandParameter(obj)) return false;
|
|
189
|
+
if (obj.type !== "boolean") return true;
|
|
190
|
+
if ("isNegativeOf" in obj && obj.isNegativeOf !== void 0 && !(0, _stryke_type_checks_is_set_string.isSetString)(obj.isNegativeOf)) return false;
|
|
191
|
+
if ("skipAddingNegative" in obj && obj.skipAddingNegative !== void 0 && !(0, _stryke_type_checks_is_boolean.isBoolean)(obj.skipAddingNegative)) return false;
|
|
192
|
+
return true;
|
|
65
193
|
}
|
|
66
194
|
isCommandOption.__type = [
|
|
67
195
|
"obj",
|
|
@@ -76,7 +204,7 @@ isCommandOption.__type = [
|
|
|
76
204
|
* @returns True if the value is a valid {@link CommandArgument} type, false otherwise.
|
|
77
205
|
*/
|
|
78
206
|
function isCommandArgument(obj) {
|
|
79
|
-
return
|
|
207
|
+
return isCommandParameter(obj);
|
|
80
208
|
}
|
|
81
209
|
isCommandArgument.__type = [
|
|
82
210
|
"obj",
|
|
@@ -90,4 +218,5 @@ exports.isCommandArgument = isCommandArgument;
|
|
|
90
218
|
exports.isCommandOption = isCommandOption;
|
|
91
219
|
exports.isCommandParameter = isCommandParameter;
|
|
92
220
|
exports.isCommandParameterConfig = isCommandParameterConfig;
|
|
93
|
-
exports.
|
|
221
|
+
exports.isCommandParameterType = isCommandParameterType;
|
|
222
|
+
//# sourceMappingURL=type-checks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-checks.cjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig,
|
|
1
|
+
import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterType } from "../types/command.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin-utils/type-checks.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Type guard to check if a value is a valid {@link
|
|
5
|
+
* Type guard to check if a value is a valid {@link CommandParameterType} type.
|
|
6
6
|
*
|
|
7
7
|
* @param obj - The value to check.
|
|
8
|
-
* @returns True if the value is a valid {@link
|
|
8
|
+
* @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
|
|
9
9
|
*/
|
|
10
|
-
declare function
|
|
10
|
+
declare function isCommandParameterType(obj: any): obj is CommandParameterType;
|
|
11
11
|
/**
|
|
12
12
|
* Type guard to check if a value is a valid {@link CommandParameterConfig} type.
|
|
13
13
|
*
|
|
@@ -37,5 +37,5 @@ declare function isCommandOption(obj: any): obj is CommandOption;
|
|
|
37
37
|
*/
|
|
38
38
|
declare function isCommandArgument(obj: any): obj is CommandArgument;
|
|
39
39
|
//#endregion
|
|
40
|
-
export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
40
|
+
export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType };
|
|
41
41
|
//# sourceMappingURL=type-checks.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-checks.d.cts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"type-checks.d.cts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;AA0MA;;;;iBAAgB,sBAAA,CAAuB,GAAA,QAAW,GAAA,IAAO,oBAAoB;;;;AAAA;AAU7E;;iBAAgB,wBAAA,CACd,GAAA,QACC,GAAA,IAAO,sBAAsB;;;;;;AAAA;iBAqBhB,kBAAA,CAAmB,GAAA,QAAW,GAAA,IAAO,gBAAgB;;;;;;;iBA0CrD,eAAA,CAAgB,GAAA,QAAW,GAAA,IAAO,aAAa;AA1CM;AA0CrE;;;;;AA1CqE,iBA4ErD,iBAAA,CAAkB,GAAA,QAAW,GAAA,IAAO,eAAe"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig,
|
|
1
|
+
import { CommandArgument, CommandOption, CommandParameter, CommandParameterConfig, CommandParameterType } from "../types/command.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin-utils/type-checks.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Type guard to check if a value is a valid {@link
|
|
5
|
+
* Type guard to check if a value is a valid {@link CommandParameterType} type.
|
|
6
6
|
*
|
|
7
7
|
* @param obj - The value to check.
|
|
8
|
-
* @returns True if the value is a valid {@link
|
|
8
|
+
* @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
|
|
9
9
|
*/
|
|
10
|
-
declare function
|
|
10
|
+
declare function isCommandParameterType(obj: any): obj is CommandParameterType;
|
|
11
11
|
/**
|
|
12
12
|
* Type guard to check if a value is a valid {@link CommandParameterConfig} type.
|
|
13
13
|
*
|
|
@@ -37,5 +37,5 @@ declare function isCommandOption(obj: any): obj is CommandOption;
|
|
|
37
37
|
*/
|
|
38
38
|
declare function isCommandArgument(obj: any): obj is CommandArgument;
|
|
39
39
|
//#endregion
|
|
40
|
-
export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig,
|
|
40
|
+
export { isCommandArgument, isCommandOption, isCommandParameter, isCommandParameterConfig, isCommandParameterType };
|
|
41
41
|
//# sourceMappingURL=type-checks.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-checks.d.mts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-checks.d.mts","names":[],"sources":["../../src/plugin-utils/type-checks.ts"],"mappings":""}
|