@optique/config 1.3.0-dev.2576 → 1.3.0-dev.2581
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 +9 -2
- package/dist/index.js +9 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -322,14 +322,16 @@ function bindConfig(parser, options) {
|
|
|
322
322
|
},
|
|
323
323
|
parse: (context) => {
|
|
324
324
|
const annotations = (0, __optique_core_annotations.getAnnotations)(context.state);
|
|
325
|
-
const
|
|
325
|
+
const hadCliValue = isConfigBindState(context.state) && context.state.hasCliValue;
|
|
326
|
+
const innerState = isConfigBindState(context.state) ? context.state.hasCliValue ? context.state.cliState : (0, __optique_core_extension.inheritAnnotations)(context.state, parser.initialState) : context.state;
|
|
326
327
|
const innerContext = innerState !== context.state ? {
|
|
327
328
|
...context,
|
|
328
329
|
state: innerState
|
|
329
330
|
} : context;
|
|
330
331
|
const processResult = (result) => {
|
|
331
332
|
if (result.success) {
|
|
332
|
-
const
|
|
333
|
+
const terminatorOnly = result.consumed.length === 1 && result.consumed[0] === "--" && !context.optionsTerminated && result.next.optionsTerminated;
|
|
334
|
+
const cliConsumed = hadCliValue || result.consumed.length > 0 && !terminatorOnly;
|
|
333
335
|
const newState$1 = (0, __optique_core_extension.injectAnnotations)({
|
|
334
336
|
[configBindStateKey]: true,
|
|
335
337
|
hasCliValue: cliConsumed,
|
|
@@ -346,6 +348,11 @@ function bindConfig(parser, options) {
|
|
|
346
348
|
};
|
|
347
349
|
}
|
|
348
350
|
if (result.consumed > 0) return result;
|
|
351
|
+
if (hadCliValue) return {
|
|
352
|
+
success: true,
|
|
353
|
+
next: context,
|
|
354
|
+
consumed: []
|
|
355
|
+
};
|
|
349
356
|
const newState = (0, __optique_core_extension.injectAnnotations)({
|
|
350
357
|
[configBindStateKey]: true,
|
|
351
358
|
hasCliValue: false
|
package/dist/index.js
CHANGED
|
@@ -299,14 +299,16 @@ function bindConfig(parser, options) {
|
|
|
299
299
|
},
|
|
300
300
|
parse: (context) => {
|
|
301
301
|
const annotations = getAnnotations(context.state);
|
|
302
|
-
const
|
|
302
|
+
const hadCliValue = isConfigBindState(context.state) && context.state.hasCliValue;
|
|
303
|
+
const innerState = isConfigBindState(context.state) ? context.state.hasCliValue ? context.state.cliState : inheritAnnotations(context.state, parser.initialState) : context.state;
|
|
303
304
|
const innerContext = innerState !== context.state ? {
|
|
304
305
|
...context,
|
|
305
306
|
state: innerState
|
|
306
307
|
} : context;
|
|
307
308
|
const processResult = (result) => {
|
|
308
309
|
if (result.success) {
|
|
309
|
-
const
|
|
310
|
+
const terminatorOnly = result.consumed.length === 1 && result.consumed[0] === "--" && !context.optionsTerminated && result.next.optionsTerminated;
|
|
311
|
+
const cliConsumed = hadCliValue || result.consumed.length > 0 && !terminatorOnly;
|
|
310
312
|
const newState$1 = injectAnnotations({
|
|
311
313
|
[configBindStateKey]: true,
|
|
312
314
|
hasCliValue: cliConsumed,
|
|
@@ -323,6 +325,11 @@ function bindConfig(parser, options) {
|
|
|
323
325
|
};
|
|
324
326
|
}
|
|
325
327
|
if (result.consumed > 0) return result;
|
|
328
|
+
if (hadCliValue) return {
|
|
329
|
+
success: true,
|
|
330
|
+
next: context,
|
|
331
|
+
consumed: []
|
|
332
|
+
};
|
|
326
333
|
const newState = injectAnnotations({
|
|
327
334
|
[configBindStateKey]: true,
|
|
328
335
|
hasCliValue: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/config",
|
|
3
|
-
"version": "1.3.0-dev.
|
|
3
|
+
"version": "1.3.0-dev.2581",
|
|
4
4
|
"description": "Configuration file support for Optique with Standard Schema validation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@standard-schema/spec": "^1.1.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@optique/core": "1.3.0-dev.
|
|
68
|
+
"@optique/core": "1.3.0-dev.2581+50dd484c"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@optique/env": "1.3.0-dev.
|
|
71
|
+
"@optique/env": "1.3.0-dev.2581+50dd484c",
|
|
72
72
|
"@standard-schema/spec": "^1.1.0",
|
|
73
73
|
"@types/node": "^24.0.0",
|
|
74
74
|
"fast-check": "^4.7.0",
|