politty 0.4.12 → 0.4.13
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 +11 -8
- package/dist/{arg-registry-BlXeCM4p.d.cts → arg-registry-6E4C5MTC.d.ts} +186 -2
- package/dist/arg-registry-6E4C5MTC.d.ts.map +1 -0
- package/dist/{arg-registry-D0MimRYf.d.ts → arg-registry-CeIRoLaB.d.cts} +186 -2
- package/dist/arg-registry-CeIRoLaB.d.cts.map +1 -0
- package/dist/augment.d.cts +1 -1
- package/dist/augment.d.ts +1 -1
- package/dist/completion/index.cjs +1 -2
- package/dist/completion/index.d.cts +1 -1
- package/dist/completion/index.d.ts +1 -1
- package/dist/completion/index.js +1 -2
- package/dist/{completion-BADAzqT9.cjs → completion-D3LUac1o.cjs} +3 -3
- package/dist/completion-D3LUac1o.cjs.map +1 -0
- package/dist/{completion-Dj7ytbLu.js → completion-DzaT2YCN.js} +2 -2
- package/dist/completion-DzaT2YCN.js.map +1 -0
- package/dist/docs/index.cjs +32 -14
- package/dist/docs/index.cjs.map +1 -1
- package/dist/docs/index.d.cts +1 -2
- package/dist/docs/index.d.cts.map +1 -1
- package/dist/docs/index.d.ts +1 -2
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +32 -14
- package/dist/docs/index.js.map +1 -1
- package/dist/{index-CBGSQVm9.d.ts → index-BW02tH1-.d.cts} +2 -3
- package/dist/index-BW02tH1-.d.cts.map +1 -0
- package/dist/{index-f2-VIfCo.d.cts → index-C3UtsvgY.d.ts} +2 -3
- package/dist/index-C3UtsvgY.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +3 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{lazy-B_E2X0KR.cjs → lazy-qPy4cMnv.cjs} +8 -3
- package/dist/lazy-qPy4cMnv.cjs.map +1 -0
- package/dist/{lazy-D6nL_iKJ.js → lazy-xrzxwnru.js} +7 -2
- package/dist/lazy-xrzxwnru.js.map +1 -0
- package/dist/prompt/clack/index.cjs +34 -0
- package/dist/prompt/clack/index.cjs.map +1 -0
- package/dist/prompt/clack/index.d.cts +18 -0
- package/dist/prompt/clack/index.d.cts.map +1 -0
- package/dist/prompt/clack/index.d.ts +18 -0
- package/dist/prompt/clack/index.d.ts.map +1 -0
- package/dist/prompt/clack/index.js +32 -0
- package/dist/prompt/clack/index.js.map +1 -0
- package/dist/prompt/index.cjs +7 -0
- package/dist/prompt/index.d.cts +108 -0
- package/dist/prompt/index.d.cts.map +1 -0
- package/dist/prompt/index.d.ts +108 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +3 -0
- package/dist/prompt/inquirer/index.cjs +49 -0
- package/dist/prompt/inquirer/index.cjs.map +1 -0
- package/dist/prompt/inquirer/index.d.cts +18 -0
- package/dist/prompt/inquirer/index.d.cts.map +1 -0
- package/dist/prompt/inquirer/index.d.ts +18 -0
- package/dist/prompt/inquirer/index.d.ts.map +1 -0
- package/dist/prompt/inquirer/index.js +47 -0
- package/dist/prompt/inquirer/index.js.map +1 -0
- package/dist/prompt-BKHqGrFw.js +172 -0
- package/dist/prompt-BKHqGrFw.js.map +1 -0
- package/dist/prompt-aXfSf27y.cjs +196 -0
- package/dist/prompt-aXfSf27y.cjs.map +1 -0
- package/dist/{runner-Bx2S6_Id.js → runner-CnG-Ncz0.js} +17 -5
- package/dist/{runner-Bx2S6_Id.js.map → runner-CnG-Ncz0.js.map} +1 -1
- package/dist/{runner-U86FIDHT.cjs → runner-DA48D-3K.cjs} +17 -5
- package/dist/{runner-U86FIDHT.cjs.map → runner-DA48D-3K.cjs.map} +1 -1
- package/dist/{subcommand-router-Bu3YTw_f.js → subcommand-router-BhYVuS83.js} +2 -2
- package/dist/{subcommand-router-Bu3YTw_f.js.map → subcommand-router-BhYVuS83.js.map} +1 -1
- package/dist/{subcommand-router-BTOzDQnY.cjs → subcommand-router-BnHpqyRk.cjs} +2 -2
- package/dist/{subcommand-router-BTOzDQnY.cjs.map → subcommand-router-BnHpqyRk.cjs.map} +1 -1
- package/package.json +51 -9
- package/dist/arg-registry-BlXeCM4p.d.cts.map +0 -1
- package/dist/arg-registry-D0MimRYf.d.ts.map +0 -1
- package/dist/completion-BADAzqT9.cjs.map +0 -1
- package/dist/completion-Dj7ytbLu.js.map +0 -1
- package/dist/index-CBGSQVm9.d.ts.map +0 -1
- package/dist/index-f2-VIfCo.d.cts.map +0 -1
- package/dist/lazy-B_E2X0KR.cjs.map +0 -1
- package/dist/lazy-D6nL_iKJ.js.map +0 -1
- package/dist/schema-extractor-CAZi3kK1.d.ts +0 -117
- package/dist/schema-extractor-CAZi3kK1.d.ts.map +0 -1
- package/dist/schema-extractor-D-eGlm4W.d.cts +0 -117
- package/dist/schema-extractor-D-eGlm4W.d.cts.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const require_subcommand_router = require('./subcommand-router-
|
|
2
|
-
const require_lazy = require('./lazy-
|
|
3
|
-
let zod = require("zod");
|
|
1
|
+
const require_subcommand_router = require('./subcommand-router-BnHpqyRk.cjs');
|
|
2
|
+
const require_lazy = require('./lazy-qPy4cMnv.cjs');
|
|
4
3
|
let node_util = require("node:util");
|
|
5
4
|
let string_width = require("string-width");
|
|
6
5
|
string_width = require_subcommand_router.__toESM(string_width);
|
|
@@ -1983,6 +1982,7 @@ async function runMain(command, options = {}) {
|
|
|
1983
1982
|
handleSignals: true,
|
|
1984
1983
|
logger: options.logger,
|
|
1985
1984
|
globalArgs: options.globalArgs,
|
|
1985
|
+
prompt: options.prompt,
|
|
1986
1986
|
_globalExtracted: globalExtracted,
|
|
1987
1987
|
_globalCleanup: options.cleanup,
|
|
1988
1988
|
_context: {
|
|
@@ -2127,6 +2127,10 @@ async function runCommandInternal(command, argv, options = {}) {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
+
if (options.prompt) {
|
|
2131
|
+
const resolved = await options.prompt(accumulatedGlobalArgs, options._globalExtracted);
|
|
2132
|
+
Object.assign(accumulatedGlobalArgs, resolved);
|
|
2133
|
+
}
|
|
2130
2134
|
const globalValidation = validateArgs(accumulatedGlobalArgs, options.globalArgs);
|
|
2131
2135
|
if (!globalValidation.success) {
|
|
2132
2136
|
collector?.stop();
|
|
@@ -2150,7 +2154,15 @@ async function runCommandInternal(command, argv, options = {}) {
|
|
|
2150
2154
|
globalCleanup: options._globalCleanup
|
|
2151
2155
|
});
|
|
2152
2156
|
}
|
|
2153
|
-
|
|
2157
|
+
let argsToValidate = parseResult.rawArgs;
|
|
2158
|
+
if (options.prompt && parseResult.extractedFields) {
|
|
2159
|
+
const resolved = await options.prompt(argsToValidate, parseResult.extractedFields);
|
|
2160
|
+
argsToValidate = {
|
|
2161
|
+
...argsToValidate,
|
|
2162
|
+
...resolved
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
const validationResult = validateArgs(argsToValidate, command.args);
|
|
2154
2166
|
if (!validationResult.success) {
|
|
2155
2167
|
collector?.stop();
|
|
2156
2168
|
return {
|
|
@@ -2368,4 +2380,4 @@ Object.defineProperty(exports, 'validateReservedAliases', {
|
|
|
2368
2380
|
return validateReservedAliases;
|
|
2369
2381
|
}
|
|
2370
2382
|
});
|
|
2371
|
-
//# sourceMappingURL=runner-
|
|
2383
|
+
//# sourceMappingURL=runner-DA48D-3K.cjs.map
|