@optique/inquirer 1.0.0-dev.600 → 1.0.0-dev.604

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 CHANGED
@@ -71,6 +71,8 @@ function isExitPromptError(error) {
71
71
  * @param parser Inner parser that reads CLI values.
72
72
  * @param config Type-safe Inquirer.js prompt configuration.
73
73
  * @returns A parser with interactive prompt fallback, always in async mode.
74
+ * @throws {Error} If prompt execution fails with an unexpected error or if
75
+ * the inner parser throws while parsing or completing.
74
76
  * @since 1.0.0
75
77
  */
76
78
  function prompt(parser, config) {
@@ -84,6 +86,16 @@ function prompt(parser, config) {
84
86
  hasCliValue = false;
85
87
  };
86
88
  let promptCache = null;
89
+ /**
90
+ * Executes the configured prompt and normalizes its result.
91
+ *
92
+ * Converts `ExitPromptError` into a parse failure and returns prompt values
93
+ * in Optique's `ValueParserResult` shape.
94
+ *
95
+ * @returns The normalized prompt result.
96
+ * @throws {Error} Rethrows unexpected prompt failures after converting
97
+ * `ExitPromptError` cancellations into parse failures.
98
+ */
87
99
  async function executePrompt() {
88
100
  const prompts = getPromptFunctions();
89
101
  try {
package/dist/index.d.cts CHANGED
@@ -347,6 +347,8 @@ type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number
347
347
  * @param parser Inner parser that reads CLI values.
348
348
  * @param config Type-safe Inquirer.js prompt configuration.
349
349
  * @returns A parser with interactive prompt fallback, always in async mode.
350
+ * @throws {Error} If prompt execution fails with an unexpected error or if
351
+ * the inner parser throws while parsing or completing.
350
352
  * @since 1.0.0
351
353
  */
352
354
  declare function prompt<M extends Mode, TValue, TState>(parser: Parser<M, TValue, TState>, config: PromptConfig<TValue>): Parser<"async", TValue, TState>;
package/dist/index.d.ts CHANGED
@@ -347,6 +347,8 @@ type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number
347
347
  * @param parser Inner parser that reads CLI values.
348
348
  * @param config Type-safe Inquirer.js prompt configuration.
349
349
  * @returns A parser with interactive prompt fallback, always in async mode.
350
+ * @throws {Error} If prompt execution fails with an unexpected error or if
351
+ * the inner parser throws while parsing or completing.
350
352
  * @since 1.0.0
351
353
  */
352
354
  declare function prompt<M extends Mode, TValue, TState>(parser: Parser<M, TValue, TState>, config: PromptConfig<TValue>): Parser<"async", TValue, TState>;
package/dist/index.js CHANGED
@@ -48,6 +48,8 @@ function isExitPromptError(error) {
48
48
  * @param parser Inner parser that reads CLI values.
49
49
  * @param config Type-safe Inquirer.js prompt configuration.
50
50
  * @returns A parser with interactive prompt fallback, always in async mode.
51
+ * @throws {Error} If prompt execution fails with an unexpected error or if
52
+ * the inner parser throws while parsing or completing.
51
53
  * @since 1.0.0
52
54
  */
53
55
  function prompt(parser, config) {
@@ -61,6 +63,16 @@ function prompt(parser, config) {
61
63
  hasCliValue = false;
62
64
  };
63
65
  let promptCache = null;
66
+ /**
67
+ * Executes the configured prompt and normalizes its result.
68
+ *
69
+ * Converts `ExitPromptError` into a parse failure and returns prompt values
70
+ * in Optique's `ValueParserResult` shape.
71
+ *
72
+ * @returns The normalized prompt result.
73
+ * @throws {Error} Rethrows unexpected prompt failures after converting
74
+ * `ExitPromptError` cancellations into parse failures.
75
+ */
64
76
  async function executePrompt() {
65
77
  const prompts = getPromptFunctions();
66
78
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/inquirer",
3
- "version": "1.0.0-dev.600+759e075b",
3
+ "version": "1.0.0-dev.604+c1a6f556",
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.600+759e075b"
59
+ "@optique/core": "1.0.0-dev.604+c1a6f556"
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.600+759e075b"
65
+ "@optique/env": "1.0.0-dev.604+c1a6f556"
66
66
  },
67
67
  "scripts": {
68
68
  "build": "tsdown",