varlock 0.0.13 → 0.0.14

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.
Files changed (50) hide show
  1. package/dist/auto-load.js +3 -3
  2. package/dist/{chunk-T3I4UFB2.js → chunk-4QTFFYV6.js} +3 -3
  3. package/dist/{chunk-T3I4UFB2.js.map → chunk-4QTFFYV6.js.map} +1 -1
  4. package/dist/{chunk-POJECYSY.js → chunk-7JMYT62X.js} +3 -3
  5. package/dist/chunk-7JMYT62X.js.map +1 -0
  6. package/dist/{chunk-UPKIHHPE.js → chunk-C5BEZMSO.js} +2 -2
  7. package/dist/{chunk-UPKIHHPE.js.map → chunk-C5BEZMSO.js.map} +1 -1
  8. package/dist/{chunk-LXJMZMID.js → chunk-EQQCW3OI.js} +5 -5
  9. package/dist/{chunk-LXJMZMID.js.map → chunk-EQQCW3OI.js.map} +1 -1
  10. package/dist/{chunk-MV5ZAKN7.js → chunk-FCVBOYES.js} +21 -21
  11. package/dist/chunk-FCVBOYES.js.map +1 -0
  12. package/dist/{chunk-IML4QZHB.js → chunk-HGJF2DUO.js} +4 -4
  13. package/dist/{chunk-IML4QZHB.js.map → chunk-HGJF2DUO.js.map} +1 -1
  14. package/dist/{chunk-UA3DMAAQ.js → chunk-J5SIYSJV.js} +4 -4
  15. package/dist/{chunk-UA3DMAAQ.js.map → chunk-J5SIYSJV.js.map} +1 -1
  16. package/dist/{chunk-5EBVEGDW.js → chunk-OJFTFBQG.js} +3 -3
  17. package/dist/{chunk-5EBVEGDW.js.map → chunk-OJFTFBQG.js.map} +1 -1
  18. package/dist/{chunk-AS4LIW7A.js → chunk-QCKADJNV.js} +4 -4
  19. package/dist/{chunk-AS4LIW7A.js.map → chunk-QCKADJNV.js.map} +1 -1
  20. package/dist/{chunk-MVYXWTAV.js → chunk-UPOIK25P.js} +4 -4
  21. package/dist/{chunk-MVYXWTAV.js.map → chunk-UPOIK25P.js.map} +1 -1
  22. package/dist/{chunk-TWKAUCTT.js → chunk-ZYL5D2UA.js} +4 -4
  23. package/dist/{chunk-TWKAUCTT.js.map → chunk-ZYL5D2UA.js.map} +1 -1
  24. package/dist/cli/cli-executable.js +14 -14
  25. package/dist/cli/cli-executable.js.map +1 -1
  26. package/dist/dotenv-compat.js +3 -3
  27. package/dist/{env-B_LAqK4w.d.ts → env-DLUhFCnC.d.ts} +3 -0
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +4 -4
  30. package/dist/init.command-VK4OGIYP.js +8 -0
  31. package/dist/{init.command-CTO64XBL.js.map → init.command-VK4OGIYP.js.map} +1 -1
  32. package/dist/load.command-N7FMBREX.js +8 -0
  33. package/dist/{load.command-EWIJDF55.js.map → load.command-N7FMBREX.js.map} +1 -1
  34. package/dist/login.command-GQCJY4NK.js +8 -0
  35. package/dist/{login.command-UZJJ4XTV.js.map → login.command-GQCJY4NK.js.map} +1 -1
  36. package/dist/run.command-LYY2M5AP.js +8 -0
  37. package/dist/{run.command-T44BAZ7X.js.map → run.command-LYY2M5AP.js.map} +1 -1
  38. package/dist/runtime/env.d.ts +1 -1
  39. package/dist/runtime/patch-console.js +1 -1
  40. package/dist/runtime/patch-server-response.js +1 -1
  41. package/dist/telemetry.command-QTEDXKIG.js +8 -0
  42. package/dist/{telemetry.command-2C3MQA4K.js.map → telemetry.command-QTEDXKIG.js.map} +1 -1
  43. package/package.json +2 -2
  44. package/dist/chunk-MV5ZAKN7.js.map +0 -1
  45. package/dist/chunk-POJECYSY.js.map +0 -1
  46. package/dist/init.command-CTO64XBL.js +0 -8
  47. package/dist/load.command-EWIJDF55.js +0 -8
  48. package/dist/login.command-UZJJ4XTV.js +0 -8
  49. package/dist/run.command-T44BAZ7X.js +0 -8
  50. package/dist/telemetry.command-2C3MQA4K.js +0 -8
@@ -1185,7 +1185,12 @@ var UrlDataType = createEnvGraphDataType(
1185
1185
  return val;
1186
1186
  },
