politty 0.9.1 → 0.9.2
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/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as runMain } from "./runner-
|
|
2
|
+
import { n as runMain } from "./runner-BmWR9TLM.js";
|
|
3
3
|
import { t as arg } from "./arg-registry-BeLLAW5-.js";
|
|
4
4
|
import { n as defineCommand } from "./command-B4yA4LXX.js";
|
|
5
5
|
import { p as generateBundledCompletionWorker } from "./completion-DwTFOtQk.js";
|
package/dist/docs/index.js
CHANGED
|
@@ -131,7 +131,8 @@ function formatDefaultValue$1(value) {
|
|
|
131
131
|
function renderUsage(info) {
|
|
132
132
|
const parts = [info.fullCommandPath];
|
|
133
133
|
if (info.options.length > 0) parts.push("[options]");
|
|
134
|
-
if (info.subCommands.length > 0) parts.push("[command]");
|
|
134
|
+
if (info.subCommands.length > 0) if (info.command.run) parts.push("[command]");
|
|
135
|
+
else parts.push("<command>");
|
|
135
136
|
for (const arg of info.positionalArgs) if (arg.required) parts.push(`<${arg.name}>`);
|
|
136
137
|
else parts.push(`[${arg.name}]`);
|
|
137
138
|
return parts.join(" ");
|
|
@@ -874,7 +875,7 @@ async function executeSingleExample(example, rootCommand, commandPath) {
|
|
|
874
875
|
collector.start();
|
|
875
876
|
let success = true;
|
|
876
877
|
try {
|
|
877
|
-
const { runCommand } = await import("../runner-
|
|
878
|
+
const { runCommand } = await import("../runner-BmWR9TLM.js").then((n) => n.r);
|
|
878
879
|
const result = await runCommand(rootCommand, argv);
|
|
879
880
|
success = result.success;
|
|
880
881
|
if (!result.success && result.error) console.error(result.error.message);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as renderMarkdown, S as renderInline, _ as DuplicateFieldError, a as parseArgv, b as ReservedAliasError, c as validateCommand, d as validateDuplicateFields, f as validateDuplicateNegations, g as DuplicateAliasError, h as CaseVariantCollisionError, i as formatValidationErrors, l as validateCrossSchemaCollisions, m as validateReservedAliases, n as runMain, o as formatCommandValidationErrors, p as validatePositionalConfig, s as validateCaseVariantCollisions, t as runCommand, u as validateDuplicateAliases, v as DuplicateNegationError, w as createDualCaseProxy, x as generateHelp, y as PositionalConfigError } from "./runner-
|
|
1
|
+
import { C as renderMarkdown, S as renderInline, _ as DuplicateFieldError, a as parseArgv, b as ReservedAliasError, c as validateCommand, d as validateDuplicateFields, f as validateDuplicateNegations, g as DuplicateAliasError, h as CaseVariantCollisionError, i as formatValidationErrors, l as validateCrossSchemaCollisions, m as validateReservedAliases, n as runMain, o as formatCommandValidationErrors, p as validatePositionalConfig, s as validateCaseVariantCollisions, t as runCommand, u as validateDuplicateAliases, v as DuplicateNegationError, w as createDualCaseProxy, x as generateHelp, y as PositionalConfigError } from "./runner-BmWR9TLM.js";
|
|
2
2
|
import { t as arg } from "./arg-registry-BeLLAW5-.js";
|
|
3
3
|
import { n as defineCommand, t as createDefineCommand } from "./command-B4yA4LXX.js";
|
|
4
4
|
import { a as toCamelCase, f as isLazyCommand, i as getUnknownKeysMode, o as toKebabCase, p as lazy, t as extractFields } from "./schema-extractor-CVHWm23M.js";
|
|
@@ -576,10 +576,12 @@ function renderUsageLine(command, context) {
|
|
|
576
576
|
if (extracted) {
|
|
577
577
|
const positionals = extracted.fields.filter((a) => a.positional);
|
|
578
578
|
if (extracted.fields.filter((a) => !a.positional).length > 0) parts.push(styles.placeholder("[options]"));
|
|
579
|
-
if (command.subCommands && getVisibleSubcommandEntries(command.subCommands).length > 0) parts.push(styles.placeholder("[command]"));
|
|
579
|
+
if (command.subCommands && getVisibleSubcommandEntries(command.subCommands).length > 0) if (command.run) parts.push(styles.placeholder("[command]"));
|
|
580
|
+
else parts.push(styles.option("<command>"));
|
|
580
581
|
for (const arg of positionals) if (arg.required) parts.push(styles.option(`<${arg.name}>`));
|
|
581
582
|
else parts.push(styles.placeholder(`[${arg.name}]`));
|
|
582
|
-
} else if (command.subCommands && getVisibleSubcommandEntries(command.subCommands).length > 0) parts.push(styles.placeholder("[command]"));
|
|
583
|
+
} else if (command.subCommands && getVisibleSubcommandEntries(command.subCommands).length > 0) if (command.run) parts.push(styles.placeholder("[command]"));
|
|
584
|
+
else parts.push(styles.option("<command>"));
|
|
583
585
|
return parts.join(" ");
|
|
584
586
|
}
|
|
585
587
|
/**
|
|
@@ -2647,4 +2649,4 @@ function extractAndValidateGlobal(options) {
|
|
|
2647
2649
|
|
|
2648
2650
|
//#endregion
|
|
2649
2651
|
export { renderMarkdown as C, renderInline as S, DuplicateFieldError as _, parseArgv as a, ReservedAliasError as b, validateCommand as c, validateDuplicateFields as d, validateDuplicateNegations as f, DuplicateAliasError as g, CaseVariantCollisionError as h, formatValidationErrors as i, validateCrossSchemaCollisions as l, validateReservedAliases as m, runMain as n, formatCommandValidationErrors as o, validatePositionalConfig as p, runner_exports as r, validateCaseVariantCollisions as s, runCommand as t, validateDuplicateAliases as u, DuplicateNegationError as v, createDualCaseProxy as w, generateHelp as x, PositionalConfigError as y };
|
|
2650
|
-
//# sourceMappingURL=runner-
|
|
2652
|
+
//# sourceMappingURL=runner-BmWR9TLM.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "politty",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "A lightweight CLI framework inspired by citty with zod v4 registry integration for type-safe metadata management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"argument-parser",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@inquirer/prompts": "8.5.2",
|
|
70
70
|
"@quansync/fs": "1.0.0",
|
|
71
71
|
"@types/node": "25.9.3",
|
|
72
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
72
|
+
"@typescript/native-preview": "7.0.0-dev.20260611.2",
|
|
73
73
|
"@vitest/coverage-v8": "4.1.8",
|
|
74
74
|
"knip": "6.16.1",
|
|
75
75
|
"lefthook": "2.1.9",
|