@optique/inquirer 1.0.0-dev.1737 → 1.0.0-dev.1741
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 +14 -19
- package/dist/index.js +14 -19
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -379,28 +379,23 @@ function prompt(parser, config) {
|
|
|
379
379
|
if (r instanceof Promise) return r;
|
|
380
380
|
return Promise.resolve(r);
|
|
381
381
|
}
|
|
382
|
-
const isProbe = exec
|
|
382
|
+
const isProbe = exec != null && exec.phase !== "complete";
|
|
383
383
|
const annotations = (0, __optique_core_annotations.getAnnotations)(state);
|
|
384
384
|
const innerInitialState = parser.initialState;
|
|
385
|
-
const effectiveInitialState = annotations != null
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
} catch {}
|
|
392
|
-
return Promise.resolve(deferredPromptResult(ph));
|
|
393
|
-
}
|
|
394
|
-
if (isProbe) {
|
|
395
|
-
let ph;
|
|
396
|
-
try {
|
|
397
|
-
ph = "placeholder" in parser ? parser.placeholder : void 0;
|
|
398
|
-
} catch {}
|
|
399
|
-
return Promise.resolve({
|
|
400
|
-
success: true,
|
|
401
|
-
value: ph
|
|
402
|
-
});
|
|
385
|
+
const effectiveInitialState = annotations != null ? (0, __optique_core_annotations.inheritAnnotations)(state, innerInitialState) : innerInitialState;
|
|
386
|
+
const readPlaceholder = () => {
|
|
387
|
+
try {
|
|
388
|
+
return "placeholder" in parser ? parser.placeholder : void 0;
|
|
389
|
+
} catch {
|
|
390
|
+
return void 0;
|
|
403
391
|
}
|
|
392
|
+
};
|
|
393
|
+
const finalizePrompt = () => {
|
|
394
|
+
if (shouldDeferPrompt(parser, state, exec)) return Promise.resolve(deferredPromptResult(readPlaceholder()));
|
|
395
|
+
if (isProbe) return Promise.resolve({
|
|
396
|
+
success: true,
|
|
397
|
+
value: readPlaceholder()
|
|
398
|
+
});
|
|
404
399
|
return executePrompt();
|
|
405
400
|
};
|
|
406
401
|
const hasDeferHook = typeof parser.shouldDeferCompletion === "function";
|
package/dist/index.js
CHANGED
|
@@ -356,28 +356,23 @@ function prompt(parser, config) {
|
|
|
356
356
|
if (r instanceof Promise) return r;
|
|
357
357
|
return Promise.resolve(r);
|
|
358
358
|
}
|
|
359
|
-
const isProbe = exec
|
|
359
|
+
const isProbe = exec != null && exec.phase !== "complete";
|
|
360
360
|
const annotations = getAnnotations(state);
|
|
361
361
|
const innerInitialState = parser.initialState;
|
|
362
|
-
const effectiveInitialState = annotations != null
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
} catch {}
|
|
369
|
-
return Promise.resolve(deferredPromptResult(ph));
|
|
370
|
-
}
|
|
371
|
-
if (isProbe) {
|
|
372
|
-
let ph;
|
|
373
|
-
try {
|
|
374
|
-
ph = "placeholder" in parser ? parser.placeholder : void 0;
|
|
375
|
-
} catch {}
|
|
376
|
-
return Promise.resolve({
|
|
377
|
-
success: true,
|
|
378
|
-
value: ph
|
|
379
|
-
});
|
|
362
|
+
const effectiveInitialState = annotations != null ? inheritAnnotations(state, innerInitialState) : innerInitialState;
|
|
363
|
+
const readPlaceholder = () => {
|
|
364
|
+
try {
|
|
365
|
+
return "placeholder" in parser ? parser.placeholder : void 0;
|
|
366
|
+
} catch {
|
|
367
|
+
return void 0;
|
|
380
368
|
}
|
|
369
|
+
};
|
|
370
|
+
const finalizePrompt = () => {
|
|
371
|
+
if (shouldDeferPrompt(parser, state, exec)) return Promise.resolve(deferredPromptResult(readPlaceholder()));
|
|
372
|
+
if (isProbe) return Promise.resolve({
|
|
373
|
+
success: true,
|
|
374
|
+
value: readPlaceholder()
|
|
375
|
+
});
|
|
381
376
|
return executePrompt();
|
|
382
377
|
};
|
|
383
378
|
const hasDeferHook = typeof parser.shouldDeferCompletion === "function";
|
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.1741+8b06f17a",
|
|
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.1741+8b06f17a"
|
|
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.1741+8b06f17a"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsdown",
|