@shell-shock/plugin-theme 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/contexts/index.cjs +1 -0
- package/dist/contexts/theme.cjs +7 -6
- package/dist/contexts/theme.d.cts +0 -1
- package/dist/contexts/theme.d.cts.map +1 -1
- package/dist/contexts/theme.d.mts +0 -1
- package/dist/contexts/theme.d.mts.map +1 -1
- package/dist/contexts/theme.mjs.map +1 -1
- package/dist/core/dist/api.d.cts +1 -0
- package/dist/core/dist/api.d.mts +1 -0
- package/dist/core/dist/index.d.cts +3 -0
- package/dist/core/dist/index.d.mts +3 -0
- package/dist/core/dist/types/command.d.cts +185 -0
- package/dist/core/dist/types/command.d.cts.map +1 -0
- package/dist/core/dist/types/command.d.mts +185 -0
- package/dist/core/dist/types/command.d.mts.map +1 -0
- package/dist/core/dist/types/config.d.cts +95 -0
- package/dist/core/dist/types/config.d.cts.map +1 -0
- package/dist/core/dist/types/config.d.mts +95 -0
- package/dist/core/dist/types/config.d.mts.map +1 -0
- package/dist/core/dist/types/context.d.cts +28 -0
- package/dist/core/dist/types/context.d.cts.map +1 -0
- package/dist/core/dist/types/context.d.mts +28 -0
- package/dist/core/dist/types/context.d.mts.map +1 -0
- package/dist/helpers/ansi-utils.cjs +1 -0
- package/dist/helpers/ansi-utils.d.cts.map +1 -1
- package/dist/helpers/ansi-utils.d.mts.map +1 -1
- package/dist/helpers/ansi-utils.mjs.map +1 -1
- package/dist/helpers/border-styles.cjs +1 -1
- package/dist/helpers/border-styles.d.cts +0 -1
- package/dist/helpers/border-styles.d.cts.map +1 -1
- package/dist/helpers/border-styles.d.mts +0 -1
- package/dist/helpers/border-styles.d.mts.map +1 -1
- package/dist/helpers/border-styles.mjs +0 -1
- package/dist/helpers/border-styles.mjs.map +1 -1
- package/dist/helpers/index.cjs +2 -1
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/merge.cjs +2 -1
- package/dist/helpers/merge.d.cts +0 -1
- package/dist/helpers/merge.d.cts.map +1 -1
- package/dist/helpers/merge.d.mts +0 -1
- package/dist/helpers/merge.d.mts.map +1 -1
- package/dist/helpers/merge.mjs.map +1 -1
- package/dist/helpers/spinners.cjs +3 -4
- package/dist/helpers/spinners.d.cts.map +1 -1
- package/dist/helpers/spinners.d.mts.map +1 -1
- package/dist/helpers/spinners.mjs +1 -2
- package/dist/helpers/spinners.mjs.map +1 -1
- package/dist/index.cjs +13 -14
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/dist/style-dictionary/border-styles.cjs +54 -54
- package/dist/style-dictionary/border-styles.mjs +7 -7
- package/dist/style-dictionary/border-styles.mjs.map +1 -1
- package/dist/style-dictionary/colors.cjs +380 -380
- package/dist/style-dictionary/colors.mjs +185 -185
- package/dist/style-dictionary/colors.mjs.map +1 -1
- package/dist/style-dictionary/icons.cjs +64 -64
- package/dist/style-dictionary/icons.mjs +28 -28
- package/dist/style-dictionary/icons.mjs.map +1 -1
- package/dist/style-dictionary/labels.cjs +58 -58
- package/dist/style-dictionary/labels.mjs +33 -33
- package/dist/style-dictionary/labels.mjs.map +1 -1
- package/dist/style-dictionary/padding.cjs +61 -61
- package/dist/style-dictionary/padding.mjs +11 -11
- package/dist/style-dictionary/padding.mjs.map +1 -1
- package/dist/style-dictionary/settings.cjs +4 -4
- package/dist/style-dictionary/settings.mjs +2 -2
- package/dist/style-dictionary/settings.mjs.map +1 -1
- package/dist/style-dictionary/spinners.cjs +5 -5
- package/dist/style-dictionary/spinners.mjs.map +1 -1
- package/dist/themes/default.mjs.map +1 -1
- package/dist/types/plugin.d.cts +2 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +2 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/theme.d.cts.map +1 -1
- package/dist/types/theme.d.mts.map +1 -1
- package/package.json +11 -11
package/dist/contexts/index.cjs
CHANGED
package/dist/contexts/theme.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_helpers_ansi_utils = require('../helpers/ansi-utils.cjs');
|
|
3
|
-
let
|
|
4
|
-
let
|
|
4
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
5
6
|
|
|
6
7
|
//#region src/contexts/theme.ts
|
|
7
8
|
/**
|
|
@@ -10,8 +11,8 @@ let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugi
|
|
|
10
11
|
* @returns The resolved theme configuration.
|
|
11
12
|
*/
|
|
12
13
|
function useTheme() {
|
|
13
|
-
const context = (0,
|
|
14
|
-
return (0,
|
|
14
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
15
|
+
return (0, _alloy_js_core.computed)(() => context.theme).value;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Hook to access the current application's ANSI colors/styles.
|
|
@@ -20,7 +21,7 @@ function useTheme() {
|
|
|
20
21
|
*/
|
|
21
22
|
function useColors() {
|
|
22
23
|
const theme = useTheme();
|
|
23
|
-
return (0,
|
|
24
|
+
return (0, _alloy_js_core.computed)(() => require_helpers_ansi_utils.getAnsiStyles(theme.colors)).value;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.cts","names":[],"sources":["../../src/contexts/theme.ts"],"
|
|
1
|
+
{"version":3,"file":"theme.d.cts","names":[],"sources":["../../src/contexts/theme.ts"],"mappings":";;;;;;AA8BA;;;iBAAgB,QAAA,CAAA,GAAY,mBAAA;;AAY5B;;;;iBAAgB,SAAA,CAAA,GAAa,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.mts","names":[],"sources":["../../src/contexts/theme.ts"],"
|
|
1
|
+
{"version":3,"file":"theme.d.mts","names":[],"sources":["../../src/contexts/theme.ts"],"mappings":";;;;;;AA8BA;;;iBAAgB,QAAA,CAAA,GAAY,mBAAA;;AAY5B;;;;iBAAgB,SAAA,CAAA,GAAa,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.mjs","names":[
|
|
1
|
+
{"version":3,"file":"theme.mjs","names":[],"sources":["../../src/contexts/theme.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { AnsiStyles } from \"../helpers/ansi-utils\";\nimport { getAnsiStyles } from \"../helpers/ansi-utils\";\nimport type { ThemePluginContext } from \"../types/plugin\";\nimport type { ThemeResolvedConfig } from \"../types/theme\";\n\n/**\n * Hook to access the current application's theme configuration.\n *\n * @returns The resolved theme configuration.\n */\nexport function useTheme(): ThemeResolvedConfig {\n const context = usePowerlines<ThemePluginContext>();\n const theme = computed(() => context.theme);\n\n return theme.value;\n}\n\n/**\n * Hook to access the current application's ANSI colors/styles.\n *\n * @returns The ANSI colors/styles.\n */\nexport function useColors(): AnsiStyles {\n const theme = useTheme();\n const colors = computed(() => getAnsiStyles(theme.colors));\n\n return colors.value;\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,WAAgC;CAC9C,MAAM,UAAU,eAAmC;AAGnD,QAFc,eAAe,QAAQ,MAAM,CAE9B;;;;;;;AAQf,SAAgB,YAAwB;CACtC,MAAM,QAAQ,UAAU;AAGxB,QAFe,eAAe,cAAc,MAAM,OAAO,CAAC,CAE5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandConfig, CommandOption, CommandParameterKind, CommandParameterKinds, CommandTree, NumberCommandParameter, StringCommandParameter } from "./types/command.cjs";
|
|
2
|
+
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./types/config.cjs";
|
|
3
|
+
import { Context } from "./types/context.cjs";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandConfig, CommandOption, CommandParameterKind, CommandParameterKinds, CommandTree, NumberCommandParameter, StringCommandParameter } from "./types/command.mjs";
|
|
2
|
+
import { Options, OutputConfig, ResolvedConfig, UserConfig } from "./types/config.mjs";
|
|
3
|
+
import { Context } from "./types/context.mjs";
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { ResolvedEntryTypeDefinition } from "powerlines";
|
|
2
|
+
|
|
3
|
+
//#region ../core/dist/types/command.d.cts
|
|
4
|
+
declare const CommandParameterKinds: {
|
|
5
|
+
readonly string: "string";
|
|
6
|
+
readonly number: "number";
|
|
7
|
+
readonly boolean: "boolean";
|
|
8
|
+
};
|
|
9
|
+
type CommandParameterKind = (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];
|
|
10
|
+
interface BaseCommandParameter {
|
|
11
|
+
/**
|
|
12
|
+
* The option name.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The option kind.
|
|
17
|
+
*/
|
|
18
|
+
kind: CommandParameterKind;
|
|
19
|
+
/**
|
|
20
|
+
* The display title.
|
|
21
|
+
*/
|
|
22
|
+
title: string;
|
|
23
|
+
/**
|
|
24
|
+
* The option description.
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* Alternative option names.
|
|
29
|
+
*/
|
|
30
|
+
alias: string[];
|
|
31
|
+
/**
|
|
32
|
+
* The environment variable name or false to disable.
|
|
33
|
+
*/
|
|
34
|
+
env: string | false;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the option is optional.
|
|
37
|
+
*/
|
|
38
|
+
optional: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface StringCommandParameter extends BaseCommandParameter {
|
|
41
|
+
/**
|
|
42
|
+
* The option kind.
|
|
43
|
+
*/
|
|
44
|
+
kind: "string";
|
|
45
|
+
/**
|
|
46
|
+
* The default value.
|
|
47
|
+
*/
|
|
48
|
+
default?: string;
|
|
49
|
+
/**
|
|
50
|
+
* A standard string format to validate the option value against.
|
|
51
|
+
*/
|
|
52
|
+
format?: "email" | "uri" | "uuid" | "ipv4" | "ipv6" | "date" | "time" | "date-time" | "duration";
|
|
53
|
+
/**
|
|
54
|
+
* Whether the option accepts multiple values.
|
|
55
|
+
*/
|
|
56
|
+
variadic: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The allowed choices for the option value.
|
|
59
|
+
*/
|
|
60
|
+
choices?: string[];
|
|
61
|
+
}
|
|
62
|
+
interface NumberCommandParameter extends BaseCommandParameter {
|
|
63
|
+
/**
|
|
64
|
+
* The option kind.
|
|
65
|
+
*/
|
|
66
|
+
kind: "number";
|
|
67
|
+
/**
|
|
68
|
+
* The default value.
|
|
69
|
+
*/
|
|
70
|
+
default?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the option accepts multiple values.
|
|
73
|
+
*/
|
|
74
|
+
variadic: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The allowed choices for the option value.
|
|
77
|
+
*/
|
|
78
|
+
choices?: number[];
|
|
79
|
+
}
|
|
80
|
+
interface BooleanCommandParameter extends BaseCommandParameter {
|
|
81
|
+
/**
|
|
82
|
+
* The option kind.
|
|
83
|
+
*/
|
|
84
|
+
kind: "boolean";
|
|
85
|
+
/**
|
|
86
|
+
* The default value.
|
|
87
|
+
*/
|
|
88
|
+
default?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface BooleanCommandOption extends BooleanCommandParameter {
|
|
91
|
+
/**
|
|
92
|
+
* The option this negates.
|
|
93
|
+
*/
|
|
94
|
+
isNegativeOf?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Whether to skip adding a negative option.
|
|
97
|
+
*/
|
|
98
|
+
skipAddingNegative?: boolean;
|
|
99
|
+
}
|
|
100
|
+
type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCommandOption;
|
|
101
|
+
type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
102
|
+
interface CommandBase {
|
|
103
|
+
/**
|
|
104
|
+
* The command id.
|
|
105
|
+
*/
|
|
106
|
+
id: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The command name.
|
|
109
|
+
*/
|
|
110
|
+
name: string;
|
|
111
|
+
/**
|
|
112
|
+
* The full command path value.
|
|
113
|
+
*/
|
|
114
|
+
path: string | null;
|
|
115
|
+
/**
|
|
116
|
+
* The path segments.
|
|
117
|
+
*/
|
|
118
|
+
segments: string[];
|
|
119
|
+
/**
|
|
120
|
+
* The display title.
|
|
121
|
+
*/
|
|
122
|
+
title?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The command description.
|
|
125
|
+
*/
|
|
126
|
+
description?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Alternative command names.
|
|
129
|
+
*/
|
|
130
|
+
alias?: string[];
|
|
131
|
+
/**
|
|
132
|
+
* The command icon.
|
|
133
|
+
*/
|
|
134
|
+
icon?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the command is virtual.
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.
|
|
140
|
+
*/
|
|
141
|
+
isVirtual: boolean;
|
|
142
|
+
}
|
|
143
|
+
interface CommandConfig extends CommandBase {
|
|
144
|
+
/**
|
|
145
|
+
* The command id.
|
|
146
|
+
*/
|
|
147
|
+
id: string;
|
|
148
|
+
/**
|
|
149
|
+
* The resolved entry definition.
|
|
150
|
+
*/
|
|
151
|
+
entry: ResolvedEntryTypeDefinition;
|
|
152
|
+
}
|
|
153
|
+
type CommandTree = CommandConfig & {
|
|
154
|
+
/**
|
|
155
|
+
* The display title.
|
|
156
|
+
*/
|
|
157
|
+
title: string;
|
|
158
|
+
/**
|
|
159
|
+
* The command description.
|
|
160
|
+
*/
|
|
161
|
+
description: string;
|
|
162
|
+
/**
|
|
163
|
+
* Alternative command names.
|
|
164
|
+
*/
|
|
165
|
+
alias: string[];
|
|
166
|
+
/**
|
|
167
|
+
* The command options.
|
|
168
|
+
*/
|
|
169
|
+
options: Record<string, CommandOption>;
|
|
170
|
+
/**
|
|
171
|
+
* The positional arguments provided to the command.
|
|
172
|
+
*/
|
|
173
|
+
args: CommandArgument[];
|
|
174
|
+
/**
|
|
175
|
+
* The parent command.
|
|
176
|
+
*/
|
|
177
|
+
parent: null | CommandTree;
|
|
178
|
+
/**
|
|
179
|
+
* Child commands.
|
|
180
|
+
*/
|
|
181
|
+
children: Record<string, CommandTree>;
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
184
|
+
export { BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandConfig, CommandOption, CommandParameterKind, CommandParameterKinds, CommandTree, NumberCommandParameter, StringCommandParameter };
|
|
185
|
+
//# sourceMappingURL=command.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.cts","names":["ResolvedEntryTypeDefinition","StandardJSONSchemaV1","JsonSchema7TupleType","AnyFunction","JSONSchema7Object","z3","CommandParameterType","CommandParameterKinds","string","number","boolean","CommandParameterKind","BaseCommandParameter","name","kind","title","description","alias","env","optional","StringCommandParameter","default","format","variadic","choices","NumberCommandParameter","BooleanCommandParameter","CommandParameter","AsCommandParameterConfig","T","Pick","Omit","Partial","StringCommandParameterConfig","NumberCommandParameterConfig","BooleanCommandParameterConfig","CommandParameterConfig","BooleanCommandOption","isNegativeOf","skipAddingNegative","CommandOption","CommandOptionConfig","CommandArgument","CommandArgumentConfig","CommandBase","id","path","segments","icon","isVirtual","CommandConfig","entry","CommandTree","Record","options","args","parent","children","SerializedCommandTree","CommandMetadata","CommandModule","AnyZodObject","AnyZodTuple","metadata"],"sources":["../../../../../core/dist/types/command.d.cts"],"mappings":";;;cAScO,qBAAAA;EAAAA,SACHC,MAAAA;EAAAA,SACAC,MAAAA;EAAAA,SACAC,OAAAA;AAAAA;AAAAA,KAENC,oBAAAA,WAA+BJ,qBAAAA,eAAoCA,qBAAAA;AAAAA,UAC9DK,oBAAAA;EADmF;AAAA;;EAK3FC,IAAAA;EAI0B;;;EAA1BC,IAAAA,EAAMH,oBAAAA;EAINI;;;EAAAA,KAAAA;EAgBAI;;;EAZAH,WAAAA;EAc8B;;;EAV9BC,KAAAA;EAcAH;;;EAVAI,GAAAA;EA0BAM;;;EAtBAL,QAAAA;AAAAA;AAAAA,UAEQC,sBAAAA,SAA+BR,oBAAAA;EAsBoB;;;EAlB3DE,IAAAA;EA8BAS;;;EA1BAF,OAAAA;EA8BO;;;EA1BPC,MAAAA;EA4BwCV;;;EAxBxCW,QAAAA;EAgCO;AASgH;;EArCvHC,OAAAA;AAAAA;AAAAA,UAEQ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2
|
+
|
|
3
|
+
//#region ../core/dist/types/command.d.cts
|
|
4
|
+
declare const CommandParameterKinds: {
|
|
5
|
+
readonly string: "string";
|
|
6
|
+
readonly number: "number";
|
|
7
|
+
readonly boolean: "boolean";
|
|
8
|
+
};
|
|
9
|
+
type CommandParameterKind = (typeof CommandParameterKinds)[keyof typeof CommandParameterKinds];
|
|
10
|
+
interface BaseCommandParameter {
|
|
11
|
+
/**
|
|
12
|
+
* The option name.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The option kind.
|
|
17
|
+
*/
|
|
18
|
+
kind: CommandParameterKind;
|
|
19
|
+
/**
|
|
20
|
+
* The display title.
|
|
21
|
+
*/
|
|
22
|
+
title: string;
|
|
23
|
+
/**
|
|
24
|
+
* The option description.
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* Alternative option names.
|
|
29
|
+
*/
|
|
30
|
+
alias: string[];
|
|
31
|
+
/**
|
|
32
|
+
* The environment variable name or false to disable.
|
|
33
|
+
*/
|
|
34
|
+
env: string | false;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the option is optional.
|
|
37
|
+
*/
|
|
38
|
+
optional: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface StringCommandParameter extends BaseCommandParameter {
|
|
41
|
+
/**
|
|
42
|
+
* The option kind.
|
|
43
|
+
*/
|
|
44
|
+
kind: "string";
|
|
45
|
+
/**
|
|
46
|
+
* The default value.
|
|
47
|
+
*/
|
|
48
|
+
default?: string;
|
|
49
|
+
/**
|
|
50
|
+
* A standard string format to validate the option value against.
|
|
51
|
+
*/
|
|
52
|
+
format?: "email" | "uri" | "uuid" | "ipv4" | "ipv6" | "date" | "time" | "date-time" | "duration";
|
|
53
|
+
/**
|
|
54
|
+
* Whether the option accepts multiple values.
|
|
55
|
+
*/
|
|
56
|
+
variadic: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The allowed choices for the option value.
|
|
59
|
+
*/
|
|
60
|
+
choices?: string[];
|
|
61
|
+
}
|
|
62
|
+
interface NumberCommandParameter extends BaseCommandParameter {
|
|
63
|
+
/**
|
|
64
|
+
* The option kind.
|
|
65
|
+
*/
|
|
66
|
+
kind: "number";
|
|
67
|
+
/**
|
|
68
|
+
* The default value.
|
|
69
|
+
*/
|
|
70
|
+
default?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the option accepts multiple values.
|
|
73
|
+
*/
|
|
74
|
+
variadic: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The allowed choices for the option value.
|
|
77
|
+
*/
|
|
78
|
+
choices?: number[];
|
|
79
|
+
}
|
|
80
|
+
interface BooleanCommandParameter extends BaseCommandParameter {
|
|
81
|
+
/**
|
|
82
|
+
* The option kind.
|
|
83
|
+
*/
|
|
84
|
+
kind: "boolean";
|
|
85
|
+
/**
|
|
86
|
+
* The default value.
|
|
87
|
+
*/
|
|
88
|
+
default?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface BooleanCommandOption extends BooleanCommandParameter {
|
|
91
|
+
/**
|
|
92
|
+
* The option this negates.
|
|
93
|
+
*/
|
|
94
|
+
isNegativeOf?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Whether to skip adding a negative option.
|
|
97
|
+
*/
|
|
98
|
+
skipAddingNegative?: boolean;
|
|
99
|
+
}
|
|
100
|
+
type CommandOption = StringCommandParameter | NumberCommandParameter | BooleanCommandOption;
|
|
101
|
+
type CommandArgument = StringCommandParameter | NumberCommandParameter | BooleanCommandParameter;
|
|
102
|
+
interface CommandBase {
|
|
103
|
+
/**
|
|
104
|
+
* The command id.
|
|
105
|
+
*/
|
|
106
|
+
id: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The command name.
|
|
109
|
+
*/
|
|
110
|
+
name: string;
|
|
111
|
+
/**
|
|
112
|
+
* The full command path value.
|
|
113
|
+
*/
|
|
114
|
+
path: string | null;
|
|
115
|
+
/**
|
|
116
|
+
* The path segments.
|
|
117
|
+
*/
|
|
118
|
+
segments: string[];
|
|
119
|
+
/**
|
|
120
|
+
* The display title.
|
|
121
|
+
*/
|
|
122
|
+
title?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The command description.
|
|
125
|
+
*/
|
|
126
|
+
description?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Alternative command names.
|
|
129
|
+
*/
|
|
130
|
+
alias?: string[];
|
|
131
|
+
/**
|
|
132
|
+
* The command icon.
|
|
133
|
+
*/
|
|
134
|
+
icon?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the command is virtual.
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* Virtual commands are considered forks in the command tree and are not directly executable. They are used to group related subcommands together without having an actual command handler or entry point.
|
|
140
|
+
*/
|
|
141
|
+
isVirtual: boolean;
|
|
142
|
+
}
|
|
143
|
+
interface CommandConfig extends CommandBase {
|
|
144
|
+
/**
|
|
145
|
+
* The command id.
|
|
146
|
+
*/
|
|
147
|
+
id: string;
|
|
148
|
+
/**
|
|
149
|
+
* The resolved entry definition.
|
|
150
|
+
*/
|
|
151
|
+
entry: ResolvedEntryTypeDefinition;
|
|
152
|
+
}
|
|
153
|
+
type CommandTree = CommandConfig & {
|
|
154
|
+
/**
|
|
155
|
+
* The display title.
|
|
156
|
+
*/
|
|
157
|
+
title: string;
|
|
158
|
+
/**
|
|
159
|
+
* The command description.
|
|
160
|
+
*/
|
|
161
|
+
description: string;
|
|
162
|
+
/**
|
|
163
|
+
* Alternative command names.
|
|
164
|
+
*/
|
|
165
|
+
alias: string[];
|
|
166
|
+
/**
|
|
167
|
+
* The command options.
|
|
168
|
+
*/
|
|
169
|
+
options: Record<string, CommandOption>;
|
|
170
|
+
/**
|
|
171
|
+
* The positional arguments provided to the command.
|
|
172
|
+
*/
|
|
173
|
+
args: CommandArgument[];
|
|
174
|
+
/**
|
|
175
|
+
* The parent command.
|
|
176
|
+
*/
|
|
177
|
+
parent: null | CommandTree;
|
|
178
|
+
/**
|
|
179
|
+
* Child commands.
|
|
180
|
+
*/
|
|
181
|
+
children: Record<string, CommandTree>;
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
184
|
+
export { BaseCommandParameter, BooleanCommandOption, BooleanCommandParameter, CommandArgument, CommandBase, CommandConfig, CommandOption, CommandParameterKind, CommandParameterKinds, CommandTree, NumberCommandParameter, StringCommandParameter };
|
|
185
|
+
//# sourceMappingURL=command.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.mts","names":["ResolvedEntryTypeDefinition","StandardJSONSchemaV1","JsonSchema7TupleType","AnyFunction","JSONSchema7Object","z3","CommandParameterType","CommandParameterKinds","string","number","boolean","CommandParameterKind","BaseCommandParameter","name","kind","title","description","alias","env","optional","StringCommandParameter","default","format","variadic","choices","NumberCommandParameter","BooleanCommandParameter","CommandParameter","AsCommandParameterConfig","T","Pick","Omit","Partial","StringCommandParameterConfig","NumberCommandParameterConfig","BooleanCommandParameterConfig","CommandParameterConfig","BooleanCommandOption","isNegativeOf","skipAddingNegative","CommandOption","CommandOptionConfig","CommandArgument","CommandArgumentConfig","CommandBase","id","path","segments","icon","isVirtual","CommandConfig","entry","CommandTree","Record","options","args","parent","children","SerializedCommandTree","CommandMetadata","CommandModule","AnyZodObject","AnyZodTuple","metadata"],"sources":["../../../../../core/dist/types/command.d.cts"],"mappings":";;;cAScO,qBAAAA;EAAAA,SACHC,MAAAA;EAAAA,SACAC,MAAAA;EAAAA,SACAC,OAAAA;AAAAA;AAAAA,KAENC,oBAAAA,WAA+BJ,qBAAAA,eAAoCA,qBAAAA;AAAAA,UAC9DK,oBAAAA;EADmF;AAAA;;EAK3FC,IAAAA;EAI0B;;;EAA1BC,IAAAA,EAAMH,oBAAAA;EAINI;;;EAAAA,KAAAA;EAgBAI;;;EAZAH,WAAAA;EAc8B;;;EAV9BC,KAAAA;EAcAH;;;EAVAI,GAAAA;EA0BAM;;;EAtBAL,QAAAA;AAAAA;AAAAA,U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e,IAAAA,EAAMb,eAAAA;;;;EAINc,MAAAA,SAAeJ,WAAAA;;;;EAIfK,QAAAA,EAAUJ,MAAAA,SAAeD,WAAAA;AAAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { CommandBase, CommandOption } from "./command.cjs";
|
|
2
|
+
import { Context } from "./context.cjs";
|
|
3
|
+
import { OutputConfig } from "powerlines";
|
|
4
|
+
import { AutoMDPluginResolvedConfig } from "@powerlines/plugin-automd/types/plugin";
|
|
5
|
+
import { NodeJsPluginOptions, NodeJsPluginResolvedConfig, NodeJsPluginUserConfig } from "@powerlines/plugin-nodejs/types/plugin";
|
|
6
|
+
import { TsdownPluginResolvedConfig, TsdownPluginUserConfig } from "@powerlines/plugin-tsdown/types/plugin";
|
|
7
|
+
|
|
8
|
+
//#region ../core/dist/types/config.d.cts
|
|
9
|
+
//#region src/types/config.d.ts
|
|
10
|
+
type BuildOptions = Pick<TsdownPluginUserConfig, "root" | "name" | "title" | "description" | "logLevel" | "mode" | "skipCache" | "autoInstall" | "plugins" | "tsconfig" | "tsconfigRaw">;
|
|
11
|
+
type BaseOptions = Partial<BuildOptions> & {
|
|
12
|
+
/**
|
|
13
|
+
* A set of default command options to apply to each command.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.
|
|
17
|
+
*/
|
|
18
|
+
defaultOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
|
|
19
|
+
/**
|
|
20
|
+
* Determines whether commands and option names are treated as case-sensitive.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue `false`
|
|
23
|
+
*/
|
|
24
|
+
isCaseSensitive?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | "bin" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.
|
|
30
|
+
*
|
|
31
|
+
* @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin
|
|
32
|
+
* @see https://yarnpkg.com/cli/bin
|
|
33
|
+
* @see https://pnpm.io/package_json#bin
|
|
34
|
+
*/
|
|
35
|
+
bin?: string | string[];
|
|
36
|
+
/**
|
|
37
|
+
* Should Shell Shock attempt to automatically assign environment variables to manipulate default values for command options based on the option name?
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* If set to a string, Shell Shock will use the provided string as an application specific environment variable prefix, convert the option name to {@link https://stringcase.org/cases/constant/ | constant case}, and prepend the provided `string` value to determine the corresponding environment variable name. For example, if an option is named `"configPath"` and the `autoAssignEnv` is `"MY_APP_"`, Shell Shock will look for an environment variable named `"MY_APP_CONFIG_PATH"` and assign its value to the option if it exists. If set to `true`, Shell Shock will use a default environment variable prefix derived from the {@link Options.name | application name}.
|
|
41
|
+
*
|
|
42
|
+
* @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa
|
|
43
|
+
* @see https://stringcase.org/cases/constant/
|
|
44
|
+
*/
|
|
45
|
+
autoAssignEnv?: true | string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The plugin options for Shell Shock.
|
|
49
|
+
*/
|
|
50
|
+
type Options = BaseOptions & Partial<NodeJsPluginOptions>;
|
|
51
|
+
/**
|
|
52
|
+
* The output configuration options for Shell Shock.
|
|
53
|
+
*/
|
|
54
|
+
type OutputConfig$1 = Pick<OutputConfig, "outputPath" | "assets" | "storage"> & {
|
|
55
|
+
/**
|
|
56
|
+
* An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.
|
|
57
|
+
*/
|
|
58
|
+
dts?: false;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The user configuration options for Shell Shock.
|
|
62
|
+
*/
|
|
63
|
+
type UserConfig = BaseOptions & Partial<NodeJsPluginUserConfig> & {
|
|
64
|
+
/**
|
|
65
|
+
* Configuration for the output of the build process
|
|
66
|
+
*/
|
|
67
|
+
output?: OutputConfig$1;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* The resolved configuration options for Shell Shock.
|
|
71
|
+
*/
|
|
72
|
+
type ResolvedConfig = TsdownPluginResolvedConfig & AutoMDPluginResolvedConfig & NodeJsPluginResolvedConfig & Required<Omit<Options, "bin">> & {
|
|
73
|
+
/**
|
|
74
|
+
* The name of the binary (the {@link https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin | "bin" field} in package.json) that will be used to run the application through NodeJs package managers (e.g., npm, yarn, pnpm).
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* If an array is provided, each binary will be linked to the same compiled output file. If not provided, the {@link Options.name | name} option will be used.
|
|
78
|
+
*
|
|
79
|
+
* @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin
|
|
80
|
+
* @see https://yarnpkg.com/cli/bin
|
|
81
|
+
* @see https://pnpm.io/package_json#bin
|
|
82
|
+
*/
|
|
83
|
+
bin: Record<string, string>;
|
|
84
|
+
/**
|
|
85
|
+
* The command-line application specific environment variable prefix used for automatically assigning environment variables to command options.
|
|
86
|
+
*/
|
|
87
|
+
appSpecificEnvPrefix: string;
|
|
88
|
+
/**
|
|
89
|
+
* The user configuration for the Shell Shock process.
|
|
90
|
+
*/
|
|
91
|
+
userConfig: UserConfig;
|
|
92
|
+
}; //#endregion
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Options, OutputConfig$1 as OutputConfig, ResolvedConfig, UserConfig };
|
|
95
|
+
//# sourceMappingURL=config.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":["CommandBase","CommandOption","Context","OutputConfig","OutputConfig$1","AutoMDPluginResolvedConfig","NodeJsPluginOptions","NodeJsPluginResolvedConfig","NodeJsPluginUserConfig","TsdownPluginResolvedConfig","TsdownPluginUserConfig","BuildOptions","Pick","BaseOptions","Partial","defaultOptions","context","input","isCaseSensitive","bin","autoAssignEnv","Options","dts","UserConfig","output","ResolvedConfig","Omit","Required","Record","appSpecificEnvPrefix","userConfig"],"sources":["../../../../../core/dist/types/config.d.cts"],"mappings":";;;;;;;;;KAQKW,YAAAA,GAAeC,IAAAA,CAAKF,sBAAAA;AAAAA,KACpBG,WAAAA,GAAcC,OAAAA,CAAQH,YAAAA;;;;AADoB;;;EAQ7CI,cAAAA,GAAiBd,aAAAA,OAAoBe,OAAAA,EAASd,OAAAA,EAASe,KAAAA,EAAOjB,WAAAA,KAAgBC,aAAAA;EAP7Da;;;;;EAajBI,eAAAA;EAN2F;;;;;;;;;;EAiB3FC,GAAAA;EAAAA;;;;AAUa;;;;;EAAbC,aAAAA;AAAAA;;;;KAKGC,OAAAA,GAAUR,WAAAA,GAAcC,OAAAA,CAAQR,mBAAAA;;;AAAmB;KAInDH,cAAAA,GAAeS,IAAAA,CAAKR,YAAAA;;;;EAIvBkB,GAAAA;AAAAA;;;AAAG;KAKAC,UAAAA,GAAaV,WAAAA,GAAcC,OAAAA,CAAQN,sBAAAA;;;;EAItCgB,MAAAA,GAASrB,cAAAA;AAAAA;;;;KAKNsB,cAAAA,GAAiBhB,0BAAAA,GAA6BJ,0BAAAA,GAA6BE,0BAAAA,GAA6BoB,QAAAA,CAASD,IAAAA,CAAKL,OAAAA;EATnFb;;;;;AAIjB;;;;;EAgBrBW,GAAAA,EAAKS,MAAAA;EAXoHP;;;EAezHQ,oBAAAA;EAIYN;;;EAAZO,UAAAA,EAAYP,UAAAA;AAAAA"}
|