@shell-shock/core 0.17.21 → 0.17.23
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/README.md +16 -7
- package/dist/api.cjs +4 -5
- package/dist/api.d.cts +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.mjs +2 -2
- package/dist/command-B6KYexlV.d.mts +308 -0
- package/dist/command-B6KYexlV.d.mts.map +1 -0
- package/dist/command-CtfR7hKM.d.cts +308 -0
- package/dist/command-CtfR7hKM.d.cts.map +1 -0
- package/dist/components/command-validation-logic.cjs +153 -216
- package/dist/components/command-validation-logic.d.cts +2 -1
- package/dist/components/command-validation-logic.d.cts.map +1 -1
- package/dist/components/command-validation-logic.d.mts +2 -1
- package/dist/components/command-validation-logic.mjs +153 -214
- package/dist/components/docs.cjs +6 -364
- package/dist/components/docs.d.cts +2 -3
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +2 -3
- package/dist/components/docs.mjs +2 -356
- package/dist/components/exec-builtin.cjs +63 -100
- 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.mjs +7 -41
- package/dist/components/helpers.cjs +2 -52
- package/dist/components/helpers.d.cts +2 -1
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +2 -1
- package/dist/components/helpers.mjs +2 -50
- package/dist/components/index.cjs +7 -23
- package/dist/components/index.mjs +9 -9
- package/dist/components/options-parser-logic.cjs +198 -420
- package/dist/components/options-parser-logic.d.cts +2 -5
- package/dist/components/options-parser-logic.d.cts.map +1 -1
- package/dist/components/options-parser-logic.d.mts +2 -5
- package/dist/components/options-parser-logic.mjs +192 -407
- package/dist/components/state-builtin.cjs +106 -164
- package/dist/components/state-builtin.d.cts +1 -2
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts +1 -2
- package/dist/components/state-builtin.mjs +12 -68
- package/dist/components/usage.cjs +4 -48
- 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.mjs +4 -46
- package/dist/components/utils-builtin.cjs +77 -144
- package/dist/components/utils-builtin.d.cts +1 -2
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +1 -2
- package/dist/components/utils-builtin.mjs +9 -74
- package/dist/config-BIF9mEz0.d.cts +157 -0
- package/dist/config-BIF9mEz0.d.cts.map +1 -0
- package/dist/config-CnNYdfsL.d.mts +157 -0
- package/dist/config-CnNYdfsL.d.mts.map +1 -0
- package/dist/config.cjs +24 -58
- package/dist/config.d.cts +1 -2
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +23 -55
- package/dist/{plugin-utils/context-helpers.mjs → context-helpers-D3EJxwbq.mjs} +5 -83
- package/dist/context-helpers-D3EJxwbq.mjs.map +1 -0
- package/dist/{plugin-utils/context-helpers.cjs → context-helpers-_wUuFRB8.cjs} +63 -92
- package/dist/contexts/command.cjs +3 -9
- package/dist/contexts/command.d.cts +1 -2
- package/dist/contexts/command.d.cts.map +1 -1
- package/dist/contexts/command.d.mts +1 -2
- package/dist/contexts/command.mjs +2 -7
- package/dist/contexts/index.cjs +19 -1
- package/dist/contexts/index.d.cts +2 -1
- package/dist/contexts/index.d.mts +2 -1
- package/dist/contexts/index.mjs +2 -1
- package/dist/contexts/options.cjs +7 -30
- package/dist/contexts/options.d.cts +1 -2
- package/dist/contexts/options.d.cts.map +1 -1
- package/dist/contexts/options.d.mts +1 -2
- package/dist/contexts/options.mjs +7 -27
- package/dist/contexts/power-plant.cjs +19 -0
- package/dist/contexts/power-plant.d.cts +2 -0
- package/dist/contexts/power-plant.d.mts +2 -0
- package/dist/contexts/power-plant.mjs +5 -0
- package/dist/docs-C6ZvsVMu.cjs +278 -0
- package/dist/docs-CGQ2HtEY.mjs +249 -0
- package/dist/docs-CGQ2HtEY.mjs.map +1 -0
- package/dist/engine.cjs +5 -39
- package/dist/engine.d.cts +1 -2
- package/dist/engine.d.cts.map +1 -1
- package/dist/engine.d.mts +1 -2
- package/dist/engine.mjs +4 -37
- package/dist/generator.cjs +68 -0
- package/dist/generator.d.cts +15 -0
- package/dist/generator.d.cts.map +1 -0
- package/dist/generator.d.mts +15 -0
- package/dist/generator.d.mts.map +1 -0
- package/dist/generator.mjs +66 -0
- package/dist/generator.mjs.map +1 -0
- package/dist/{helpers/get-framework.cjs → get-framework-CxZc2krd.cjs} +7 -8
- package/dist/{helpers/get-framework.mjs → get-framework-Dlqz2hVZ.mjs} +3 -8
- package/dist/get-framework-Dlqz2hVZ.mjs.map +1 -0
- package/dist/helpers/power-plant.cjs +102 -0
- package/dist/helpers/power-plant.d.cts +61 -0
- package/dist/helpers/power-plant.d.cts.map +1 -0
- package/dist/helpers/power-plant.d.mts +61 -0
- package/dist/helpers/power-plant.d.mts.map +1 -0
- package/dist/helpers/power-plant.mjs +99 -0
- package/dist/helpers/power-plant.mjs.map +1 -0
- package/dist/index-D4klH_pj.d.mts +2 -0
- package/dist/index-DYOBadKY.d.cts +2 -0
- package/dist/index.cjs +1 -37
- package/dist/index.d.cts +4 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +0 -35
- package/dist/package-B7Vu265G.mjs +6 -0
- package/dist/package-B7Vu265G.mjs.map +1 -0
- package/dist/{package.cjs → package-BLC4qc8t.cjs} +2 -4
- package/dist/plugin-B-hM2twc.mjs +1458 -0
- package/dist/plugin-B-hM2twc.mjs.map +1 -0
- package/dist/plugin-Bhfq0DMC.cjs +1490 -0
- package/dist/plugin-utils/index.cjs +359 -26
- package/dist/plugin-utils/index.d.cts +273 -9
- package/dist/plugin-utils/index.d.cts.map +1 -0
- package/dist/plugin-utils/index.d.mts +273 -9
- package/dist/plugin-utils/index.d.mts.map +1 -0
- package/dist/plugin-utils/index.mjs +346 -10
- package/dist/plugin-utils/index.mjs.map +1 -0
- package/dist/plugin.cjs +3 -496
- package/dist/plugin.d.cts +1 -3
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +1 -3
- package/dist/plugin.mjs +2 -491
- package/dist/power-plant-LgxcvlMN.d.cts +4 -0
- package/dist/power-plant-LgxcvlMN.d.mts +4 -0
- package/dist/reflect-CSiffeL9.cjs +27 -0
- package/dist/reflect-DXKSFgvS.mjs +23 -0
- package/dist/reflect-DXKSFgvS.mjs.map +1 -0
- package/dist/schemas/env.cjs +91 -0
- package/dist/schemas/env.d.cts +145 -0
- package/dist/schemas/env.d.cts.map +1 -0
- package/dist/schemas/env.d.mts +145 -0
- package/dist/{types → schemas}/env.d.mts.map +1 -1
- package/dist/schemas/env.mjs +91 -0
- package/dist/schemas/index.cjs +4 -0
- package/dist/schemas/index.d.cts +2 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/types/command.cjs +0 -402
- package/dist/types/command.d.cts +2 -309
- package/dist/types/command.d.mts +2 -309
- package/dist/types/command.mjs +1 -368
- package/dist/types/config.cjs +0 -175
- package/dist/types/config.d.cts +2 -126
- package/dist/types/config.d.mts +2 -126
- package/dist/types/config.mjs +1 -164
- package/dist/types/context.cjs +0 -45
- package/dist/types/context.d.cts +2 -31
- package/dist/types/context.d.mts +2 -31
- package/dist/types/context.mjs +1 -41
- package/dist/types/index.cjs +3 -53
- package/dist/types/index.d.cts +4 -5
- package/dist/types/index.d.mts +4 -5
- package/dist/types/index.mjs +4 -5
- package/package.json +106 -42
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/api.cjs.map +0 -1
- package/dist/components/command-validation-logic.cjs.map +0 -1
- package/dist/components/docs.cjs.map +0 -1
- package/dist/components/docs.mjs.map +0 -1
- package/dist/components/exec-builtin.cjs.map +0 -1
- package/dist/components/helpers.cjs.map +0 -1
- package/dist/components/options-parser-logic.cjs.map +0 -1
- package/dist/components/state-builtin.cjs.map +0 -1
- package/dist/components/usage.cjs.map +0 -1
- package/dist/components/utils-builtin.cjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/contexts/command.cjs.map +0 -1
- package/dist/contexts/options.cjs.map +0 -1
- package/dist/engine.cjs.map +0 -1
- package/dist/helpers/automd.cjs +0 -193
- package/dist/helpers/automd.cjs.map +0 -1
- package/dist/helpers/automd.mjs +0 -190
- package/dist/helpers/automd.mjs.map +0 -1
- package/dist/helpers/docs-helpers.cjs +0 -24
- package/dist/helpers/docs-helpers.cjs.map +0 -1
- package/dist/helpers/docs-helpers.mjs +0 -24
- package/dist/helpers/docs-helpers.mjs.map +0 -1
- package/dist/helpers/get-framework.cjs.map +0 -1
- package/dist/helpers/get-framework.mjs.map +0 -1
- package/dist/helpers/paths.cjs +0 -137
- package/dist/helpers/paths.cjs.map +0 -1
- package/dist/helpers/paths.mjs +0 -134
- package/dist/helpers/paths.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -114
- package/dist/helpers/persistence.cjs.map +0 -1
- package/dist/helpers/persistence.mjs +0 -113
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/update-package-json.cjs +0 -65
- package/dist/helpers/update-package-json.cjs.map +0 -1
- package/dist/helpers/update-package-json.mjs +0 -64
- package/dist/helpers/update-package-json.mjs.map +0 -1
- package/dist/helpers/utilities.cjs +0 -95
- package/dist/helpers/utilities.cjs.map +0 -1
- package/dist/helpers/utilities.mjs +0 -94
- package/dist/helpers/utilities.mjs.map +0 -1
- package/dist/helpers/validations.cjs +0 -71
- package/dist/helpers/validations.cjs.map +0 -1
- package/dist/helpers/validations.mjs +0 -70
- package/dist/helpers/validations.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/package.cjs.map +0 -1
- package/dist/package.mjs +0 -6
- package/dist/package.mjs.map +0 -1
- package/dist/plugin-utils/compute-bin.cjs +0 -49
- package/dist/plugin-utils/compute-bin.cjs.map +0 -1
- package/dist/plugin-utils/compute-bin.d.cts +0 -13
- package/dist/plugin-utils/compute-bin.d.cts.map +0 -1
- package/dist/plugin-utils/compute-bin.d.mts +0 -13
- package/dist/plugin-utils/compute-bin.d.mts.map +0 -1
- package/dist/plugin-utils/compute-bin.mjs +0 -49
- package/dist/plugin-utils/compute-bin.mjs.map +0 -1
- package/dist/plugin-utils/context-helpers.cjs.map +0 -1
- package/dist/plugin-utils/context-helpers.d.cts +0 -106
- package/dist/plugin-utils/context-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/context-helpers.d.mts +0 -106
- package/dist/plugin-utils/context-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/context-helpers.mjs.map +0 -1
- package/dist/plugin-utils/deepkit.cjs +0 -70
- package/dist/plugin-utils/deepkit.cjs.map +0 -1
- package/dist/plugin-utils/deepkit.d.cts +0 -23
- package/dist/plugin-utils/deepkit.d.cts.map +0 -1
- package/dist/plugin-utils/deepkit.d.mts +0 -23
- package/dist/plugin-utils/deepkit.d.mts.map +0 -1
- package/dist/plugin-utils/deepkit.mjs +0 -69
- package/dist/plugin-utils/deepkit.mjs.map +0 -1
- package/dist/plugin-utils/description-helpers.cjs +0 -112
- package/dist/plugin-utils/description-helpers.cjs.map +0 -1
- package/dist/plugin-utils/description-helpers.d.cts +0 -44
- package/dist/plugin-utils/description-helpers.d.cts.map +0 -1
- package/dist/plugin-utils/description-helpers.d.mts +0 -44
- package/dist/plugin-utils/description-helpers.d.mts.map +0 -1
- package/dist/plugin-utils/description-helpers.mjs +0 -108
- package/dist/plugin-utils/description-helpers.mjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.cjs +0 -118
- package/dist/plugin-utils/get-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.cts +0 -36
- package/dist/plugin-utils/get-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/get-command-tree.d.mts +0 -36
- package/dist/plugin-utils/get-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/get-command-tree.mjs +0 -115
- package/dist/plugin-utils/get-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/reflect.cjs +0 -54
- package/dist/plugin-utils/reflect.cjs.map +0 -1
- package/dist/plugin-utils/reflect.d.cts +0 -14
- package/dist/plugin-utils/reflect.d.cts.map +0 -1
- package/dist/plugin-utils/reflect.d.mts +0 -14
- package/dist/plugin-utils/reflect.d.mts.map +0 -1
- package/dist/plugin-utils/reflect.mjs +0 -53
- package/dist/plugin-utils/reflect.mjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +0 -65
- package/dist/plugin-utils/traverse-command-tree.cjs.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.cts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.cts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.d.mts +0 -22
- package/dist/plugin-utils/traverse-command-tree.d.mts.map +0 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +0 -63
- package/dist/plugin-utils/traverse-command-tree.mjs.map +0 -1
- package/dist/plugin-utils/type-checks.cjs +0 -222
- package/dist/plugin-utils/type-checks.cjs.map +0 -1
- package/dist/plugin-utils/type-checks.d.cts +0 -41
- package/dist/plugin-utils/type-checks.d.cts.map +0 -1
- package/dist/plugin-utils/type-checks.d.mts +0 -41
- package/dist/plugin-utils/type-checks.d.mts.map +0 -1
- package/dist/plugin-utils/type-checks.mjs +0 -218
- package/dist/plugin-utils/type-checks.mjs.map +0 -1
- package/dist/plugin.cjs.map +0 -1
- package/dist/plugin.mjs.map +0 -1
- package/dist/resolver/deepkit.cjs +0 -110
- package/dist/resolver/deepkit.cjs.map +0 -1
- package/dist/resolver/deepkit.mjs +0 -109
- package/dist/resolver/deepkit.mjs.map +0 -1
- package/dist/resolver/helpers.cjs +0 -184
- package/dist/resolver/helpers.cjs.map +0 -1
- package/dist/resolver/helpers.mjs +0 -180
- package/dist/resolver/helpers.mjs.map +0 -1
- package/dist/resolver/resolve.cjs +0 -473
- package/dist/resolver/resolve.cjs.map +0 -1
- package/dist/resolver/resolve.mjs +0 -473
- package/dist/resolver/resolve.mjs.map +0 -1
- package/dist/types/command.cjs.map +0 -1
- package/dist/types/command.d.cts.map +0 -1
- package/dist/types/command.d.mts.map +0 -1
- package/dist/types/command.mjs.map +0 -1
- package/dist/types/config.cjs.map +0 -1
- package/dist/types/config.d.cts.map +0 -1
- package/dist/types/config.d.mts.map +0 -1
- package/dist/types/config.mjs.map +0 -1
- package/dist/types/context.cjs.map +0 -1
- package/dist/types/context.d.cts.map +0 -1
- package/dist/types/context.d.mts.map +0 -1
- package/dist/types/context.mjs.map +0 -1
- package/dist/types/env.cjs +0 -53
- package/dist/types/env.cjs.map +0 -1
- package/dist/types/env.d.cts +0 -71
- package/dist/types/env.d.cts.map +0 -1
- package/dist/types/env.d.mts +0 -71
- package/dist/types/env.mjs +0 -51
- /package/dist/{types → schemas}/env.mjs.map +0 -0
|
@@ -1,9 +1,273 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { S as CommandTree, _ as CommandOption, b as CommandParameterConfig, d as CommandArgument, r as BaseCommandParameter, x as CommandParameterType, y as CommandParameter } from "../command-CtfR7hKM.cjs";
|
|
2
|
+
import { f as Context, m as UnresolvedContext } from "../config-BIF9mEz0.cjs";
|
|
3
|
+
import "../index-DYOBadKY.cjs";
|
|
4
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
5
|
+
import { ReflectionKind, Type } from "@deepkit/type";
|
|
6
|
+
//#region src/plugin-utils/compute-bin.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Computes the command tree for the root binary command based on the provided context.
|
|
9
|
+
*
|
|
10
|
+
* @param context - The plugin context containing the necessary information to compute the command tree.
|
|
11
|
+
* @returns The computed command tree for the root binary command.
|
|
12
|
+
*/
|
|
13
|
+
declare function computeBin(context: Context): CommandTree;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/plugin-utils/context-helpers.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.
|
|
18
|
+
*
|
|
19
|
+
* @param aliases - An array of argument aliases to sort.
|
|
20
|
+
* @returns A new array of sorted aliases.
|
|
21
|
+
*/
|
|
22
|
+
declare function sortArgAliases(aliases: string[]): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the application name from the context and configuration.
|
|
25
|
+
*
|
|
26
|
+
* @param context - The build context containing workspace and package information.
|
|
27
|
+
* @returns The application name in kebab-case format.
|
|
28
|
+
* @throws An error if no valid application name is found.
|
|
29
|
+
*/
|
|
30
|
+
declare function getAppName<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves the application title from the context and configuration.
|
|
33
|
+
*
|
|
34
|
+
* @param context - The build context containing workspace and package information.
|
|
35
|
+
* @param replaceCLI - Whether to replace CLI-related terms in the title with the application name.
|
|
36
|
+
* @returns The application title in title-case format.
|
|
37
|
+
*/
|
|
38
|
+
declare function getAppTitle<TContext extends UnresolvedContext | Context>(context: TContext, replaceCLI?: boolean): string;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the application description from the context and configuration.
|
|
41
|
+
*
|
|
42
|
+
* @param context - The build context containing workspace and package information.
|
|
43
|
+
* @returns The application description.
|
|
44
|
+
*/
|
|
45
|
+
declare function getAppDescription<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves the primary binary name for the application.
|
|
48
|
+
*
|
|
49
|
+
* @param context - The build context containing workspace and package information.
|
|
50
|
+
* @returns The primary binary name as a string.
|
|
51
|
+
*/
|
|
52
|
+
declare function getAppBin<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
53
|
+
/**
|
|
54
|
+
* Determines if a given command path segment is variable (enclosed in square brackets).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* isDynamicPathSegment("[user]"); // true
|
|
59
|
+
* isDynamicPathSegment("user"); // false
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param path - The command path segment to check.
|
|
63
|
+
* @returns True if the path is variable, false otherwise.
|
|
64
|
+
*/
|
|
65
|
+
declare function isDynamicPathSegment(path: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* getDynamicPathSegmentName("[user]"); // "user"
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param path - The command path segment.
|
|
75
|
+
* @returns The variable name without square brackets.
|
|
76
|
+
*/
|
|
77
|
+
declare function getDynamicPathSegmentName(path: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Determines if a given command path segment is a path segment group (enclosed in parentheses).
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* isPathSegmentGroup("(user)"); // true
|
|
84
|
+
* isPathSegmentGroup("[user]"); // false
|
|
85
|
+
* isPathSegmentGroup("user"); // false
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param path - The command path segment to check.
|
|
89
|
+
* @returns True if the path is a path segment group, false otherwise.
|
|
90
|
+
*/
|
|
91
|
+
declare function isPathSegmentGroup(path: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Extracts the group name from a command path segment by removing enclosing parentheses.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* getPathSegmentGroupName("(admin)"); // "admin"
|
|
98
|
+
* getPathSegmentGroupName("((group))"); // "group"
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @param path - The command path segment.
|
|
102
|
+
* @returns The group name without parentheses.
|
|
103
|
+
*/
|
|
104
|
+
declare function getPathSegmentGroupName(path: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* getDynamicPathSegmentName("[user]"); // "user"
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param path - The command path segment.
|
|
114
|
+
* @returns The variable name without square brackets.
|
|
115
|
+
*/
|
|
116
|
+
declare function getPathSegmentName(path: string): string;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/plugin-utils/deepkit.d.ts
|
|
119
|
+
/**
|
|
120
|
+
* Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
|
|
121
|
+
*
|
|
122
|
+
* @param command - The command parameter or kind to extract the reflection kind from.
|
|
123
|
+
* @param checkVariadic - Whether to check for variadic parameters (arrays).
|
|
124
|
+
* @returns The extracted {@link ReflectionKind}.
|
|
125
|
+
*/
|
|
126
|
+
declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): ReflectionKind;
|
|
127
|
+
/**
|
|
128
|
+
* Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
|
|
129
|
+
*
|
|
130
|
+
* @param command - The command parameter or kind to extract the type from.
|
|
131
|
+
* @param checkVariadic - Whether to check for variadic parameters (arrays).
|
|
132
|
+
* @returns The extracted {@link Type}.
|
|
133
|
+
*/
|
|
134
|
+
declare function extractType(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): Type;
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/plugin-utils/description-helpers.d.ts
|
|
137
|
+
interface FormatDescriptionOptions {
|
|
138
|
+
/**
|
|
139
|
+
* If true, replaces newlines in the description with spaces. This is useful for ensuring that descriptions are displayed as a single line in contexts where multiline descriptions may not be supported or may cause formatting issues.
|
|
140
|
+
*
|
|
141
|
+
* @defaultValue false
|
|
142
|
+
*/
|
|
143
|
+
replaceNewlines?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* If true, collapses multiple consecutive spaces in the description into a single space. This helps to ensure that descriptions are concise and do not contain unnecessary whitespace.
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue false
|
|
148
|
+
*/
|
|
149
|
+
collapseWhitespace?: boolean;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Formats a description string by trimming whitespace, replacing newlines with spaces (optionally), collapsing multiple spaces into a single space (optionally), and escaping special characters.
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* This is useful for ensuring that descriptions are concise and well-formatted when displayed in the CLI or documentation.
|
|
156
|
+
*
|
|
157
|
+
* @param description - The full description string.
|
|
158
|
+
* @returns The formatted description string.
|
|
159
|
+
*/
|
|
160
|
+
declare function formatDescription(description: string, options?: FormatDescriptionOptions): string;
|
|
161
|
+
interface FormatShortDescriptionOptions extends FormatDescriptionOptions {
|
|
162
|
+
/**
|
|
163
|
+
* The maximum length of the short description. If the first sentence exceeds this length, it will be truncated.
|
|
164
|
+
*
|
|
165
|
+
* @defaultValue 62
|
|
166
|
+
*/
|
|
167
|
+
length?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Extracts the short description from a longer description string. The short description is typically the first sentence or the first line of the description.
|
|
171
|
+
*
|
|
172
|
+
* @param description - The full description string.
|
|
173
|
+
* @param options - Options for formatting the short description, including the maximum length.
|
|
174
|
+
* @returns The extracted short description.
|
|
175
|
+
*/
|
|
176
|
+
declare function formatShortDescription(description: string, options?: FormatShortDescriptionOptions): string;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/plugin-utils/get-command-tree.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves a specific command tree based on the provided path.
|
|
181
|
+
*
|
|
182
|
+
* @param context - The build context containing the command definitions.
|
|
183
|
+
* @param path - An array of strings representing the command path.
|
|
184
|
+
* @returns The command tree at the specified path, or null if not found.
|
|
185
|
+
*/
|
|
186
|
+
declare function getCommandTree(context: Context, path?: string[]): CommandTree | null;
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves a list of all command trees defined in the context.
|
|
189
|
+
*
|
|
190
|
+
* @param context - The build context containing the command definitions.
|
|
191
|
+
* @returns A promise that resolves to an array of all command trees in the context.
|
|
192
|
+
*/
|
|
193
|
+
declare function getCommandList(context: Context): Promise<CommandTree[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieves a list of all command paths defined in the context.
|
|
196
|
+
*
|
|
197
|
+
* @param context - The build context containing the command definitions.
|
|
198
|
+
* @returns A promise that resolves to an array of all command paths in the context.
|
|
199
|
+
*/
|
|
200
|
+
declare function getCommandPaths(context: Context): Promise<string[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves a list of all command segments defined in the context.
|
|
203
|
+
*
|
|
204
|
+
* @param context - The build context containing the command definitions.
|
|
205
|
+
* @returns A promise that resolves to an array of all command segments in the context.
|
|
206
|
+
*/
|
|
207
|
+
declare function getCommandSegments(context: Context): Promise<string[][]>;
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/plugin-utils/reflect.d.ts
|
|
210
|
+
/**
|
|
211
|
+
* Sort command options alphabetically by name, placing boolean options with negatives appropriately.
|
|
212
|
+
*
|
|
213
|
+
* @param options - The array of command options to sort.
|
|
214
|
+
* @param skipNegatives - Whether to skip negative options when sorting (default: true).
|
|
215
|
+
* @returns A new array of sorted command options.
|
|
216
|
+
*/
|
|
217
|
+
declare function sortOptions(options: CommandOption[], skipNegatives?: boolean): CommandOption[];
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/plugin-utils/traverse-command-tree.d.ts
|
|
220
|
+
/**
|
|
221
|
+
* Traverses a command tree and applies a visitor function to each node.
|
|
222
|
+
*
|
|
223
|
+
* @param commandTree - The command tree to traverse.
|
|
224
|
+
* @param visitor - The visitor function to apply to each node.
|
|
225
|
+
*/
|
|
226
|
+
declare function traverseCommandTree(commandTree: CommandTree, visitor: (node: CommandTree) => MaybePromise<void>): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Traverses all commands in the context and applies a visitor function to each command tree.
|
|
229
|
+
*
|
|
230
|
+
* @param context - The build context containing the command definitions.
|
|
231
|
+
* @param visitor - The visitor function to apply to each command tree.
|
|
232
|
+
*/
|
|
233
|
+
declare function traverseCommands<TContext extends Context>(context: TContext, visitor: (node: CommandTree) => MaybePromise<void>): Promise<void>;
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/plugin-utils/type-checks.d.ts
|
|
236
|
+
/**
|
|
237
|
+
* Type guard to check if a value is a valid {@link CommandParameterType} type.
|
|
238
|
+
*
|
|
239
|
+
* @param obj - The value to check.
|
|
240
|
+
* @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
|
|
241
|
+
*/
|
|
242
|
+
declare function isCommandParameterType(obj: any): obj is CommandParameterType;
|
|
243
|
+
/**
|
|
244
|
+
* Type guard to check if a value is a valid {@link CommandParameterConfig} type.
|
|
245
|
+
*
|
|
246
|
+
* @param obj - The value to check.
|
|
247
|
+
* @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.
|
|
248
|
+
*/
|
|
249
|
+
declare function isCommandParameterConfig(obj: any): obj is CommandParameterConfig;
|
|
250
|
+
/**
|
|
251
|
+
* Type guard to check if a value is a valid {@link CommandParameter} type.
|
|
252
|
+
*
|
|
253
|
+
* @param obj - The value to check.
|
|
254
|
+
* @returns True if the value is a valid {@link CommandParameter} type, false otherwise.
|
|
255
|
+
*/
|
|
256
|
+
declare function isCommandParameter(obj: any): obj is CommandParameter;
|
|
257
|
+
/**
|
|
258
|
+
* Type guard to check if a value is a valid {@link CommandOption} type.
|
|
259
|
+
*
|
|
260
|
+
* @param obj - The value to check.
|
|
261
|
+
* @returns True if the value is a valid {@link CommandOption} type, false otherwise.
|
|
262
|
+
*/
|
|
263
|
+
declare function isCommandOption(obj: any): obj is CommandOption;
|
|
264
|
+
/**
|
|
265
|
+
* Type guard to check if a value is a valid {@link CommandArgument} type.
|
|
266
|
+
*
|
|
267
|
+
* @param obj - The value to check.
|
|
268
|
+
* @returns True if the value is a valid {@link CommandArgument} type, false otherwise.
|
|
269
|
+
*/
|
|
270
|
+
declare function isCommandArgument(obj: any): obj is CommandArgument;
|
|
271
|
+
//#endregion
|
|
272
|
+
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 };
|
|
273
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts","../../src/plugin-utils/context-helpers.ts","../../src/plugin-utils/deepkit.ts","../../src/plugin-utils/description-helpers.ts","../../src/plugin-utils/get-command-tree.ts","../../src/plugin-utils/reflect.ts","../../src/plugin-utils/traverse-command-tree.ts","../../src/plugin-utils/type-checks.ts"],"mappings":";;;;;;;;;;;;iBA4BgB,WAAW,SAAS,UAAU;;;;;;;;;iBCE9B,eAAe;;;;;;;;iBAkBf,WAAW,iBAAiB,oBAAoB,SAC9D,SAAS;;;;;;;;iBA4BK,YAAY,iBAAiB,oBAAoB,SAC/D,SAAS,UACT;;;;;;;iBAsBc,kBAAkB,iBAAiB,oBAAoB,SACrE,SAAS;;;;;;;iBAeK,UAAU,iBAAiB,oBAAoB,SAC7D,SAAS;;;;;;;;;;;;;iBAmBK,qBAAqB;;;;;;;;;;;;iBAerB,0BAA0B;;;;;;;;;;;;;;iBAiB1B,mBAAmB;;;;;;;;;;;;;iBAgBnB,wBAAwB;;;;;;;;;;;;iBAkBxB,mBAAmB;;;;;;;;;;iBCxKnB,sBACd,SAAS,uBAAuB,sBAChC,0BACC;;;;;;;;iBAgCa,YACd,SAAS,uBAAuB,sBAChC,0BACC;;;UCvDc;;;;;;EAMf;;;;;;EAOA;;;;;;;;;;;iBAqDc,kBACd,qBACA,UAAS;UAOM,sCAAsC;;;;;;EAMrD;;;;;;;;;iBAUc,uBACd,qBACA,UAAS;;;;;;;;;;iBCjFK,eACd,SAAS,SACT,kBACC;;;;;;;iBA+BmB,eAAe,SAAS,UAAU,QAAQ;;;;;;;iBAe1C,gBAAgB,SAAS,UAAU;;;;;;;iBAiBnC,mBACpB,SAAS,UACR;;;;;;;;;;iBCvEa,YACd,SAAS,iBACT,0BACC;;;;;;;;;iBCFmB,oBACpB,aAAa,aACb,UAAU,MAAM,gBAAgB,qBAC/B;;;;;;;iBAmBmB,iBAAiB,iBAAiB,SACtD,SAAS,UACT,UAAU,MAAM,gBAAgB,qBAC/B;;;;;;;;;iBCqJa,uBAAuB,WAAW,OAAO;;;;;;;iBAUzC,yBACd,WACC,OAAO;;;;;;;iBAqBM,mBAAmB,WAAW,OAAO;;;;;;;iBA0CrC,gBAAgB,WAAW,OAAO;;;;;;;iBAkClC,kBAAkB,WAAW,OAAO"}
|
|
@@ -1,9 +1,273 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { S as CommandTree, _ as CommandOption, b as CommandParameterConfig, d as CommandArgument, r as BaseCommandParameter, x as CommandParameterType, y as CommandParameter } from "../command-B6KYexlV.mjs";
|
|
2
|
+
import { f as Context, m as UnresolvedContext } from "../config-CnNYdfsL.mjs";
|
|
3
|
+
import "../index-D4klH_pj.mjs";
|
|
4
|
+
import { ReflectionKind, Type } from "@deepkit/type";
|
|
5
|
+
import { MaybePromise } from "@stryke/types/base";
|
|
6
|
+
//#region src/plugin-utils/compute-bin.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Computes the command tree for the root binary command based on the provided context.
|
|
9
|
+
*
|
|
10
|
+
* @param context - The plugin context containing the necessary information to compute the command tree.
|
|
11
|
+
* @returns The computed command tree for the root binary command.
|
|
12
|
+
*/
|
|
13
|
+
declare function computeBin(context: Context): CommandTree;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/plugin-utils/context-helpers.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.
|
|
18
|
+
*
|
|
19
|
+
* @param aliases - An array of argument aliases to sort.
|
|
20
|
+
* @returns A new array of sorted aliases.
|
|
21
|
+
*/
|
|
22
|
+
declare function sortArgAliases(aliases: string[]): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the application name from the context and configuration.
|
|
25
|
+
*
|
|
26
|
+
* @param context - The build context containing workspace and package information.
|
|
27
|
+
* @returns The application name in kebab-case format.
|
|
28
|
+
* @throws An error if no valid application name is found.
|
|
29
|
+
*/
|
|
30
|
+
declare function getAppName<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves the application title from the context and configuration.
|
|
33
|
+
*
|
|
34
|
+
* @param context - The build context containing workspace and package information.
|
|
35
|
+
* @param replaceCLI - Whether to replace CLI-related terms in the title with the application name.
|
|
36
|
+
* @returns The application title in title-case format.
|
|
37
|
+
*/
|
|
38
|
+
declare function getAppTitle<TContext extends UnresolvedContext | Context>(context: TContext, replaceCLI?: boolean): string;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the application description from the context and configuration.
|
|
41
|
+
*
|
|
42
|
+
* @param context - The build context containing workspace and package information.
|
|
43
|
+
* @returns The application description.
|
|
44
|
+
*/
|
|
45
|
+
declare function getAppDescription<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves the primary binary name for the application.
|
|
48
|
+
*
|
|
49
|
+
* @param context - The build context containing workspace and package information.
|
|
50
|
+
* @returns The primary binary name as a string.
|
|
51
|
+
*/
|
|
52
|
+
declare function getAppBin<TContext extends UnresolvedContext | Context>(context: TContext): string;
|
|
53
|
+
/**
|
|
54
|
+
* Determines if a given command path segment is variable (enclosed in square brackets).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* isDynamicPathSegment("[user]"); // true
|
|
59
|
+
* isDynamicPathSegment("user"); // false
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param path - The command path segment to check.
|
|
63
|
+
* @returns True if the path is variable, false otherwise.
|
|
64
|
+
*/
|
|
65
|
+
declare function isDynamicPathSegment(path: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* getDynamicPathSegmentName("[user]"); // "user"
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @param path - The command path segment.
|
|
75
|
+
* @returns The variable name without square brackets.
|
|
76
|
+
*/
|
|
77
|
+
declare function getDynamicPathSegmentName(path: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Determines if a given command path segment is a path segment group (enclosed in parentheses).
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* isPathSegmentGroup("(user)"); // true
|
|
84
|
+
* isPathSegmentGroup("[user]"); // false
|
|
85
|
+
* isPathSegmentGroup("user"); // false
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param path - The command path segment to check.
|
|
89
|
+
* @returns True if the path is a path segment group, false otherwise.
|
|
90
|
+
*/
|
|
91
|
+
declare function isPathSegmentGroup(path: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Extracts the group name from a command path segment by removing enclosing parentheses.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* getPathSegmentGroupName("(admin)"); // "admin"
|
|
98
|
+
* getPathSegmentGroupName("((group))"); // "group"
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @param path - The command path segment.
|
|
102
|
+
* @returns The group name without parentheses.
|
|
103
|
+
*/
|
|
104
|
+
declare function getPathSegmentGroupName(path: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Extracts the variable name from a command path segment by removing enclosing square brackets.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* getDynamicPathSegmentName("[user]"); // "user"
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param path - The command path segment.
|
|
114
|
+
* @returns The variable name without square brackets.
|
|
115
|
+
*/
|
|
116
|
+
declare function getPathSegmentName(path: string): string;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/plugin-utils/deepkit.d.ts
|
|
119
|
+
/**
|
|
120
|
+
* Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
|
|
121
|
+
*
|
|
122
|
+
* @param command - The command parameter or kind to extract the reflection kind from.
|
|
123
|
+
* @param checkVariadic - Whether to check for variadic parameters (arrays).
|
|
124
|
+
* @returns The extracted {@link ReflectionKind}.
|
|
125
|
+
*/
|
|
126
|
+
declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): ReflectionKind;
|
|
127
|
+
/**
|
|
128
|
+
* Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
|
|
129
|
+
*
|
|
130
|
+
* @param command - The command parameter or kind to extract the type from.
|
|
131
|
+
* @param checkVariadic - Whether to check for variadic parameters (arrays).
|
|
132
|
+
* @returns The extracted {@link Type}.
|
|
133
|
+
*/
|
|
134
|
+
declare function extractType(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): Type;
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/plugin-utils/description-helpers.d.ts
|
|
137
|
+
interface FormatDescriptionOptions {
|
|
138
|
+
/**
|
|
139
|
+
* If true, replaces newlines in the description with spaces. This is useful for ensuring that descriptions are displayed as a single line in contexts where multiline descriptions may not be supported or may cause formatting issues.
|
|
140
|
+
*
|
|
141
|
+
* @defaultValue false
|
|
142
|
+
*/
|
|
143
|
+
replaceNewlines?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* If true, collapses multiple consecutive spaces in the description into a single space. This helps to ensure that descriptions are concise and do not contain unnecessary whitespace.
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue false
|
|
148
|
+
*/
|
|
149
|
+
collapseWhitespace?: boolean;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Formats a description string by trimming whitespace, replacing newlines with spaces (optionally), collapsing multiple spaces into a single space (optionally), and escaping special characters.
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* This is useful for ensuring that descriptions are concise and well-formatted when displayed in the CLI or documentation.
|
|
156
|
+
*
|
|
157
|
+
* @param description - The full description string.
|
|
158
|
+
* @returns The formatted description string.
|
|
159
|
+
*/
|
|
160
|
+
declare function formatDescription(description: string, options?: FormatDescriptionOptions): string;
|
|
161
|
+
interface FormatShortDescriptionOptions extends FormatDescriptionOptions {
|
|
162
|
+
/**
|
|
163
|
+
* The maximum length of the short description. If the first sentence exceeds this length, it will be truncated.
|
|
164
|
+
*
|
|
165
|
+
* @defaultValue 62
|
|
166
|
+
*/
|
|
167
|
+
length?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Extracts the short description from a longer description string. The short description is typically the first sentence or the first line of the description.
|
|
171
|
+
*
|
|
172
|
+
* @param description - The full description string.
|
|
173
|
+
* @param options - Options for formatting the short description, including the maximum length.
|
|
174
|
+
* @returns The extracted short description.
|
|
175
|
+
*/
|
|
176
|
+
declare function formatShortDescription(description: string, options?: FormatShortDescriptionOptions): string;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/plugin-utils/get-command-tree.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves a specific command tree based on the provided path.
|
|
181
|
+
*
|
|
182
|
+
* @param context - The build context containing the command definitions.
|
|
183
|
+
* @param path - An array of strings representing the command path.
|
|
184
|
+
* @returns The command tree at the specified path, or null if not found.
|
|
185
|
+
*/
|
|
186
|
+
declare function getCommandTree(context: Context, path?: string[]): CommandTree | null;
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves a list of all command trees defined in the context.
|
|
189
|
+
*
|
|
190
|
+
* @param context - The build context containing the command definitions.
|
|
191
|
+
* @returns A promise that resolves to an array of all command trees in the context.
|
|
192
|
+
*/
|
|
193
|
+
declare function getCommandList(context: Context): Promise<CommandTree[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieves a list of all command paths defined in the context.
|
|
196
|
+
*
|
|
197
|
+
* @param context - The build context containing the command definitions.
|
|
198
|
+
* @returns A promise that resolves to an array of all command paths in the context.
|
|
199
|
+
*/
|
|
200
|
+
declare function getCommandPaths(context: Context): Promise<string[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves a list of all command segments defined in the context.
|
|
203
|
+
*
|
|
204
|
+
* @param context - The build context containing the command definitions.
|
|
205
|
+
* @returns A promise that resolves to an array of all command segments in the context.
|
|
206
|
+
*/
|
|
207
|
+
declare function getCommandSegments(context: Context): Promise<string[][]>;
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/plugin-utils/reflect.d.ts
|
|
210
|
+
/**
|
|
211
|
+
* Sort command options alphabetically by name, placing boolean options with negatives appropriately.
|
|
212
|
+
*
|
|
213
|
+
* @param options - The array of command options to sort.
|
|
214
|
+
* @param skipNegatives - Whether to skip negative options when sorting (default: true).
|
|
215
|
+
* @returns A new array of sorted command options.
|
|
216
|
+
*/
|
|
217
|
+
declare function sortOptions(options: CommandOption[], skipNegatives?: boolean): CommandOption[];
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/plugin-utils/traverse-command-tree.d.ts
|
|
220
|
+
/**
|
|
221
|
+
* Traverses a command tree and applies a visitor function to each node.
|
|
222
|
+
*
|
|
223
|
+
* @param commandTree - The command tree to traverse.
|
|
224
|
+
* @param visitor - The visitor function to apply to each node.
|
|
225
|
+
*/
|
|
226
|
+
declare function traverseCommandTree(commandTree: CommandTree, visitor: (node: CommandTree) => MaybePromise<void>): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Traverses all commands in the context and applies a visitor function to each command tree.
|
|
229
|
+
*
|
|
230
|
+
* @param context - The build context containing the command definitions.
|
|
231
|
+
* @param visitor - The visitor function to apply to each command tree.
|
|
232
|
+
*/
|
|
233
|
+
declare function traverseCommands<TContext extends Context>(context: TContext, visitor: (node: CommandTree) => MaybePromise<void>): Promise<void>;
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/plugin-utils/type-checks.d.ts
|
|
236
|
+
/**
|
|
237
|
+
* Type guard to check if a value is a valid {@link CommandParameterType} type.
|
|
238
|
+
*
|
|
239
|
+
* @param obj - The value to check.
|
|
240
|
+
* @returns True if the value is a valid {@link CommandParameterType} type, false otherwise.
|
|
241
|
+
*/
|
|
242
|
+
declare function isCommandParameterType(obj: any): obj is CommandParameterType;
|
|
243
|
+
/**
|
|
244
|
+
* Type guard to check if a value is a valid {@link CommandParameterConfig} type.
|
|
245
|
+
*
|
|
246
|
+
* @param obj - The value to check.
|
|
247
|
+
* @returns True if the value is a valid {@link CommandParameterConfig} type, false otherwise.
|
|
248
|
+
*/
|
|
249
|
+
declare function isCommandParameterConfig(obj: any): obj is CommandParameterConfig;
|
|
250
|
+
/**
|
|
251
|
+
* Type guard to check if a value is a valid {@link CommandParameter} type.
|
|
252
|
+
*
|
|
253
|
+
* @param obj - The value to check.
|
|
254
|
+
* @returns True if the value is a valid {@link CommandParameter} type, false otherwise.
|
|
255
|
+
*/
|
|
256
|
+
declare function isCommandParameter(obj: any): obj is CommandParameter;
|
|
257
|
+
/**
|
|
258
|
+
* Type guard to check if a value is a valid {@link CommandOption} type.
|
|
259
|
+
*
|
|
260
|
+
* @param obj - The value to check.
|
|
261
|
+
* @returns True if the value is a valid {@link CommandOption} type, false otherwise.
|
|
262
|
+
*/
|
|
263
|
+
declare function isCommandOption(obj: any): obj is CommandOption;
|
|
264
|
+
/**
|
|
265
|
+
* Type guard to check if a value is a valid {@link CommandArgument} type.
|
|
266
|
+
*
|
|
267
|
+
* @param obj - The value to check.
|
|
268
|
+
* @returns True if the value is a valid {@link CommandArgument} type, false otherwise.
|
|
269
|
+
*/
|
|
270
|
+
declare function isCommandArgument(obj: any): obj is CommandArgument;
|
|
271
|
+
//#endregion
|
|
272
|
+
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 };
|
|
273
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts","../../src/plugin-utils/context-helpers.ts","../../src/plugin-utils/deepkit.ts","../../src/plugin-utils/description-helpers.ts","../../src/plugin-utils/get-command-tree.ts","../../src/plugin-utils/reflect.ts","../../src/plugin-utils/traverse-command-tree.ts","../../src/plugin-utils/type-checks.ts"],"mappings":""}
|