politty 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/{arg-registry-CkPDokIu.d.ts → arg-registry-Cd6xnjHa.d.ts} +118 -4
- package/dist/arg-registry-Cd6xnjHa.d.ts.map +1 -0
- package/dist/{arg-registry-r5wYN6qd.d.cts → arg-registry-MVWOAcvw.d.cts} +118 -4
- package/dist/arg-registry-MVWOAcvw.d.cts.map +1 -0
- package/dist/augment.d.cts +1 -1
- package/dist/augment.d.cts.map +1 -1
- package/dist/augment.d.ts +1 -1
- package/dist/augment.d.ts.map +1 -1
- package/dist/completion/index.cjs +2 -1
- package/dist/completion/index.d.cts +2 -2
- package/dist/completion/index.d.ts +2 -2
- package/dist/completion/index.js +2 -2
- package/dist/{completion-yHz8Pdr7.js → completion-B04iiki9.js} +580 -31
- package/dist/completion-B04iiki9.js.map +1 -0
- package/dist/{completion-CAekGYS4.cjs → completion-BlZxMSeU.cjs} +598 -43
- package/dist/completion-BlZxMSeU.cjs.map +1 -0
- package/dist/docs/index.cjs +121 -65
- package/dist/docs/index.cjs.map +1 -1
- package/dist/docs/index.d.cts +5 -1
- package/dist/docs/index.d.cts.map +1 -1
- package/dist/docs/index.d.ts +5 -1
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +124 -67
- package/dist/docs/index.js.map +1 -1
- package/dist/{index-DPswv0Vt.d.cts → index-CPebddth.d.cts} +58 -4
- package/dist/index-CPebddth.d.cts.map +1 -0
- package/dist/{index-BLySW_2k.d.ts → index-DR9HLxIP.d.ts} +58 -4
- package/dist/index-DR9HLxIP.d.ts.map +1 -0
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +39 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +39 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{subcommand-router-C9ONv6Nq.cjs → log-collector-Cd2_mv87.cjs} +1 -59
- package/dist/log-collector-Cd2_mv87.cjs.map +1 -0
- package/dist/{subcommand-router--EUt6ftA.js → log-collector-Cu6MCtAx.js} +2 -43
- package/dist/log-collector-Cu6MCtAx.js.map +1 -0
- package/dist/prompt/clack/index.cjs +1 -1
- package/dist/prompt/clack/index.cjs.map +1 -1
- package/dist/prompt/clack/index.d.cts +1 -1
- package/dist/prompt/clack/index.d.cts.map +1 -1
- package/dist/prompt/clack/index.d.ts +1 -1
- package/dist/prompt/clack/index.d.ts.map +1 -1
- package/dist/prompt/clack/index.js.map +1 -1
- package/dist/prompt/index.d.cts +1 -1
- package/dist/prompt/index.d.cts.map +1 -1
- package/dist/prompt/index.d.ts +1 -1
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/inquirer/index.cjs +1 -1
- package/dist/prompt/inquirer/index.cjs.map +1 -1
- package/dist/prompt/inquirer/index.d.cts +1 -1
- package/dist/prompt/inquirer/index.d.cts.map +1 -1
- package/dist/prompt/inquirer/index.d.ts +1 -1
- package/dist/prompt/inquirer/index.d.ts.map +1 -1
- package/dist/prompt/inquirer/index.js.map +1 -1
- package/dist/prompt-BKHqGrFw.js.map +1 -1
- package/dist/prompt-aXfSf27y.cjs.map +1 -1
- package/dist/{runner-DSZw1AsW.js → runner-BHeCMEa5.js} +383 -57
- package/dist/runner-BHeCMEa5.js.map +1 -0
- package/dist/{runner-CY5fOsSh.cjs → runner-BcyR6Z8r.cjs} +434 -96
- package/dist/runner-BcyR6Z8r.cjs.map +1 -0
- package/dist/{lazy-AGV9Pkt5.cjs → subcommand-router-DQy0KZU-.cjs} +148 -4
- package/dist/subcommand-router-DQy0KZU-.cjs.map +1 -0
- package/dist/{lazy-DiMJSDMB.js → subcommand-router-XZBWe8HN.js} +118 -4
- package/dist/subcommand-router-XZBWe8HN.js.map +1 -0
- package/package.json +16 -16
- package/dist/arg-registry-CkPDokIu.d.ts.map +0 -1
- package/dist/arg-registry-r5wYN6qd.d.cts.map +0 -1
- package/dist/completion-CAekGYS4.cjs.map +0 -1
- package/dist/completion-yHz8Pdr7.js.map +0 -1
- package/dist/index-BLySW_2k.d.ts.map +0 -1
- package/dist/index-DPswv0Vt.d.cts.map +0 -1
- package/dist/lazy-AGV9Pkt5.cjs.map +0 -1
- package/dist/lazy-DiMJSDMB.js.map +0 -1
- package/dist/runner-CY5fOsSh.cjs.map +0 -1
- package/dist/runner-DSZw1AsW.js.map +0 -1
- package/dist/subcommand-router--EUt6ftA.js.map +0 -1
- package/dist/subcommand-router-C9ONv6Nq.cjs.map +0 -1
package/dist/docs/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as SubCommandValue, R as ExtractedFields, h as Example, l as AnyCommand, u as ArgsSchema, z as ResolvedFieldMeta } from "../arg-registry-
|
|
1
|
+
import { N as SubCommandValue, R as ExtractedFields, h as Example, l as AnyCommand, u as ArgsSchema, z as ResolvedFieldMeta } from "../arg-registry-MVWOAcvw.cjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
|
|
@@ -66,6 +66,8 @@ interface CommandInfo {
|
|
|
66
66
|
name: string;
|
|
67
67
|
/** Command description */
|
|
68
68
|
description?: string | undefined;
|
|
69
|
+
/** Alternative names (aliases) for this command */
|
|
70
|
+
aliases?: string[] | undefined;
|
|
69
71
|
/** Full command path (e.g., "my-cli config get") */
|
|
70
72
|
fullCommandPath: string;
|
|
71
73
|
/** Command path relative to root (e.g., "" for root, "config" for subcommand) */
|
|
@@ -105,6 +107,8 @@ interface SubCommandInfo {
|
|
|
105
107
|
name: string;
|
|
106
108
|
/** Subcommand description */
|
|
107
109
|
description?: string | undefined;
|
|
110
|
+
/** Alternative names (aliases) for this subcommand */
|
|
111
|
+
aliases?: string[] | undefined;
|
|
108
112
|
/** Full command path */
|
|
109
113
|
fullPath: string[];
|
|
110
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/executor/subcommand-router.ts","../../src/docs/render-args.ts","../../src/docs/types.ts","../../src/docs/default-renderers.ts","../../src/docs/doc-comparator.ts","../../src/docs/doc-generator.ts","../../src/docs/example-executor.ts","../../src/docs/golden-test.ts","../../src/docs/render-index.ts"],"mappings":";;;;;;;;;AASA;;iBAAsB,kBAAA,CAAmB,GAAA,EAAK,eAAA,GAAkB,OAAA,CAAQ,UAAA;;;;;;;KCD5D,SAAA,GAAY,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/executor/subcommand-router.ts","../../src/docs/render-args.ts","../../src/docs/types.ts","../../src/docs/default-renderers.ts","../../src/docs/doc-comparator.ts","../../src/docs/doc-generator.ts","../../src/docs/example-executor.ts","../../src/docs/golden-test.ts","../../src/docs/render-index.ts"],"mappings":";;;;;;;;;AASA;;iBAAsB,kBAAA,CAAmB,GAAA,EAAK,eAAA,GAAkB,OAAA,CAAQ,UAAA;;;;;;;KCD5D,SAAA,GAAY,MAAM,SAAS,CAAA,CAAE,OAAA;;;;KAK7B,gBAAA;EDJoD,6DCM9D,OAAO;AAAA;;;;;;ADNyE;;;;ACDlF;;;;;;;;AAAgD;AAKhD;;;;AAES;iBAuCO,eAAA,CAAgB,IAAA,EAAM,SAAA,EAAW,OAAA,GAAU,gBAAgB;;;;KCjD/D,YAAA;AFIZ;;;AAAA,KECY,mBAAA;EFD4D,4DEGtE,YAAA,GAAe,YAAY,EFH0C;EEKrE,QAAA;AAAA;;;;UAMe,WAAA;EFXiE;EEahF,IAAA;;EAEA,WAAA;EDhBU;ECkBV,OAAA;;EAEA,eAAA;EDpBsB;ECsBtB,WAAA;EDtBuC;ECwBvC,KAAA;EDxB8C;EC0B9C,cAAA,EAAgB,iBAAA;EDrBU;ECuB1B,OAAA,EAAS,iBAAA;EDrBF;ECuBP,WAAA,EAAa,cAAA;EDgBC;ECdd,SAAA,EAAW,eAAA;;EAEX,OAAA,EAAS,UAAA;EDY2B;ECVpC,KAAA;EDU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C,WAAA,URhB8D;EQkB9D,QAAA,YRlBqE;EQoBrE,OAAA;AAAA;;;ARpBgF;;;;ACDlF;;;;;;;;AAAgD;AAKhD;;;;AAES;AAuCT;;;;;;;;;AAA2E;iBOuGrD,kBAAA,CACpB,OAAA,EAAS,UAAA,EACT,UAAA,EAAY,eAAA,IACZ,OAAA,GAAU,mBAAA,GACT,OAAA"}
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as SubCommandValue, R as ExtractedFields, h as Example, l as AnyCommand, u as ArgsSchema, z as ResolvedFieldMeta } from "../arg-registry-
|
|
1
|
+
import { N as SubCommandValue, R as ExtractedFields, h as Example, l as AnyCommand, u as ArgsSchema, z as ResolvedFieldMeta } from "../arg-registry-Cd6xnjHa.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
|
|
@@ -66,6 +66,8 @@ interface CommandInfo {
|
|
|
66
66
|
name: string;
|
|
67
67
|
/** Command description */
|
|
68
68
|
description?: string | undefined;
|
|
69
|
+
/** Alternative names (aliases) for this command */
|
|
70
|
+
aliases?: string[] | undefined;
|
|
69
71
|
/** Full command path (e.g., "my-cli config get") */
|
|
70
72
|
fullCommandPath: string;
|
|
71
73
|
/** Command path relative to root (e.g., "" for root, "config" for subcommand) */
|
|
@@ -105,6 +107,8 @@ interface SubCommandInfo {
|
|
|
105
107
|
name: string;
|
|
106
108
|
/** Subcommand description */
|
|
107
109
|
description?: string | undefined;
|
|
110
|
+
/** Alternative names (aliases) for this subcommand */
|
|
111
|
+
aliases?: string[] | undefined;
|
|
108
112
|
/** Full command path */
|
|
109
113
|
fullPath: string[];
|
|
110
114
|
}
|
package/dist/docs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/executor/subcommand-router.ts","../../src/docs/render-args.ts","../../src/docs/types.ts","../../src/docs/default-renderers.ts","../../src/docs/doc-comparator.ts","../../src/docs/doc-generator.ts","../../src/docs/example-executor.ts","../../src/docs/golden-test.ts","../../src/docs/render-index.ts"],"mappings":";;;;;;;;;AASA;;iBAAsB,kBAAA,CAAmB,GAAA,EAAK,eAAA,GAAkB,OAAA,CAAQ,UAAA;;;;;;;KCD5D,SAAA,GAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/executor/subcommand-router.ts","../../src/docs/render-args.ts","../../src/docs/types.ts","../../src/docs/default-renderers.ts","../../src/docs/doc-comparator.ts","../../src/docs/doc-generator.ts","../../src/docs/example-executor.ts","../../src/docs/golden-test.ts","../../src/docs/render-index.ts"],"mappings":";;;;;;;;;AASA;;iBAAsB,kBAAA,CAAmB,GAAA,EAAK,eAAA,GAAkB,OAAA,CAAQ,UAAA;;;;;;;KCD5D,SAAA,GAAY,MAAM,SAAS,CAAA,CAAE,OAAA;;;;KAK7B,gBAAA;EDJoD,6DCM9D,OAAO;AAAA;;;;;;ADNyE;;;;ACDlF;;;;;;;;AAAgD;AAKhD;;;;AAES;iBAuCO,eAAA,CAAgB,IAAA,EAAM,SAAA,EAAW,OAAA,GAAU,gBAAgB;;;;KCjD/D,YAAA;AFIZ;;;AAAA,KECY,mBAAA;EFD4D,4DEGtE,YAAA,GAAe,YAAY,EFH0C;EEKrE,QAAA;AAAA;;;;UAMe,WAAA;EFXiE;EEahF,IAAA;;EAEA,WAAA;EDhBU;ECkBV,OAAA;;EAEA,eAAA;EDpBsB;ECsBtB,WAAA;EDtBuC;ECwBvC,KAAA;EDxB8C;EC0B9C,cAAA,EAAgB,iBAAA;EDrBU;ECuB1B,OAAA,EAAS,iBAAA;EDrBF;ECuBP,WAAA,EAAa,cAAA;EDgBC;ECdd,SAAA,EAAW,eAAA;;EAEX,OAAA,EAAS,UAAA;EDY2B;ECVpC,KAAA;EDUyD;ECRzD,QAAA;EDQyE;ECNzE,OAAA,GAAU,MAAA;;EAEV,QAAA,GAAW,OAAA;;EAEX,c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;;;;;AAAgD;AAKhD;;;;AAES;AAuCT;;;;;;;;;AAA2E;iBOuGrD,kBAAA,CACpB,OAAA,EAAS,UAAA,EACT,UAAA,EAAY,eAAA,IACZ,OAAA,GAAU,mBAAA,GACT,OAAA"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as getExtractedFields, l as extractFields, r as resolveLazyCommand } from "../subcommand-router-XZBWe8HN.js";
|
|
2
|
+
import { t as createLogCollector } from "../log-collector-Cu6MCtAx.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { isDeepStrictEqual } from "node:util";
|
|
5
4
|
import * as fs from "node:fs";
|
|
6
|
-
import * as path from "node:path";
|
|
5
|
+
import * as path$1 from "node:path";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { isDeepStrictEqual } from "node:util";
|
|
7
8
|
|
|
8
9
|
//#region src/docs/types.ts
|
|
9
10
|
/**
|
|
@@ -111,6 +112,13 @@ function escapeTableCell$2(str) {
|
|
|
111
112
|
return str.replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
115
|
+
* Marker appended to a custom negation row/line so readers can see which
|
|
116
|
+
* positive flag it negates (e.g. `--monochrome` → `(↔ \`--color\`)`).
|
|
117
|
+
*/
|
|
118
|
+
function negationRelationMarker(opt) {
|
|
119
|
+
return `(↔ \`--${opt.cliName}\`)`;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
114
122
|
* Format default value for display
|
|
115
123
|
*/
|
|
116
124
|
function formatDefaultValue$1(value) {
|
|
@@ -171,25 +179,39 @@ function resolvePlaceholder(opt) {
|
|
|
171
179
|
}
|
|
172
180
|
/**
|
|
173
181
|
* Format option name for table display (e.g., `--dry-run` or `--port <PORT>`)
|
|
182
|
+
*
|
|
183
|
+
* Boolean fields with a custom inline `negation` (no separate description) are
|
|
184
|
+
* shown as `\`--cache\` / \`--disable-cache\``.
|
|
174
185
|
*/
|
|
175
186
|
function formatOptionName(opt) {
|
|
176
187
|
const placeholder = resolvePlaceholder(opt);
|
|
177
|
-
|
|
188
|
+
if (opt.type === "boolean") {
|
|
189
|
+
const positive = `\`--${opt.cliName}\``;
|
|
190
|
+
if (opt.negationDisplay && !opt.negationDescription) return `${positive} / \`--${opt.negationDisplay}\``;
|
|
191
|
+
return positive;
|
|
192
|
+
}
|
|
193
|
+
return `\`--${opt.cliName} <${placeholder}>\``;
|
|
178
194
|
}
|
|
179
195
|
/**
|
|
180
|
-
* Format option flags for list display (uses kebab-case cliName)
|
|
196
|
+
* Format option flags for list display (uses kebab-case cliName).
|
|
197
|
+
* Aliases are joined with `, `; the inline negation (when no separate
|
|
198
|
+
* `negationDescription` is set) is appended with ` / ` so it stays
|
|
199
|
+
* visually distinct from aliases, matching help and table output.
|
|
181
200
|
*/
|
|
182
201
|
function formatOptionFlags(opt) {
|
|
183
202
|
const placeholder = resolvePlaceholder(opt);
|
|
184
203
|
const longFlag = opt.type === "boolean" ? `--${opt.cliName}` : `--${opt.cliName} <${placeholder}>`;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
204
|
+
const parts = [];
|
|
205
|
+
if (opt.alias) {
|
|
206
|
+
for (const a of opt.alias) if (a.length === 1) parts.push(`\`-${a}\``);
|
|
207
|
+
}
|
|
208
|
+
parts.push(`\`${longFlag}\``);
|
|
209
|
+
if (opt.alias) {
|
|
210
|
+
for (const a of opt.alias) if (a.length > 1) parts.push(`\`--${a}\``);
|
|
211
|
+
}
|
|
212
|
+
const aliasJoined = parts.join(", ");
|
|
213
|
+
if (opt.type === "boolean" && opt.negationDisplay && !opt.negationDescription) return `${aliasJoined} / \`--${opt.negationDisplay}\``;
|
|
214
|
+
return aliasJoined;
|
|
193
215
|
}
|
|
194
216
|
/**
|
|
195
217
|
* Format aliases for a markdown table cell
|
|
@@ -241,6 +263,12 @@ function renderOptionsTable(info) {
|
|
|
241
263
|
const envNames = formatEnvNames(opt.env);
|
|
242
264
|
lines.push(`| ${optionName} | ${alias} | ${desc} | ${required} | ${defaultVal} | ${envNames} |`);
|
|
243
265
|
} else lines.push(`| ${optionName} | ${alias} | ${desc} | ${required} | ${defaultVal} |`);
|
|
266
|
+
if (opt.type === "boolean" && opt.negationDisplay && opt.negationDescription) {
|
|
267
|
+
const negName = `\`--${opt.negationDisplay}\``;
|
|
268
|
+
const negDesc = `${escapeTableCell$2(opt.negationDescription)} ${negationRelationMarker(opt)}`;
|
|
269
|
+
if (hasEnv) lines.push(`| ${negName} | - | ${negDesc} | ${required} | - | - |`);
|
|
270
|
+
else lines.push(`| ${negName} | - | ${negDesc} | ${required} | - |`);
|
|
271
|
+
}
|
|
244
272
|
}
|
|
245
273
|
return lines.join("\n");
|
|
246
274
|
}
|
|
@@ -265,6 +293,7 @@ function renderOptionsList(info) {
|
|
|
265
293
|
const defaultVal = opt.defaultValue !== void 0 ? ` (default: ${JSON.stringify(opt.defaultValue)})` : "";
|
|
266
294
|
const envInfo = formatEnvInfo(opt.env);
|
|
267
295
|
lines.push(`- ${flags}${desc}${required}${defaultVal}${envInfo}`);
|
|
296
|
+
if (opt.type === "boolean" && opt.negationDisplay && opt.negationDescription) lines.push(`- \`--${opt.negationDisplay}\` - ${opt.negationDescription} ${negationRelationMarker(opt)}`);
|
|
268
297
|
}
|
|
269
298
|
return lines.join("\n");
|
|
270
299
|
}
|
|
@@ -275,40 +304,19 @@ function generateAnchor$1(commandPath) {
|
|
|
275
304
|
return commandPath.join("-").toLowerCase();
|
|
276
305
|
}
|
|
277
306
|
/**
|
|
278
|
-
* Generate relative path from one file to another
|
|
307
|
+
* Generate relative path from one file to another.
|
|
308
|
+
* Always emits forward slashes so Markdown links remain portable across OSes.
|
|
279
309
|
*/
|
|
280
310
|
function getRelativePath(from, to) {
|
|
281
|
-
const
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
while (commonLength < fromParts.length && commonLength < toParts.length - 1 && fromParts[commonLength] === toParts[commonLength]) commonLength++;
|
|
285
|
-
const upCount = fromParts.length - commonLength;
|
|
286
|
-
return [...Array(upCount).fill(".."), ...toParts.slice(commonLength)].join("/") || (toParts[toParts.length - 1] ?? "");
|
|
311
|
+
const fromPosix = from.replace(/\\/g, "/");
|
|
312
|
+
const toPosix = to.replace(/\\/g, "/");
|
|
313
|
+
return path.posix.relative(path.posix.dirname(fromPosix), toPosix);
|
|
287
314
|
}
|
|
288
315
|
/**
|
|
289
316
|
* Render subcommands as table
|
|
290
317
|
*/
|
|
291
318
|
function renderSubcommandsTable(info, generateAnchors = true) {
|
|
292
|
-
|
|
293
|
-
const lines = [];
|
|
294
|
-
lines.push("| Command | Description |");
|
|
295
|
-
lines.push("|---------|-------------|");
|
|
296
|
-
const currentFile = info.filePath;
|
|
297
|
-
const fileMap = info.fileMap;
|
|
298
|
-
for (const sub of info.subCommands) {
|
|
299
|
-
const fullName = sub.fullPath.join(" ");
|
|
300
|
-
const desc = escapeTableCell$2(sub.description ?? "");
|
|
301
|
-
const subCommandPath = sub.fullPath.join(" ");
|
|
302
|
-
if (generateAnchors) {
|
|
303
|
-
const anchor = generateAnchor$1(sub.fullPath);
|
|
304
|
-
const subFile = fileMap?.[subCommandPath];
|
|
305
|
-
if (currentFile && subFile && currentFile !== subFile) {
|
|
306
|
-
const relativePath = getRelativePath(currentFile, subFile);
|
|
307
|
-
lines.push(`| [\`${fullName}\`](${relativePath}#${anchor}) | ${desc} |`);
|
|
308
|
-
} else lines.push(`| [\`${fullName}\`](#${anchor}) | ${desc} |`);
|
|
309
|
-
} else lines.push(`| \`${fullName}\` | ${desc} |`);
|
|
310
|
-
}
|
|
311
|
-
return lines.join("\n");
|
|
319
|
+
return renderSubcommandsTableFromArray(info.subCommands, info, generateAnchors);
|
|
312
320
|
}
|
|
313
321
|
/**
|
|
314
322
|
* Render options from array as table
|
|
@@ -334,6 +342,12 @@ function renderOptionsTableFromArray(options) {
|
|
|
334
342
|
const envNames = formatEnvNames(opt.env);
|
|
335
343
|
lines.push(`| ${optionName} | ${alias} | ${desc} | ${required} | ${defaultVal} | ${envNames} |`);
|
|
336
344
|
} else lines.push(`| ${optionName} | ${alias} | ${desc} | ${required} | ${defaultVal} |`);
|
|
345
|
+
if (opt.type === "boolean" && opt.negationDisplay && opt.negationDescription) {
|
|
346
|
+
const negName = `\`--${opt.negationDisplay}\``;
|
|
347
|
+
const negDesc = `${escapeTableCell$2(opt.negationDescription)} ${negationRelationMarker(opt)}`;
|
|
348
|
+
if (hasEnv) lines.push(`| ${negName} | - | ${negDesc} | ${required} | - | - |`);
|
|
349
|
+
else lines.push(`| ${negName} | - | ${negDesc} | ${required} | - |`);
|
|
350
|
+
}
|
|
337
351
|
}
|
|
338
352
|
return lines.join("\n");
|
|
339
353
|
}
|
|
@@ -415,6 +429,7 @@ function renderOptionsListFromArray(options) {
|
|
|
415
429
|
const defaultVal = opt.defaultValue !== void 0 ? ` (default: ${JSON.stringify(opt.defaultValue)})` : "";
|
|
416
430
|
const envInfo = formatEnvInfo(opt.env);
|
|
417
431
|
lines.push(`- ${flags}${desc}${required}${defaultVal}${envInfo}`);
|
|
432
|
+
if (opt.type === "boolean" && opt.negationDisplay && opt.negationDescription) lines.push(`- \`--${opt.negationDisplay}\` - ${opt.negationDescription} ${negationRelationMarker(opt)}`);
|
|
418
433
|
}
|
|
419
434
|
return lines.join("\n");
|
|
420
435
|
}
|
|
@@ -451,23 +466,31 @@ function renderArgumentsListFromArray(args) {
|
|
|
451
466
|
*/
|
|
452
467
|
function renderSubcommandsTableFromArray(subcommands, info, generateAnchors = true) {
|
|
453
468
|
if (subcommands.length === 0) return "";
|
|
469
|
+
const hasAliases = subcommands.some((s) => s.aliases && s.aliases.length > 0);
|
|
454
470
|
const lines = [];
|
|
455
|
-
|
|
456
|
-
|
|
471
|
+
if (hasAliases) {
|
|
472
|
+
lines.push("| Command | Aliases | Description |");
|
|
473
|
+
lines.push("|---------|---------|-------------|");
|
|
474
|
+
} else {
|
|
475
|
+
lines.push("| Command | Description |");
|
|
476
|
+
lines.push("|---------|-------------|");
|
|
477
|
+
}
|
|
457
478
|
const currentFile = info.filePath;
|
|
458
479
|
const fileMap = info.fileMap;
|
|
459
480
|
for (const sub of subcommands) {
|
|
460
481
|
const fullName = sub.fullPath.join(" ");
|
|
461
482
|
const desc = escapeTableCell$2(sub.description ?? "");
|
|
462
483
|
const subCommandPath = sub.fullPath.join(" ");
|
|
484
|
+
const aliasCell = hasAliases ? sub.aliases && sub.aliases.length > 0 ? sub.aliases.map((a) => `\`${escapeTableCell$2(a)}\``).join(", ") : "-" : "";
|
|
485
|
+
let cmdCell;
|
|
463
486
|
if (generateAnchors) {
|
|
464
487
|
const anchor = generateAnchor$1(sub.fullPath);
|
|
465
488
|
const subFile = fileMap?.[subCommandPath];
|
|
466
|
-
if (currentFile && subFile && currentFile !== subFile) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
489
|
+
if (currentFile && subFile && currentFile !== subFile) cmdCell = `[\`${fullName}\`](${getRelativePath(currentFile, subFile)}#${anchor})`;
|
|
490
|
+
else cmdCell = `[\`${fullName}\`](#${anchor})`;
|
|
491
|
+
} else cmdCell = `\`${fullName}\``;
|
|
492
|
+
if (hasAliases) lines.push(`| ${cmdCell} | ${aliasCell} | ${desc} |`);
|
|
493
|
+
else lines.push(`| ${cmdCell} | ${desc} |`);
|
|
471
494
|
}
|
|
472
495
|
return lines.join("\n");
|
|
473
496
|
}
|
|
@@ -534,14 +557,19 @@ function createCommandRenderer(options = {}) {
|
|
|
534
557
|
const h = "#".repeat(effectiveLevel);
|
|
535
558
|
const title = info.commandPath || info.name;
|
|
536
559
|
sections.push(wrapWithMarker("heading", scope, `${h} ${title}`));
|
|
537
|
-
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
560
|
+
{
|
|
561
|
+
const parts = [];
|
|
562
|
+
if (info.description) parts.push(info.description);
|
|
563
|
+
if (info.aliases && info.aliases.length > 0) parts.push(`**Aliases:** ${info.aliases.map((a) => `\`${a}\``).join(", ")}`);
|
|
564
|
+
if (parts.length > 0) {
|
|
565
|
+
const context = {
|
|
566
|
+
content: parts.join("\n\n"),
|
|
567
|
+
heading: "",
|
|
568
|
+
info
|
|
569
|
+
};
|
|
570
|
+
const content = customRenderDescription ? customRenderDescription(context) : context.content;
|
|
571
|
+
if (content) sections.push(wrapWithMarker("description", scope, content));
|
|
572
|
+
}
|
|
545
573
|
}
|
|
546
574
|
{
|
|
547
575
|
const context = {
|
|
@@ -653,8 +681,11 @@ function createCommandRenderer(options = {}) {
|
|
|
653
681
|
* Default renderers presets
|
|
654
682
|
*/
|
|
655
683
|
const defaultRenderers = {
|
|
684
|
+
/** Standard command documentation */
|
|
656
685
|
command: (options) => createCommandRenderer(options),
|
|
686
|
+
/** Table style options (default) */
|
|
657
687
|
tableStyle: createCommandRenderer({ optionStyle: "table" }),
|
|
688
|
+
/** List style options */
|
|
658
689
|
listStyle: createCommandRenderer({ optionStyle: "list" })
|
|
659
690
|
};
|
|
660
691
|
|
|
@@ -664,7 +695,7 @@ const defaultRenderers = {
|
|
|
664
695
|
* Compare generated content with existing file
|
|
665
696
|
*/
|
|
666
697
|
function compareWithExisting(generatedContent, filePath) {
|
|
667
|
-
const absolutePath = path.resolve(filePath);
|
|
698
|
+
const absolutePath = path$1.resolve(filePath);
|
|
668
699
|
if (!fs.existsSync(absolutePath)) return {
|
|
669
700
|
match: false,
|
|
670
701
|
fileExists: false
|
|
@@ -729,8 +760,8 @@ function formatDiff(expected, actual) {
|
|
|
729
760
|
* Write content to file, creating directories if needed
|
|
730
761
|
*/
|
|
731
762
|
function writeFile(filePath, content) {
|
|
732
|
-
const absolutePath = path.resolve(filePath);
|
|
733
|
-
const dir = path.dirname(absolutePath);
|
|
763
|
+
const absolutePath = path$1.resolve(filePath);
|
|
764
|
+
const dir = path$1.dirname(absolutePath);
|
|
734
765
|
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
735
766
|
fs.writeFileSync(absolutePath, content, "utf-8");
|
|
736
767
|
}
|
|
@@ -739,7 +770,7 @@ function writeFile(filePath, content) {
|
|
|
739
770
|
* Returns null if file does not exist
|
|
740
771
|
*/
|
|
741
772
|
function readFile(filePath) {
|
|
742
|
-
const absolutePath = path.resolve(filePath);
|
|
773
|
+
const absolutePath = path$1.resolve(filePath);
|
|
743
774
|
if (!fs.existsSync(absolutePath)) return null;
|
|
744
775
|
return fs.readFileSync(absolutePath, "utf-8");
|
|
745
776
|
}
|
|
@@ -749,7 +780,7 @@ function readFile(filePath) {
|
|
|
749
780
|
* @param fileSystem - Optional fs implementation (useful when fs is mocked)
|
|
750
781
|
*/
|
|
751
782
|
function deleteFile(filePath, fileSystem = fs) {
|
|
752
|
-
const absolutePath = path.resolve(filePath);
|
|
783
|
+
const absolutePath = path$1.resolve(filePath);
|
|
753
784
|
if (fileSystem.existsSync(absolutePath)) fileSystem.unlinkSync(absolutePath);
|
|
754
785
|
}
|
|
755
786
|
|
|
@@ -769,12 +800,14 @@ async function buildCommandInfo(command, rootName, commandPath = []) {
|
|
|
769
800
|
subCommands.push({
|
|
770
801
|
name,
|
|
771
802
|
description: resolved.description,
|
|
803
|
+
aliases: resolved.aliases,
|
|
772
804
|
fullPath
|
|
773
805
|
});
|
|
774
806
|
}
|
|
775
807
|
return {
|
|
776
808
|
name: command.name ?? "",
|
|
777
809
|
description: command.description,
|
|
810
|
+
aliases: command.aliases,
|
|
778
811
|
fullCommandPath: commandPath.length > 0 ? `${rootName} ${commandPath.join(" ")}` : rootName,
|
|
779
812
|
commandPath: commandPath.join(" "),
|
|
780
813
|
depth: commandPath.length + 1,
|
|
@@ -838,7 +871,7 @@ async function executeSingleExample(example, rootCommand, commandPath) {
|
|
|
838
871
|
collector.start();
|
|
839
872
|
let success = true;
|
|
840
873
|
try {
|
|
841
|
-
const { runCommand } = await import("../runner-
|
|
874
|
+
const { runCommand } = await import("../runner-BHeCMEa5.js").then((n) => n.r);
|
|
842
875
|
const result = await runCommand(rootCommand, argv);
|
|
843
876
|
success = result.success;
|
|
844
877
|
if (!result.success && result.error) console.error(result.error.message);
|
|
@@ -986,7 +1019,11 @@ function renderFilteredTable(options, columns) {
|
|
|
986
1019
|
for (const col of columns) switch (col) {
|
|
987
1020
|
case "option": {
|
|
988
1021
|
const placeholder = opt.placeholder ?? opt.cliName.toUpperCase().replace(/-/g, "_");
|
|
989
|
-
|
|
1022
|
+
let optionName;
|
|
1023
|
+
if (opt.type === "boolean") {
|
|
1024
|
+
optionName = `\`--${opt.cliName}\``;
|
|
1025
|
+
if (opt.negationDisplay && !opt.negationDescription) optionName += ` / \`--${opt.negationDisplay}\``;
|
|
1026
|
+
} else optionName = `\`--${opt.cliName} <${placeholder}>\``;
|
|
990
1027
|
cells.push(optionName);
|
|
991
1028
|
break;
|
|
992
1029
|
}
|
|
@@ -1009,6 +1046,26 @@ function renderFilteredTable(options, columns) {
|
|
|
1009
1046
|
}
|
|
1010
1047
|
}
|
|
1011
1048
|
lines.push(`| ${cells.join(" | ")} |`);
|
|
1049
|
+
if (opt.type === "boolean" && opt.negationDisplay && opt.negationDescription) {
|
|
1050
|
+
const negCells = [];
|
|
1051
|
+
for (const col of columns) switch (col) {
|
|
1052
|
+
case "option":
|
|
1053
|
+
negCells.push(`\`--${opt.negationDisplay}\``);
|
|
1054
|
+
break;
|
|
1055
|
+
case "description":
|
|
1056
|
+
negCells.push(`${escapeTableCell$1(opt.negationDescription)} ${negationRelationMarker(opt)}`);
|
|
1057
|
+
break;
|
|
1058
|
+
case "required":
|
|
1059
|
+
negCells.push(opt.required ? "Yes" : "No");
|
|
1060
|
+
break;
|
|
1061
|
+
case "alias":
|
|
1062
|
+
case "default":
|
|
1063
|
+
case "env":
|
|
1064
|
+
negCells.push("-");
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
lines.push(`| ${negCells.join(" | ")} |`);
|
|
1068
|
+
}
|
|
1012
1069
|
}
|
|
1013
1070
|
return lines.join("\n");
|
|
1014
1071
|
}
|
|
@@ -1568,12 +1625,12 @@ function deriveIndexFromFiles(files, rootDocPath, allCommands, ignores) {
|
|
|
1568
1625
|
for (const [filePath, fileConfigRaw] of Object.entries(files)) {
|
|
1569
1626
|
const { commandPaths, topLevelCommands } = resolveConfiguredCommandPaths(fileConfigRaw, allCommands, ignores);
|
|
1570
1627
|
if (commandPaths.length === 0) continue;
|
|
1571
|
-
const docPath = "./" + path.relative(path.dirname(rootDocPath), filePath).replace(/\\/g, "/");
|
|
1628
|
+
const docPath = "./" + path$1.relative(path$1.dirname(rootDocPath), filePath).replace(/\\/g, "/");
|
|
1572
1629
|
const firstCmdPath = commandPaths[0];
|
|
1573
1630
|
const cmdInfo = firstCmdPath !== void 0 ? allCommands.get(firstCmdPath) : void 0;
|
|
1574
1631
|
const fileConfig = Array.isArray(fileConfigRaw) ? void 0 : fileConfigRaw;
|
|
1575
1632
|
categories.push({
|
|
1576
|
-
title: fileConfig?.title ?? cmdInfo?.name ?? path.basename(filePath, path.extname(filePath)),
|
|
1633
|
+
title: fileConfig?.title ?? cmdInfo?.name ?? path$1.basename(filePath, path$1.extname(filePath)),
|
|
1577
1634
|
description: fileConfig?.description ?? cmdInfo?.description ?? "",
|
|
1578
1635
|
commands: topLevelCommands,
|
|
1579
1636
|
docPath
|
|
@@ -1649,7 +1706,7 @@ async function generateIndexSection(categories, command, scope, options) {
|
|
|
1649
1706
|
* Normalize a doc file path for equivalence checks.
|
|
1650
1707
|
*/
|
|
1651
1708
|
function normalizeDocPathForComparison(filePath) {
|
|
1652
|
-
return path.resolve(filePath);
|
|
1709
|
+
return path$1.resolve(filePath);
|
|
1653
1710
|
}
|
|
1654
1711
|
/**
|
|
1655
1712
|
* Process global options marker in file content
|
|
@@ -2176,7 +2233,7 @@ async function generateDoc(config) {
|
|
|
2176
2233
|
if (globalOptionsResult.wasUpdated) markerUpdated = true;
|
|
2177
2234
|
}
|
|
2178
2235
|
const derivedCategories = deriveIndexFromFiles(files, rootDocFilePath, allCommands, ignores);
|
|
2179
|
-
const indexScope = path.relative(process.cwd(), rootDocFilePath);
|
|
2236
|
+
const indexScope = path$1.relative(process.cwd(), rootDocFilePath).replace(/\\/g, "/");
|
|
2180
2237
|
const indexResult = await processIndexMarker(content, derivedCategories, command, indexScope, updateMode, formatter, rootDoc.index);
|
|
2181
2238
|
content = indexResult.content;
|
|
2182
2239
|
rootDocDiffs.push(...indexResult.diffs);
|