@optique/inquirer 1.2.1 → 1.3.0-dev.2352

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
@@ -96,7 +96,7 @@ const validPromptTypes = new Set([
96
96
  */
97
97
  function prompt(parser, config) {
98
98
  const promptWithAdapter = (0, __optique_prompt.createPromptAdapter)({
99
- execute: (cfg) => executePromptRaw(cfg),
99
+ execute: executePromptRaw,
100
100
  getDefaultValue: getConfigDefault
101
101
  });
102
102
  return promptWithAdapter(parser, config);
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Separator } from "@inquirer/prompts";
2
2
  import { FluentParser } from "@optique/core/fluent";
3
3
  import { Mode, Parser } from "@optique/core/parser";
4
+ import { PromptCondition } from "@optique/prompt";
4
5
 
5
6
  //#region src/index.d.ts
6
7
 
@@ -217,8 +218,9 @@ type StringPromptConfig = InputConfig | PasswordConfig | EditorConfig | SelectCo
217
218
  * Type-safe prompt configuration for a given parser value type `T`.
218
219
  *
219
220
  * @since 1.0.0
221
+ * @since 1.3.0 Added conditional prompt skipping.
220
222
  */
221
- type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>>;
223
+ type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>> & PromptCondition<T>;
222
224
  type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number ? NumberPromptConfig : T extends string ? StringPromptConfig : T extends readonly string[] ? CheckboxConfig : never;
223
225
  /**
224
226
  * Wraps a parser with an interactive Inquirer.js prompt fallback.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Separator } from "@inquirer/prompts";
2
+ import { PromptCondition } from "@optique/prompt";
2
3
  import { FluentParser } from "@optique/core/fluent";
3
4
  import { Mode, Parser } from "@optique/core/parser";
4
5
 
@@ -217,8 +218,9 @@ type StringPromptConfig = InputConfig | PasswordConfig | EditorConfig | SelectCo
217
218
  * Type-safe prompt configuration for a given parser value type `T`.
218
219
  *
219
220
  * @since 1.0.0
221
+ * @since 1.3.0 Added conditional prompt skipping.
220
222
  */
221
- type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>>;
223
+ type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>> & PromptCondition<T>;
222
224
  type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number ? NumberPromptConfig : T extends string ? StringPromptConfig : T extends readonly string[] ? CheckboxConfig : never;
223
225
  /**
224
226
  * Wraps a parser with an interactive Inquirer.js prompt fallback.
package/dist/index.js CHANGED
@@ -73,7 +73,7 @@ const validPromptTypes = new Set([
73
73
  */
74
74
  function prompt(parser, config) {
75
75
  const promptWithAdapter = createPromptAdapter({
76
- execute: (cfg) => executePromptRaw(cfg),
76
+ execute: executePromptRaw,
77
77
  getDefaultValue: getConfigDefault
78
78
  });
79
79
  return promptWithAdapter(parser, config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/inquirer",
3
- "version": "1.2.1",
3
+ "version": "1.3.0-dev.2352",
4
4
  "description": "Inquirer.js prompt support for Optique",
5
5
  "keywords": [
6
6
  "CLI",
@@ -62,17 +62,17 @@
62
62
  "sideEffects": false,
63
63
  "dependencies": {
64
64
  "@inquirer/prompts": "^8.3.0",
65
- "@optique/core": "1.2.1",
66
- "@optique/prompt": "1.2.1"
65
+ "@optique/core": "1.3.0-dev.2352+32a63ede",
66
+ "@optique/prompt": "1.3.0-dev.2352+32a63ede"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/node": "^24.0.0",
70
70
  "fast-check": "^4.7.0",
71
71
  "tsdown": "^0.13.0",
72
72
  "typescript": "^5.8.3",
73
- "@optique/env": "1.2.1",
74
- "@optique/config": "1.2.1",
75
- "@optique/run": "1.2.1"
73
+ "@optique/env": "1.3.0-dev.2352+32a63ede",
74
+ "@optique/config": "1.3.0-dev.2352+32a63ede",
75
+ "@optique/run": "1.3.0-dev.2352+32a63ede"
76
76
  },
77
77
  "scripts": {
78
78
  "build": "tsdown",