@optique/inquirer 1.0.0-dev.1743 → 1.0.0-dev.1745
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 +12 -12
- package/dist/index.js +12 -12
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -391,7 +391,8 @@ function prompt(parser, config) {
|
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
393
|
const finalizePrompt = () => {
|
|
394
|
-
|
|
394
|
+
const shouldDefer = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => shouldDeferPrompt(parser, annotatedInnerState, exec));
|
|
395
|
+
if (shouldDefer) return Promise.resolve(deferredPromptResult(readPlaceholder()));
|
|
395
396
|
if (isProbe) return Promise.resolve({
|
|
396
397
|
success: true,
|
|
397
398
|
value: readPlaceholder()
|
|
@@ -415,7 +416,7 @@ function prompt(parser, config) {
|
|
|
415
416
|
if (innerR instanceof Promise) return innerR.then(handleCompleteResult);
|
|
416
417
|
return handleCompleteResult(innerR);
|
|
417
418
|
};
|
|
418
|
-
|
|
419
|
+
if (hasDeferHook) {
|
|
419
420
|
const innerR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => parser.complete(annotatedInnerState, exec));
|
|
420
421
|
const handleDeferHookResult = (res) => {
|
|
421
422
|
if (res.success && res.value === void 0) return finalizePrompt();
|
|
@@ -424,16 +425,15 @@ function prompt(parser, config) {
|
|
|
424
425
|
};
|
|
425
426
|
if (innerR instanceof Promise) return innerR.then(handleDeferHookResult);
|
|
426
427
|
return handleDeferHookResult(innerR);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
})();
|
|
428
|
+
}
|
|
429
|
+
const simParseR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedState) => parser.parse({
|
|
430
|
+
buffer: [],
|
|
431
|
+
state: annotatedState,
|
|
432
|
+
optionsTerminated: false,
|
|
433
|
+
usage: parser.usage
|
|
434
|
+
}));
|
|
435
|
+
if (simParseR instanceof Promise) return simParseR.then(decideFromParse);
|
|
436
|
+
return decideFromParse(simParseR);
|
|
437
437
|
},
|
|
438
438
|
suggest: (context, prefix) => {
|
|
439
439
|
const innerState = isPromptBindState(context.state) ? context.state.cliState === void 0 ? parser.initialState : context.state.cliState : context.state;
|
package/dist/index.js
CHANGED
|
@@ -368,7 +368,8 @@ function prompt(parser, config) {
|
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
const finalizePrompt = () => {
|
|
371
|
-
|
|
371
|
+
const shouldDefer = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => shouldDeferPrompt(parser, annotatedInnerState, exec));
|
|
372
|
+
if (shouldDefer) return Promise.resolve(deferredPromptResult(readPlaceholder()));
|
|
372
373
|
if (isProbe) return Promise.resolve({
|
|
373
374
|
success: true,
|
|
374
375
|
value: readPlaceholder()
|
|
@@ -392,7 +393,7 @@ function prompt(parser, config) {
|
|
|
392
393
|
if (innerR instanceof Promise) return innerR.then(handleCompleteResult);
|
|
393
394
|
return handleCompleteResult(innerR);
|
|
394
395
|
};
|
|
395
|
-
|
|
396
|
+
if (hasDeferHook) {
|
|
396
397
|
const innerR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedInnerState) => parser.complete(annotatedInnerState, exec));
|
|
397
398
|
const handleDeferHookResult = (res) => {
|
|
398
399
|
if (res.success && res.value === void 0) return finalizePrompt();
|
|
@@ -401,16 +402,15 @@ function prompt(parser, config) {
|
|
|
401
402
|
};
|
|
402
403
|
if (innerR instanceof Promise) return innerR.then(handleDeferHookResult);
|
|
403
404
|
return handleDeferHookResult(innerR);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
})();
|
|
405
|
+
}
|
|
406
|
+
const simParseR = withAnnotatedInnerState(state, effectiveInitialState, (annotatedState) => parser.parse({
|
|
407
|
+
buffer: [],
|
|
408
|
+
state: annotatedState,
|
|
409
|
+
optionsTerminated: false,
|
|
410
|
+
usage: parser.usage
|
|
411
|
+
}));
|
|
412
|
+
if (simParseR instanceof Promise) return simParseR.then(decideFromParse);
|
|
413
|
+
return decideFromParse(simParseR);
|
|
414
414
|
},
|
|
415
415
|
suggest: (context, prefix) => {
|
|
416
416
|
const innerState = isPromptBindState(context.state) ? context.state.cliState === void 0 ? parser.initialState : context.state.cliState : context.state;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/inquirer",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.1745+56960ff9",
|
|
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.0-dev.
|
|
59
|
+
"@optique/core": "1.0.0-dev.1745+56960ff9"
|
|
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.0-dev.
|
|
65
|
+
"@optique/env": "1.0.0-dev.1745+56960ff9"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsdown",
|