@shell-shock/core 0.17.18 → 0.17.19
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/components/command-validation-logic.cjs +1 -1
- package/dist/components/command-validation-logic.mjs +1 -1
- package/dist/components/docs.cjs +103 -18
- package/dist/components/docs.d.cts +8 -4
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +8 -4
- package/dist/components/docs.mjs +102 -18
- package/dist/components/index.cjs +2 -1
- 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/usage.cjs +2 -5
- package/dist/components/usage.mjs +2 -5
- package/dist/helpers/automd.cjs +133 -10
- package/dist/helpers/automd.mjs +132 -12
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugin.cjs +8 -5
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.mjs +9 -6
- package/package.json +2 -2
|
@@ -3,8 +3,8 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
|
3
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
4
|
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
5
5
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
6
|
-
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
7
6
|
let _stryke_string_format_list = require("@stryke/string-format/list");
|
|
7
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
8
8
|
|
|
9
9
|
//#region src/components/command-validation-logic.tsx
|
|
10
10
|
function __assignType(fn, args) {
|
|
@@ -2,8 +2,8 @@ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
|
2
2
|
import { For, Show, code } from "@alloy-js/core";
|
|
3
3
|
import { camelCase } from "@stryke/string-format/camel-case";
|
|
4
4
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
5
|
-
import { ElseIfClause, IfStatement, VarDeclaration } from "@alloy-js/typescript";
|
|
6
5
|
import { list } from "@stryke/string-format/list";
|
|
6
|
+
import { ElseIfClause, IfStatement, VarDeclaration } from "@alloy-js/typescript";
|
|
7
7
|
|
|
8
8
|
//#region src/components/command-validation-logic.tsx
|
|
9
9
|
function __assignType(fn, args) {
|
package/dist/components/docs.cjs
CHANGED
|
@@ -13,6 +13,7 @@ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin
|
|
|
13
13
|
let _powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
|
|
14
14
|
let _powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
|
|
15
15
|
let _stryke_path_join = require("@stryke/path/join");
|
|
16
|
+
let _stryke_string_format_list = require("@stryke/string-format/list");
|
|
16
17
|
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
17
18
|
|
|
18
19
|
//#region src/components/docs.tsx
|
|
@@ -30,14 +31,44 @@ function __assignType(fn, args) {
|
|
|
30
31
|
fn.__type = args;
|
|
31
32
|
return fn;
|
|
32
33
|
}
|
|
33
|
-
const __Ω
|
|
34
|
+
const __ΩCommandParametersDocsProps = [
|
|
34
35
|
"CommandTree",
|
|
35
36
|
"command",
|
|
36
37
|
"The command to generate options documentation for.",
|
|
37
|
-
"
|
|
38
|
+
"CommandParametersDocsProps",
|
|
38
39
|
"P\"w!4\"?#Mw$y"
|
|
39
40
|
];
|
|
40
41
|
/**
|
|
42
|
+
* Generates the arguments markdown documentation for a command.
|
|
43
|
+
*/
|
|
44
|
+
function CommandArgumentDocs(props) {
|
|
45
|
+
const { command } = props;
|
|
46
|
+
if (Object.keys(command.options).length === 0) return _alloy_js_core.code`This command does not have any arguments.`;
|
|
47
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
|
|
48
|
+
return require_reflect.sortOptions(Object.values(command.options)).reduce(__assignType((ret, option) => {
|
|
49
|
+
ret.push({
|
|
50
|
+
name: option.name.trim(),
|
|
51
|
+
description: option.description.trim(),
|
|
52
|
+
defaultValue: (0, _stryke_type_checks_is_undefined.isUndefined)(option.default) ? "" : JSON.stringify(option.default),
|
|
53
|
+
required: !option.required || option.default ? "" : "✔"
|
|
54
|
+
});
|
|
55
|
+
return ret;
|
|
56
|
+
}, [
|
|
57
|
+
"ret",
|
|
58
|
+
"option",
|
|
59
|
+
"",
|
|
60
|
+
"P\"2!\"2\"\"/#"
|
|
61
|
+
]), []);
|
|
62
|
+
} });
|
|
63
|
+
}
|
|
64
|
+
CommandArgumentDocs.__type = [
|
|
65
|
+
() => __ΩCommandParametersDocsProps,
|
|
66
|
+
"props",
|
|
67
|
+
"CommandArgumentDocs",
|
|
68
|
+
"Generates the arguments markdown documentation for a command.",
|
|
69
|
+
"Pn!2\"\"/#?$"
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
41
72
|
* Generates the options markdown documentation for a command.
|
|
42
73
|
*/
|
|
43
74
|
function CommandOptionsDocs(props) {
|
|
@@ -61,7 +92,7 @@ function CommandOptionsDocs(props) {
|
|
|
61
92
|
} });
|
|
62
93
|
}
|
|
63
94
|
CommandOptionsDocs.__type = [
|
|
64
|
-
() => __Ω
|
|
95
|
+
() => __ΩCommandParametersDocsProps,
|
|
65
96
|
"props",
|
|
66
97
|
"CommandOptionsDocs",
|
|
67
98
|
"Generates the options markdown documentation for a command.",
|
|
@@ -88,15 +119,20 @@ const __ΩCommandDocsUsageExampleProps = [
|
|
|
88
119
|
* Generates the markdown documentation for a command.
|
|
89
120
|
*/
|
|
90
121
|
function CommandDocsUsageExample(props) {
|
|
91
|
-
const { packageManager = "npm", command, expand =
|
|
122
|
+
const { packageManager = "npm", command, expand = false } = props;
|
|
92
123
|
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
93
124
|
return [
|
|
94
125
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
95
126
|
when: expand,
|
|
96
|
-
fallback: _alloy_js_core.code`\`\`\`
|
|
97
|
-
children
|
|
98
|
-
|
|
99
|
-
|
|
127
|
+
fallback: _alloy_js_core.code`\`\`\`sh `,
|
|
128
|
+
get children() {
|
|
129
|
+
return [
|
|
130
|
+
_alloy_js_core.code`<details>
|
|
131
|
+
<summary>Using ${packageManager}:</summary>`,
|
|
132
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
133
|
+
_alloy_js_core.code`\`\`\`sh `
|
|
134
|
+
];
|
|
135
|
+
}
|
|
100
136
|
}),
|
|
101
137
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
102
138
|
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_usage.Usage, {
|
|
@@ -110,10 +146,14 @@ function CommandDocsUsageExample(props) {
|
|
|
110
146
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
111
147
|
when: expand,
|
|
112
148
|
fallback: _alloy_js_core.code`\`\`\` `,
|
|
113
|
-
children
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
149
|
+
get children() {
|
|
150
|
+
return [
|
|
151
|
+
_alloy_js_core.code`\`\`\``,
|
|
152
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
153
|
+
_alloy_js_core.code`</details>`
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
})
|
|
117
157
|
];
|
|
118
158
|
}
|
|
119
159
|
CommandDocsUsageExample.__type = [
|
|
@@ -148,18 +188,40 @@ function CommandDocs(props) {
|
|
|
148
188
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
149
189
|
level: 1 + levelOffset,
|
|
150
190
|
get children() {
|
|
151
|
-
return command.title
|
|
191
|
+
return `${command.title}${command.tags.includes("deprecated") ? " (Deprecated)" : command.tags.includes("beta") ? " (Beta)" : command.tags.includes("alpha") ? " (Alpha)" : command.tags.includes("experimental") ? " (Experimental)" : ""}`;
|
|
152
192
|
}
|
|
153
193
|
}),
|
|
154
194
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
155
195
|
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`${command.description}`),
|
|
196
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
197
|
+
get when() {
|
|
198
|
+
return command.alias && command.alias.length > 0;
|
|
199
|
+
},
|
|
200
|
+
get children() {
|
|
201
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
202
|
+
get when() {
|
|
203
|
+
return command.alias.length > 1;
|
|
204
|
+
},
|
|
205
|
+
get fallback() {
|
|
206
|
+
return _alloy_js_core.code`The \`${command.name}\` command can also be invoked using the alias \`${command.alias[0]}\`.`;
|
|
207
|
+
},
|
|
208
|
+
get children() {
|
|
209
|
+
return _alloy_js_core.code`The \`${command.name}\` command can also be invoked using the following aliases: ${(0, _stryke_string_format_list.list)(command.alias.map(__assignType((alias) => `\`${alias}\``, [
|
|
210
|
+
"alias",
|
|
211
|
+
"",
|
|
212
|
+
"P\"2!\"/\""
|
|
213
|
+
])), { conjunction: "or" })}.`;
|
|
214
|
+
}
|
|
215
|
+
})];
|
|
216
|
+
}
|
|
217
|
+
}),
|
|
156
218
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
157
219
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
158
220
|
level: 2 + levelOffset,
|
|
159
221
|
children: "Usage"
|
|
160
222
|
}),
|
|
161
223
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
162
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The
|
|
224
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The \`${command.name}\` command can be executed using the following syntax: `),
|
|
163
225
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
164
226
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
165
227
|
get when() {
|
|
@@ -174,11 +236,14 @@ function CommandDocs(props) {
|
|
|
174
236
|
get children() {
|
|
175
237
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
176
238
|
each: usageExamples,
|
|
177
|
-
|
|
239
|
+
doubleHardline: true,
|
|
178
240
|
get children() {
|
|
179
241
|
return __assignType((packageManager) => (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
|
|
180
242
|
packageManager,
|
|
181
|
-
command
|
|
243
|
+
command,
|
|
244
|
+
get expand() {
|
|
245
|
+
return usageExamples && usageExamples.length > 1;
|
|
246
|
+
}
|
|
182
247
|
}), [
|
|
183
248
|
"packageManager",
|
|
184
249
|
"",
|
|
@@ -189,12 +254,31 @@ function CommandDocs(props) {
|
|
|
189
254
|
}
|
|
190
255
|
}),
|
|
191
256
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
257
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
258
|
+
get when() {
|
|
259
|
+
return command.args.length > 0;
|
|
260
|
+
},
|
|
261
|
+
get children() {
|
|
262
|
+
return [
|
|
263
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
264
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
265
|
+
level: 2 + levelOffset,
|
|
266
|
+
children: "Positional Arguments"
|
|
267
|
+
}),
|
|
268
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
269
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following positional arguments are available for the \`${command.name}\` command:`),
|
|
270
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
271
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandArgumentDocs, { command }),
|
|
272
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
}),
|
|
192
276
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
193
277
|
level: 2 + levelOffset,
|
|
194
278
|
children: "Options"
|
|
195
279
|
}),
|
|
196
280
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
197
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following options are available for the
|
|
281
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following options are available for the \`${command.name}\` command:`),
|
|
198
282
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
199
283
|
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
|
|
200
284
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
@@ -270,6 +354,7 @@ CommandDocsFile.__type = [
|
|
|
270
354
|
];
|
|
271
355
|
|
|
272
356
|
//#endregion
|
|
357
|
+
exports.CommandArgumentDocs = CommandArgumentDocs;
|
|
273
358
|
exports.CommandDocs = CommandDocs;
|
|
274
359
|
exports.CommandDocsFile = CommandDocsFile;
|
|
275
360
|
exports.CommandDocsUsageExample = CommandDocsUsageExample;
|
|
@@ -277,5 +362,5 @@ exports.CommandOptionsDocs = CommandOptionsDocs;
|
|
|
277
362
|
exports.__ΩCommandDocsFileProps = __ΩCommandDocsFileProps;
|
|
278
363
|
exports.__ΩCommandDocsProps = __ΩCommandDocsProps;
|
|
279
364
|
exports.__ΩCommandDocsUsageExampleProps = __ΩCommandDocsUsageExampleProps;
|
|
280
|
-
exports.__Ω
|
|
365
|
+
exports.__ΩCommandParametersDocsProps = __ΩCommandParametersDocsProps;
|
|
281
366
|
//# sourceMappingURL=docs.cjs.map
|
|
@@ -2,16 +2,20 @@ import { CommandTree } from "../types/command.cjs";
|
|
|
2
2
|
import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
3
3
|
|
|
4
4
|
//#region src/components/docs.d.ts
|
|
5
|
-
interface
|
|
5
|
+
interface CommandParametersDocsProps {
|
|
6
6
|
/**
|
|
7
7
|
* The command to generate options documentation for.
|
|
8
8
|
*/
|
|
9
9
|
command: CommandTree;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates the arguments markdown documentation for a command.
|
|
13
|
+
*/
|
|
14
|
+
declare function CommandArgumentDocs(props: CommandParametersDocsProps): import("@alloy-js/core").Children;
|
|
11
15
|
/**
|
|
12
16
|
* Generates the options markdown documentation for a command.
|
|
13
17
|
*/
|
|
14
|
-
declare function CommandOptionsDocs(props:
|
|
18
|
+
declare function CommandOptionsDocs(props: CommandParametersDocsProps): import("@alloy-js/core").Children;
|
|
15
19
|
interface CommandDocsUsageExampleProps {
|
|
16
20
|
/**
|
|
17
21
|
* The package manager to generate the usage example for.
|
|
@@ -29,7 +33,7 @@ interface CommandDocsUsageExampleProps {
|
|
|
29
33
|
/**
|
|
30
34
|
* Whether to add expand/collapse details tags around the usage example. This is useful for hiding long usage examples by default.
|
|
31
35
|
*
|
|
32
|
-
* @defaultValue
|
|
36
|
+
* @defaultValue false
|
|
33
37
|
*/
|
|
34
38
|
expand?: boolean;
|
|
35
39
|
}
|
|
@@ -82,5 +86,5 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
|
82
86
|
*/
|
|
83
87
|
declare function CommandDocsFile(props: CommandDocsFileProps): import("@alloy-js/core").Children;
|
|
84
88
|
//#endregion
|
|
85
|
-
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
89
|
+
export { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParametersDocsProps };
|
|
86
90
|
//# sourceMappingURL=docs.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"docs.d.cts","names":[],"sources":["../../src/components/docs.tsx"],"mappings":";;;;UAqCiB,0BAAA;;AAAjB;;EAIE,OAAA,EAAS,WAAW;AAAA;AAAA;AAMtB;;AANsB,iBAMN,mBAAA,CAAoB,KAAA,EAAO,0BAA0B,4BAAA,QAAA;;;;iBAmCrD,kBAAA,CAAmB,KAAA,EAAO,0BAA0B,4BAAA,QAAA;AAAA,UAgCnD,4BAAA;EAnEoD;AAmCrE;;;;;;;EAyCE,cAAA;EAzCkE;AAgCpE;;EAcE,OAAA,EAAS,WAAW;EAAA;;;;;EAOpB,MAAA;AAAA;AAMF;;;AAAA,iBAAgB,uBAAA,CAAwB,KAAA,EAAO,4BAA4B,4BAAA,QAAA;AAAA,UA6B1D,gBAAA;EA7BuB;;;AAAmC;AA6B3E;;;;EASE,WAAA;EAYgB;;;EAPhB,OAAA,EAAS,WAAA;EAAT;;;;;EAOA,aAAA,GAAgB,QAAA,CAAS,4BAAA;AAAA;AAM3B;;;AAAA,iBAAgB,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA;AAAA,UAyElC,oBAAA,SAA6B,OAAA,CAAQ,iBAAA;EAzE1B;;;AAAuB;AAyEnD;;;;EASE,WAAA;EAT4C;;;EAc5C,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA"}
|
|
@@ -2,16 +2,20 @@ import { CommandTree } from "../types/command.mjs";
|
|
|
2
2
|
import { MarkdownFileProps } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
3
3
|
|
|
4
4
|
//#region src/components/docs.d.ts
|
|
5
|
-
interface
|
|
5
|
+
interface CommandParametersDocsProps {
|
|
6
6
|
/**
|
|
7
7
|
* The command to generate options documentation for.
|
|
8
8
|
*/
|
|
9
9
|
command: CommandTree;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates the arguments markdown documentation for a command.
|
|
13
|
+
*/
|
|
14
|
+
declare function CommandArgumentDocs(props: CommandParametersDocsProps): import("@alloy-js/core").Children;
|
|
11
15
|
/**
|
|
12
16
|
* Generates the options markdown documentation for a command.
|
|
13
17
|
*/
|
|
14
|
-
declare function CommandOptionsDocs(props:
|
|
18
|
+
declare function CommandOptionsDocs(props: CommandParametersDocsProps): import("@alloy-js/core").Children;
|
|
15
19
|
interface CommandDocsUsageExampleProps {
|
|
16
20
|
/**
|
|
17
21
|
* The package manager to generate the usage example for.
|
|
@@ -29,7 +33,7 @@ interface CommandDocsUsageExampleProps {
|
|
|
29
33
|
/**
|
|
30
34
|
* Whether to add expand/collapse details tags around the usage example. This is useful for hiding long usage examples by default.
|
|
31
35
|
*
|
|
32
|
-
* @defaultValue
|
|
36
|
+
* @defaultValue false
|
|
33
37
|
*/
|
|
34
38
|
expand?: boolean;
|
|
35
39
|
}
|
|
@@ -82,5 +86,5 @@ interface CommandDocsFileProps extends Partial<MarkdownFileProps> {
|
|
|
82
86
|
*/
|
|
83
87
|
declare function CommandDocsFile(props: CommandDocsFileProps): import("@alloy-js/core").Children;
|
|
84
88
|
//#endregion
|
|
85
|
-
export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
89
|
+
export { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParametersDocsProps };
|
|
86
90
|
//# sourceMappingURL=docs.d.mts.map
|
package/dist/components/docs.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
|
12
12
|
import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
|
|
13
13
|
import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
|
|
14
14
|
import { joinPaths } from "@stryke/path/join";
|
|
15
|
+
import { list } from "@stryke/string-format/list";
|
|
15
16
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
16
17
|
|
|
17
18
|
//#region src/components/docs.tsx
|
|
@@ -29,14 +30,44 @@ function __assignType(fn, args) {
|
|
|
29
30
|
fn.__type = args;
|
|
30
31
|
return fn;
|
|
31
32
|
}
|
|
32
|
-
const __Ω
|
|
33
|
+
const __ΩCommandParametersDocsProps = [
|
|
33
34
|
"CommandTree",
|
|
34
35
|
"command",
|
|
35
36
|
"The command to generate options documentation for.",
|
|
36
|
-
"
|
|
37
|
+
"CommandParametersDocsProps",
|
|
37
38
|
"P\"w!4\"?#Mw$y"
|
|
38
39
|
];
|
|
39
40
|
/**
|
|
41
|
+
* Generates the arguments markdown documentation for a command.
|
|
42
|
+
*/
|
|
43
|
+
function CommandArgumentDocs(props) {
|
|
44
|
+
const { command } = props;
|
|
45
|
+
if (Object.keys(command.options).length === 0) return code`This command does not have any arguments.`;
|
|
46
|
+
return createComponent(MarkdownTable, { get data() {
|
|
47
|
+
return sortOptions(Object.values(command.options)).reduce(__assignType((ret, option) => {
|
|
48
|
+
ret.push({
|
|
49
|
+
name: option.name.trim(),
|
|
50
|
+
description: option.description.trim(),
|
|
51
|
+
defaultValue: isUndefined(option.default) ? "" : JSON.stringify(option.default),
|
|
52
|
+
required: !option.required || option.default ? "" : "✔"
|
|
53
|
+
});
|
|
54
|
+
return ret;
|
|
55
|
+
}, [
|
|
56
|
+
"ret",
|
|
57
|
+
"option",
|
|
58
|
+
"",
|
|
59
|
+
"P\"2!\"2\"\"/#"
|
|
60
|
+
]), []);
|
|
61
|
+
} });
|
|
62
|
+
}
|
|
63
|
+
CommandArgumentDocs.__type = [
|
|
64
|
+
() => __ΩCommandParametersDocsProps,
|
|
65
|
+
"props",
|
|
66
|
+
"CommandArgumentDocs",
|
|
67
|
+
"Generates the arguments markdown documentation for a command.",
|
|
68
|
+
"Pn!2\"\"/#?$"
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
40
71
|
* Generates the options markdown documentation for a command.
|
|
41
72
|
*/
|
|
42
73
|
function CommandOptionsDocs(props) {
|
|
@@ -60,7 +91,7 @@ function CommandOptionsDocs(props) {
|
|
|
60
91
|
} });
|
|
61
92
|
}
|
|
62
93
|
CommandOptionsDocs.__type = [
|
|
63
|
-
() => __Ω
|
|
94
|
+
() => __ΩCommandParametersDocsProps,
|
|
64
95
|
"props",
|
|
65
96
|
"CommandOptionsDocs",
|
|
66
97
|
"Generates the options markdown documentation for a command.",
|
|
@@ -87,15 +118,20 @@ const __ΩCommandDocsUsageExampleProps = [
|
|
|
87
118
|
* Generates the markdown documentation for a command.
|
|
88
119
|
*/
|
|
89
120
|
function CommandDocsUsageExample(props) {
|
|
90
|
-
const { packageManager = "npm", command, expand =
|
|
121
|
+
const { packageManager = "npm", command, expand = false } = props;
|
|
91
122
|
const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
|
|
92
123
|
return [
|
|
93
124
|
createComponent(Show, {
|
|
94
125
|
when: expand,
|
|
95
|
-
fallback: code`\`\`\`
|
|
96
|
-
children
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
fallback: code`\`\`\`sh `,
|
|
127
|
+
get children() {
|
|
128
|
+
return [
|
|
129
|
+
code`<details>
|
|
130
|
+
<summary>Using ${packageManager}:</summary>`,
|
|
131
|
+
createComponent(Spacing, {}),
|
|
132
|
+
code`\`\`\`sh `
|
|
133
|
+
];
|
|
134
|
+
}
|
|
99
135
|
}),
|
|
100
136
|
createIntrinsic("hbr", {}),
|
|
101
137
|
createComponent(Usage, {
|
|
@@ -109,10 +145,14 @@ function CommandDocsUsageExample(props) {
|
|
|
109
145
|
createComponent(Show, {
|
|
110
146
|
when: expand,
|
|
111
147
|
fallback: code`\`\`\` `,
|
|
112
|
-
children
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
148
|
+
get children() {
|
|
149
|
+
return [
|
|
150
|
+
code`\`\`\``,
|
|
151
|
+
createComponent(Spacing, {}),
|
|
152
|
+
code`</details>`
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
})
|
|
116
156
|
];
|
|
117
157
|
}
|
|
118
158
|
CommandDocsUsageExample.__type = [
|
|
@@ -147,18 +187,40 @@ function CommandDocs(props) {
|
|
|
147
187
|
createComponent(Heading, {
|
|
148
188
|
level: 1 + levelOffset,
|
|
149
189
|
get children() {
|
|
150
|
-
return command.title
|
|
190
|
+
return `${command.title}${command.tags.includes("deprecated") ? " (Deprecated)" : command.tags.includes("beta") ? " (Beta)" : command.tags.includes("alpha") ? " (Alpha)" : command.tags.includes("experimental") ? " (Experimental)" : ""}`;
|
|
151
191
|
}
|
|
152
192
|
}),
|
|
153
193
|
createComponent(Spacing, {}),
|
|
154
194
|
memo(() => code`${command.description}`),
|
|
195
|
+
createComponent(Show, {
|
|
196
|
+
get when() {
|
|
197
|
+
return command.alias && command.alias.length > 0;
|
|
198
|
+
},
|
|
199
|
+
get children() {
|
|
200
|
+
return [createComponent(Spacing, {}), createComponent(Show, {
|
|
201
|
+
get when() {
|
|
202
|
+
return command.alias.length > 1;
|
|
203
|
+
},
|
|
204
|
+
get fallback() {
|
|
205
|
+
return code`The \`${command.name}\` command can also be invoked using the alias \`${command.alias[0]}\`.`;
|
|
206
|
+
},
|
|
207
|
+
get children() {
|
|
208
|
+
return code`The \`${command.name}\` command can also be invoked using the following aliases: ${list(command.alias.map(__assignType((alias) => `\`${alias}\``, [
|
|
209
|
+
"alias",
|
|
210
|
+
"",
|
|
211
|
+
"P\"2!\"/\""
|
|
212
|
+
])), { conjunction: "or" })}.`;
|
|
213
|
+
}
|
|
214
|
+
})];
|
|
215
|
+
}
|
|
216
|
+
}),
|
|
155
217
|
createComponent(Spacing, {}),
|
|
156
218
|
createComponent(Heading, {
|
|
157
219
|
level: 2 + levelOffset,
|
|
158
220
|
children: "Usage"
|
|
159
221
|
}),
|
|
160
222
|
createComponent(Spacing, {}),
|
|
161
|
-
memo(() => code`The
|
|
223
|
+
memo(() => code`The \`${command.name}\` command can be executed using the following syntax: `),
|
|
162
224
|
createComponent(Spacing, {}),
|
|
163
225
|
createComponent(Show, {
|
|
164
226
|
get when() {
|
|
@@ -173,11 +235,14 @@ function CommandDocs(props) {
|
|
|
173
235
|
get children() {
|
|
174
236
|
return createComponent(For, {
|
|
175
237
|
each: usageExamples,
|
|
176
|
-
|
|
238
|
+
doubleHardline: true,
|
|
177
239
|
get children() {
|
|
178
240
|
return __assignType((packageManager) => createComponent(CommandDocsUsageExample, {
|
|
179
241
|
packageManager,
|
|
180
|
-
command
|
|
242
|
+
command,
|
|
243
|
+
get expand() {
|
|
244
|
+
return usageExamples && usageExamples.length > 1;
|
|
245
|
+
}
|
|
181
246
|
}), [
|
|
182
247
|
"packageManager",
|
|
183
248
|
"",
|
|
@@ -188,12 +253,31 @@ function CommandDocs(props) {
|
|
|
188
253
|
}
|
|
189
254
|
}),
|
|
190
255
|
createComponent(Spacing, {}),
|
|
256
|
+
createComponent(Show, {
|
|
257
|
+
get when() {
|
|
258
|
+
return command.args.length > 0;
|
|
259
|
+
},
|
|
260
|
+
get children() {
|
|
261
|
+
return [
|
|
262
|
+
createComponent(Spacing, {}),
|
|
263
|
+
createComponent(Heading, {
|
|
264
|
+
level: 2 + levelOffset,
|
|
265
|
+
children: "Positional Arguments"
|
|
266
|
+
}),
|
|
267
|
+
createComponent(Spacing, {}),
|
|
268
|
+
memo(() => code`The following positional arguments are available for the \`${command.name}\` command:`),
|
|
269
|
+
createComponent(Spacing, {}),
|
|
270
|
+
createComponent(CommandArgumentDocs, { command }),
|
|
271
|
+
createComponent(Spacing, {})
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
}),
|
|
191
275
|
createComponent(Heading, {
|
|
192
276
|
level: 2 + levelOffset,
|
|
193
277
|
children: "Options"
|
|
194
278
|
}),
|
|
195
279
|
createComponent(Spacing, {}),
|
|
196
|
-
memo(() => code`The following options are available for the
|
|
280
|
+
memo(() => code`The following options are available for the \`${command.name}\` command:`),
|
|
197
281
|
createComponent(Spacing, {}),
|
|
198
282
|
createComponent(CommandOptionsDocs, { command }),
|
|
199
283
|
createComponent(Spacing, {})
|
|
@@ -269,5 +353,5 @@ CommandDocsFile.__type = [
|
|
|
269
353
|
];
|
|
270
354
|
|
|
271
355
|
//#endregion
|
|
272
|
-
export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __Ω
|
|
356
|
+
export { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __ΩCommandParametersDocsProps };
|
|
273
357
|
//# sourceMappingURL=docs.mjs.map
|
|
@@ -12,6 +12,7 @@ exports.ArgsUtilities = require_components_state_builtin.ArgsUtilities;
|
|
|
12
12
|
exports.ArgumentsParserLogic = require_components_options_parser_logic.ArgumentsParserLogic;
|
|
13
13
|
exports.BooleanInputParserLogic = require_components_helpers.BooleanInputParserLogic;
|
|
14
14
|
exports.ColorSupportUtilities = require_components_utils_builtin.ColorSupportUtilities;
|
|
15
|
+
exports.CommandArgumentDocs = require_components_docs.CommandArgumentDocs;
|
|
15
16
|
exports.CommandDocs = require_components_docs.CommandDocs;
|
|
16
17
|
exports.CommandDocsFile = require_components_docs.CommandDocsFile;
|
|
17
18
|
exports.CommandDocsUsageExample = require_components_docs.CommandDocsUsageExample;
|
|
@@ -45,7 +46,7 @@ exports.__ΩBooleanInputParserLogicProps = require_components_helpers.__ΩBoolea
|
|
|
45
46
|
exports.__ΩCommandDocsFileProps = require_components_docs.__ΩCommandDocsFileProps;
|
|
46
47
|
exports.__ΩCommandDocsProps = require_components_docs.__ΩCommandDocsProps;
|
|
47
48
|
exports.__ΩCommandDocsUsageExampleProps = require_components_docs.__ΩCommandDocsUsageExampleProps;
|
|
48
|
-
exports.__Ω
|
|
49
|
+
exports.__ΩCommandParametersDocsProps = require_components_docs.__ΩCommandParametersDocsProps;
|
|
49
50
|
exports.__ΩCommandParserLogicProps = require_components_options_parser_logic.__ΩCommandParserLogicProps;
|
|
50
51
|
exports.__ΩCommandValidationLogicProps = require_components_command_validation_logic.__ΩCommandValidationLogicProps;
|
|
51
52
|
exports.__ΩDynamicSegmentsParserLogicProps = require_components_options_parser_logic.__ΩDynamicSegmentsParserLogicProps;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CommandValidationLogic, CommandValidationLogicProps } from "./command-validation-logic.cjs";
|
|
2
|
-
import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
2
|
+
import { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParametersDocsProps } from "./docs.cjs";
|
|
3
3
|
import { ExecBuiltin, ExecBuiltinProps } from "./exec-builtin.cjs";
|
|
4
4
|
import { BooleanInputParserLogic, BooleanInputParserLogicProps, CommandParameterType, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose } from "./helpers.cjs";
|
|
5
5
|
import { ArgumentsParserLogic, ArgumentsParserLogicProps, CommandParserLogic, CommandParserLogicProps, DynamicSegmentsParserLogic, DynamicSegmentsParserLogicProps, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps } from "./options-parser-logic.cjs";
|
|
6
6
|
import { ArgsUtilities, ContextUtilities, GlobalTypeDefinitions, StateBuiltin, StateBuiltinProps } from "./state-builtin.cjs";
|
|
7
7
|
import { Usage, UsageProps } from "./usage.cjs";
|
|
8
8
|
import { ColorSupportUtilities, EnvSupportUtilities, FindSuggestionsDeclaration, HyperlinkSupportUtilities, ResolveModuleFunctionDeclaration, TerminalSizeDeclaration, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.cjs";
|
|
9
|
-
export { ArgsUtilities, ArgumentsParserLogic, ArgumentsParserLogicProps, BooleanInputParserLogic, BooleanInputParserLogicProps, ColorSupportUtilities, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
9
|
+
export { ArgsUtilities, ArgumentsParserLogic, ArgumentsParserLogicProps, BooleanInputParserLogic, BooleanInputParserLogicProps, ColorSupportUtilities, CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParameterType, CommandParametersDocsProps, CommandParserLogic, CommandParserLogicProps, CommandValidationLogic, CommandValidationLogicProps, ContextUtilities, DynamicSegmentsParserLogic, DynamicSegmentsParserLogicProps, EnvSupportUtilities, ExecBuiltin, ExecBuiltinProps, FindSuggestionsDeclaration, GlobalTypeDefinitions, HyperlinkSupportUtilities, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, ResolveModuleFunctionDeclaration, StateBuiltin, StateBuiltinProps, TerminalSizeDeclaration, Usage, UsageProps, UtilsBuiltin, UtilsBuiltinProps };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CommandValidationLogic, CommandValidationLogicProps } from "./command-validation-logic.mjs";
|
|
2
|
-
import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
2
|
+
import { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParametersDocsProps } from "./docs.mjs";
|
|
3
3
|
import { ExecBuiltin, ExecBuiltinProps } from "./exec-builtin.mjs";
|
|
4
4
|
import { BooleanInputParserLogic, BooleanInputParserLogicProps, CommandParameterType, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose } from "./helpers.mjs";
|
|
5
5
|
import { ArgumentsParserLogic, ArgumentsParserLogicProps, CommandParserLogic, CommandParserLogicProps, DynamicSegmentsParserLogic, DynamicSegmentsParserLogicProps, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps } from "./options-parser-logic.mjs";
|
|
6
6
|
import { ArgsUtilities, ContextUtilities, GlobalTypeDefinitions, StateBuiltin, StateBuiltinProps } from "./state-builtin.mjs";
|
|
7
7
|
import { Usage, UsageProps } from "./usage.mjs";
|
|
8
8
|
import { ColorSupportUtilities, EnvSupportUtilities, FindSuggestionsDeclaration, HyperlinkSupportUtilities, ResolveModuleFunctionDeclaration, TerminalSizeDeclaration, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.mjs";
|
|
9
|
-
export { ArgsUtilities, ArgumentsParserLogic, ArgumentsParserLogicProps, BooleanInputParserLogic, BooleanInputParserLogicProps, ColorSupportUtilities, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs,
|
|
9
|
+
export { ArgsUtilities, ArgumentsParserLogic, ArgumentsParserLogicProps, BooleanInputParserLogic, BooleanInputParserLogicProps, ColorSupportUtilities, CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandParameterType, CommandParametersDocsProps, CommandParserLogic, CommandParserLogicProps, CommandValidationLogic, CommandValidationLogicProps, ContextUtilities, DynamicSegmentsParserLogic, DynamicSegmentsParserLogicProps, EnvSupportUtilities, ExecBuiltin, ExecBuiltinProps, FindSuggestionsDeclaration, GlobalTypeDefinitions, HyperlinkSupportUtilities, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserConditionProps, OptionsMemberParserLogic, OptionsMemberParserLogicProps, OptionsParserLogic, OptionsParserLogicProps, ResolveModuleFunctionDeclaration, StateBuiltin, StateBuiltinProps, TerminalSizeDeclaration, Usage, UsageProps, UtilsBuiltin, UtilsBuiltinProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Usage, __ΩUsageProps } from "./usage.mjs";
|
|
2
|
-
import { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __Ω
|
|
2
|
+
import { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __ΩCommandParametersDocsProps } from "./docs.mjs";
|
|
3
3
|
import { ExecBuiltin, __ΩExecBuiltinProps } from "./exec-builtin.mjs";
|
|
4
4
|
import { BooleanInputParserLogic, CommandParameterType, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose, __ΩBooleanInputParserLogicProps } from "./helpers.mjs";
|
|
5
5
|
import { ArgumentsParserLogic, CommandParserLogic, DynamicSegmentsParserLogic, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, __ΩArgumentsParserLogicProps, __ΩCommandParserLogicProps, __ΩDynamicSegmentsParserLogicProps, __ΩOptionsMemberParserConditionProps, __ΩOptionsMemberParserLogicProps, __ΩOptionsParserLogicProps } from "./options-parser-logic.mjs";
|
|
@@ -7,4 +7,4 @@ import { ArgsUtilities, ContextUtilities, GlobalTypeDefinitions, StateBuiltin, _
|
|
|
7
7
|
import { ColorSupportUtilities, EnvSupportUtilities, FindSuggestionsDeclaration, HyperlinkSupportUtilities, ResolveModuleFunctionDeclaration, TerminalSizeDeclaration, UtilsBuiltin, __ΩUtilsBuiltinProps } from "./utils-builtin.mjs";
|
|
8
8
|
import { CommandValidationLogic, __ΩCommandValidationLogicProps } from "./command-validation-logic.mjs";
|
|
9
9
|
|
|
10
|
-
export { ArgsUtilities, ArgumentsParserLogic, BooleanInputParserLogic, ColorSupportUtilities, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, CommandParameterType, CommandParserLogic, CommandValidationLogic, ContextUtilities, DynamicSegmentsParserLogic, EnvSupportUtilities, ExecBuiltin, FindSuggestionsDeclaration, GlobalTypeDefinitions, HyperlinkSupportUtilities, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, ResolveModuleFunctionDeclaration, StateBuiltin, TerminalSizeDeclaration, Usage, UtilsBuiltin, __ΩArgumentsParserLogicProps, __ΩBooleanInputParserLogicProps, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __Ω
|
|
10
|
+
export { ArgsUtilities, ArgumentsParserLogic, BooleanInputParserLogic, ColorSupportUtilities, CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, CommandParameterType, CommandParserLogic, CommandValidationLogic, ContextUtilities, DynamicSegmentsParserLogic, EnvSupportUtilities, ExecBuiltin, FindSuggestionsDeclaration, GlobalTypeDefinitions, HyperlinkSupportUtilities, IsDebug, IsNotDebug, IsNotVerbose, IsVerbose, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, ResolveModuleFunctionDeclaration, StateBuiltin, TerminalSizeDeclaration, Usage, UtilsBuiltin, __ΩArgumentsParserLogicProps, __ΩBooleanInputParserLogicProps, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __ΩCommandParametersDocsProps, __ΩCommandParserLogicProps, __ΩCommandValidationLogicProps, __ΩDynamicSegmentsParserLogicProps, __ΩExecBuiltinProps, __ΩOptionsMemberParserConditionProps, __ΩOptionsMemberParserLogicProps, __ΩOptionsParserLogicProps, __ΩStateBuiltinProps, __ΩUsageProps, __ΩUtilsBuiltinProps };
|
|
@@ -54,20 +54,17 @@ function Usage(props) {
|
|
|
54
54
|
"segment",
|
|
55
55
|
"",
|
|
56
56
|
"P\"2!\"/\""
|
|
57
|
-
])).join(" ")}` : ""}${Object.values(command.children).length > 0 ? " <commands>" : ""}${command.args.length > 0 ? command.args.map(__assignType((param) => `<${(0, _stryke_string_format_snake_case.snakeCase)(param.name)}${(param.type === "string" || param.type === "number") && param.variadic ? "..." : ""}>`, [
|
|
57
|
+
])).join(" ")}` : ""}${Object.values(command.children).length > 0 ? " <commands>" : ""}${command.args.length > 0 ? ` ${command.args.map(__assignType((param) => `<${(0, _stryke_string_format_snake_case.snakeCase)(param.name)}${(param.type === "string" || param.type === "number") && param.variadic ? "..." : ""}>`, [
|
|
58
58
|
"param",
|
|
59
59
|
"",
|
|
60
60
|
"P\"2!\"/\""
|
|
61
|
-
])).join(" ") : ""} [options]`),
|
|
61
|
+
])).join(" ")}` : ""} [options]`),
|
|
62
62
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
63
63
|
get when() {
|
|
64
64
|
return command.args.length > 0;
|
|
65
65
|
},
|
|
66
66
|
get children() {
|
|
67
67
|
return [
|
|
68
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
69
|
-
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
70
|
-
_alloy_js_core.code`# or with options before arguments: `,
|
|
71
68
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
72
69
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Switch, { get children() {
|
|
73
70
|
return [
|
|
@@ -53,20 +53,17 @@ function Usage(props) {
|
|
|
53
53
|
"segment",
|
|
54
54
|
"",
|
|
55
55
|
"P\"2!\"/\""
|
|
56
|
-
])).join(" ")}` : ""}${Object.values(command.children).length > 0 ? " <commands>" : ""}${command.args.length > 0 ? command.args.map(__assignType((param) => `<${snakeCase(param.name)}${(param.type === "string" || param.type === "number") && param.variadic ? "..." : ""}>`, [
|
|
56
|
+
])).join(" ")}` : ""}${Object.values(command.children).length > 0 ? " <commands>" : ""}${command.args.length > 0 ? ` ${command.args.map(__assignType((param) => `<${snakeCase(param.name)}${(param.type === "string" || param.type === "number") && param.variadic ? "..." : ""}>`, [
|
|
57
57
|
"param",
|
|
58
58
|
"",
|
|
59
59
|
"P\"2!\"/\""
|
|
60
|
-
])).join(" ") : ""} [options]`),
|
|
60
|
+
])).join(" ")}` : ""} [options]`),
|
|
61
61
|
createComponent(Show, {
|
|
62
62
|
get when() {
|
|
63
63
|
return command.args.length > 0;
|
|
64
64
|
},
|
|
65
65
|
get children() {
|
|
66
66
|
return [
|
|
67
|
-
createIntrinsic("hbr", {}),
|
|
68
|
-
createIntrinsic("hbr", {}),
|
|
69
|
-
code`# or with options before arguments: `,
|
|
70
67
|
createIntrinsic("hbr", {}),
|
|
71
68
|
createComponent(Switch, { get children() {
|
|
72
69
|
return [
|
package/dist/helpers/automd.cjs
CHANGED
|
@@ -23,19 +23,35 @@ function __assignType(fn, args) {
|
|
|
23
23
|
*/
|
|
24
24
|
const commands = __assignType((context) => (0, automd.defineGenerator)({
|
|
25
25
|
name: "commands",
|
|
26
|
-
async generate() {
|
|
26
|
+
async generate(ctx) {
|
|
27
|
+
let commands = Object.values(context.commands).filter(__assignType((cmd) => !cmd.virtual, [
|
|
28
|
+
"cmd",
|
|
29
|
+
"",
|
|
30
|
+
"P\"2!\"/\""
|
|
31
|
+
]));
|
|
32
|
+
if (ctx.args.command) {
|
|
33
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
34
|
+
commands = [context.commands[ctx.args.command]];
|
|
35
|
+
}
|
|
27
36
|
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, [
|
|
28
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
38
|
+
get when() {
|
|
39
|
+
return !ctx.args.command;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
return [
|
|
43
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
|
|
44
|
+
level: 2,
|
|
45
|
+
children: "Commands"
|
|
46
|
+
}),
|
|
47
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
48
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following commands are available in the ${require_context_helpers.getAppTitle(context, true)} command-line interface application:`),
|
|
49
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
50
|
+
];
|
|
51
|
+
}
|
|
31
52
|
}),
|
|
32
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
33
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following commands are available in the ${require_context_helpers.getAppTitle(context, true)} command-line interface application:`),
|
|
34
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
35
53
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
36
|
-
|
|
37
|
-
return Object.values(context.commands);
|
|
38
|
-
},
|
|
54
|
+
each: commands,
|
|
39
55
|
doubleHardline: true,
|
|
40
56
|
get children() {
|
|
41
57
|
return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
@@ -64,7 +80,114 @@ const commands = __assignType((context) => (0, automd.defineGenerator)({
|
|
|
64
80
|
"",
|
|
65
81
|
"P\"w!2\"\"/#"
|
|
66
82
|
]);
|
|
83
|
+
/**
|
|
84
|
+
* AutoMD generator to generate usage examples for a specific command.
|
|
85
|
+
*
|
|
86
|
+
* @param context - The generator context.
|
|
87
|
+
* @returns The generated usage content.
|
|
88
|
+
*/
|
|
89
|
+
const usage = __assignType((context) => (0, automd.defineGenerator)({
|
|
90
|
+
name: "usage",
|
|
91
|
+
async generate(ctx) {
|
|
92
|
+
if (!ctx.args.command) throw new Error("The 'usage' generator requires the \"command\" argument.");
|
|
93
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
94
|
+
let packageManagers = [
|
|
95
|
+
"npm",
|
|
96
|
+
"yarn",
|
|
97
|
+
"pnpm",
|
|
98
|
+
"bun"
|
|
99
|
+
];
|
|
100
|
+
if (ctx.args.packageManager) packageManagers = [String(ctx.args.packageManager)];
|
|
101
|
+
if (packageManagers.some(__assignType((pm) => ![
|
|
102
|
+
"npm",
|
|
103
|
+
"yarn",
|
|
104
|
+
"pnpm",
|
|
105
|
+
"bun"
|
|
106
|
+
].includes(pm), [
|
|
107
|
+
"pm",
|
|
108
|
+
"",
|
|
109
|
+
"P\"2!\"/\""
|
|
110
|
+
]))) throw new Error(`Invalid package manager specified. Supported package managers are: npm, yarn, pnpm, and bun.`);
|
|
111
|
+
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
112
|
+
each: packageManagers,
|
|
113
|
+
doubleHardline: true,
|
|
114
|
+
get children() {
|
|
115
|
+
return __assignType((packageManager) => [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocsUsageExample, {
|
|
116
|
+
packageManager,
|
|
117
|
+
get command() {
|
|
118
|
+
return context.commands[ctx.args.command];
|
|
119
|
+
},
|
|
120
|
+
get expand() {
|
|
121
|
+
return packageManagers && packageManagers.length > 1;
|
|
122
|
+
}
|
|
123
|
+
})], [
|
|
124
|
+
"packageManager",
|
|
125
|
+
"",
|
|
126
|
+
"P\"2!\"/\""
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
})]) };
|
|
130
|
+
}
|
|
131
|
+
}), [
|
|
132
|
+
"Context",
|
|
133
|
+
"context",
|
|
134
|
+
"",
|
|
135
|
+
"P\"w!2\"\"/#"
|
|
136
|
+
]);
|
|
137
|
+
/**
|
|
138
|
+
* AutoMD generator to generate options for a specific command.
|
|
139
|
+
*
|
|
140
|
+
* @param context - The generator context.
|
|
141
|
+
* @returns The generated options content.
|
|
142
|
+
*/
|
|
143
|
+
const options = __assignType((context) => (0, automd.defineGenerator)({
|
|
144
|
+
name: "options",
|
|
145
|
+
generate: __assignType(async function generate(ctx) {
|
|
146
|
+
if (!ctx.args.command) throw new Error("The 'options' generator requires the \"command\" argument.");
|
|
147
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
148
|
+
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandOptionsDocs, { get command() {
|
|
149
|
+
return context.commands[ctx.args.command];
|
|
150
|
+
} })) };
|
|
151
|
+
}, [
|
|
152
|
+
"ctx",
|
|
153
|
+
"generate",
|
|
154
|
+
"P\"2!\"/\""
|
|
155
|
+
])
|
|
156
|
+
}), [
|
|
157
|
+
"Context",
|
|
158
|
+
"context",
|
|
159
|
+
"",
|
|
160
|
+
"P\"w!2\"\"/#"
|
|
161
|
+
]);
|
|
162
|
+
/**
|
|
163
|
+
* AutoMD generator to generate arguments for a specific command.
|
|
164
|
+
*
|
|
165
|
+
* @param context - The generator context.
|
|
166
|
+
* @returns The generated arguments content.
|
|
167
|
+
*/
|
|
168
|
+
const args = __assignType((context) => (0, automd.defineGenerator)({
|
|
169
|
+
name: "args",
|
|
170
|
+
generate: __assignType(async function generate(ctx) {
|
|
171
|
+
if (!ctx.args.command) throw new Error("The 'args' generator requires the \"command\" argument.");
|
|
172
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
173
|
+
return { contents: (0, _powerlines_plugin_alloy_render.renderString)(context, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandArgumentDocs, { get command() {
|
|
174
|
+
return context.commands[ctx.args.command];
|
|
175
|
+
} })) };
|
|
176
|
+
}, [
|
|
177
|
+
"ctx",
|
|
178
|
+
"generate",
|
|
179
|
+
"P\"2!\"/\""
|
|
180
|
+
])
|
|
181
|
+
}), [
|
|
182
|
+
"Context",
|
|
183
|
+
"context",
|
|
184
|
+
"",
|
|
185
|
+
"P\"w!2\"\"/#"
|
|
186
|
+
]);
|
|
67
187
|
|
|
68
188
|
//#endregion
|
|
189
|
+
exports.args = args;
|
|
69
190
|
exports.commands = commands;
|
|
191
|
+
exports.options = options;
|
|
192
|
+
exports.usage = usage;
|
|
70
193
|
//# sourceMappingURL=automd.cjs.map
|
package/dist/helpers/automd.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
|
|
2
|
-
import { CommandDocs } from "../components/docs.mjs";
|
|
2
|
+
import { CommandArgumentDocs, CommandDocs, CommandDocsUsageExample, CommandOptionsDocs } from "../components/docs.mjs";
|
|
3
3
|
import "../plugin-utils/index.mjs";
|
|
4
4
|
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { For, Show, code } from "@alloy-js/core";
|
|
@@ -23,19 +23,35 @@ function __assignType(fn, args) {
|
|
|
23
23
|
*/
|
|
24
24
|
const commands = __assignType((context) => defineGenerator({
|
|
25
25
|
name: "commands",
|
|
26
|
-
async generate() {
|
|
26
|
+
async generate(ctx) {
|
|
27
|
+
let commands = Object.values(context.commands).filter(__assignType((cmd) => !cmd.virtual, [
|
|
28
|
+
"cmd",
|
|
29
|
+
"",
|
|
30
|
+
"P\"2!\"/\""
|
|
31
|
+
]));
|
|
32
|
+
if (ctx.args.command) {
|
|
33
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
34
|
+
commands = [context.commands[ctx.args.command]];
|
|
35
|
+
}
|
|
27
36
|
return { contents: renderString(context, [
|
|
28
|
-
createComponent(
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
createComponent(Show, {
|
|
38
|
+
get when() {
|
|
39
|
+
return !ctx.args.command;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
return [
|
|
43
|
+
createComponent(Heading, {
|
|
44
|
+
level: 2,
|
|
45
|
+
children: "Commands"
|
|
46
|
+
}),
|
|
47
|
+
createComponent(Spacing, {}),
|
|
48
|
+
memo(() => code`The following commands are available in the ${getAppTitle(context, true)} command-line interface application:`),
|
|
49
|
+
createComponent(Spacing, {})
|
|
50
|
+
];
|
|
51
|
+
}
|
|
31
52
|
}),
|
|
32
|
-
createComponent(Spacing, {}),
|
|
33
|
-
memo(() => code`The following commands are available in the ${getAppTitle(context, true)} command-line interface application:`),
|
|
34
|
-
createComponent(Spacing, {}),
|
|
35
53
|
createComponent(For, {
|
|
36
|
-
|
|
37
|
-
return Object.values(context.commands);
|
|
38
|
-
},
|
|
54
|
+
each: commands,
|
|
39
55
|
doubleHardline: true,
|
|
40
56
|
get children() {
|
|
41
57
|
return __assignType((child) => createComponent(Show, {
|
|
@@ -64,7 +80,111 @@ const commands = __assignType((context) => defineGenerator({
|
|
|
64
80
|
"",
|
|
65
81
|
"P\"w!2\"\"/#"
|
|
66
82
|
]);
|
|
83
|
+
/**
|
|
84
|
+
* AutoMD generator to generate usage examples for a specific command.
|
|
85
|
+
*
|
|
86
|
+
* @param context - The generator context.
|
|
87
|
+
* @returns The generated usage content.
|
|
88
|
+
*/
|
|
89
|
+
const usage = __assignType((context) => defineGenerator({
|
|
90
|
+
name: "usage",
|
|
91
|
+
async generate(ctx) {
|
|
92
|
+
if (!ctx.args.command) throw new Error("The 'usage' generator requires the \"command\" argument.");
|
|
93
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
94
|
+
let packageManagers = [
|
|
95
|
+
"npm",
|
|
96
|
+
"yarn",
|
|
97
|
+
"pnpm",
|
|
98
|
+
"bun"
|
|
99
|
+
];
|
|
100
|
+
if (ctx.args.packageManager) packageManagers = [String(ctx.args.packageManager)];
|
|
101
|
+
if (packageManagers.some(__assignType((pm) => ![
|
|
102
|
+
"npm",
|
|
103
|
+
"yarn",
|
|
104
|
+
"pnpm",
|
|
105
|
+
"bun"
|
|
106
|
+
].includes(pm), [
|
|
107
|
+
"pm",
|
|
108
|
+
"",
|
|
109
|
+
"P\"2!\"/\""
|
|
110
|
+
]))) throw new Error(`Invalid package manager specified. Supported package managers are: npm, yarn, pnpm, and bun.`);
|
|
111
|
+
return { contents: renderString(context, [createComponent(For, {
|
|
112
|
+
each: packageManagers,
|
|
113
|
+
doubleHardline: true,
|
|
114
|
+
get children() {
|
|
115
|
+
return __assignType((packageManager) => [createComponent(CommandDocsUsageExample, {
|
|
116
|
+
packageManager,
|
|
117
|
+
get command() {
|
|
118
|
+
return context.commands[ctx.args.command];
|
|
119
|
+
},
|
|
120
|
+
get expand() {
|
|
121
|
+
return packageManagers && packageManagers.length > 1;
|
|
122
|
+
}
|
|
123
|
+
})], [
|
|
124
|
+
"packageManager",
|
|
125
|
+
"",
|
|
126
|
+
"P\"2!\"/\""
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
})]) };
|
|
130
|
+
}
|
|
131
|
+
}), [
|
|
132
|
+
"Context",
|
|
133
|
+
"context",
|
|
134
|
+
"",
|
|
135
|
+
"P\"w!2\"\"/#"
|
|
136
|
+
]);
|
|
137
|
+
/**
|
|
138
|
+
* AutoMD generator to generate options for a specific command.
|
|
139
|
+
*
|
|
140
|
+
* @param context - The generator context.
|
|
141
|
+
* @returns The generated options content.
|
|
142
|
+
*/
|
|
143
|
+
const options = __assignType((context) => defineGenerator({
|
|
144
|
+
name: "options",
|
|
145
|
+
generate: __assignType(async function generate(ctx) {
|
|
146
|
+
if (!ctx.args.command) throw new Error("The 'options' generator requires the \"command\" argument.");
|
|
147
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
148
|
+
return { contents: renderString(context, createComponent(CommandOptionsDocs, { get command() {
|
|
149
|
+
return context.commands[ctx.args.command];
|
|
150
|
+
} })) };
|
|
151
|
+
}, [
|
|
152
|
+
"ctx",
|
|
153
|
+
"generate",
|
|
154
|
+
"P\"2!\"/\""
|
|
155
|
+
])
|
|
156
|
+
}), [
|
|
157
|
+
"Context",
|
|
158
|
+
"context",
|
|
159
|
+
"",
|
|
160
|
+
"P\"w!2\"\"/#"
|
|
161
|
+
]);
|
|
162
|
+
/**
|
|
163
|
+
* AutoMD generator to generate arguments for a specific command.
|
|
164
|
+
*
|
|
165
|
+
* @param context - The generator context.
|
|
166
|
+
* @returns The generated arguments content.
|
|
167
|
+
*/
|
|
168
|
+
const args = __assignType((context) => defineGenerator({
|
|
169
|
+
name: "args",
|
|
170
|
+
generate: __assignType(async function generate(ctx) {
|
|
171
|
+
if (!ctx.args.command) throw new Error("The 'args' generator requires the \"command\" argument.");
|
|
172
|
+
if (!context.commands[ctx.args.command]) throw new Error(`The command "${ctx.args.command}" does not exist in the application.`);
|
|
173
|
+
return { contents: renderString(context, createComponent(CommandArgumentDocs, { get command() {
|
|
174
|
+
return context.commands[ctx.args.command];
|
|
175
|
+
} })) };
|
|
176
|
+
}, [
|
|
177
|
+
"ctx",
|
|
178
|
+
"generate",
|
|
179
|
+
"P\"2!\"/\""
|
|
180
|
+
])
|
|
181
|
+
}), [
|
|
182
|
+
"Context",
|
|
183
|
+
"context",
|
|
184
|
+
"",
|
|
185
|
+
"P\"w!2\"\"/#"
|
|
186
|
+
]);
|
|
67
187
|
|
|
68
188
|
//#endregion
|
|
69
|
-
export { commands };
|
|
189
|
+
export { args, commands, options, usage };
|
|
70
190
|
//# sourceMappingURL=automd.mjs.map
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -53,7 +53,7 @@ const MAX_DEPTH = 50;
|
|
|
53
53
|
/**
|
|
54
54
|
* The core Powerlines plugin to build Shell Shock projects.
|
|
55
55
|
*/
|
|
56
|
-
const plugin = __assignType((options = {}) => {
|
|
56
|
+
const plugin = __assignType((options$1 = {}) => {
|
|
57
57
|
return [
|
|
58
58
|
(_powerlines_plugin_tsdown.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_tsdown.default)()),
|
|
59
59
|
(_powerlines_plugin_automd.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_automd.default)()),
|
|
@@ -61,7 +61,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
61
61
|
name: "shell-shock/core:config",
|
|
62
62
|
config: __assignType(async function config() {
|
|
63
63
|
this.debug("Resolving the Shell Shock configuration.");
|
|
64
|
-
return (0, defu.defu)(options, {
|
|
64
|
+
return (0, defu.defu)(options$1, {
|
|
65
65
|
name: require_context_helpers.getAppName(this),
|
|
66
66
|
title: require_context_helpers.getAppTitle(this),
|
|
67
67
|
description: require_context_helpers.getAppDescription(this),
|
|
@@ -125,7 +125,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
|
-
...(_powerlines_plugin_nodejs.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_nodejs.default)((0, defu.defu)(options ?? {}, { env: {
|
|
128
|
+
...(_powerlines_plugin_nodejs.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_nodejs.default)((0, defu.defu)(options$1 ?? {}, { env: {
|
|
129
129
|
config: "@shell-shock/core/types/env#ShellShockEnv",
|
|
130
130
|
validate: false
|
|
131
131
|
} }))),
|
|
@@ -446,11 +446,14 @@ const plugin = __assignType((options = {}) => {
|
|
|
446
446
|
this.config.automd ??= {};
|
|
447
447
|
this.config.automd.generators = {
|
|
448
448
|
...this.config.automd.generators ?? {},
|
|
449
|
-
commands: require_automd.commands(this)
|
|
449
|
+
commands: require_automd.commands(this),
|
|
450
|
+
usage: require_automd.usage(this),
|
|
451
|
+
options: require_automd.options(this),
|
|
452
|
+
args: require_automd.args(this)
|
|
450
453
|
};
|
|
451
454
|
}, ["configResolved", "P\"/!"]),
|
|
452
455
|
async docs() {
|
|
453
|
-
this.debug("Rendering
|
|
456
|
+
this.debug("Rendering CLI command reference documentation and writing to the output directory.");
|
|
454
457
|
const commands = this.inputs.map(__assignType((input) => require_get_command_tree.getCommandTree(this, input.segments), [
|
|
455
458
|
"input",
|
|
456
459
|
"",
|
package/dist/plugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;AA6FA;cAAa,MAAA,oBAA2B,OAAA,GAAU,OAAA,EAChD,OAAA,GAAS,OAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/plugin.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { traverseCommands } from "./plugin-utils/traverse-command-tree.mjs";
|
|
|
5
5
|
import { getCommandTree } from "./plugin-utils/get-command-tree.mjs";
|
|
6
6
|
import { StateBuiltin } from "./components/state-builtin.mjs";
|
|
7
7
|
import { UtilsBuiltin } from "./components/utils-builtin.mjs";
|
|
8
|
-
import { commands } from "./helpers/automd.mjs";
|
|
8
|
+
import { args, commands, options, usage } from "./helpers/automd.mjs";
|
|
9
9
|
import { getFramework } from "./helpers/get-framework.mjs";
|
|
10
10
|
import { findCommandsRoot, resolveCommandId, resolveCommandName, resolveCommandPath } from "./helpers/paths.mjs";
|
|
11
11
|
import { writeCommandsPersistence } from "./helpers/persistence.mjs";
|
|
@@ -48,7 +48,7 @@ const MAX_DEPTH = 50;
|
|
|
48
48
|
/**
|
|
49
49
|
* The core Powerlines plugin to build Shell Shock projects.
|
|
50
50
|
*/
|
|
51
|
-
const plugin = __assignType((options = {}) => {
|
|
51
|
+
const plugin = __assignType((options$1 = {}) => {
|
|
52
52
|
return [
|
|
53
53
|
(tsdown.Ω = [["Context", "\"w!"]], tsdown()),
|
|
54
54
|
(automd.Ω = [["Context", "\"w!"]], automd()),
|
|
@@ -56,7 +56,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
56
56
|
name: "shell-shock/core:config",
|
|
57
57
|
config: __assignType(async function config() {
|
|
58
58
|
this.debug("Resolving the Shell Shock configuration.");
|
|
59
|
-
return defu(options, {
|
|
59
|
+
return defu(options$1, {
|
|
60
60
|
name: getAppName(this),
|
|
61
61
|
title: getAppTitle(this),
|
|
62
62
|
description: getAppDescription(this),
|
|
@@ -120,7 +120,7 @@ const plugin = __assignType((options = {}) => {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
...(nodejs.Ω = [["Context", "\"w!"]], nodejs(defu(options ?? {}, { env: {
|
|
123
|
+
...(nodejs.Ω = [["Context", "\"w!"]], nodejs(defu(options$1 ?? {}, { env: {
|
|
124
124
|
config: "@shell-shock/core/types/env#ShellShockEnv",
|
|
125
125
|
validate: false
|
|
126
126
|
} }))),
|
|
@@ -441,11 +441,14 @@ const plugin = __assignType((options = {}) => {
|
|
|
441
441
|
this.config.automd ??= {};
|
|
442
442
|
this.config.automd.generators = {
|
|
443
443
|
...this.config.automd.generators ?? {},
|
|
444
|
-
commands: commands(this)
|
|
444
|
+
commands: commands(this),
|
|
445
|
+
usage: usage(this),
|
|
446
|
+
options: options(this),
|
|
447
|
+
args: args(this)
|
|
445
448
|
};
|
|
446
449
|
}, ["configResolved", "P\"/!"]),
|
|
447
450
|
async docs() {
|
|
448
|
-
this.debug("Rendering
|
|
451
|
+
this.debug("Rendering CLI command reference documentation and writing to the output directory.");
|
|
449
452
|
const commands = this.inputs.map(__assignType((input) => getCommandTree(this, input.segments), [
|
|
450
453
|
"input",
|
|
451
454
|
"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/core",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing the core Shell Shock functionality used to build and manage a command-line application.",
|
|
6
6
|
"keywords": ["shell-shock", "powerlines", "storm-software"],
|
|
@@ -407,5 +407,5 @@
|
|
|
407
407
|
"typescript": "^6.0.3"
|
|
408
408
|
},
|
|
409
409
|
"publishConfig": { "access": "public" },
|
|
410
|
-
"gitHead": "
|
|
410
|
+
"gitHead": "f65ed318b22c10407fc4f3770b3f1f742d02ab35"
|
|
411
411
|
}
|