1187
1187
  validate(val) {
1188
- const url = new URL(val);
1188
+ let url;
1189
+ try {
1190
+ url = new URL(val);
1191
+ } catch (err) {
1192
+ throw new ValidationError("Invalid URL");
1193
+ }
1189
1194
  if (settings?.allowedDomains && !settings.allowedDomains.includes(url.host.toLowerCase())) {
1190
1195
  return new ValidationError(`Domain (${url.host}) is not in allowed list: ${settings.allowedDomains.join(",")}`);
1191
1196
  }
@@ -2045,7 +2050,7 @@ var EnvGraph2 = class {
2045
2050
  const sources = Array.from(this.sortedDataSources).reverse();
2046
2051
  for (const s of sources) {
2047
2052
  if (s.disabled) continue;
2048
- if (s.importKeys) continue;
2053
+ if (s.isPartialImport) continue;
2049
2054
  const decs = s.getRootDecorators(decoratorName);
2050
2055
  if (decs.length) return decs[0].simplifiedValue;
2051
2056
  }
@@ -2056,7 +2061,7 @@ var EnvGraph2 = class {
2056
2061
  const combinedDecsWithSources = [];
2057
2062
  for (const source of sources) {
2058
2063
  if (source.disabled) continue;
2059
- if (source.importKeys) continue;
2064
+ if (source.isPartialImport) continue;
2060
2065
  const decs = source.getRootDecorators(decoratorName);
2061
2066
  combinedDecsWithSources.push([source, decs]);
2062
2067
  }
@@ -2429,6 +2434,9 @@ var EnvGraphDataSource3 = class {
2429
2434
  get isImport() {
2430
2435
  return !!this.importMeta?.isImport || !!this.parent?.isImport;
2431
2436
  }
2437
+ get isPartialImport() {
2438
+ return (this.importMeta?.importKeys || []).length > 0;
2439
+ }
2432
2440
  get importKeys() {
2433
2441
  const importKeysArrays = [];
2434
2442
  let currentSource = this;
@@ -2458,6 +2466,13 @@ var EnvGraphDataSource3 = class {
2458
2466
  get envFlagKey() {
2459
2467
  return this._envFlagKey || this.parent?.envFlagKey;
2460
2468
  }
2469
+ /** helper to set the current envFlag key, also propogating upwards */
2470
+ setEnvFlag(key) {
2471
+ this._envFlagKey = key;
2472
+ if (this.parent && !this.isPartialImport && !this.parent._envFlagKey) {
2473
+ this.parent.setEnvFlag(key);
2474
+ }
2475
+ }
2461
2476
  /** environment flag config item getter (follows up the parent chain) */
2462
2477
  get envFlagConfigItem() {
2463
2478
  const envFlagKey = this.envFlagKey;
@@ -2513,7 +2528,7 @@ var EnvGraphDataSource3 = class {
2513
2528
  this._loadingError = new Error(`@envFlag key ${envFlagDecoratorValue} must be an item within this schema`);
2514
2529
  return;
2515
2530
  }
2516
- this._envFlagKey = envFlagDecoratorValue;
2531
+ this.setEnvFlag(envFlagDecoratorValue);
2517
2532
  }
2518
2533
  for (const itemKey of this.importKeys || my_dash_default.keys(this.configItemDefs)) {
2519
2534
  const itemDef = this.configItemDefs[itemKey];
@@ -2600,18 +2615,6 @@ var EnvGraphDataSource3 = class {
2600
2615
  }
2601
2616
  }
2602
2617
  }
2603
- if (envFlagDecoratorValue) {
2604
- const envFlagItem = this.envFlagConfigItem;
2605
- await envFlagItem.earlyResolve();
2606
- if (!envFlagItem.isValid) {
2607
- const err = new Error("resolved @envFlag value is not valid");
2608
- err.cause = envFlagItem.errors[0];
2609
- throw err;
2610
- }
2611
- if (!my_dash_default.isString(envFlagItem.resolvedValue)) {
2612
- throw new Error("expected resolved @envFlag value to be a string");
2613
- }
2614
- }
2615
2618
  }
2616
2619
  /**
2617
2620
  * called by the finishInit - meant to be overridden by subclasses
@@ -2807,9 +2810,6 @@ var DirectoryDataSource = class extends EnvGraphDataSource3 {
2807
2810
  get loadingError() {
2808
2811
  return this._loadingError || this.schemaDataSource?.loadingError;
2809
2812
  }
2810
- get envFlagKey() {
2811
- return this.schemaDataSource?._envFlagKey || this.parent?.envFlagKey;
2812
- }
2813
2813
  async addAutoLoadedFile(fileName) {
2814
2814
  if (!this.graph) throw new Error("expected graph to be set");
2815
2815
  const filePath = path2.join(this.basePath, fileName);
@@ -3048,5 +3048,5 @@ __name(gracefulExit, "gracefulExit");
3048
3048
  //! these are probably not relevant anymore, or needs to move to a plugin layer?
3049
3049
 
3050
3050
  export { CoercionError, ConfigLoadError, DotEnvFileDataSource, EnvGraph2 as EnvGraph, EnvSourceParseError, FileBasedDataSource, ResolutionError, SchemaError, ValidationError, ansis_default, asyncExitHook, checkIsFileGitIgnored, getItemSummary, gracefulExit, joinAndCompact, loadEnvGraph, my_dash_default, pathExists, pathExistsSync, tryCatch };
3051
- //# sourceMappingURL=chunk-MV5ZAKN7.js.map
3052
- //# sourceMappingURL=chunk-MV5ZAKN7.js.map
3051
+ //# sourceMappingURL=chunk-FCVBOYES.js.map
3052
+ //# sourceMappingURL=chunk-FCVBOYES.js.map