@shell-shock/core 0.9.7 → 0.11.0
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 +1 -2
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +1 -2
- package/dist/api.mjs.map +1 -1
- package/dist/components/docs.cjs +4 -4
- package/dist/components/docs.cjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/helpers.d.cts +6 -6
- 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.cjs +31 -31
- package/dist/components/options-parser-logic.cjs.map +1 -1
- package/dist/components/options-parser-logic.d.cts +9 -9
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +9 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/options-parser-logic.mjs +26 -26
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/usage.cjs +5 -5
- package/dist/components/usage.cjs.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.cts.map +1 -1
- package/dist/components/usage.mjs +4 -4
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +204 -0
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +13 -9
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +13 -9
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +208 -5
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/contexts/options.cjs +2 -2
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.d.cts +1 -1
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -1
- package/dist/contexts/options.d.mts.map +1 -1
- package/dist/contexts/options.mjs +4 -4
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +2 -2
- package/dist/helpers/automd.cjs.map +1 -1
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +1 -1
- package/dist/helpers/docs-helpers.cjs.map +1 -1
- package/dist/helpers/docs-helpers.mjs +1 -1
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/paths.cjs +125 -0
- package/dist/helpers/paths.cjs.map +1 -0
- package/dist/helpers/paths.mjs +121 -0
- package/dist/helpers/paths.mjs.map +1 -0
- package/dist/helpers/persistence.cjs +68 -116
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs +68 -116
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +5 -5
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/update-package-json.mjs +1 -1
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +1 -1
- package/dist/helpers/utilities.mjs +1 -1
- package/dist/helpers/validations.cjs +2 -3
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +2 -2
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +14 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +3 -5
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +72 -0
- package/dist/plugin-utils/deepkit.cjs.map +1 -0
- package/dist/plugin-utils/deepkit.d.cts +24 -0
- package/dist/plugin-utils/deepkit.d.cts.map +1 -0
- package/dist/plugin-utils/deepkit.d.mts +24 -0
- package/dist/plugin-utils/deepkit.d.mts.map +1 -0
- package/dist/plugin-utils/deepkit.mjs +70 -0
- package/dist/plugin-utils/deepkit.mjs.map +1 -0
- package/dist/plugin-utils/get-command-tree.cjs +2 -2
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/index.cjs +27 -18
- package/dist/plugin-utils/index.d.cts +3 -1
- package/dist/plugin-utils/index.d.mts +3 -1
- package/dist/plugin-utils/index.mjs +3 -1
- package/dist/plugin-utils/reflect.cjs +4 -5
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.mjs +4 -4
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +89 -0
- package/dist/plugin-utils/type-checks.cjs.map +1 -0
- package/dist/plugin-utils/type-checks.d.cts +42 -0
- package/dist/plugin-utils/type-checks.d.cts.map +1 -0
- package/dist/plugin-utils/type-checks.d.mts +42 -0
- package/dist/plugin-utils/type-checks.d.mts.map +1 -0
- package/dist/plugin-utils/type-checks.mjs +84 -0
- package/dist/plugin-utils/type-checks.mjs.map +1 -0
- package/dist/plugin.cjs +48 -45
- 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 +30 -26
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +129 -0
- package/dist/resolver/deepkit.cjs.map +1 -0
- package/dist/resolver/deepkit.mjs +128 -0
- package/dist/resolver/deepkit.mjs.map +1 -0
- package/dist/resolver/helpers.cjs +173 -0
- package/dist/resolver/helpers.cjs.map +1 -0
- package/dist/resolver/helpers.mjs +168 -0
- package/dist/resolver/helpers.mjs.map +1 -0
- package/dist/resolver/module.cjs +144 -0
- package/dist/resolver/module.cjs.map +1 -0
- package/dist/resolver/module.mjs +143 -0
- package/dist/resolver/module.mjs.map +1 -0
- package/dist/resolver/resolve.cjs +209 -0
- package/dist/resolver/resolve.cjs.map +1 -0
- package/dist/resolver/resolve.mjs +208 -0
- package/dist/resolver/resolve.mjs.map +1 -0
- package/dist/types/command.cjs +131 -99
- package/dist/types/command.cjs.map +1 -1
- package/dist/types/command.d.cts +49 -75
- package/dist/types/command.d.cts.map +1 -1
- package/dist/types/command.d.mts +49 -75
- package/dist/types/command.d.mts.map +1 -1
- package/dist/types/command.mjs +119 -91
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +1 -2
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.cts +2 -2
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +2 -2
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +1 -2
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +1 -1
- package/dist/types/context.cjs.map +1 -1
- package/dist/types/context.d.cts +3 -3
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -3
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +1 -1
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/index.cjs +13 -9
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/package.json +34 -79
- package/dist/helpers/resolve-command.cjs +0 -410
- package/dist/helpers/resolve-command.cjs.map +0 -1
- package/dist/helpers/resolve-command.mjs +0 -405
- package/dist/helpers/resolve-command.mjs.map +0 -1
package/dist/types/index.cjs
CHANGED
|
@@ -4,31 +4,35 @@ const require_types_context = require('./context.cjs');
|
|
|
4
4
|
const require_types_options = require('./options.cjs');
|
|
5
5
|
const require_types_runtime = require('./runtime.cjs');
|
|
6
6
|
|
|
7
|
+
exports.CommandParameterKinds = require_types_command.CommandParameterKinds;
|
|
8
|
+
exports.__ΩAsCommandParameterConfig = require_types_command.__ΩAsCommandParameterConfig;
|
|
7
9
|
exports.__ΩBaseCommandOptions = require_types_options.__ΩBaseCommandOptions;
|
|
8
10
|
exports.__ΩBaseCommandParameter = require_types_command.__ΩBaseCommandParameter;
|
|
9
|
-
exports.__ΩBooleanCommandArgument = require_types_command.__ΩBooleanCommandArgument;
|
|
10
11
|
exports.__ΩBooleanCommandOption = require_types_command.__ΩBooleanCommandOption;
|
|
11
12
|
exports.__ΩBooleanCommandParameter = require_types_command.__ΩBooleanCommandParameter;
|
|
13
|
+
exports.__ΩBooleanCommandParameterConfig = require_types_command.__ΩBooleanCommandParameterConfig;
|
|
12
14
|
exports.__ΩCommandArgument = require_types_command.__ΩCommandArgument;
|
|
15
|
+
exports.__ΩCommandArgumentConfig = require_types_command.__ΩCommandArgumentConfig;
|
|
13
16
|
exports.__ΩCommandBase = require_types_command.__ΩCommandBase;
|
|
17
|
+
exports.__ΩCommandConfig = require_types_command.__ΩCommandConfig;
|
|
14
18
|
exports.__ΩCommandContext = require_types_runtime.__ΩCommandContext;
|
|
15
|
-
exports.__Ω
|
|
19
|
+
exports.__ΩCommandMetadata = require_types_command.__ΩCommandMetadata;
|
|
16
20
|
exports.__ΩCommandModule = require_types_command.__ΩCommandModule;
|
|
17
21
|
exports.__ΩCommandOption = require_types_command.__ΩCommandOption;
|
|
22
|
+
exports.__ΩCommandOptionConfig = require_types_command.__ΩCommandOptionConfig;
|
|
23
|
+
exports.__ΩCommandParameter = require_types_command.__ΩCommandParameter;
|
|
24
|
+
exports.__ΩCommandParameterConfig = require_types_command.__ΩCommandParameterConfig;
|
|
25
|
+
exports.__ΩCommandParameterKind = require_types_command.__ΩCommandParameterKind;
|
|
26
|
+
exports.__ΩCommandParameterType = require_types_command.__ΩCommandParameterType;
|
|
18
27
|
exports.__ΩCommandTree = require_types_command.__ΩCommandTree;
|
|
19
28
|
exports.__ΩContext = require_types_context.__ΩContext;
|
|
20
|
-
exports.__ΩMetadata = require_types_command.__ΩMetadata;
|
|
21
|
-
exports.__ΩNumberCommandArgument = require_types_command.__ΩNumberCommandArgument;
|
|
22
|
-
exports.__ΩNumberCommandOption = require_types_command.__ΩNumberCommandOption;
|
|
23
29
|
exports.__ΩNumberCommandParameter = require_types_command.__ΩNumberCommandParameter;
|
|
30
|
+
exports.__ΩNumberCommandParameterConfig = require_types_command.__ΩNumberCommandParameterConfig;
|
|
24
31
|
exports.__ΩOptions = require_types_config.__ΩOptions;
|
|
25
32
|
exports.__ΩOutputConfig = require_types_config.__ΩOutputConfig;
|
|
26
33
|
exports.__ΩResolvedConfig = require_types_config.__ΩResolvedConfig;
|
|
27
|
-
exports.__ΩSerializedCommandArgument = require_types_command.__ΩSerializedCommandArgument;
|
|
28
|
-
exports.__ΩSerializedCommandOption = require_types_command.__ΩSerializedCommandOption;
|
|
29
34
|
exports.__ΩSerializedCommandTree = require_types_command.__ΩSerializedCommandTree;
|
|
30
|
-
exports.__ΩStringCommandArgument = require_types_command.__ΩStringCommandArgument;
|
|
31
|
-
exports.__ΩStringCommandOption = require_types_command.__ΩStringCommandOption;
|
|
32
35
|
exports.__ΩStringCommandParameter = require_types_command.__ΩStringCommandParameter;
|
|
36
|
+
exports.__ΩStringCommandParameterConfig = require_types_command.__ΩStringCommandParameterConfig;
|
|
33
37
|
exports.__ΩUnresolvedContext = require_types_context.__ΩUnresolvedContext;
|
|
34
38
|
exports.__ΩUserConfig = require_types_config.__ΩUserConfig;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsCommandParameterConfig, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig } from "./command.cjs";
|
|
2
2
|
import { Context, UnresolvedContext } from "./context.cjs";
|
|
3
3
|
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./config.cjs";
|
|
4
4
|
import { BaseCommandOptions } from "./options.cjs";
|
|
5
5
|
import { CommandContext } from "./runtime.cjs";
|
|
6
|
-
export { BaseCommandOptions, BaseCommandParameter,
|
|
6
|
+
export { AsCommandParameterConfig, BaseCommandOptions, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandContext, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ResolvedConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsCommandParameterConfig, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig } from "./command.mjs";
|
|
2
2
|
import { Context, UnresolvedContext } from "./context.mjs";
|
|
3
3
|
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./config.mjs";
|
|
4
4
|
import { BaseCommandOptions } from "./options.mjs";
|
|
5
5
|
import { CommandContext } from "./runtime.mjs";
|
|
6
|
-
export { BaseCommandOptions, BaseCommandParameter,
|
|
6
|
+
export { AsCommandParameterConfig, BaseCommandOptions, BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandContext, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ResolvedConfig, SerializedCommandTree, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __Ω
|
|
1
|
+
import { CommandParameterKinds, __ΩAsCommandParameterConfig, __ΩBaseCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩSerializedCommandTree, __ΩStringCommandParameter, __ΩStringCommandParameterConfig } from "./command.mjs";
|
|
2
2
|
import { __ΩOptions, __ΩOutputConfig, __ΩResolvedConfig, __ΩUserConfig } from "./config.mjs";
|
|
3
3
|
import { __ΩContext, __ΩUnresolvedContext } from "./context.mjs";
|
|
4
4
|
import { __ΩBaseCommandOptions } from "./options.mjs";
|
|
5
5
|
import { __ΩCommandContext } from "./runtime.mjs";
|
|
6
6
|
|
|
7
|
-
export { __Ω
|
|
7
|
+
export { CommandParameterKinds, __ΩAsCommandParameterConfig, __ΩBaseCommandOptions, __ΩBaseCommandParameter, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩBooleanCommandParameterConfig, __ΩCommandArgument, __ΩCommandArgumentConfig, __ΩCommandBase, __ΩCommandConfig, __ΩCommandContext, __ΩCommandMetadata, __ΩCommandModule, __ΩCommandOption, __ΩCommandOptionConfig, __ΩCommandParameter, __ΩCommandParameterConfig, __ΩCommandParameterKind, __ΩCommandParameterType, __ΩCommandTree, __ΩContext, __ΩNumberCommandParameter, __ΩNumberCommandParameterConfig, __ΩOptions, __ΩOutputConfig, __ΩResolvedConfig, __ΩSerializedCommandTree, __ΩStringCommandParameter, __ΩStringCommandParameterConfig, __ΩUnresolvedContext, __ΩUserConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the core Shell Shock functionality used to build and manage a command-line application.",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"default": "./dist/index.mjs"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
+
"./*": "./*",
|
|
58
59
|
"./api": {
|
|
59
60
|
"require": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" },
|
|
60
61
|
"import": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" },
|
|
@@ -200,7 +201,6 @@
|
|
|
200
201
|
"default": "./dist/contexts/options.mjs"
|
|
201
202
|
}
|
|
202
203
|
},
|
|
203
|
-
"./package.json": "./package.json",
|
|
204
204
|
"./plugin": {
|
|
205
205
|
"require": {
|
|
206
206
|
"types": "./dist/plugin.d.cts",
|
|
@@ -229,62 +229,6 @@
|
|
|
229
229
|
"default": "./dist/plugin-utils/index.mjs"
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
|
-
"./plugin-utils/context-helpers": {
|
|
233
|
-
"require": {
|
|
234
|
-
"types": "./dist/plugin-utils/context-helpers.d.cts",
|
|
235
|
-
"default": "./dist/plugin-utils/context-helpers.cjs"
|
|
236
|
-
},
|
|
237
|
-
"import": {
|
|
238
|
-
"types": "./dist/plugin-utils/context-helpers.d.mts",
|
|
239
|
-
"default": "./dist/plugin-utils/context-helpers.mjs"
|
|
240
|
-
},
|
|
241
|
-
"default": {
|
|
242
|
-
"types": "./dist/plugin-utils/context-helpers.d.mts",
|
|
243
|
-
"default": "./dist/plugin-utils/context-helpers.mjs"
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
"./plugin-utils/get-command-tree": {
|
|
247
|
-
"require": {
|
|
248
|
-
"types": "./dist/plugin-utils/get-command-tree.d.cts",
|
|
249
|
-
"default": "./dist/plugin-utils/get-command-tree.cjs"
|
|
250
|
-
},
|
|
251
|
-
"import": {
|
|
252
|
-
"types": "./dist/plugin-utils/get-command-tree.d.mts",
|
|
253
|
-
"default": "./dist/plugin-utils/get-command-tree.mjs"
|
|
254
|
-
},
|
|
255
|
-
"default": {
|
|
256
|
-
"types": "./dist/plugin-utils/get-command-tree.d.mts",
|
|
257
|
-
"default": "./dist/plugin-utils/get-command-tree.mjs"
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
"./plugin-utils/reflect": {
|
|
261
|
-
"require": {
|
|
262
|
-
"types": "./dist/plugin-utils/reflect.d.cts",
|
|
263
|
-
"default": "./dist/plugin-utils/reflect.cjs"
|
|
264
|
-
},
|
|
265
|
-
"import": {
|
|
266
|
-
"types": "./dist/plugin-utils/reflect.d.mts",
|
|
267
|
-
"default": "./dist/plugin-utils/reflect.mjs"
|
|
268
|
-
},
|
|
269
|
-
"default": {
|
|
270
|
-
"types": "./dist/plugin-utils/reflect.d.mts",
|
|
271
|
-
"default": "./dist/plugin-utils/reflect.mjs"
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
"./plugin-utils/traverse-command-tree": {
|
|
275
|
-
"require": {
|
|
276
|
-
"types": "./dist/plugin-utils/traverse-command-tree.d.cts",
|
|
277
|
-
"default": "./dist/plugin-utils/traverse-command-tree.cjs"
|
|
278
|
-
},
|
|
279
|
-
"import": {
|
|
280
|
-
"types": "./dist/plugin-utils/traverse-command-tree.d.mts",
|
|
281
|
-
"default": "./dist/plugin-utils/traverse-command-tree.mjs"
|
|
282
|
-
},
|
|
283
|
-
"default": {
|
|
284
|
-
"types": "./dist/plugin-utils/traverse-command-tree.d.mts",
|
|
285
|
-
"default": "./dist/plugin-utils/traverse-command-tree.mjs"
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
232
|
"./types": {
|
|
289
233
|
"require": {
|
|
290
234
|
"types": "./dist/types/index.d.cts",
|
|
@@ -388,32 +332,43 @@
|
|
|
388
332
|
"typings": "dist/index.d.mts",
|
|
389
333
|
"files": ["dist/**/*"],
|
|
390
334
|
"keywords": ["shell-shock", "powerlines", "storm-software"],
|
|
335
|
+
"peerDependencies": { "zod": "^3.25.0 || ^4.0.0" },
|
|
336
|
+
"peerDependenciesMeta": { "zod": { "optional": true } },
|
|
391
337
|
"dependencies": {
|
|
392
338
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
393
339
|
"@alloy-js/markdown": "0.23.0-dev.1",
|
|
394
340
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
395
|
-
"@powerlines/deepkit": "^0.6.
|
|
396
|
-
"@powerlines/plugin-alloy": "^0.
|
|
397
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
398
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
399
|
-
"@powerlines/plugin-nodejs": "^0.1.
|
|
400
|
-
"@powerlines/plugin-
|
|
401
|
-
"@
|
|
402
|
-
"@
|
|
403
|
-
"@stryke/
|
|
404
|
-
"@stryke/
|
|
405
|
-
"@stryke/
|
|
406
|
-
"@stryke/
|
|
407
|
-
"@stryke/
|
|
408
|
-
"@stryke/
|
|
409
|
-
"@stryke/
|
|
410
|
-
"@stryke/
|
|
341
|
+
"@powerlines/deepkit": "^0.6.90",
|
|
342
|
+
"@powerlines/plugin-alloy": "^0.24.2",
|
|
343
|
+
"@powerlines/plugin-automd": "^0.1.311",
|
|
344
|
+
"@powerlines/plugin-deepkit": "^0.11.190",
|
|
345
|
+
"@powerlines/plugin-nodejs": "^0.1.231",
|
|
346
|
+
"@powerlines/plugin-tsdown": "^0.1.262",
|
|
347
|
+
"@standard-schema/spec": "^1.1.0",
|
|
348
|
+
"@standard-schema/utils": "^0.3.0",
|
|
349
|
+
"@stryke/cli": "^0.13.22",
|
|
350
|
+
"@stryke/convert": "^0.6.46",
|
|
351
|
+
"@stryke/fs": "^0.33.50",
|
|
352
|
+
"@stryke/helpers": "^0.9.48",
|
|
353
|
+
"@stryke/json": "^0.14.0",
|
|
354
|
+
"@stryke/path": "^0.26.12",
|
|
355
|
+
"@stryke/string-format": "^0.14.8",
|
|
356
|
+
"@stryke/type-checks": "^0.5.31",
|
|
357
|
+
"@stryke/types": "^0.10.45",
|
|
358
|
+
"@stryke/zod": "^0.3.1",
|
|
411
359
|
"automd": "^0.4.3",
|
|
412
|
-
"defu": "6.1.4",
|
|
413
|
-
"
|
|
414
|
-
"
|
|
360
|
+
"defu": "^6.1.4",
|
|
361
|
+
"json-schema": "^0.4.0",
|
|
362
|
+
"powerlines": "^0.39.19",
|
|
363
|
+
"rolldown": "1.0.0-rc.6"
|
|
364
|
+
},
|
|
365
|
+
"devDependencies": {
|
|
366
|
+
"@powerlines/plugin-plugin": "^0.12.262",
|
|
367
|
+
"@types/json-schema": "^7.0.15",
|
|
368
|
+
"@types/node": "^25.3.3",
|
|
369
|
+
"typescript": "^5.9.3",
|
|
370
|
+
"zod": "^4.3.6"
|
|
415
371
|
},
|
|
416
|
-
"devDependencies": { "@types/node": "^25.3.1", "typescript": "^5.9.3" },
|
|
417
372
|
"publishConfig": { "access": "public" },
|
|
418
|
-
"gitHead": "
|
|
373
|
+
"gitHead": "6fbda1ffc234bdd12b5d0fd0a32e59727b369c5c"
|
|
419
374
|
}
|
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_plugin_utils_context_helpers = require('../plugin-utils/context-helpers.cjs');
|
|
3
|
-
const require_utilities = require('./utilities.cjs');
|
|
4
|
-
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
5
|
-
let __stryke_path_append = require("@stryke/path/append");
|
|
6
|
-
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
8
|
-
let __stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
|
|
9
|
-
let __stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
10
|
-
let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
11
|
-
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
12
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
13
|
-
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
14
|
-
let __powerlines_deepkit_esbuild_plugin = require("@powerlines/deepkit/esbuild-plugin");
|
|
15
|
-
let __stryke_path_common = require("@stryke/path/common");
|
|
16
|
-
let __stryke_path_normalize = require("@stryke/path/normalize");
|
|
17
|
-
let powerlines_lib_utilities_resolve = require("powerlines/lib/utilities/resolve");
|
|
18
|
-
|
|
19
|
-
//#region src/helpers/resolve-command.ts
|
|
20
|
-
function __assignType(fn, args) {
|
|
21
|
-
fn.__type = args;
|
|
22
|
-
return fn;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Resolves the description for a command option based on its reflection.
|
|
26
|
-
*
|
|
27
|
-
* @param name - The name of the command option.
|
|
28
|
-
* @param kind - The reflection kind of the command option.
|
|
29
|
-
* @param optional - Whether the command option is optional.
|
|
30
|
-
* @param variadic - Whether the command option is variadic (i.e., an array).
|
|
31
|
-
* @param title - The title of the command option, if any.
|
|
32
|
-
* @param defaultValue - The default value of the command option, if any.
|
|
33
|
-
* @returns The resolved description for the command option.
|
|
34
|
-
*/
|
|
35
|
-
function resolveCommandOptionDescription(name, kind, optional = false, variadic = false, title, defaultValue) {
|
|
36
|
-
return `A${optional && !defaultValue ? "n optional" : ""} command-line ${kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "flag" : "option"} that allows the user to ${kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "set the" : variadic ? "specify custom" : "specify a custom"} ${title?.trim() || (0, __stryke_string_format_title_case.titleCase)(name)} ${kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "indicator" : `${kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? "numeric" : "string"} value${variadic ? "s" : ""}`}.`;
|
|
37
|
-
}
|
|
38
|
-
resolveCommandOptionDescription.__type = [
|
|
39
|
-
"name",
|
|
40
|
-
() => __powerlines_deepkit_vendor_type.__ΩReflectionKind,
|
|
41
|
-
"kind",
|
|
42
|
-
"optional",
|
|
43
|
-
"variadic",
|
|
44
|
-
"title",
|
|
45
|
-
"defaultValue",
|
|
46
|
-
"resolveCommandOptionDescription",
|
|
47
|
-
"P&2!n\"2#\"2$\"2%&2&8\"2'8&/("
|
|
48
|
-
];
|
|
49
|
-
/**
|
|
50
|
-
* Resolves the description for a command argument based on its reflection.
|
|
51
|
-
*
|
|
52
|
-
* @param name - The name of the command argument.
|
|
53
|
-
* @param kind - The reflection kind of the command argument.
|
|
54
|
-
* @param optional - Whether the command argument is optional.
|
|
55
|
-
* @param variadic - Whether the command argument is variadic (i.e., an array).
|
|
56
|
-
* @param title - The title of the command argument, if any.
|
|
57
|
-
* @param defaultValue - The default value of the command argument, if any.
|
|
58
|
-
* @returns The resolved description for the command argument.
|
|
59
|
-
*/
|
|
60
|
-
function resolveCommandArgumentDescription(name, kind, optional = false, variadic = false, title, defaultValue) {
|
|
61
|
-
return `An${optional && !defaultValue ? " optional" : ""} argument that allows the user to ${kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "set the" : variadic ? "specify custom" : "specify a custom"} ${title?.trim() || (0, __stryke_string_format_title_case.titleCase)(name)} ${kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "indicator" : `${kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? "numeric" : "string"} value${variadic ? "s" : ""}`}.`;
|
|
62
|
-
}
|
|
63
|
-
resolveCommandArgumentDescription.__type = [
|
|
64
|
-
"name",
|
|
65
|
-
() => __powerlines_deepkit_vendor_type.__ΩReflectionKind,
|
|
66
|
-
"kind",
|
|
67
|
-
"optional",
|
|
68
|
-
"variadic",
|
|
69
|
-
"title",
|
|
70
|
-
"defaultValue",
|
|
71
|
-
"resolveCommandArgumentDescription",
|
|
72
|
-
"P&2!n\"2#\"2$\"2%&2&8\"2'8&/("
|
|
73
|
-
];
|
|
74
|
-
function resolveCommandId(context, file) {
|
|
75
|
-
return (0, __stryke_path_replace.replacePath)((0, __stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((p) => Boolean(p) && !require_plugin_utils_context_helpers.isDynamicPathSegment(p), [
|
|
76
|
-
"p",
|
|
77
|
-
"",
|
|
78
|
-
"P\"2!\"/\""
|
|
79
|
-
])).join("/").replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").replaceAll("/", "-");
|
|
80
|
-
}
|
|
81
|
-
resolveCommandId.__type = [
|
|
82
|
-
"Context",
|
|
83
|
-
"context",
|
|
84
|
-
"file",
|
|
85
|
-
"resolveCommandId",
|
|
86
|
-
"P\"w!2\"&2#&/$"
|
|
87
|
-
];
|
|
88
|
-
/**
|
|
89
|
-
* Finds the command name from the given file path.
|
|
90
|
-
*
|
|
91
|
-
* @param file - The file path to extract the command name from.
|
|
92
|
-
* @returns The command name.
|
|
93
|
-
*/
|
|
94
|
-
function resolveCommandName(file) {
|
|
95
|
-
let path = (0, __stryke_path_file_path_fns.findFilePath)(file);
|
|
96
|
-
let name = (0, __stryke_path_file_path_fns.findFolderName)(file, { requireExtension: true });
|
|
97
|
-
while (require_plugin_utils_context_helpers.isDynamicPathSegment(name)) {
|
|
98
|
-
path = (0, __stryke_path_resolve_parent_path.resolveParentPath)(path);
|
|
99
|
-
name = (0, __stryke_path_file_path_fns.findFolderName)(path, { requireExtension: true });
|
|
100
|
-
}
|
|
101
|
-
return name;
|
|
102
|
-
}
|
|
103
|
-
resolveCommandName.__type = [
|
|
104
|
-
"file",
|
|
105
|
-
"resolveCommandName",
|
|
106
|
-
"P&2!\"/\""
|
|
107
|
-
];
|
|
108
|
-
function resolveCommandPath(context, file) {
|
|
109
|
-
return (0, __stryke_path_replace.replacePath)((0, __stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).replaceAll(/^\/+/g, "").replaceAll(/\/+$/g, "").split("/").filter(__assignType((path) => path && !require_plugin_utils_context_helpers.isPathSegmentGroup(path), [
|
|
110
|
-
"path",
|
|
111
|
-
"",
|
|
112
|
-
"P\"2!\"/\""
|
|
113
|
-
])).join("/");
|
|
114
|
-
}
|
|
115
|
-
resolveCommandPath.__type = [
|
|
116
|
-
"Context",
|
|
117
|
-
"context",
|
|
118
|
-
"file",
|
|
119
|
-
"resolveCommandPath",
|
|
120
|
-
"P\"w!2\"&2#&/$"
|
|
121
|
-
];
|
|
122
|
-
function resolveCommandDynamicPathSegments(context, file) {
|
|
123
|
-
return (0, __stryke_path_replace.replacePath)((0, __stryke_path_file_path_fns.findFilePath)(file), context.commandsPath).split("/").filter(__assignType((path) => Boolean(path) && require_plugin_utils_context_helpers.isDynamicPathSegment(path), [
|
|
124
|
-
"path",
|
|
125
|
-
"",
|
|
126
|
-
"P\"2!\"/\""
|
|
127
|
-
])).map(__assignType((path) => require_plugin_utils_context_helpers.getDynamicPathSegmentName(path), [
|
|
128
|
-
"path",
|
|
129
|
-
"",
|
|
130
|
-
"P\"2!\"/\""
|
|
131
|
-
]));
|
|
132
|
-
}
|
|
133
|
-
resolveCommandDynamicPathSegments.__type = [
|
|
134
|
-
"Context",
|
|
135
|
-
"context",
|
|
136
|
-
"file",
|
|
137
|
-
"resolveCommandDynamicPathSegments",
|
|
138
|
-
"P\"w!2\"&2#&F/$"
|
|
139
|
-
];
|
|
140
|
-
function findCommandsRoot(context) {
|
|
141
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(context.config.entry)) return (0, __stryke_path_append.appendPath)((0, __stryke_path_append.appendPath)((0, __stryke_path_normalize.stripStars)(context.config.entry), context.config.projectRoot), context.workspaceConfig.workspaceRoot);
|
|
142
|
-
else if ((0, __stryke_type_checks_is_set_object.isSetObject)(context.config.entry) && "file" in context.config.entry) return (0, __stryke_path_append.appendPath)((0, __stryke_path_append.appendPath)((0, __stryke_path_normalize.stripStars)(context.config.entry.file), context.config.projectRoot), context.workspaceConfig.workspaceRoot);
|
|
143
|
-
else if (Array.isArray(context.config.entry) && context.config.entry.length > 0) return (0, __stryke_path_common.commonPath)(context.config.entry.map(__assignType((entry) => (0, __stryke_path_append.appendPath)((0, __stryke_path_append.appendPath)((0, __stryke_path_normalize.stripStars)((0, __stryke_type_checks_is_set_string.isSetString)(entry) ? entry : entry.file), context.config.projectRoot), context.workspaceConfig.workspaceRoot), [
|
|
144
|
-
"entry",
|
|
145
|
-
"",
|
|
146
|
-
"P\"2!\"/\""
|
|
147
|
-
])));
|
|
148
|
-
return (0, __stryke_path_append.appendPath)(context.config.sourceRoot || context.config.projectRoot, context.workspaceConfig.workspaceRoot);
|
|
149
|
-
}
|
|
150
|
-
findCommandsRoot.__type = [
|
|
151
|
-
"Context",
|
|
152
|
-
"context",
|
|
153
|
-
"findCommandsRoot",
|
|
154
|
-
"P\"w!2\"&/#"
|
|
155
|
-
];
|
|
156
|
-
/**
|
|
157
|
-
* Extracts command parameter information from a type parameter reflection.
|
|
158
|
-
*
|
|
159
|
-
* @param command - The command tree to which the parameter belongs.
|
|
160
|
-
* @param reflection - The type parameter reflection to extract information from.
|
|
161
|
-
* @returns The extracted command option information.
|
|
162
|
-
*/
|
|
163
|
-
function extractCommandOption(command, reflection) {
|
|
164
|
-
const type = reflection.getType();
|
|
165
|
-
const option = {
|
|
166
|
-
name: reflection.getNameAsString(),
|
|
167
|
-
alias: reflection.getTags().alias ?? [],
|
|
168
|
-
title: reflection.getTags().title?.trim() || (0, __stryke_string_format_title_case.titleCase)(reflection.getNameAsString()),
|
|
169
|
-
description: reflection.getDescription() || resolveCommandOptionDescription(reflection.getNameAsString(), reflection.getKind(), reflection.isOptional(), reflection.isArray(), reflection.getTags().title, reflection.getDefaultValue()),
|
|
170
|
-
env: (0, __stryke_string_format_constant_case.constantCase)(reflection.getNameAsString()),
|
|
171
|
-
kind: type.kind,
|
|
172
|
-
optional: reflection.isOptional(),
|
|
173
|
-
default: reflection.getDefaultValue(),
|
|
174
|
-
variadic: reflection.isArray(),
|
|
175
|
-
reflection
|
|
176
|
-
};
|
|
177
|
-
if (reflection.isArray()) if (type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) {
|
|
178
|
-
option.variadic = true;
|
|
179
|
-
option.kind = type.type.kind;
|
|
180
|
-
} else throw new Error(`Unsupported array type for option "${reflection.getNameAsString()}" in command "${command.name}". Only string[] and number[] are supported, received ${(0, __powerlines_deepkit_vendor_type.stringifyType)(type).trim().replaceAll(" | ", ", or ")}.`);
|
|
181
|
-
else if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.boolean && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.string && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.number) throw new Error(`Unsupported type for option "${reflection.getNameAsString()}" in command "${command.name}". Only string, number, boolean, string[] and number[] are supported, received ${(0, __powerlines_deepkit_vendor_type.stringifyType)(type).trim().replaceAll(" | ", ", or ")}.`);
|
|
182
|
-
return option;
|
|
183
|
-
}
|
|
184
|
-
extractCommandOption.__type = [
|
|
185
|
-
"CommandInput",
|
|
186
|
-
"command",
|
|
187
|
-
"ReflectionProperty",
|
|
188
|
-
"reflection",
|
|
189
|
-
"CommandOption",
|
|
190
|
-
"extractCommandOption",
|
|
191
|
-
"P\"w!2\"\"w#2$\"w%/&"
|
|
192
|
-
];
|
|
193
|
-
/**
|
|
194
|
-
* Extracts command positional argument information from a type parameter reflection.
|
|
195
|
-
*
|
|
196
|
-
* @param command - The command tree to which the parameter belongs.
|
|
197
|
-
* @param reflection - The type parameter reflection to extract information from.
|
|
198
|
-
* @returns The extracted command positional argument information.
|
|
199
|
-
*/
|
|
200
|
-
function extractCommandArgument(command, reflection) {
|
|
201
|
-
const type = reflection.getType();
|
|
202
|
-
if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.string && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.number && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.boolean && !(type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array && (type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number))) throw new Error(`Unsupported type for argument "${reflection.getName()}" in command "${command.name}". Only string types (or an array of strings) are supported, received ${(0, __powerlines_deepkit_vendor_type.stringifyType)(type).trim().replaceAll(" | ", ", or ")}.`);
|
|
203
|
-
const argument = {
|
|
204
|
-
name: reflection.getName(),
|
|
205
|
-
alias: reflection.getAlias(),
|
|
206
|
-
kind: type.kind,
|
|
207
|
-
title: (0, __stryke_string_format_title_case.titleCase)(reflection.getName()),
|
|
208
|
-
description: reflection.parameter.description || resolveCommandArgumentDescription(reflection.getName(), type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array ? type.type.kind : type.kind, reflection.isOptional(), type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array, (0, __stryke_string_format_title_case.titleCase)(reflection.getName()), reflection.getDefaultValue()),
|
|
209
|
-
env: (0, __stryke_string_format_constant_case.constantCase)(reflection.getName()),
|
|
210
|
-
optional: reflection.isOptional(),
|
|
211
|
-
default: reflection.getDefaultValue(),
|
|
212
|
-
reflection
|
|
213
|
-
};
|
|
214
|
-
if (type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) if (type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) {
|
|
215
|
-
argument.variadic = true;
|
|
216
|
-
argument.kind = type.type.kind;
|
|
217
|
-
} else throw new Error(`Unsupported array type for argument "${reflection.getName()}" in command "${command.name}". Only string[] and number[] are supported, received ${(0, __powerlines_deepkit_vendor_type.stringifyType)(type).trim().replaceAll(" | ", ", or ")}.`);
|
|
218
|
-
else if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.boolean && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.string && type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.number) throw new Error(`Unsupported type for argument "${reflection.getName()}" in command "${command.name}". Only string, number, boolean, string[] and number[] are supported, received ${(0, __powerlines_deepkit_vendor_type.stringifyType)(type).trim().replaceAll(" | ", ", or ")}.`);
|
|
219
|
-
return argument;
|
|
220
|
-
}
|
|
221
|
-
extractCommandArgument.__type = [
|
|
222
|
-
"CommandInput",
|
|
223
|
-
"command",
|
|
224
|
-
"ReflectionParameter",
|
|
225
|
-
"reflection",
|
|
226
|
-
"CommandArgument",
|
|
227
|
-
"extractCommandArgument",
|
|
228
|
-
"P\"w!2\"\"w#2$\"w%/&"
|
|
229
|
-
];
|
|
230
|
-
/**
|
|
231
|
-
* Reflects the command tree for a given command input.
|
|
232
|
-
*
|
|
233
|
-
* @param context - The context in which the command is being reflected.
|
|
234
|
-
* @param command - The command input to reflect.
|
|
235
|
-
* @param parent - The parent command tree, if any.
|
|
236
|
-
* @returns The reflected command tree.
|
|
237
|
-
*/
|
|
238
|
-
async function reflectCommandTree(context, command, parent) {
|
|
239
|
-
const title = command.title || `${parent?.title ? `${parent.isVirtual ? parent.title.replace(/(?:c|C)ommands?$/, "").trim() : parent.title} - ` : ""}${(0, __stryke_string_format_title_case.titleCase)(command.name)}${command.isVirtual ? " Commands" : ""}`;
|
|
240
|
-
const tree = {
|
|
241
|
-
alias: [],
|
|
242
|
-
icon: parent?.icon,
|
|
243
|
-
...command,
|
|
244
|
-
title,
|
|
245
|
-
options: require_utilities.getDefaultOptions(context, command),
|
|
246
|
-
arguments: [],
|
|
247
|
-
parent: parent ?? null,
|
|
248
|
-
children: {},
|
|
249
|
-
reflection: null
|
|
250
|
-
};
|
|
251
|
-
if (!command.isVirtual) {
|
|
252
|
-
if (!command.entry.input?.file || !context.fs.existsSync(command.entry.input.file)) throw new Error(`${!command.entry.input?.file ? "Missing" : "Non-existent"} command entry file for "${command.name}"`);
|
|
253
|
-
context.debug(`Adding reflection for user-defined command: ${command.id} (file: ${command.entry.input.file})`);
|
|
254
|
-
const resolved = await (powerlines_lib_utilities_resolve.resolveModule.Ω = [["CommandModule", "\"w!"]], (0, powerlines_lib_utilities_resolve.resolveModule)(context, command.entry.input, { plugins: [(0, __powerlines_deepkit_esbuild_plugin.esbuildPlugin)(context, {
|
|
255
|
-
reflection: "default",
|
|
256
|
-
reflectionLevel: "verbose"
|
|
257
|
-
})] }));
|
|
258
|
-
const metadata = resolved.metadata ?? {};
|
|
259
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(metadata.title)) tree.title = metadata.title;
|
|
260
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(metadata.description)) tree.description = metadata.description;
|
|
261
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(metadata.alias) || Array.isArray(metadata.alias) && metadata.alias.length > 0) tree.alias = (0, __stryke_convert_to_array.toArray)(metadata.alias);
|
|
262
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(metadata.icon)) tree.icon = metadata.icon;
|
|
263
|
-
const type = (0, __powerlines_deepkit_vendor_type.reflect)(resolved);
|
|
264
|
-
if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.function) throw new Error(`The command entry file "${command.entry.input.file}" does not export a valid function.`);
|
|
265
|
-
tree.reflection = new __powerlines_deepkit_vendor_type.ReflectionFunction(type);
|
|
266
|
-
tree.description ??= command.description || type.description || `The ${tree.title.replace(/(?:c|C)ommands?$/, "").trim()} executable command-line interface.`;
|
|
267
|
-
const parameters = tree.reflection.getParameters();
|
|
268
|
-
if (parameters.length > 0 && parameters[0]) {
|
|
269
|
-
if (parameters[0].type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral || parameters[0].type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class) {
|
|
270
|
-
const optionsReflection = __powerlines_deepkit_vendor_type.ReflectionClass.from(parameters[0].type);
|
|
271
|
-
for (const propertyReflection of optionsReflection.getProperties()) tree.options[propertyReflection.getNameAsString()] = extractCommandOption(command, propertyReflection);
|
|
272
|
-
} else throw new Error(`The first parameter of the command handler function in "${command.entry.input.file}" must be an object literal or class type representing the command options.`);
|
|
273
|
-
tree.arguments = parameters.slice(1).map(__assignType((arg) => extractCommandArgument(command, arg), [
|
|
274
|
-
"arg",
|
|
275
|
-
"",
|
|
276
|
-
"P\"2!\"/\""
|
|
277
|
-
]));
|
|
278
|
-
tree.arguments.forEach(__assignType((argument, index) => {
|
|
279
|
-
const found = tree.arguments.findIndex(__assignType((arg) => arg.name === argument.name, [
|
|
280
|
-
"arg",
|
|
281
|
-
"",
|
|
282
|
-
"P\"2!\"/\""
|
|
283
|
-
]));
|
|
284
|
-
if (found !== -1 && found !== index || tree.segments.some(__assignType((segment) => require_plugin_utils_context_helpers.isDynamicPathSegment(segment) && require_plugin_utils_context_helpers.getDynamicPathSegmentName(segment) === argument.name, [
|
|
285
|
-
"segment",
|
|
286
|
-
"",
|
|
287
|
-
"P\"2!\"/\""
|
|
288
|
-
]))) {
|
|
289
|
-
argument.name += `_${tree.segments.filter(__assignType((segment) => require_plugin_utils_context_helpers.isDynamicPathSegment(segment) && require_plugin_utils_context_helpers.getDynamicPathSegmentName(segment).replace(/_\d+$/, "") === argument.name, [
|
|
290
|
-
"segment",
|
|
291
|
-
"",
|
|
292
|
-
"P\"2!\"/\""
|
|
293
|
-
])).length + tree.arguments.filter(__assignType((arg) => arg.name.replace(/_\d+$/, "") === argument.name, [
|
|
294
|
-
"arg",
|
|
295
|
-
"",
|
|
296
|
-
"P\"2!\"/\""
|
|
297
|
-
])).length}`;
|
|
298
|
-
argument.env = (0, __stryke_string_format_constant_case.constantCase)(argument.name);
|
|
299
|
-
}
|
|
300
|
-
}, [
|
|
301
|
-
"argument",
|
|
302
|
-
"index",
|
|
303
|
-
"",
|
|
304
|
-
"P\"2!\"2\"\"/#"
|
|
305
|
-
]));
|
|
306
|
-
}
|
|
307
|
-
} else tree.description ??= `A collection of available ${tree.title.replace(/(?:c|C)ommands?$/, "").trim() || (0, __stryke_string_format_title_case.titleCase)(tree.name)} commands that are included in the ${require_plugin_utils_context_helpers.getAppTitle(context)} command-line application.`;
|
|
308
|
-
if (context.env) {
|
|
309
|
-
if ((0, __stryke_type_checks_is_set_object.isSetObject)(tree.options)) Object.values(tree.options).filter(__assignType((option) => option.env !== false, [
|
|
310
|
-
"option",
|
|
311
|
-
"",
|
|
312
|
-
"P\"2!\"/\""
|
|
313
|
-
])).forEach(__assignType((option) => {
|
|
314
|
-
context.env.types.env.addProperty({
|
|
315
|
-
name: option.env,
|
|
316
|
-
optional: option.optional ? true : void 0,
|
|
317
|
-
description: option.description,
|
|
318
|
-
visibility: __powerlines_deepkit_vendor_type.ReflectionVisibility.public,
|
|
319
|
-
type: option.reflection?.getType() ?? (option.variadic ? {
|
|
320
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.array,
|
|
321
|
-
type: { kind: option.kind }
|
|
322
|
-
} : { kind: option.kind }),
|
|
323
|
-
default: option.default,
|
|
324
|
-
tags: {
|
|
325
|
-
...option.reflection?.getTags(),
|
|
326
|
-
title: option.title,
|
|
327
|
-
alias: option.alias.filter(__assignType((alias) => alias.length > 1, [
|
|
328
|
-
"alias",
|
|
329
|
-
"",
|
|
330
|
-
"P\"2!\"/\""
|
|
331
|
-
])).map(__assignType((alias) => (0, __stryke_string_format_constant_case.constantCase)(alias), [
|
|
332
|
-
"alias",
|
|
333
|
-
"",
|
|
334
|
-
"P\"2!\"/\""
|
|
335
|
-
])),
|
|
336
|
-
domain: "cli"
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
}, [
|
|
340
|
-
"option",
|
|
341
|
-
"",
|
|
342
|
-
"P\"2!\"/\""
|
|
343
|
-
]));
|
|
344
|
-
tree.arguments.filter(__assignType((arg) => arg.env !== false, [
|
|
345
|
-
"arg",
|
|
346
|
-
"",
|
|
347
|
-
"P\"2!\"/\""
|
|
348
|
-
])).forEach(__assignType((arg) => context.env.types.env.addProperty({
|
|
349
|
-
name: arg.env,
|
|
350
|
-
optional: arg.optional ? true : void 0,
|
|
351
|
-
description: arg.description,
|
|
352
|
-
visibility: __powerlines_deepkit_vendor_type.ReflectionVisibility.public,
|
|
353
|
-
type: arg.reflection.getType(),
|
|
354
|
-
default: arg.default,
|
|
355
|
-
tags: {
|
|
356
|
-
...arg.reflection.getTags(),
|
|
357
|
-
alias: arg.alias.filter(__assignType((alias) => alias.length > 1, [
|
|
358
|
-
"alias",
|
|
359
|
-
"",
|
|
360
|
-
"P\"2!\"/\""
|
|
361
|
-
])).map(__assignType((alias) => (0, __stryke_string_format_constant_case.constantCase)(alias), [
|
|
362
|
-
"alias",
|
|
363
|
-
"",
|
|
364
|
-
"P\"2!\"/\""
|
|
365
|
-
])),
|
|
366
|
-
domain: "cli"
|
|
367
|
-
}
|
|
368
|
-
}), [
|
|
369
|
-
"arg",
|
|
370
|
-
"",
|
|
371
|
-
"P\"2!\"/\""
|
|
372
|
-
]));
|
|
373
|
-
}
|
|
374
|
-
for (const input of context.inputs.filter(__assignType((input$1) => input$1.segments.filter(__assignType((segment) => !require_plugin_utils_context_helpers.isDynamicPathSegment(segment), [
|
|
375
|
-
"segment",
|
|
376
|
-
"",
|
|
377
|
-
"P\"2!\"/\""
|
|
378
|
-
])).length === command.segments.filter(__assignType((segment) => !require_plugin_utils_context_helpers.isDynamicPathSegment(segment), [
|
|
379
|
-
"segment",
|
|
380
|
-
"",
|
|
381
|
-
"P\"2!\"/\""
|
|
382
|
-
])).length + 1 && input$1.segments.slice(0, command.segments.length).every(__assignType((value, index) => value === command.segments[index], [
|
|
383
|
-
"value",
|
|
384
|
-
"index",
|
|
385
|
-
"",
|
|
386
|
-
"P\"2!\"2\"\"/#"
|
|
387
|
-
])), [
|
|
388
|
-
"input",
|
|
389
|
-
"",
|
|
390
|
-
"P\"2!\"/\""
|
|
391
|
-
]))) tree.children[input.name] = await reflectCommandTree(context, input, tree);
|
|
392
|
-
return tree;
|
|
393
|
-
}
|
|
394
|
-
reflectCommandTree.__type = [
|
|
395
|
-
"context",
|
|
396
|
-
"CommandInput",
|
|
397
|
-
"command",
|
|
398
|
-
"CommandTree",
|
|
399
|
-
"parent",
|
|
400
|
-
"reflectCommandTree",
|
|
401
|
-
"P\"2!\"w\"2#\"w$2%8\"w$`/&"
|
|
402
|
-
];
|
|
403
|
-
|
|
404
|
-
//#endregion
|
|
405
|
-
exports.findCommandsRoot = findCommandsRoot;
|
|
406
|
-
exports.reflectCommandTree = reflectCommandTree;
|
|
407
|
-
exports.resolveCommandId = resolveCommandId;
|
|
408
|
-
exports.resolveCommandName = resolveCommandName;
|
|
409
|
-
exports.resolveCommandPath = resolveCommandPath;
|
|
410
|
-
//# sourceMappingURL=resolve-command.cjs.map
|