@optique/core 1.4.0-dev.2726 → 1.4.0-dev.2729

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.4.0-dev.2726",
3
+ "version": "1.4.0-dev.2729",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -245,7 +245,7 @@
245
245
  },
246
246
  "sideEffects": false,
247
247
  "devDependencies": {
248
- "@optique/env": "1.4.0-dev.2726+dfa3c577",
248
+ "@optique/env": "1.4.0-dev.2729+72048695",
249
249
  "@types/node": "^24.0.0",
250
250
  "fast-check": "^4.7.0",
251
251
  "tsdown": "^0.13.0",
@@ -57,19 +57,20 @@ Core rules
57
57
  `dependency(source.deriveSync(...))`. Optique resolves such chains by
58
58
  dependency order, independently of object/tuple field order.
59
59
  - Use `derivePromptConfig(source, resolver)` from *@optique/prompt* or its
60
- adapter re-exports for choices or messages that depend on parsed values.
61
- Async resolvers run at the real fallback after sources resolve; pass
62
- `[sourceA, sourceB]` for several sources. Return a prompt kind matching the
63
- parser's value type. Derive the CLI parser separately; make it a dependency
64
- source only if another consumer needs its answer. Use a lone resolver for
65
- fetched choices and forward its `signal`. Clack's third argument accepts
66
- `pendingMessage` for a resolver spinner; omit it for silent prompter tests.
67
- - Pass `{ validate, maxAttempts, signal }` as a generated prompt wrapper's
68
- third argument, including `prompt()` from *@optique/inquirer* and
69
- *@optique/clack*. The validator returns `undefined` to accept the prompted
70
- value or a structured `Message` to retry, synchronously or asynchronously.
71
- Attempt limits must be positive integers and default to unlimited retries.
72
- Selection prompts keep their config and use the shared `validate` option.
60
+ adapters for choices/messages depending on parsed values; use
61
+ `[sourceA, sourceB]` for several sources. Async resolvers run at fallback
62
+ after sources resolve. Match the prompt kind to the parser's value type;
63
+ derive the CLI parser separately. A lone resolver fetches choices lazily;
64
+ forward its `signal`. Clack `pendingMessage` enables a resolver spinner.
65
+ - Pass `{ validate, maxAttempts, signal }` as `prompt()`'s third argument.
66
+ Return `undefined` to accept or a structured `Message` to retry, sync/async.
67
+ Attempt limits are positive integers; retries default to unlimited.
68
+ Clack `autocomplete` also has sync native validation; Inquirer `search`
69
+ has sync/async native validation. Multi selections use shared validation.
70
+ - Clack `autocomplete` filters one selection; `autocomplete-multiselect`
71
+ returns `readonly string[]`. Both take array `options`. Inquirer `search`
72
+ calls `source(term, { signal })` per query; forward the signal to requests.
73
+ Empty search input gives `undefined`.
73
74
  - Implement a custom adapter's `execute(config, context)` so retries can show
74
75
  `context.previousValidationMessage`, and forward `context.signal` when the
75
76
  prompt library supports aborting active work. Adapter-native validation