@optique/env 1.0.11-dev.2640 → 1.0.11-dev.2656

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
@@ -104,6 +104,7 @@ function bindEnv(parser, options) {
104
104
  return value != null && typeof value === "object" && envBindStateKey in value;
105
105
  }
106
106
  const deferPromptUntilConfigResolves = parser.shouldDeferCompletion;
107
+ const getCliState = (state) => isEnvBindState(state) ? state.hasCliValue ? state.cliState : (0, __optique_core_extension.inheritAnnotations)(state, parser.initialState) : state;
107
108
  const boundParser = {
108
109
  mode: parser.mode,
109
110
  $valueType: parser.$valueType,
@@ -123,7 +124,7 @@ function bindEnv(parser, options) {
123
124
  parse: (context) => {
124
125
  const annotations = (0, __optique_core_annotations.getAnnotations)(context.state);
125
126
  const hadCliValue = isEnvBindState(context.state) && context.state.hasCliValue;
126
- const innerState = isEnvBindState(context.state) ? context.state.hasCliValue ? context.state.cliState : (0, __optique_core_extension.inheritAnnotations)(context.state, parser.initialState) : context.state;
127
+ const innerState = getCliState(context.state);
127
128
  const innerContext = innerState !== context.state ? {
128
129
  ...context,
129
130
  state: innerState
@@ -225,6 +226,7 @@ function bindEnv(parser, options) {
225
226
  configurable: true,
226
227
  enumerable: false
227
228
  });
229
+ (0, __optique_core_extension.delegateOptionParsing)(boundParser, parser, getCliState);
228
230
  return boundParser;
229
231
  }
230
232
  /**
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getAnnotations } from "@optique/core/annotations";
2
- import { defineTraits, delegateSuggestNodes, dispatchByMode, getTraits, inheritAnnotations, injectAnnotations, isInjectedAnnotationState, mapModeValue, mapSourceMetadata, wrapForMode } from "@optique/core/extension";
2
+ import { defineTraits, delegateOptionParsing, delegateSuggestNodes, dispatchByMode, getTraits, inheritAnnotations, injectAnnotations, isInjectedAnnotationState, mapModeValue, mapSourceMetadata, wrapForMode } from "@optique/core/extension";
3
3
  import { envVar, message, valueSet } from "@optique/core/message";
4
4
  import { ensureNonEmptyString, isValueParser } from "@optique/core/valueparser";
5
5
 
@@ -81,6 +81,7 @@ function bindEnv(parser, options) {
81
81
  return value != null && typeof value === "object" && envBindStateKey in value;
82
82
  }
83
83
  const deferPromptUntilConfigResolves = parser.shouldDeferCompletion;
84
+ const getCliState = (state) => isEnvBindState(state) ? state.hasCliValue ? state.cliState : inheritAnnotations(state, parser.initialState) : state;
84
85
  const boundParser = {
85
86
  mode: parser.mode,
86
87
  $valueType: parser.$valueType,
@@ -100,7 +101,7 @@ function bindEnv(parser, options) {
100
101
  parse: (context) => {
101
102
  const annotations = getAnnotations(context.state);
102
103
  const hadCliValue = isEnvBindState(context.state) && context.state.hasCliValue;
103
- const innerState = isEnvBindState(context.state) ? context.state.hasCliValue ? context.state.cliState : inheritAnnotations(context.state, parser.initialState) : context.state;
104
+ const innerState = getCliState(context.state);
104
105
  const innerContext = innerState !== context.state ? {
105
106
  ...context,
106
107
  state: innerState
@@ -202,6 +203,7 @@ function bindEnv(parser, options) {
202
203
  configurable: true,
203
204
  enumerable: false
204
205
  });
206
+ delegateOptionParsing(boundParser, parser, getCliState);
205
207
  return boundParser;
206
208
  }
207
209
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/env",
3
- "version": "1.0.11-dev.2640",
3
+ "version": "1.0.11-dev.2656",
4
4
  "description": "Environment variable support for Optique",
5
5
  "keywords": [
6
6
  "CLI",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "sideEffects": false,
56
56
  "dependencies": {
57
- "@optique/core": "1.0.11-dev.2640+cb8b320c"
57
+ "@optique/core": "1.0.11-dev.2656+6a79d33a"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^20.19.9",