@shell-shock/core 0.8.13 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.cjs +34 -0
- package/dist/api.cjs.map +1 -1
- package/dist/api.mjs +34 -0
- package/dist/api.mjs.map +1 -1
- package/dist/components/docs.d.cts +5 -5
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +5 -5
- package/dist/components/helpers.d.cts +6 -6
- package/dist/components/helpers.d.cts.map +1 -1
- package/dist/components/helpers.d.mts +6 -6
- package/dist/components/helpers.d.mts.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/options-parser-logic.d.cts +9 -9
- package/dist/components/options-parser-logic.d.mts +9 -9
- package/dist/components/options-parser-logic.d.mts.map +1 -1
- package/dist/components/usage.d.cts +2 -2
- package/dist/components/usage.d.mts +2 -2
- package/dist/components/utils-builtin.cjs +341 -0
- package/dist/components/utils-builtin.cjs.map +1 -1
- package/dist/components/utils-builtin.d.cts +12 -8
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts +5 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +342 -2
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +12 -0
- package/dist/config.cjs.map +1 -1
- package/dist/config.mjs +12 -0
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +3 -2
- package/dist/contexts/command.cjs.map +1 -1
- package/dist/contexts/command.mjs +3 -2
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/options.cjs +20 -4
- package/dist/contexts/options.cjs.map +1 -1
- package/dist/contexts/options.mjs +20 -4
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +6 -0
- package/dist/helpers/docs-helpers.cjs.map +1 -1
- package/dist/helpers/docs-helpers.mjs +6 -0
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +92 -11
- package/dist/helpers/persistence.cjs.map +1 -1
- package/dist/helpers/persistence.mjs +92 -11
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/resolve-command.cjs +200 -18
- package/dist/helpers/resolve-command.cjs.map +1 -1
- package/dist/helpers/resolve-command.mjs +201 -19
- package/dist/helpers/resolve-command.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +27 -3
- package/dist/helpers/update-package-json.cjs.map +1 -1
- package/dist/helpers/update-package-json.mjs +27 -3
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +58 -4
- package/dist/helpers/utilities.cjs.map +1 -1
- package/dist/helpers/utilities.mjs +58 -4
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +28 -1
- package/dist/helpers/validations.cjs.map +1 -1
- package/dist/helpers/validations.mjs +28 -1
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +78 -3
- package/dist/plugin-utils/context-helpers.cjs.map +1 -1
- package/dist/plugin-utils/context-helpers.mjs +78 -3
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +17 -1
- package/dist/plugin-utils/get-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.mjs +17 -1
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/reflect.cjs +31 -3
- package/dist/plugin-utils/reflect.cjs.map +1 -1
- package/dist/plugin-utils/reflect.mjs +31 -3
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +34 -4
- package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.mjs +34 -4
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin.cjs +5 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +5 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/types/command.cjs +241 -0
- package/dist/types/command.cjs.map +1 -0
- package/dist/types/command.mjs +221 -1
- package/dist/types/command.mjs.map +1 -0
- package/dist/types/config.cjs +114 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +11 -10
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +11 -10
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +110 -1
- package/dist/types/config.mjs.map +1 -0
- package/dist/types/context.cjs +33 -0
- package/dist/types/context.cjs.map +1 -0
- package/dist/types/context.mjs +31 -1
- package/dist/types/context.mjs.map +1 -0
- package/dist/types/env.cjs +12 -0
- package/dist/types/env.cjs.map +1 -0
- package/dist/types/env.d.cts +17 -0
- package/dist/types/env.d.cts.map +1 -0
- package/dist/types/env.d.mts +17 -0
- package/dist/types/env.d.mts.map +1 -0
- package/dist/types/env.mjs +11 -0
- package/dist/types/env.mjs.map +1 -0
- package/dist/types/index.cjs +34 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +7 -1
- package/dist/types/options.cjs +12 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.mjs +11 -1
- package/dist/types/options.mjs.map +1 -0
- package/dist/types/runtime.cjs +12 -0
- package/dist/types/runtime.cjs.map +1 -0
- package/dist/types/runtime.mjs +11 -1
- package/dist/types/runtime.mjs.map +1 -0
- package/package.json +25 -11
package/dist/types/command.cjs
CHANGED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/types/command.ts
|
|
3
|
+
const __ΩRecord = [
|
|
4
|
+
"K",
|
|
5
|
+
"T",
|
|
6
|
+
"Record",
|
|
7
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
8
|
+
];
|
|
9
|
+
const __ΩOmit = [
|
|
10
|
+
"T",
|
|
11
|
+
"K",
|
|
12
|
+
() => __ΩPick,
|
|
13
|
+
() => __ΩExclude,
|
|
14
|
+
"Omit",
|
|
15
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
16
|
+
];
|
|
17
|
+
const __ΩPick = [
|
|
18
|
+
"T",
|
|
19
|
+
"K",
|
|
20
|
+
"Pick",
|
|
21
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
22
|
+
];
|
|
23
|
+
const __ΩExclude = [
|
|
24
|
+
"T",
|
|
25
|
+
"U",
|
|
26
|
+
"Exclude",
|
|
27
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
28
|
+
];
|
|
29
|
+
const __ΩBaseCommandParameter = [
|
|
30
|
+
"name",
|
|
31
|
+
"ReflectionKind",
|
|
32
|
+
"kind",
|
|
33
|
+
"title",
|
|
34
|
+
"description",
|
|
35
|
+
"alias",
|
|
36
|
+
false,
|
|
37
|
+
"env",
|
|
38
|
+
"optional",
|
|
39
|
+
"BaseCommandParameter",
|
|
40
|
+
"P&4!\"w\"4#&4$&4%&F4&P&.'J4()4)Mw*y"
|
|
41
|
+
];
|
|
42
|
+
const __ΩStringCommandParameter = [
|
|
43
|
+
() => __ΩBaseCommandParameter,
|
|
44
|
+
5,
|
|
45
|
+
"kind",
|
|
46
|
+
"default",
|
|
47
|
+
"variadic",
|
|
48
|
+
"StringCommandParameter",
|
|
49
|
+
"Pn!a\"4#&4$8)4%Mw&y"
|
|
50
|
+
];
|
|
51
|
+
const __ΩNumberCommandParameter = [
|
|
52
|
+
() => __ΩBaseCommandParameter,
|
|
53
|
+
6,
|
|
54
|
+
"kind",
|
|
55
|
+
"default",
|
|
56
|
+
"variadic",
|
|
57
|
+
"NumberCommandParameter",
|
|
58
|
+
"Pn!a\"4#'4$8)4%Mw&y"
|
|
59
|
+
];
|
|
60
|
+
const __ΩBooleanCommandParameter = [
|
|
61
|
+
() => __ΩBaseCommandParameter,
|
|
62
|
+
7,
|
|
63
|
+
"kind",
|
|
64
|
+
"default",
|
|
65
|
+
"isNegativeOf",
|
|
66
|
+
"skipAddingNegative",
|
|
67
|
+
"BooleanCommandParameter",
|
|
68
|
+
"Pn!a\"4#)4$8&4%8)4&8Mw'y"
|
|
69
|
+
];
|
|
70
|
+
const __ΩStringCommandOption = [
|
|
71
|
+
() => __ΩStringCommandParameter,
|
|
72
|
+
"ReflectionProperty",
|
|
73
|
+
"reflection",
|
|
74
|
+
"StringCommandOption",
|
|
75
|
+
"Pn!\"w\"4#8Mw$y"
|
|
76
|
+
];
|
|
77
|
+
const __ΩNumberCommandOption = [
|
|
78
|
+
() => __ΩNumberCommandParameter,
|
|
79
|
+
"ReflectionProperty",
|
|
80
|
+
"reflection",
|
|
81
|
+
"NumberCommandOption",
|
|
82
|
+
"Pn!\"w\"4#8Mw$y"
|
|
83
|
+
];
|
|
84
|
+
const __ΩBooleanCommandOption = [
|
|
85
|
+
() => __ΩBooleanCommandParameter,
|
|
86
|
+
"ReflectionProperty",
|
|
87
|
+
"reflection",
|
|
88
|
+
"isNegativeOf",
|
|
89
|
+
"skipAddingNegative",
|
|
90
|
+
"BooleanCommandOption",
|
|
91
|
+
"Pn!\"w\"4#8&4$8)4%8Mw&y"
|
|
92
|
+
];
|
|
93
|
+
const __ΩCommandOption = [
|
|
94
|
+
() => __ΩStringCommandOption,
|
|
95
|
+
() => __ΩNumberCommandOption,
|
|
96
|
+
() => __ΩBooleanCommandOption,
|
|
97
|
+
"CommandOption",
|
|
98
|
+
"Pn!n\"n#Jw$y"
|
|
99
|
+
];
|
|
100
|
+
const __ΩStringCommandArgument = [
|
|
101
|
+
() => __ΩStringCommandParameter,
|
|
102
|
+
"ReflectionParameter",
|
|
103
|
+
"reflection",
|
|
104
|
+
"StringCommandArgument",
|
|
105
|
+
"Pn!\"w\"4#Mw$y"
|
|
106
|
+
];
|
|
107
|
+
const __ΩNumberCommandArgument = [
|
|
108
|
+
() => __ΩNumberCommandParameter,
|
|
109
|
+
"ReflectionParameter",
|
|
110
|
+
"reflection",
|
|
111
|
+
"NumberCommandArgument",
|
|
112
|
+
"Pn!\"w\"4#Mw$y"
|
|
113
|
+
];
|
|
114
|
+
const __ΩBooleanCommandArgument = [
|
|
115
|
+
() => __ΩBooleanCommandParameter,
|
|
116
|
+
"ReflectionParameter",
|
|
117
|
+
"reflection",
|
|
118
|
+
"BooleanCommandArgument",
|
|
119
|
+
"Pn!\"w\"4#Mw$y"
|
|
120
|
+
];
|
|
121
|
+
const __ΩCommandArgument = [
|
|
122
|
+
() => __ΩStringCommandArgument,
|
|
123
|
+
() => __ΩNumberCommandArgument,
|
|
124
|
+
() => __ΩBooleanCommandArgument,
|
|
125
|
+
"CommandArgument",
|
|
126
|
+
"Pn!n\"n#Jw$y"
|
|
127
|
+
];
|
|
128
|
+
const __ΩCommandBase = [
|
|
129
|
+
"id",
|
|
130
|
+
"name",
|
|
131
|
+
"path",
|
|
132
|
+
"segments",
|
|
133
|
+
"title",
|
|
134
|
+
"description",
|
|
135
|
+
"alias",
|
|
136
|
+
"icon",
|
|
137
|
+
"isVirtual",
|
|
138
|
+
"CommandBase",
|
|
139
|
+
"PP&,J4!&4\"P&,J4#&F4$&4%8&4&8&F4'8&4(8)4)Mw*y"
|
|
140
|
+
];
|
|
141
|
+
const __ΩCommandInput = [
|
|
142
|
+
() => __ΩCommandBase,
|
|
143
|
+
"id",
|
|
144
|
+
"entry",
|
|
145
|
+
"CommandInput",
|
|
146
|
+
"Pn!&4\"!4#Mw$y"
|
|
147
|
+
];
|
|
148
|
+
const __ΩCommandTree = [
|
|
149
|
+
() => __ΩCommandInput,
|
|
150
|
+
"title",
|
|
151
|
+
"description",
|
|
152
|
+
"alias",
|
|
153
|
+
() => __ΩRecord,
|
|
154
|
+
() => __ΩCommandOption,
|
|
155
|
+
"options",
|
|
156
|
+
() => __ΩCommandArgument,
|
|
157
|
+
"arguments",
|
|
158
|
+
0,
|
|
159
|
+
"parent",
|
|
160
|
+
() => __ΩRecord,
|
|
161
|
+
0,
|
|
162
|
+
"children",
|
|
163
|
+
"ReflectionFunction",
|
|
164
|
+
"reflection",
|
|
165
|
+
"CommandTree",
|
|
166
|
+
"Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.P\"w/,J40MKw1y"
|
|
167
|
+
];
|
|
168
|
+
const __ΩSerializedCommandOption = [
|
|
169
|
+
() => __ΩOmit,
|
|
170
|
+
() => __ΩCommandOption,
|
|
171
|
+
"reflection",
|
|
172
|
+
"SerializedCommandOption",
|
|
173
|
+
"n\".#o!#w$y"
|
|
174
|
+
];
|
|
175
|
+
const __ΩSerializedCommandArgument = [
|
|
176
|
+
() => __ΩOmit,
|
|
177
|
+
() => __ΩCommandArgument,
|
|
178
|
+
"reflection",
|
|
179
|
+
"SerializedCommandArgument",
|
|
180
|
+
"n\".#o!#w$y"
|
|
181
|
+
];
|
|
182
|
+
const __ΩSerializedCommandTree = [
|
|
183
|
+
() => __ΩOmit,
|
|
184
|
+
() => __ΩCommandTree,
|
|
185
|
+
"options",
|
|
186
|
+
"arguments",
|
|
187
|
+
"parent",
|
|
188
|
+
"children",
|
|
189
|
+
"reflection",
|
|
190
|
+
() => __ΩRecord,
|
|
191
|
+
() => __ΩSerializedCommandOption,
|
|
192
|
+
"options",
|
|
193
|
+
() => __ΩSerializedCommandArgument,
|
|
194
|
+
"arguments",
|
|
195
|
+
"parent",
|
|
196
|
+
() => __ΩRecord,
|
|
197
|
+
0,
|
|
198
|
+
"children",
|
|
199
|
+
"SerializedTypes",
|
|
200
|
+
"reflection",
|
|
201
|
+
"SerializedCommandTree",
|
|
202
|
+
"Pn\"P.#.$.%.&.'Jo!#P&n)o(#4*n+F4,P,&J4-&n/o.#40\"w1428MKw3y"
|
|
203
|
+
];
|
|
204
|
+
const __ΩMetadata = [
|
|
205
|
+
"title",
|
|
206
|
+
"description",
|
|
207
|
+
"alias",
|
|
208
|
+
"icon",
|
|
209
|
+
"Metadata",
|
|
210
|
+
"P&4!8&4\"8P&&FJ4#8&4$8Mw%y"
|
|
211
|
+
];
|
|
212
|
+
const __ΩCommandModule = [
|
|
213
|
+
() => __ΩMetadata,
|
|
214
|
+
"metadata",
|
|
215
|
+
"default",
|
|
216
|
+
"CommandModule",
|
|
217
|
+
"Pn!4\"8!4#8Mw$y"
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
//#endregion
|
|
221
|
+
exports.__ΩBaseCommandParameter = __ΩBaseCommandParameter;
|
|
222
|
+
exports.__ΩBooleanCommandArgument = __ΩBooleanCommandArgument;
|
|
223
|
+
exports.__ΩBooleanCommandOption = __ΩBooleanCommandOption;
|
|
224
|
+
exports.__ΩBooleanCommandParameter = __ΩBooleanCommandParameter;
|
|
225
|
+
exports.__ΩCommandArgument = __ΩCommandArgument;
|
|
226
|
+
exports.__ΩCommandBase = __ΩCommandBase;
|
|
227
|
+
exports.__ΩCommandInput = __ΩCommandInput;
|
|
228
|
+
exports.__ΩCommandModule = __ΩCommandModule;
|
|
229
|
+
exports.__ΩCommandOption = __ΩCommandOption;
|
|
230
|
+
exports.__ΩCommandTree = __ΩCommandTree;
|
|
231
|
+
exports.__ΩMetadata = __ΩMetadata;
|
|
232
|
+
exports.__ΩNumberCommandArgument = __ΩNumberCommandArgument;
|
|
233
|
+
exports.__ΩNumberCommandOption = __ΩNumberCommandOption;
|
|
234
|
+
exports.__ΩNumberCommandParameter = __ΩNumberCommandParameter;
|
|
235
|
+
exports.__ΩSerializedCommandArgument = __ΩSerializedCommandArgument;
|
|
236
|
+
exports.__ΩSerializedCommandOption = __ΩSerializedCommandOption;
|
|
237
|
+
exports.__ΩSerializedCommandTree = __ΩSerializedCommandTree;
|
|
238
|
+
exports.__ΩStringCommandArgument = __ΩStringCommandArgument;
|
|
239
|
+
exports.__ΩStringCommandOption = __ΩStringCommandOption;
|
|
240
|
+
exports.__ΩStringCommandParameter = __ΩStringCommandParameter;
|
|
241
|
+
//# sourceMappingURL=command.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.cjs","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n ReflectionFunction,\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty,\n SerializedTypes\n} from \"@powerlines/deepkit/vendor/type\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines/types/resolved\";\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: ReflectionKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.string;\n /**\n * The default value.\n */\n default?: string;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.number;\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.boolean;\n /**\n * The default value.\n */\n default?: boolean;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport interface StringCommandOption extends StringCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface NumberCommandOption extends NumberCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandOption\n | NumberCommandOption\n | BooleanCommandOption;\n\nexport interface StringCommandArgument extends StringCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface NumberCommandArgument extends NumberCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface BooleanCommandArgument extends BooleanCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport type CommandArgument =\n | StringCommandArgument\n | NumberCommandArgument\n | BooleanCommandArgument;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * 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.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandInput extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandInput & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n /**\n * The command handler reflection.\n */\n reflection: ReflectionFunction | null;\n};\n\nexport type SerializedCommandOption = Omit<CommandOption, \"reflection\">;\n\nexport type SerializedCommandArgument = Omit<CommandArgument, \"reflection\">;\n\nexport type SerializedCommandTree = Omit<\n CommandTree,\n \"options\" | \"arguments\" | \"parent\" | \"children\" | \"reflection\"\n> & {\n /**\n * The command options.\n */\n options: Record<string, SerializedCommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: SerializedCommandArgument[];\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n /**\n * The command handler reflection.\n */\n reflection?: SerializedTypes;\n};\n\nexport interface Metadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: Metadata;\n default?: AnyFunction;\n}\n"],"mappings":";;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;;;;;;;;AAEhE,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAAY;;;;;;;AAE/C,MAAM,0BAA0B;CAAC;CAAQ;CAAkB;CAAQ;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,4BAA4B;OAAO;CAAyB;CAAG;CAAE;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;AAIvE,MAAM,6BAA6B;OAAO;CAAyB;CAAG;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;AAEvE,MAAM,yBAAyB;OAAO;CAAqB;CAAA;CAAA;CAAA;CAAA;AAE3D,MAAM,yBAAyB;OAAK;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,0BAA0B;OAAO;CAA4B;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,mBAAM;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAEZ,MAAM,2BAAU;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEhB,MAAM,2BAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,4BAA4B;OAAM;CAAA;CAAA;CAAA;CAAA;CAAA;AAExC,MAAM,qBAAqB;OAAO;OAAgC;OAAU;CAAA;CAAA;CAAA;AAE5E,MAAM,iBAAiB;CAAC;CAAM;CAAQ;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,kBAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAQ;OAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEd,MAAM,6BAAc;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,+BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,2BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,cAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEf,MAAM,mBAAmB;OAAE;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/command.mjs
CHANGED
|
@@ -1 +1,221 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/types/command.ts
|
|
2
|
+
const __ΩRecord = [
|
|
3
|
+
"K",
|
|
4
|
+
"T",
|
|
5
|
+
"Record",
|
|
6
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
7
|
+
];
|
|
8
|
+
const __ΩOmit = [
|
|
9
|
+
"T",
|
|
10
|
+
"K",
|
|
11
|
+
() => __ΩPick,
|
|
12
|
+
() => __ΩExclude,
|
|
13
|
+
"Omit",
|
|
14
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
15
|
+
];
|
|
16
|
+
const __ΩPick = [
|
|
17
|
+
"T",
|
|
18
|
+
"K",
|
|
19
|
+
"Pick",
|
|
20
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
21
|
+
];
|
|
22
|
+
const __ΩExclude = [
|
|
23
|
+
"T",
|
|
24
|
+
"U",
|
|
25
|
+
"Exclude",
|
|
26
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
27
|
+
];
|
|
28
|
+
const __ΩBaseCommandParameter = [
|
|
29
|
+
"name",
|
|
30
|
+
"ReflectionKind",
|
|
31
|
+
"kind",
|
|
32
|
+
"title",
|
|
33
|
+
"description",
|
|
34
|
+
"alias",
|
|
35
|
+
false,
|
|
36
|
+
"env",
|
|
37
|
+
"optional",
|
|
38
|
+
"BaseCommandParameter",
|
|
39
|
+
"P&4!\"w\"4#&4$&4%&F4&P&.'J4()4)Mw*y"
|
|
40
|
+
];
|
|
41
|
+
const __ΩStringCommandParameter = [
|
|
42
|
+
() => __ΩBaseCommandParameter,
|
|
43
|
+
5,
|
|
44
|
+
"kind",
|
|
45
|
+
"default",
|
|
46
|
+
"variadic",
|
|
47
|
+
"StringCommandParameter",
|
|
48
|
+
"Pn!a\"4#&4$8)4%Mw&y"
|
|
49
|
+
];
|
|
50
|
+
const __ΩNumberCommandParameter = [
|
|
51
|
+
() => __ΩBaseCommandParameter,
|
|
52
|
+
6,
|
|
53
|
+
"kind",
|
|
54
|
+
"default",
|
|
55
|
+
"variadic",
|
|
56
|
+
"NumberCommandParameter",
|
|
57
|
+
"Pn!a\"4#'4$8)4%Mw&y"
|
|
58
|
+
];
|
|
59
|
+
const __ΩBooleanCommandParameter = [
|
|
60
|
+
() => __ΩBaseCommandParameter,
|
|
61
|
+
7,
|
|
62
|
+
"kind",
|
|
63
|
+
"default",
|
|
64
|
+
"isNegativeOf",
|
|
65
|
+
"skipAddingNegative",
|
|
66
|
+
"BooleanCommandParameter",
|
|
67
|
+
"Pn!a\"4#)4$8&4%8)4&8Mw'y"
|
|
68
|
+
];
|
|
69
|
+
const __ΩStringCommandOption = [
|
|
70
|
+
() => __ΩStringCommandParameter,
|
|
71
|
+
"ReflectionProperty",
|
|
72
|
+
"reflection",
|
|
73
|
+
"StringCommandOption",
|
|
74
|
+
"Pn!\"w\"4#8Mw$y"
|
|
75
|
+
];
|
|
76
|
+
const __ΩNumberCommandOption = [
|
|
77
|
+
() => __ΩNumberCommandParameter,
|
|
78
|
+
"ReflectionProperty",
|
|
79
|
+
"reflection",
|
|
80
|
+
"NumberCommandOption",
|
|
81
|
+
"Pn!\"w\"4#8Mw$y"
|
|
82
|
+
];
|
|
83
|
+
const __ΩBooleanCommandOption = [
|
|
84
|
+
() => __ΩBooleanCommandParameter,
|
|
85
|
+
"ReflectionProperty",
|
|
86
|
+
"reflection",
|
|
87
|
+
"isNegativeOf",
|
|
88
|
+
"skipAddingNegative",
|
|
89
|
+
"BooleanCommandOption",
|
|
90
|
+
"Pn!\"w\"4#8&4$8)4%8Mw&y"
|
|
91
|
+
];
|
|
92
|
+
const __ΩCommandOption = [
|
|
93
|
+
() => __ΩStringCommandOption,
|
|
94
|
+
() => __ΩNumberCommandOption,
|
|
95
|
+
() => __ΩBooleanCommandOption,
|
|
96
|
+
"CommandOption",
|
|
97
|
+
"Pn!n\"n#Jw$y"
|
|
98
|
+
];
|
|
99
|
+
const __ΩStringCommandArgument = [
|
|
100
|
+
() => __ΩStringCommandParameter,
|
|
101
|
+
"ReflectionParameter",
|
|
102
|
+
"reflection",
|
|
103
|
+
"StringCommandArgument",
|
|
104
|
+
"Pn!\"w\"4#Mw$y"
|
|
105
|
+
];
|
|
106
|
+
const __ΩNumberCommandArgument = [
|
|
107
|
+
() => __ΩNumberCommandParameter,
|
|
108
|
+
"ReflectionParameter",
|
|
109
|
+
"reflection",
|
|
110
|
+
"NumberCommandArgument",
|
|
111
|
+
"Pn!\"w\"4#Mw$y"
|
|
112
|
+
];
|
|
113
|
+
const __ΩBooleanCommandArgument = [
|
|
114
|
+
() => __ΩBooleanCommandParameter,
|
|
115
|
+
"ReflectionParameter",
|
|
116
|
+
"reflection",
|
|
117
|
+
"BooleanCommandArgument",
|
|
118
|
+
"Pn!\"w\"4#Mw$y"
|
|
119
|
+
];
|
|
120
|
+
const __ΩCommandArgument = [
|
|
121
|
+
() => __ΩStringCommandArgument,
|
|
122
|
+
() => __ΩNumberCommandArgument,
|
|
123
|
+
() => __ΩBooleanCommandArgument,
|
|
124
|
+
"CommandArgument",
|
|
125
|
+
"Pn!n\"n#Jw$y"
|
|
126
|
+
];
|
|
127
|
+
const __ΩCommandBase = [
|
|
128
|
+
"id",
|
|
129
|
+
"name",
|
|
130
|
+
"path",
|
|
131
|
+
"segments",
|
|
132
|
+
"title",
|
|
133
|
+
"description",
|
|
134
|
+
"alias",
|
|
135
|
+
"icon",
|
|
136
|
+
"isVirtual",
|
|
137
|
+
"CommandBase",
|
|
138
|
+
"PP&,J4!&4\"P&,J4#&F4$&4%8&4&8&F4'8&4(8)4)Mw*y"
|
|
139
|
+
];
|
|
140
|
+
const __ΩCommandInput = [
|
|
141
|
+
() => __ΩCommandBase,
|
|
142
|
+
"id",
|
|
143
|
+
"entry",
|
|
144
|
+
"CommandInput",
|
|
145
|
+
"Pn!&4\"!4#Mw$y"
|
|
146
|
+
];
|
|
147
|
+
const __ΩCommandTree = [
|
|
148
|
+
() => __ΩCommandInput,
|
|
149
|
+
"title",
|
|
150
|
+
"description",
|
|
151
|
+
"alias",
|
|
152
|
+
() => __ΩRecord,
|
|
153
|
+
() => __ΩCommandOption,
|
|
154
|
+
"options",
|
|
155
|
+
() => __ΩCommandArgument,
|
|
156
|
+
"arguments",
|
|
157
|
+
0,
|
|
158
|
+
"parent",
|
|
159
|
+
() => __ΩRecord,
|
|
160
|
+
0,
|
|
161
|
+
"children",
|
|
162
|
+
"ReflectionFunction",
|
|
163
|
+
"reflection",
|
|
164
|
+
"CommandTree",
|
|
165
|
+
"Pn!P&4\"&4#&F4$&n&o%#4'n(F4)P,n*J4+&n-o,#4.P\"w/,J40MKw1y"
|
|
166
|
+
];
|
|
167
|
+
const __ΩSerializedCommandOption = [
|
|
168
|
+
() => __ΩOmit,
|
|
169
|
+
() => __ΩCommandOption,
|
|
170
|
+
"reflection",
|
|
171
|
+
"SerializedCommandOption",
|
|
172
|
+
"n\".#o!#w$y"
|
|
173
|
+
];
|
|
174
|
+
const __ΩSerializedCommandArgument = [
|
|
175
|
+
() => __ΩOmit,
|
|
176
|
+
() => __ΩCommandArgument,
|
|
177
|
+
"reflection",
|
|
178
|
+
"SerializedCommandArgument",
|
|
179
|
+
"n\".#o!#w$y"
|
|
180
|
+
];
|
|
181
|
+
const __ΩSerializedCommandTree = [
|
|
182
|
+
() => __ΩOmit,
|
|
183
|
+
() => __ΩCommandTree,
|
|
184
|
+
"options",
|
|
185
|
+
"arguments",
|
|
186
|
+
"parent",
|
|
187
|
+
"children",
|
|
188
|
+
"reflection",
|
|
189
|
+
() => __ΩRecord,
|
|
190
|
+
() => __ΩSerializedCommandOption,
|
|
191
|
+
"options",
|
|
192
|
+
() => __ΩSerializedCommandArgument,
|
|
193
|
+
"arguments",
|
|
194
|
+
"parent",
|
|
195
|
+
() => __ΩRecord,
|
|
196
|
+
0,
|
|
197
|
+
"children",
|
|
198
|
+
"SerializedTypes",
|
|
199
|
+
"reflection",
|
|
200
|
+
"SerializedCommandTree",
|
|
201
|
+
"Pn\"P.#.$.%.&.'Jo!#P&n)o(#4*n+F4,P,&J4-&n/o.#40\"w1428MKw3y"
|
|
202
|
+
];
|
|
203
|
+
const __ΩMetadata = [
|
|
204
|
+
"title",
|
|
205
|
+
"description",
|
|
206
|
+
"alias",
|
|
207
|
+
"icon",
|
|
208
|
+
"Metadata",
|
|
209
|
+
"P&4!8&4\"8P&&FJ4#8&4$8Mw%y"
|
|
210
|
+
];
|
|
211
|
+
const __ΩCommandModule = [
|
|
212
|
+
() => __ΩMetadata,
|
|
213
|
+
"metadata",
|
|
214
|
+
"default",
|
|
215
|
+
"CommandModule",
|
|
216
|
+
"Pn!4\"8!4#8Mw$y"
|
|
217
|
+
];
|
|
218
|
+
|
|
219
|
+
//#endregion
|
|
220
|
+
export { __ΩBaseCommandParameter, __ΩBooleanCommandArgument, __ΩBooleanCommandOption, __ΩBooleanCommandParameter, __ΩCommandArgument, __ΩCommandBase, __ΩCommandInput, __ΩCommandModule, __ΩCommandOption, __ΩCommandTree, __ΩMetadata, __ΩNumberCommandArgument, __ΩNumberCommandOption, __ΩNumberCommandParameter, __ΩSerializedCommandArgument, __ΩSerializedCommandOption, __ΩSerializedCommandTree, __ΩStringCommandArgument, __ΩStringCommandOption, __ΩStringCommandParameter };
|
|
221
|
+
//# sourceMappingURL=command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.mjs","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n ReflectionFunction,\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty,\n SerializedTypes\n} from \"@powerlines/deepkit/vendor/type\";\nimport type { AnyFunction } from \"@stryke/types/base\";\nimport type { ResolvedEntryTypeDefinition } from \"powerlines/types/resolved\";\n\nexport interface BaseCommandParameter {\n /**\n * The option name.\n */\n name: string;\n /**\n * The option kind.\n */\n kind: ReflectionKind;\n /**\n * The display title.\n */\n title: string;\n /**\n * The option description.\n */\n description: string;\n /**\n * Alternative option names.\n */\n alias: string[];\n /**\n * The environment variable name or false to disable.\n */\n env: string | false;\n /**\n * Whether the option is optional.\n */\n optional: boolean;\n}\n\nexport interface StringCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.string;\n /**\n * The default value.\n */\n default?: string;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n}\n\nexport interface NumberCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.number;\n /**\n * The default value.\n */\n default?: number;\n /**\n * Whether the option accepts multiple values.\n */\n variadic: boolean;\n}\n\nexport interface BooleanCommandParameter extends BaseCommandParameter {\n /**\n * The option kind.\n */\n kind: ReflectionKind.boolean;\n /**\n * The default value.\n */\n default?: boolean;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport interface StringCommandOption extends StringCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface NumberCommandOption extends NumberCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n}\n\nexport interface BooleanCommandOption extends BooleanCommandParameter {\n /**\n * The property reflection.\n */\n reflection?: ReflectionProperty;\n /**\n * The option this negates.\n */\n isNegativeOf?: string;\n /**\n * Whether to skip adding a negative option.\n */\n skipAddingNegative?: boolean;\n}\n\nexport type CommandOption =\n | StringCommandOption\n | NumberCommandOption\n | BooleanCommandOption;\n\nexport interface StringCommandArgument extends StringCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface NumberCommandArgument extends NumberCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport interface BooleanCommandArgument extends BooleanCommandParameter {\n /**\n * The parameter reflection.\n */\n reflection: ReflectionParameter;\n}\n\nexport type CommandArgument =\n | StringCommandArgument\n | NumberCommandArgument\n | BooleanCommandArgument;\n\nexport interface CommandBase {\n /**\n * The command id.\n */\n id: string | null;\n\n /**\n * The command name.\n */\n name: string;\n\n /**\n * The full command path value.\n */\n path: string | null;\n\n /**\n * The path segments.\n */\n segments: string[];\n\n /**\n * The display title.\n */\n title?: string;\n\n /**\n * The command description.\n */\n description?: string;\n\n /**\n * Alternative command names.\n */\n alias?: string[];\n\n /**\n * The command icon.\n */\n icon?: string;\n\n /**\n * Whether the command is virtual.\n *\n * @remarks\n * 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.\n */\n isVirtual: boolean;\n}\n\nexport interface CommandInput extends CommandBase {\n /**\n * The command id.\n */\n id: string;\n\n /**\n * The resolved entry definition.\n */\n entry: ResolvedEntryTypeDefinition;\n}\n\nexport type CommandTree = CommandInput & {\n /**\n * The display title.\n */\n title: string;\n /**\n * The command description.\n */\n description: string;\n /**\n * Alternative command names.\n */\n alias: string[];\n /**\n * The command options.\n */\n options: Record<string, CommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: CommandArgument[];\n /**\n * The parent command.\n */\n parent: null | CommandTree;\n /**\n * Child commands.\n */\n children: Record<string, CommandTree>;\n /**\n * The command handler reflection.\n */\n reflection: ReflectionFunction | null;\n};\n\nexport type SerializedCommandOption = Omit<CommandOption, \"reflection\">;\n\nexport type SerializedCommandArgument = Omit<CommandArgument, \"reflection\">;\n\nexport type SerializedCommandTree = Omit<\n CommandTree,\n \"options\" | \"arguments\" | \"parent\" | \"children\" | \"reflection\"\n> & {\n /**\n * The command options.\n */\n options: Record<string, SerializedCommandOption>;\n /**\n * The positional arguments provided to the command.\n */\n arguments: SerializedCommandArgument[];\n /**\n * The parent command id.\n */\n parent: null | string;\n /**\n * Serialized child commands.\n */\n children: Record<string, SerializedCommandTree>;\n /**\n * The command handler reflection.\n */\n reflection?: SerializedTypes;\n};\n\nexport interface Metadata {\n /**\n * The display name of the command.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a formatted value of the command name will be used.\n */\n title?: string;\n\n /**\n * A brief description of what the command does.\n *\n * @remarks\n * This value will be used in various displays of the user interface and documentation. If not provided, a default message may be shown.\n */\n description?: string;\n\n /**\n * One or more alternative names for the command.\n */\n alias?: string | string[];\n\n /**\n * An optional icon to visually represent the command in user interfaces.\n *\n * @remarks\n * This can be a string containing an emoji, a Unicode character, or any other symbol that helps to visually identify the command. If not provided, no icon will be displayed.\n */\n icon?: string;\n}\n\nexport interface CommandModule {\n metadata?: Metadata;\n default?: AnyFunction;\n}\n"],"mappings":";AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;;;;;;;;AAEhE,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAAY;;;;;;;AAE/C,MAAM,0BAA0B;CAAC;CAAQ;CAAkB;CAAQ;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,4BAA4B;OAAO;CAAyB;CAAG;CAAE;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;AAIvE,MAAM,6BAA6B;OAAO;CAAyB;CAAG;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;AAEvE,MAAM,yBAAyB;OAAO;CAAqB;CAAA;CAAA;CAAA;CAAA;AAE3D,MAAM,yBAAyB;OAAK;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpC,MAAM,0BAA0B;OAAO;CAA4B;CAAG;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtE,MAAM,mBAAM;OAAA;OAAA;OAAA;CAAA;CAAA;CAAA;AAEZ,MAAM,2BAAU;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEhB,MAAM,2BAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,4BAA4B;OAAM;CAAA;CAAA;CAAA;CAAA;CAAA;AAExC,MAAM,qBAAqB;OAAO;OAAgC;OAAU;CAAA;CAAA;CAAA;AAE5E,MAAM,iBAAiB;CAAC;CAAM;CAAQ;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtC,MAAM,kBAAc;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,iBAAQ;OAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEd,MAAM,6BAAc;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEpB,MAAM,+BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,2BAAgB;OAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;OAAA;OAAA;CAAA;OAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEtB,MAAM,cAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEf,MAAM,mBAAmB;OAAE;CAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/types/config.cjs
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/types/config.ts
|
|
3
|
+
const __ΩPick = [
|
|
4
|
+
"T",
|
|
5
|
+
"K",
|
|
6
|
+
"Pick",
|
|
7
|
+
"l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
|
|
8
|
+
];
|
|
9
|
+
const __ΩPartial = [
|
|
10
|
+
"T",
|
|
11
|
+
"Partial",
|
|
12
|
+
"l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
|
|
13
|
+
];
|
|
14
|
+
const __ΩRequired = [
|
|
15
|
+
"T",
|
|
16
|
+
"Required",
|
|
17
|
+
"l+e#!e\"!fRb!Pde\"!gN##w\"y"
|
|
18
|
+
];
|
|
19
|
+
const __ΩOmit = [
|
|
20
|
+
"T",
|
|
21
|
+
"K",
|
|
22
|
+
() => __ΩPick,
|
|
23
|
+
() => __ΩExclude,
|
|
24
|
+
"Omit",
|
|
25
|
+
"b!b\"e!!e!!ge!\"o$#o##w%y"
|
|
26
|
+
];
|
|
27
|
+
const __ΩRecord = [
|
|
28
|
+
"K",
|
|
29
|
+
"T",
|
|
30
|
+
"Record",
|
|
31
|
+
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
32
|
+
];
|
|
33
|
+
const __ΩExclude = [
|
|
34
|
+
"T",
|
|
35
|
+
"U",
|
|
36
|
+
"Exclude",
|
|
37
|
+
"l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
|
|
38
|
+
];
|
|
39
|
+
const __ΩBuildOptions = [
|
|
40
|
+
() => __ΩPick,
|
|
41
|
+
"root",
|
|
42
|
+
"name",
|
|
43
|
+
"title",
|
|
44
|
+
"description",
|
|
45
|
+
"logLevel",
|
|
46
|
+
"mode",
|
|
47
|
+
"skipCache",
|
|
48
|
+
"autoInstall",
|
|
49
|
+
"entry",
|
|
50
|
+
"plugins",
|
|
51
|
+
"tsconfig",
|
|
52
|
+
"tsconfigRaw",
|
|
53
|
+
"BuildOptions",
|
|
54
|
+
"!P.\".#.$.%.&.'.(.).*.+.,.-Jo!#w.y"
|
|
55
|
+
];
|
|
56
|
+
const __ΩBaseOptions = [
|
|
57
|
+
() => __ΩPartial,
|
|
58
|
+
() => __ΩBuildOptions,
|
|
59
|
+
"CommandOption",
|
|
60
|
+
"Context",
|
|
61
|
+
"context",
|
|
62
|
+
"CommandBase",
|
|
63
|
+
"input",
|
|
64
|
+
"",
|
|
65
|
+
false,
|
|
66
|
+
"defaultOptions",
|
|
67
|
+
"isCaseSensitive",
|
|
68
|
+
true,
|
|
69
|
+
"bin",
|
|
70
|
+
"envPrefix",
|
|
71
|
+
"BaseOptions",
|
|
72
|
+
"Pn\"o!\"PP\"w#FP\"w$2%\"w&2'\"w#F/(.)J4*8)4+8>,P&&FJ4-8&4.8MKw/y"
|
|
73
|
+
];
|
|
74
|
+
const __ΩOptions = [
|
|
75
|
+
() => __ΩBaseOptions,
|
|
76
|
+
"Options",
|
|
77
|
+
"Pn!!Kw\"y"
|
|
78
|
+
];
|
|
79
|
+
const __ΩOutputConfig = [
|
|
80
|
+
() => __ΩPick,
|
|
81
|
+
"outputPath",
|
|
82
|
+
"assets",
|
|
83
|
+
"storage",
|
|
84
|
+
false,
|
|
85
|
+
"dts",
|
|
86
|
+
"OutputConfig",
|
|
87
|
+
"P!P.\".#.$Jo!#P.%4&8MKw'y"
|
|
88
|
+
];
|
|
89
|
+
const __ΩUserConfig = [
|
|
90
|
+
() => __ΩBaseOptions,
|
|
91
|
+
() => __ΩOutputConfig,
|
|
92
|
+
"output",
|
|
93
|
+
"UserConfig",
|
|
94
|
+
"Pn!!Pn\"4#8MKw$y"
|
|
95
|
+
];
|
|
96
|
+
const __ΩResolvedConfig = [
|
|
97
|
+
() => __ΩRequired,
|
|
98
|
+
() => __ΩOmit,
|
|
99
|
+
() => __ΩOptions,
|
|
100
|
+
"bin",
|
|
101
|
+
() => __ΩRecord,
|
|
102
|
+
"bin",
|
|
103
|
+
() => __ΩUserConfig,
|
|
104
|
+
"userConfig",
|
|
105
|
+
"ResolvedConfig",
|
|
106
|
+
"P!!!n#.$o\"#o!\"P&&o%#4&n'4(MKw)y"
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
exports.__ΩOptions = __ΩOptions;
|
|
111
|
+
exports.__ΩOutputConfig = __ΩOutputConfig;
|
|
112
|
+
exports.__ΩResolvedConfig = __ΩResolvedConfig;
|
|
113
|
+
exports.__ΩUserConfig = __ΩUserConfig;
|
|
114
|
+
//# sourceMappingURL=config.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.cjs","names":[],"sources":["../../src/types/config.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { AutoMDPluginResolvedConfig } from \"@powerlines/plugin-automd/types/plugin\";\nimport type {\n NodeJsPluginOptions,\n NodeJsPluginResolvedConfig,\n NodeJsPluginUserConfig\n} from \"@powerlines/plugin-nodejs/types/plugin\";\nimport type {\n TsdownPluginResolvedConfig,\n TsdownPluginUserConfig\n} from \"@powerlines/plugin-tsdown/types/plugin\";\nimport type { OutputConfig as PowerlinesOutputConfig } from \"powerlines/types/config\";\nimport type { CommandBase, CommandOption } from \"./command\";\nimport type { Context } from \"./context\";\n\ntype BuildOptions = Pick<\n TsdownPluginUserConfig,\n | \"root\"\n | \"name\"\n | \"title\"\n | \"description\"\n | \"logLevel\"\n | \"mode\"\n | \"skipCache\"\n | \"autoInstall\"\n | \"entry\"\n | \"plugins\"\n | \"tsconfig\"\n | \"tsconfigRaw\"\n>;\n\ntype BaseOptions = Partial<BuildOptions> & {\n /**\n * A set of default command options to apply to each command.\n *\n * @remarks\n * 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.\n */\n defaultOptions?:\n | CommandOption[]\n | ((context: Context, input: CommandBase) => CommandOption[])\n | false;\n\n /**\n * Determines whether commands and option names are treated as case-sensitive.\n *\n * @defaultValue `false`\n */\n isCaseSensitive?: boolean;\n\n /**\n * 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).\n *\n * @remarks\n * 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.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin?: string | string[];\n\n /**\n * An application specific prefix to check for environment variables.\n *\n * @remarks\n * If not provided, Shell Shock will convert {@link Options.name | name} to {@link https://stringcase.org/cases/constant/ | constant case} format and append an underscore (`_`). If the provided {@link Options.name | name} is `\"my-app\"`, environment variables starting with `\"MY_APP_\"` will be used - for example: `\"MY_APP_CONFIG_NAME\"`. If a trailing underscore already exists in the user provided value, it will result in two consecutive underscores - for example: `\"MY_APP__CONFIG_NAME\"` (this was done intentionally so that users who specifically want multiple underscores have a way to do so).\n *\n * @see https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa\n * @see https://stringcase.org/cases/constant/\n */\n envPrefix?: string;\n};\n\n/**\n * The plugin options for Shell Shock.\n */\nexport type Options = BaseOptions & NodeJsPluginOptions;\n\n/**\n * The output configuration options for Shell Shock.\n */\nexport type OutputConfig = Pick<\n PowerlinesOutputConfig,\n \"outputPath\" | \"assets\" | \"storage\"\n> & {\n /**\n * An indicator specifying whether to generate TypeScript declaration files (.d.ts) during the build process.\n */\n dts?: false;\n};\n\n/**\n * The user configuration options for Shell Shock.\n */\nexport type UserConfig = BaseOptions &\n NodeJsPluginUserConfig & {\n /**\n * Configuration for the output of the build process\n */\n output?: OutputConfig;\n };\n\n/**\n * The resolved configuration options for Shell Shock.\n */\nexport type ResolvedConfig = TsdownPluginResolvedConfig &\n AutoMDPluginResolvedConfig &\n NodeJsPluginResolvedConfig &\n Required<Omit<Options, \"bin\">> & {\n /**\n * 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).\n *\n * @remarks\n * 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.\n *\n * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin\n * @see https://yarnpkg.com/cli/bin\n * @see https://pnpm.io/package_json#bin\n */\n bin: Record<string, string>;\n\n /**\n * The user configuration for the Shell Shock process.\n */\n userConfig: UserConfig;\n };\n"],"mappings":";;AAAA,MAAM,UAAU;CAAC;CAAK;CAAK;CAAQ;CAA4B;;;;;;AAE/D,MAAM,cAAc;CAAC;CAAK;CAAY;CAAS;;;;;;;;;AAE/C,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;AAChE,MAAM,aAAa;CAAC;CAAK;CAAK;CAAW;CAA2B;AACpE,MAAM,kBAAkB;OAAO;CAAS;CAAQ;CAAQ;CAAS;CAAM;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AACvE,MAAM,iBAAiB;OAAO;OAAkB;CAAiB;CAAa;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;AAG9E,MAAM,kBAAkB;OAAO;CAAS;CAAc;CAAU;CAAO;CAAA;CAAA;CAAA;CAAA;AAEvE,MAAM,gBAAgB;OAAO;OAAsB;CAAQ;CAAA;CAAA;CAAA;AAE3D,MAAM,oBAAoB;OAAO;OAAG;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|