@optique/clack 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 +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ function getPromptFunctions() {
|
|
|
66
66
|
*/
|
|
67
67
|
function prompt(parser, config) {
|
|
68
68
|
const promptWithAdapter = (0, __optique_prompt.createPromptAdapter)({
|
|
69
|
-
execute:
|
|
69
|
+
execute: executePromptRaw,
|
|
70
70
|
getDefaultValue: getConfigDefault
|
|
71
71
|
});
|
|
72
72
|
return promptWithAdapter(parser, config);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FluentParser } from "@optique/core/fluent";
|
|
2
2
|
import { Mode, Parser } from "@optique/core/parser";
|
|
3
|
+
import { PromptCondition } from "@optique/prompt";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
5
6
|
|
|
@@ -141,8 +142,9 @@ type StringPromptConfig = TextConfig | PasswordConfig | SelectConfig;
|
|
|
141
142
|
* Type-safe Clack prompt configuration for a given parser value type `T`.
|
|
142
143
|
*
|
|
143
144
|
* @since 1.2.0
|
|
145
|
+
* @since 1.3.0 Added conditional prompt skipping.
|
|
144
146
|
*/
|
|
145
|
-
type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined
|
|
147
|
+
type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>> & PromptCondition<T>;
|
|
146
148
|
type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number ? NumberPromptConfig : T extends string ? StringPromptConfig : T extends readonly string[] ? MultiselectConfig : never;
|
|
147
149
|
/**
|
|
148
150
|
* Wraps a parser with an interactive Clack prompt fallback.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PromptCondition } from "@optique/prompt";
|
|
1
2
|
import { FluentParser } from "@optique/core/fluent";
|
|
2
3
|
import { Mode, Parser } from "@optique/core/parser";
|
|
3
4
|
|
|
@@ -141,8 +142,9 @@ type StringPromptConfig = TextConfig | PasswordConfig | SelectConfig;
|
|
|
141
142
|
* Type-safe Clack prompt configuration for a given parser value type `T`.
|
|
142
143
|
*
|
|
143
144
|
* @since 1.2.0
|
|
145
|
+
* @since 1.3.0 Added conditional prompt skipping.
|
|
144
146
|
*/
|
|
145
|
-
type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined
|
|
147
|
+
type PromptConfig<T> = BasePromptConfig<Exclude<T, null | undefined>> & PromptCondition<T>;
|
|
146
148
|
type BasePromptConfig<T> = T extends boolean ? ConfirmConfig : T extends number ? NumberPromptConfig : T extends string ? StringPromptConfig : T extends readonly string[] ? MultiselectConfig : never;
|
|
147
149
|
/**
|
|
148
150
|
* Wraps a parser with an interactive Clack prompt fallback.
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ function getPromptFunctions() {
|
|
|
43
43
|
*/
|
|
44
44
|
function prompt(parser, config) {
|
|
45
45
|
const promptWithAdapter = createPromptAdapter({
|
|
46
|
-
execute:
|
|
46
|
+
execute: executePromptRaw,
|
|
47
47
|
getDefaultValue: getConfigDefault
|
|
48
48
|
});
|
|
49
49
|
return promptWithAdapter(parser, config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/clack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-dev.2352",
|
|
4
4
|
"description": "Interactive prompt support for Optique via Clack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
"sideEffects": false,
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@clack/prompts": "^1.6.0",
|
|
65
|
-
"@optique/core": "1.
|
|
66
|
-
"@optique/prompt": "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/
|
|
74
|
-
"@optique/
|
|
73
|
+
"@optique/env": "1.3.0-dev.2352+32a63ede",
|
|
74
|
+
"@optique/run": "1.3.0-dev.2352+32a63ede"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "tsdown",
|