@optique/inquirer 1.0.11-dev.2640 → 1.0.11-dev.2654
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/index.cjs +3 -1
- package/dist/index.js +4 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -287,6 +287,7 @@ function prompt(parser, config) {
|
|
|
287
287
|
const result = await executePromptRaw();
|
|
288
288
|
return validatePromptedValue(result);
|
|
289
289
|
}
|
|
290
|
+
const getCliState = (state) => isPromptBindState(state) ? state.hasCliValue ? state.cliState : parser.initialState : state;
|
|
290
291
|
const promptedParser = {
|
|
291
292
|
mode: "async",
|
|
292
293
|
$valueType: parser.$valueType,
|
|
@@ -312,7 +313,7 @@ function prompt(parser, config) {
|
|
|
312
313
|
parse: (context) => {
|
|
313
314
|
const annotations = (0, __optique_core_annotations.getAnnotations)(context.state);
|
|
314
315
|
const hadCliValue = isPromptBindState(context.state) && context.state.hasCliValue;
|
|
315
|
-
const innerState =
|
|
316
|
+
const innerState = getCliState(context.state);
|
|
316
317
|
const baseInnerContext = innerState !== context.state ? {
|
|
317
318
|
...context,
|
|
318
319
|
state: innerState
|
|
@@ -476,6 +477,7 @@ function prompt(parser, config) {
|
|
|
476
477
|
configurable: true,
|
|
477
478
|
enumerable: false
|
|
478
479
|
});
|
|
480
|
+
(0, __optique_core_extension.delegateOptionParsing)(promptedParser, parser, getCliState);
|
|
479
481
|
return promptedParser;
|
|
480
482
|
}
|
|
481
483
|
/** Normalize choices to the format Inquirer.js expects. */
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Separator, checkbox, confirm, editor, expand, input, number, password, rawlist, select } from "@inquirer/prompts";
|
|
2
2
|
import { getAnnotations } from "@optique/core/annotations";
|
|
3
|
-
import { defineTraits, delegateSuggestNodes, getTraits, inheritAnnotations, injectAnnotations, mapSourceMetadata, unwrapInjectedAnnotationState, withAnnotationView } from "@optique/core/extension";
|
|
3
|
+
import { defineTraits, delegateOptionParsing, delegateSuggestNodes, getTraits, inheritAnnotations, injectAnnotations, mapSourceMetadata, unwrapInjectedAnnotationState, withAnnotationView } from "@optique/core/extension";
|
|
4
4
|
import { message } from "@optique/core/message";
|
|
5
5
|
|
|
6
6
|
//#region src/index.ts
|
|
@@ -264,6 +264,7 @@ function prompt(parser, config) {
|
|
|
264
264
|
const result = await executePromptRaw();
|
|
265
265
|
return validatePromptedValue(result);
|
|
266
266
|
}
|
|
267
|
+
const getCliState = (state) => isPromptBindState(state) ? state.hasCliValue ? state.cliState : parser.initialState : state;
|
|
267
268
|
const promptedParser = {
|
|
268
269
|
mode: "async",
|
|
269
270
|
$valueType: parser.$valueType,
|
|
@@ -289,7 +290,7 @@ function prompt(parser, config) {
|
|
|
289
290
|
parse: (context) => {
|
|
290
291
|
const annotations = getAnnotations(context.state);
|
|
291
292
|
const hadCliValue = isPromptBindState(context.state) && context.state.hasCliValue;
|
|
292
|
-
const innerState =
|
|
293
|
+
const innerState = getCliState(context.state);
|
|
293
294
|
const baseInnerContext = innerState !== context.state ? {
|
|
294
295
|
...context,
|
|
295
296
|
state: innerState
|
|
@@ -453,6 +454,7 @@ function prompt(parser, config) {
|
|
|
453
454
|
configurable: true,
|
|
454
455
|
enumerable: false
|
|
455
456
|
});
|
|
457
|
+
delegateOptionParsing(promptedParser, parser, getCliState);
|
|
456
458
|
return promptedParser;
|
|
457
459
|
}
|
|
458
460
|
/** Normalize choices to the format Inquirer.js expects. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/inquirer",
|
|
3
|
-
"version": "1.0.11-dev.
|
|
3
|
+
"version": "1.0.11-dev.2654",
|
|
4
4
|
"description": "Interactive prompt support for Optique via Inquirer.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"sideEffects": false,
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@inquirer/prompts": "^8.3.0",
|
|
59
|
-
"@optique/core": "1.0.11-dev.
|
|
59
|
+
"@optique/core": "1.0.11-dev.2654+01322ff5"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "^20.19.9",
|
|
63
63
|
"tsdown": "^0.13.0",
|
|
64
64
|
"typescript": "^5.8.3",
|
|
65
|
-
"@optique/env": "1.0.11-dev.
|
|
65
|
+
"@optique/env": "1.0.11-dev.2654+01322ff5"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsdown",
|