@e-n-v/env 0.0.12 → 0.0.13

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 (92) hide show
  1. package/dist/{BooleanMap-BPQuO3Ae.d.ts → BooleanMap-B7iiI-eg.d.ts} +1 -7
  2. package/dist/{BooleanMap-CX_YrPCf.d.cts → BooleanMap-D74MMuAh.d.cts} +1 -7
  3. package/dist/{EnvChannel-CfSwa_25.d.cts → EnvChannel-gV-4XlM8.d.cts} +0 -2
  4. package/dist/{EnvChannel-CfSwa_25.d.ts → EnvChannel-gV-4XlM8.d.ts} +0 -2
  5. package/dist/{EnvChannelOptions-BmdQcl4b.d.cts → EnvChannelOptions-BxsZpwjq.d.cts} +0 -20
  6. package/dist/{EnvChannelOptions-BmdQcl4b.d.ts → EnvChannelOptions-BxsZpwjq.d.ts} +0 -20
  7. package/dist/{EnvSource-s8F_M_6O.cjs → EnvSource-B_7XBrZM.cjs} +4 -8
  8. package/dist/{EnvSource-WAGWqRVM.js → EnvSource-DL1wl3j4.js} +4 -8
  9. package/dist/{EnvVarSchema-CDZGmnex.cjs → EnvVarSchema-D_fQ2A89.cjs} +2 -3
  10. package/dist/{EnvVarSchema-Dr6q7jf6.js → EnvVarSchema-Dd3ZrR30.js} +2 -3
  11. package/dist/{ProcessEnvChannel-eCOGEuJv.d.ts → ProcessEnvChannel-BN4U3VXU.d.cts} +2 -10
  12. package/dist/{ProcessEnvChannel-Br3hZSq6.d.cts → ProcessEnvChannel-Df1v0WyG.d.ts} +2 -10
  13. package/dist/{StringEnvVarSchema-D9Jr1Aws.d.cts → StringEnvVarSchema-CymYIek7.d.cts} +0 -16
  14. package/dist/{StringEnvVarSchema-D9Jr1Aws.d.ts → StringEnvVarSchema-CymYIek7.d.ts} +0 -16
  15. package/dist/channels.cjs +1 -1
  16. package/dist/channels.d.cts +3 -5
  17. package/dist/channels.d.ts +3 -5
  18. package/dist/channels.js +1 -1
  19. package/dist/cli.cjs +8 -10
  20. package/dist/cli.js +4 -6
  21. package/dist/core.cjs +7 -10
  22. package/dist/core.d.cts +5 -39
  23. package/dist/core.d.ts +5 -39
  24. package/dist/core.js +7 -10
  25. package/dist/{custom-Bd-jLg80.js → custom-BRT8y9Jj.js} +9 -18
  26. package/dist/{custom-Dyb9TnER.cjs → custom-_p4QyQTG.cjs} +9 -18
  27. package/dist/files.cjs +3 -5
  28. package/dist/files.d.cts +0 -10
  29. package/dist/files.d.ts +0 -10
  30. package/dist/files.js +3 -5
  31. package/dist/{index-dtOxwPe7.d.ts → index-B-GXzdUQ.d.ts} +3 -9
  32. package/dist/{index-Cb0abjLf.d.ts → index-BwID8Va2.d.ts} +2 -14
  33. package/dist/{index-BHTM8nxS.d.ts → index-C7wTQSSV.d.cts} +1 -5
  34. package/dist/{index-Bf0im0jZ.d.cts → index-CgeWhoQX.d.cts} +3 -9
  35. package/dist/{index-B2eNij2x.d.cts → index-ClGSiwuc.d.ts} +1 -5
  36. package/dist/{index-Cz3frUwZ.d.cts → index-D8rUvOZ5.d.cts} +2 -14
  37. package/dist/index.cjs +15 -16
  38. package/dist/index.d.cts +7 -10
  39. package/dist/index.d.ts +7 -10
  40. package/dist/index.js +7 -8
  41. package/dist/model.cjs +2 -3
  42. package/dist/model.d.cts +1 -1
  43. package/dist/model.d.ts +1 -1
  44. package/dist/model.js +2 -3
  45. package/dist/parse.cjs +4 -5
  46. package/dist/parse.d.cts +4 -6
  47. package/dist/parse.d.ts +4 -6
  48. package/dist/parse.js +4 -5
  49. package/dist/{preprocessors-DFVyF0c7.d.cts → preprocessors-BRPHeq3e.d.cts} +2 -24
  50. package/dist/{preprocessors-BKuIcZa1.d.ts → preprocessors-BUAo8e4Q.d.ts} +2 -24
  51. package/dist/prompt.cjs +3 -4
  52. package/dist/prompt.d.cts +10 -5
  53. package/dist/prompt.d.ts +4 -5
  54. package/dist/prompt.js +3 -4
  55. package/dist/{redis-D18f4ztf.js → redis-B-sECHB8.js} +9 -18
  56. package/dist/{redis-tRD4nAy_.d.ts → redis-BSCXEwN0.d.cts} +1 -39
  57. package/dist/{redis-CyTF0SYT.cjs → redis-CyJB1Nt0.cjs} +9 -18
  58. package/dist/{redis-DsW-Vkwq.d.cts → redis-n80OfSRZ.d.ts} +1 -39
  59. package/dist/{resolveChannel-DB1XyYCC.js → resolveChannel-CkQhgsxw.js} +6 -11
  60. package/dist/{resolveChannel-Cug62jvj.cjs → resolveChannel-EJwecI0-.cjs} +6 -11
  61. package/dist/{rolldown-runtime-C0BPl7ul.cjs → rolldown-runtime-BW-eSwOZ.cjs} +1 -2
  62. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
  63. package/dist/{schema-CtP5lpU1.js → schema-BTv2xFHz.js} +2 -3
  64. package/dist/{schema-D9nJKipf.cjs → schema-CKx-cny7.cjs} +2 -3
  65. package/dist/{schema-B-JLVS42.d.ts → schema-ChcxJMuu.d.ts} +1 -3
  66. package/dist/{schema-B1i83alz.d.cts → schema-DBTZcufP.d.cts} +1 -3
  67. package/dist/schemas/zod.cjs +30 -59
  68. package/dist/schemas/zod.d.cts +0 -56
  69. package/dist/schemas/zod.d.ts +0 -56
  70. package/dist/schemas/zod.js +30 -59
  71. package/dist/schemas.cjs +1 -1
  72. package/dist/schemas.d.cts +1 -1
  73. package/dist/schemas.d.ts +1 -1
  74. package/dist/schemas.js +1 -1
  75. package/dist/{src-DB0Har0j.cjs → src-B5LvPydi.cjs} +24 -44
  76. package/dist/{src-DgHZi7PD.js → src-BAkjmW8v.js} +10 -18
  77. package/dist/{src-DvUBRBe3.js → src-BLZdiWZJ.js} +24 -44
  78. package/dist/{src-CJ_QE-uc.cjs → src-B_wC-Ff0.cjs} +4 -6
  79. package/dist/{src-TZx_e95f.cjs → src-BgwAyw-w.cjs} +20 -40
  80. package/dist/{src-CtWcViFD.cjs → src-C57GsLLI.cjs} +11 -19
  81. package/dist/{src-DefPAYdi.cjs → src-CILRt8pX.cjs} +33 -56
  82. package/dist/{src-BK5HcxMN.js → src-CkblS8lK.js} +27 -50
  83. package/dist/{src-BPxfJblL.js → src-DCLHRLpS.js} +4 -6
  84. package/dist/{src-Cg49gGJb.js → src-DtejQU3A.js} +20 -40
  85. package/dist/{vars-obKYxaSu.d.ts → vars-BLXbjxcm.d.cts} +1 -3
  86. package/dist/{vars-DtzGL5Nc.d.cts → vars-XT7wuxpb.d.ts} +1 -3
  87. package/dist/vars.cjs +3 -4
  88. package/dist/vars.d.cts +2 -2
  89. package/dist/vars.d.ts +2 -2
  90. package/dist/vars.js +3 -4
  91. package/package.json +1 -1
  92. package/dist/prompt-B45cjMsq.d.cts +0 -9
package/dist/cli.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require("./src-CtWcViFD.cjs");
3
- const require_src$1 = require("./src-DefPAYdi.cjs");
2
+ const require_src = require("./src-CILRt8pX.cjs");
3
+ const require_src$1 = require("./src-C57GsLLI.cjs");
4
4
  let node_path = require("node:path");
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  let node_url = require("node:url");
7
7
  let node_os = require("node:os");
8
8
  let commander = require("commander");
9
9
  let tsx_esm_api = require("tsx/esm/api");
10
- //#region ../cli/src/index.ts
10
+ // ../cli/src/index.ts
11
11
  let tsxRegistered = false;
12
12
  const DEFAULT_MODEL_BASENAME = "env.model";
13
13
  const MODEL_EXTENSIONS = [
@@ -78,7 +78,7 @@ function resolveModel(moduleExports, origin) {
78
78
  moduleExports.model,
79
79
  moduleExports.EnvModel
80
80
  ].concat(Object.values(moduleExports));
81
- for (const candidate of candidates) if (candidate instanceof require_src.EnvModel) return candidate;
81
+ for (const candidate of candidates) if (candidate instanceof require_src$1.EnvModel) return candidate;
82
82
  throw new Error(`Unable to locate an EnvModel export in ${origin}`);
83
83
  }
84
84
  function resolvePromptOptions(moduleExports, origin) {
@@ -89,7 +89,7 @@ function resolvePromptOptions(moduleExports, origin) {
89
89
  ];
90
90
  for (const candidate of candidates) if (candidate && typeof candidate === "object") return candidate;
91
91
  for (const value of Object.values(moduleExports)) {
92
- if (value instanceof require_src.EnvModel) continue;
92
+ if (value instanceof require_src$1.EnvModel) continue;
93
93
  if (value && typeof value === "object") return value;
94
94
  }
95
95
  throw new Error(`Unable to locate prompt configuration exports in ${origin}`);
@@ -99,12 +99,12 @@ async function handleSetupCommand(modelPathInput, configPathInput) {
99
99
  if (!modelPath) throw new Error("Unable to locate an EnvModel file. Provide a path or create a file named \"env.model.*\".");
100
100
  const model = resolveModel(await importUserModule(modelPath), modelPath);
101
101
  if (!configPathInput) {
102
- await require_src$1.prompt(model);
102
+ await require_src.prompt(model);
103
103
  return;
104
104
  }
105
105
  const configPath = toAbsolutePath(configPathInput);
106
106
  const options = resolvePromptOptions(await importUserModule(configPath), configPath);
107
- await require_src$1.prompt(model, options);
107
+ await require_src.prompt(model, options);
108
108
  }
109
109
  async function run(argv = process.argv) {
110
110
  const program = new commander.Command();
@@ -124,11 +124,9 @@ async function run(argv = process.argv) {
124
124
  program.showSuggestionAfterError();
125
125
  await program.parseAsync(argv);
126
126
  }
127
- //#endregion
128
- //#region src/cli.ts
127
+ // src/cli.ts
129
128
  run(process.argv).catch((error) => {
130
129
  if (error instanceof Error) console.error(error.message);
131
130
  else console.error(error);
132
131
  process.exit(1);
133
132
  });
134
- //#endregion
package/dist/cli.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { n as EnvModel } from "./src-DgHZi7PD.js";
3
- import { t as prompt } from "./src-BK5HcxMN.js";
2
+ import { t as prompt } from "./src-CkblS8lK.js";
3
+ import { n as EnvModel } from "./src-BAkjmW8v.js";
4
4
  import { isAbsolute, join, resolve } from "node:path";
5
5
  import { readdir } from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { homedir } from "node:os";
8
8
  import { Command } from "commander";
9
9
  import { register } from "tsx/esm/api";
10
- //#region ../cli/src/index.ts
10
+ // ../cli/src/index.ts
11
11
  let tsxRegistered = false;
12
12
  const DEFAULT_MODEL_BASENAME = "env.model";
13
13
  const MODEL_EXTENSIONS = [
@@ -124,12 +124,10 @@ async function run(argv = process.argv) {
124
124
  program.showSuggestionAfterError();
125
125
  await program.parseAsync(argv);
126
126
  }
127
- //#endregion
128
- //#region src/cli.ts
127
+ // src/cli.ts
129
128
  run(process.argv).catch((error) => {
130
129
  if (error instanceof Error) console.error(error.message);
131
130
  else console.error(error);
132
131
  process.exit(1);
133
132
  });
134
- //#endregion
135
133
  export {};
package/dist/core.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-TZx_e95f.cjs");
3
- const require_EnvVarSchema = require("./EnvVarSchema-CDZGmnex.cjs");
4
- const require_custom = require("./custom-Dyb9TnER.cjs");
5
- const require_schema = require("./schema-D9nJKipf.cjs");
6
- //#region ../core/src/processing/checks/maxLength.ts
2
+ const require_src = require("./src-BgwAyw-w.cjs");
3
+ const require_EnvVarSchema = require("./EnvVarSchema-D_fQ2A89.cjs");
4
+ const require_custom = require("./custom-_p4QyQTG.cjs");
5
+ const require_schema = require("./schema-CKx-cny7.cjs");
6
+ // ../core/src/processing/checks/maxLength.ts
7
7
  /**
8
8
  * String check: maximum length.
9
9
  */
@@ -13,8 +13,7 @@ function maxLength(max, trait) {
13
13
  return [];
14
14
  };
15
15
  }
16
- //#endregion
17
- //#region ../core/src/processing/checks/min.ts
16
+ // ../core/src/processing/checks/min.ts
18
17
  /**
19
18
  * Number check: minimum value.
20
19
  */
@@ -24,8 +23,7 @@ function min(minimum, trait) {
24
23
  return [];
25
24
  };
26
25
  }
27
- //#endregion
28
- //#region ../core/src/processing/checks/max.ts
26
+ // ../core/src/processing/checks/max.ts
29
27
  /**
30
28
  * Number check: maximum value.
31
29
  */
@@ -35,7 +33,6 @@ function max(maximum, trait) {
35
33
  return [];
36
34
  };
37
35
  }
38
- //#endregion
39
36
  exports.BooleanEnvVarSchema = require_src.BooleanEnvVarSchema;
40
37
  exports.EnumEnvVarSchema = require_src.EnumEnvVarSchema;
41
38
  exports.EnvVarSchemaBase = require_src.EnvVarSchemaBase;
package/dist/core.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- import { a as EnumEnvVarSchema, c as BooleanEnvVarSchemaInput, d as EnvVarType, f as Processor, i as NumberEnvVarSchemaInput, l as EnvVarSchemaBase, n as StringEnvVarSchemaInput, o as EnumEnvVarSchemaInput, r as NumberEnvVarSchema, s as BooleanEnvVarSchema, t as StringEnvVarSchema, u as EnvVarSchemaInput } from "./StringEnvVarSchema-D9Jr1Aws.cjs";
2
- import { a as isEnvVarSchema, i as EnvVarSchema, n as Preprocessor, r as PreprocessorToggle, t as BooleanMap } from "./BooleanMap-CX_YrPCf.cjs";
3
- import { a as number, i as boolean, n as processors, o as string, r as enumeration, s as Check, t as preprocessors } from "./preprocessors-DFVyF0c7.cjs";
4
- import { t as EnvChannel } from "./EnvChannel-CfSwa_25.cjs";
5
- import { n as schema, t as s } from "./schema-B1i83alz.cjs";
6
- //#region ../core/src/schemas/EnvVarSchemaDetails.d.ts
1
+ import { a as EnumEnvVarSchema, c as BooleanEnvVarSchemaInput, d as EnvVarType, f as Processor, i as NumberEnvVarSchemaInput, l as EnvVarSchemaBase, n as StringEnvVarSchemaInput, o as EnumEnvVarSchemaInput, r as NumberEnvVarSchema, s as BooleanEnvVarSchema, t as StringEnvVarSchema, u as EnvVarSchemaInput } from "./StringEnvVarSchema-CymYIek7.cjs";
2
+ import { a as isEnvVarSchema, i as EnvVarSchema, n as Preprocessor, r as PreprocessorToggle, t as BooleanMap } from "./BooleanMap-D74MMuAh.cjs";
3
+ import { a as number, i as boolean, n as processors, o as string, r as enumeration, s as Check, t as preprocessors } from "./preprocessors-BRPHeq3e.cjs";
4
+ import { t as EnvChannel } from "./EnvChannel-gV-4XlM8.cjs";
5
+ import { n as schema, t as s } from "./schema-DBTZcufP.cjs";
7
6
  export interface EnvVarSchemaDetails<T> {
8
7
  type: EnvVarType;
9
8
  required: boolean;
@@ -12,8 +11,6 @@ export interface EnvVarSchemaDetails<T> {
12
11
  link?: string;
13
12
  process?: Processor<T>;
14
13
  }
15
- //#endregion
16
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
17
14
  type PreprocessorOptions = Partial<{
18
15
  /**
19
16
  * Custom string preprocessing function
@@ -44,89 +41,61 @@ type PreprocessorOptions = Partial<{
44
41
  */
45
42
  enum?: Preprocessor<string> | boolean;
46
43
  }>;
47
- //#endregion
48
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
49
44
  type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
50
45
  /**
51
46
  * Resolve the effective preprocessor for a given environment variable type.
52
47
  * Respects custom overrides and falls back to built-in defaults (number, boolean).
53
48
  */
54
49
  export declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
55
- //#endregion
56
- //#region ../core/src/processing/checks/minLength.d.ts
57
50
  /**
58
51
  * String check: minimum length.
59
52
  */
60
53
  export declare function minLength(min: number, trait?: string): Check<string>;
61
- //#endregion
62
- //#region ../core/src/processing/checks/maxLength.d.ts
63
54
  /**
64
55
  * String check: maximum length.
65
56
  */
66
57
  export declare function maxLength(max: number, trait?: string): Check<string>;
67
- //#endregion
68
- //#region ../core/src/processing/checks/lengthBetween.d.ts
69
58
  /**
70
59
  * String check: length within a range.
71
60
  */
72
61
  export declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
73
- //#endregion
74
- //#region ../core/src/processing/checks/exactLength.d.ts
75
62
  /**
76
63
  * String check: exact length.
77
64
  */
78
65
  export declare function exactLength(length: number, trait?: string): Check<string>;
79
- //#endregion
80
- //#region ../core/src/processing/checks/pattern.d.ts
81
66
  /**
82
67
  * String check: regex pattern match.
83
68
  */
84
69
  export declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
85
- //#endregion
86
- //#region ../core/src/processing/checks/url.d.ts
87
70
  /**
88
71
  * String check: valid URL.
89
72
  */
90
73
  export declare function url(trait?: string): Check<string>;
91
- //#endregion
92
- //#region ../core/src/processing/checks/oneOf.d.ts
93
74
  /**
94
75
  * String check: value must be one of the provided values.
95
76
  */
96
77
  export declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
97
- //#endregion
98
- //#region ../core/src/processing/checks/integer.d.ts
99
78
  /**
100
79
  * Number check: must be an integer.
101
80
  */
102
81
  export declare function integer(trait?: string): Check<number>;
103
- //#endregion
104
- //#region ../core/src/processing/checks/min.d.ts
105
82
  /**
106
83
  * Number check: minimum value.
107
84
  */
108
85
  export declare function min(minimum: number, trait?: string): Check<number>;
109
- //#endregion
110
- //#region ../core/src/processing/checks/max.d.ts
111
86
  /**
112
87
  * Number check: maximum value.
113
88
  */
114
89
  export declare function max(maximum: number, trait?: string): Check<number>;
115
- //#endregion
116
- //#region ../core/src/processing/checks/between.d.ts
117
90
  /**
118
91
  * Number check: value within a range.
119
92
  */
120
93
  export declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
121
- //#endregion
122
- //#region ../core/src/processing/checks/custom.d.ts
123
94
  /**
124
95
  * Custom check with user-defined validation function.
125
96
  * Can return multiple traits.
126
97
  */
127
98
  export declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
128
- //#endregion
129
- //#region ../core/src/processing/helpers/toList.d.ts
130
99
  /**
131
100
  * Convert array of items to natural language list.
132
101
  * Examples:
@@ -136,12 +105,9 @@ export declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]
136
105
  * - ["one", "two", "three"] => "one, two, and three"
137
106
  */
138
107
  export declare function toList(items: string[]): string;
139
- //#endregion
140
- //#region ../core/src/processing/helpers/validate.d.ts
141
108
  /**
142
109
  * Run checks and aggregate errors.
143
110
  * Throws an error with all validation requirements if any check fails.
144
111
  */
145
112
  export declare function validate<T>(value: T, checks: Array<Check<T>>): T;
146
- //#endregion
147
113
  export { BooleanEnvVarSchema, BooleanEnvVarSchemaInput, BooleanMap, type BooleanMap as BooleanPreprocessorOptions, type Check, EnumEnvVarSchema, EnumEnvVarSchemaInput, EnvChannel, type EnvVarSchema, EnvVarSchemaBase, EnvVarSchemaInput, EnvVarType, NumberEnvVarSchema, NumberEnvVarSchemaInput, Preprocessor, PreprocessorToggle, type PreprocessorOptions as Preprocessors, Processor, StringEnvVarSchema, StringEnvVarSchemaInput, boolean, enumeration, isEnvVarSchema, number, preprocessors, processors, s, schema, string };
package/dist/core.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { a as EnumEnvVarSchema, c as BooleanEnvVarSchemaInput, d as EnvVarType, f as Processor, i as NumberEnvVarSchemaInput, l as EnvVarSchemaBase, n as StringEnvVarSchemaInput, o as EnumEnvVarSchemaInput, r as NumberEnvVarSchema, s as BooleanEnvVarSchema, t as StringEnvVarSchema, u as EnvVarSchemaInput } from "./StringEnvVarSchema-D9Jr1Aws.js";
2
- import { a as isEnvVarSchema, i as EnvVarSchema, n as Preprocessor, r as PreprocessorToggle, t as BooleanMap } from "./BooleanMap-BPQuO3Ae.js";
3
- import { a as number, i as boolean, n as processors, o as string, r as enumeration, s as Check, t as preprocessors } from "./preprocessors-BKuIcZa1.js";
4
- import { t as EnvChannel } from "./EnvChannel-CfSwa_25.js";
5
- import { n as schema, t as s } from "./schema-B-JLVS42.js";
6
- //#region ../core/src/schemas/EnvVarSchemaDetails.d.ts
1
+ import { a as EnumEnvVarSchema, c as BooleanEnvVarSchemaInput, d as EnvVarType, f as Processor, i as NumberEnvVarSchemaInput, l as EnvVarSchemaBase, n as StringEnvVarSchemaInput, o as EnumEnvVarSchemaInput, r as NumberEnvVarSchema, s as BooleanEnvVarSchema, t as StringEnvVarSchema, u as EnvVarSchemaInput } from "./StringEnvVarSchema-CymYIek7.js";
2
+ import { a as isEnvVarSchema, i as EnvVarSchema, n as Preprocessor, r as PreprocessorToggle, t as BooleanMap } from "./BooleanMap-B7iiI-eg.js";
3
+ import { a as number, i as boolean, n as processors, o as string, r as enumeration, s as Check, t as preprocessors } from "./preprocessors-BUAo8e4Q.js";
4
+ import { t as EnvChannel } from "./EnvChannel-gV-4XlM8.js";
5
+ import { n as schema, t as s } from "./schema-ChcxJMuu.js";
7
6
  export interface EnvVarSchemaDetails<T> {
8
7
  type: EnvVarType;
9
8
  required: boolean;
@@ -12,8 +11,6 @@ export interface EnvVarSchemaDetails<T> {
12
11
  link?: string;
13
12
  process?: Processor<T>;
14
13
  }
15
- //#endregion
16
- //#region ../core/src/processing/options/PreprocessorOptions.d.ts
17
14
  type PreprocessorOptions = Partial<{
18
15
  /**
19
16
  * Custom string preprocessing function
@@ -44,89 +41,61 @@ type PreprocessorOptions = Partial<{
44
41
  */
45
42
  enum?: Preprocessor<string> | boolean;
46
43
  }>;
47
- //#endregion
48
- //#region ../core/src/processing/preprocessors/resolvePreprocessor.d.ts
49
44
  type DefaultPreprocessor<T extends EnvVarType> = T extends "number" ? Preprocessor<number> : T extends "boolean" ? Preprocessor<boolean> : Preprocessor<string>;
50
45
  /**
51
46
  * Resolve the effective preprocessor for a given environment variable type.
52
47
  * Respects custom overrides and falls back to built-in defaults (number, boolean).
53
48
  */
54
49
  export declare function resolvePreprocessor<T extends EnvVarType>(envVarType: T, preprocessorOptions?: PreprocessorOptions): DefaultPreprocessor<T> | undefined;
55
- //#endregion
56
- //#region ../core/src/processing/checks/minLength.d.ts
57
50
  /**
58
51
  * String check: minimum length.
59
52
  */
60
53
  export declare function minLength(min: number, trait?: string): Check<string>;
61
- //#endregion
62
- //#region ../core/src/processing/checks/maxLength.d.ts
63
54
  /**
64
55
  * String check: maximum length.
65
56
  */
66
57
  export declare function maxLength(max: number, trait?: string): Check<string>;
67
- //#endregion
68
- //#region ../core/src/processing/checks/lengthBetween.d.ts
69
58
  /**
70
59
  * String check: length within a range.
71
60
  */
72
61
  export declare function lengthBetween(min: number, max: number, trait?: string): Check<string>;
73
- //#endregion
74
- //#region ../core/src/processing/checks/exactLength.d.ts
75
62
  /**
76
63
  * String check: exact length.
77
64
  */
78
65
  export declare function exactLength(length: number, trait?: string): Check<string>;
79
- //#endregion
80
- //#region ../core/src/processing/checks/pattern.d.ts
81
66
  /**
82
67
  * String check: regex pattern match.
83
68
  */
84
69
  export declare function pattern(regex: RegExp, trait: string | readonly string[]): Check<string>;
85
- //#endregion
86
- //#region ../core/src/processing/checks/url.d.ts
87
70
  /**
88
71
  * String check: valid URL.
89
72
  */
90
73
  export declare function url(trait?: string): Check<string>;
91
- //#endregion
92
- //#region ../core/src/processing/checks/oneOf.d.ts
93
74
  /**
94
75
  * String check: value must be one of the provided values.
95
76
  */
96
77
  export declare function oneOf<T extends string>(values: readonly T[], trait?: string): Check<string>;
97
- //#endregion
98
- //#region ../core/src/processing/checks/integer.d.ts
99
78
  /**
100
79
  * Number check: must be an integer.
101
80
  */
102
81
  export declare function integer(trait?: string): Check<number>;
103
- //#endregion
104
- //#region ../core/src/processing/checks/min.d.ts
105
82
  /**
106
83
  * Number check: minimum value.
107
84
  */
108
85
  export declare function min(minimum: number, trait?: string): Check<number>;
109
- //#endregion
110
- //#region ../core/src/processing/checks/max.d.ts
111
86
  /**
112
87
  * Number check: maximum value.
113
88
  */
114
89
  export declare function max(maximum: number, trait?: string): Check<number>;
115
- //#endregion
116
- //#region ../core/src/processing/checks/between.d.ts
117
90
  /**
118
91
  * Number check: value within a range.
119
92
  */
120
93
  export declare function between(minimum: number, maximum: number, trait?: string): Check<number>;
121
- //#endregion
122
- //#region ../core/src/processing/checks/custom.d.ts
123
94
  /**
124
95
  * Custom check with user-defined validation function.
125
96
  * Can return multiple traits.
126
97
  */
127
98
  export declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]): Check<T>;
128
- //#endregion
129
- //#region ../core/src/processing/helpers/toList.d.ts
130
99
  /**
131
100
  * Convert array of items to natural language list.
132
101
  * Examples:
@@ -136,12 +105,9 @@ export declare function custom<T>(fn: (value: T) => boolean, ...traits: string[]
136
105
  * - ["one", "two", "three"] => "one, two, and three"
137
106
  */
138
107
  export declare function toList(items: string[]): string;
139
- //#endregion
140
- //#region ../core/src/processing/helpers/validate.d.ts
141
108
  /**
142
109
  * Run checks and aggregate errors.
143
110
  * Throws an error with all validation requirements if any check fails.
144
111
  */
145
112
  export declare function validate<T>(value: T, checks: Array<Check<T>>): T;
146
- //#endregion
147
113
  export { BooleanEnvVarSchema, BooleanEnvVarSchemaInput, BooleanMap, type BooleanMap as BooleanPreprocessorOptions, type Check, EnumEnvVarSchema, EnumEnvVarSchemaInput, EnvChannel, type EnvVarSchema, EnvVarSchemaBase, EnvVarSchemaInput, EnvVarType, NumberEnvVarSchema, NumberEnvVarSchemaInput, Preprocessor, PreprocessorToggle, type PreprocessorOptions as Preprocessors, Processor, StringEnvVarSchema, StringEnvVarSchemaInput, boolean, enumeration, isEnvVarSchema, number, preprocessors, processors, s, schema, string };
package/dist/core.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as EnumEnvVarSchema, c as enumeration, d as string, f as validate, i as NumberEnvVarSchema, l as boolean, m as EnvVarSchemaBase, n as preprocessors, o as BooleanEnvVarSchema, p as toList, r as StringEnvVarSchema, s as processors, t as resolvePreprocessor, u as number } from "./src-Cg49gGJb.js";
2
- import { t as isEnvVarSchema } from "./EnvVarSchema-Dr6q7jf6.js";
3
- import { a as url, c as lengthBetween, i as oneOf, l as minLength, n as between, o as pattern, r as integer, s as exactLength, t as custom } from "./custom-Bd-jLg80.js";
4
- import { n as schema, t as s } from "./schema-CtP5lpU1.js";
5
- //#region ../core/src/processing/checks/maxLength.ts
1
+ import { a as EnumEnvVarSchema, c as enumeration, d as string, f as validate, i as NumberEnvVarSchema, l as boolean, m as EnvVarSchemaBase, n as preprocessors, o as BooleanEnvVarSchema, p as toList, r as StringEnvVarSchema, s as processors, t as resolvePreprocessor, u as number } from "./src-DtejQU3A.js";
2
+ import { t as isEnvVarSchema } from "./EnvVarSchema-Dd3ZrR30.js";
3
+ import { a as url, c as lengthBetween, i as oneOf, l as minLength, n as between, o as pattern, r as integer, s as exactLength, t as custom } from "./custom-BRT8y9Jj.js";
4
+ import { n as schema, t as s } from "./schema-BTv2xFHz.js";
5
+ // ../core/src/processing/checks/maxLength.ts
6
6
  /**
7
7
  * String check: maximum length.
8
8
  */
@@ -12,8 +12,7 @@ function maxLength(max, trait) {
12
12
  return [];
13
13
  };
14
14
  }
15
- //#endregion
16
- //#region ../core/src/processing/checks/min.ts
15
+ // ../core/src/processing/checks/min.ts
17
16
  /**
18
17
  * Number check: minimum value.
19
18
  */
@@ -23,8 +22,7 @@ function min(minimum, trait) {
23
22
  return [];
24
23
  };
25
24
  }
26
- //#endregion
27
- //#region ../core/src/processing/checks/max.ts
25
+ // ../core/src/processing/checks/max.ts
28
26
  /**
29
27
  * Number check: maximum value.
30
28
  */
@@ -34,5 +32,4 @@ function max(maximum, trait) {
34
32
  return [];
35
33
  };
36
34
  }
37
- //#endregion
38
35
  export { BooleanEnvVarSchema, EnumEnvVarSchema, EnvVarSchemaBase, NumberEnvVarSchema, StringEnvVarSchema, between, boolean, custom, enumeration, exactLength, integer, isEnvVarSchema, lengthBetween, max, maxLength, min, minLength, number, oneOf, pattern, preprocessors, processors, resolvePreprocessor, s, schema, string, toList, url, validate };
@@ -1,4 +1,4 @@
1
- //#region ../core/src/processing/checks/minLength.ts
1
+ // ../core/src/processing/checks/minLength.ts
2
2
  /**
3
3
  * String check: minimum length.
4
4
  */
@@ -8,8 +8,7 @@ function minLength(min, trait) {
8
8
  return [];
9
9
  };
10
10
  }
11
- //#endregion
12
- //#region ../core/src/processing/checks/lengthBetween.ts
11
+ // ../core/src/processing/checks/lengthBetween.ts
13
12
  /**
14
13
  * String check: length within a range.
15
14
  */
@@ -19,8 +18,7 @@ function lengthBetween(min, max, trait) {
19
18
  return [];
20
19
  };
21
20
  }
22
- //#endregion
23
- //#region ../core/src/processing/checks/exactLength.ts
21
+ // ../core/src/processing/checks/exactLength.ts
24
22
  /**
25
23
  * String check: exact length.
26
24
  */
@@ -30,8 +28,7 @@ function exactLength(length, trait) {
30
28
  return [];
31
29
  };
32
30
  }
33
- //#endregion
34
- //#region ../core/src/processing/checks/pattern.ts
31
+ // ../core/src/processing/checks/pattern.ts
35
32
  /**
36
33
  * String check: regex pattern match.
37
34
  */
@@ -41,8 +38,7 @@ function pattern(regex, trait) {
41
38
  return [];
42
39
  };
43
40
  }
44
- //#endregion
45
- //#region ../core/src/processing/checks/url.ts
41
+ // ../core/src/processing/checks/url.ts
46
42
  /**
47
43
  * String check: valid URL.
48
44
  */
@@ -56,8 +52,7 @@ function url(trait) {
56
52
  }
57
53
  };
58
54
  }
59
- //#endregion
60
- //#region ../core/src/processing/checks/oneOf.ts
55
+ // ../core/src/processing/checks/oneOf.ts
61
56
  /**
62
57
  * String check: value must be one of the provided values.
63
58
  */
@@ -67,8 +62,7 @@ function oneOf(values, trait) {
67
62
  return [];
68
63
  };
69
64
  }
70
- //#endregion
71
- //#region ../core/src/processing/checks/integer.ts
65
+ // ../core/src/processing/checks/integer.ts
72
66
  /**
73
67
  * Number check: must be an integer.
74
68
  */
@@ -78,8 +72,7 @@ function integer(trait) {
78
72
  return [];
79
73
  };
80
74
  }
81
- //#endregion
82
- //#region ../core/src/processing/checks/between.ts
75
+ // ../core/src/processing/checks/between.ts
83
76
  /**
84
77
  * Number check: value within a range.
85
78
  */
@@ -89,8 +82,7 @@ function between(minimum, maximum, trait) {
89
82
  return [];
90
83
  };
91
84
  }
92
- //#endregion
93
- //#region ../core/src/processing/checks/custom.ts
85
+ // ../core/src/processing/checks/custom.ts
94
86
  /**
95
87
  * Custom check with user-defined validation function.
96
88
  * Can return multiple traits.
@@ -101,5 +93,4 @@ function custom(fn, ...traits) {
101
93
  return [];
102
94
  };
103
95
  }
104
- //#endregion
105
96
  export { url as a, lengthBetween as c, oneOf as i, minLength as l, between as n, pattern as o, integer as r, exactLength as s, custom as t };
@@ -1,4 +1,4 @@
1
- //#region ../core/src/processing/checks/minLength.ts
1
+ // ../core/src/processing/checks/minLength.ts
2
2
  /**
3
3
  * String check: minimum length.
4
4
  */
@@ -8,8 +8,7 @@ function minLength(min, trait) {
8
8
  return [];
9
9
  };
10
10
  }
11
- //#endregion
12
- //#region ../core/src/processing/checks/lengthBetween.ts
11
+ // ../core/src/processing/checks/lengthBetween.ts
13
12
  /**
14
13
  * String check: length within a range.
15
14
  */
@@ -19,8 +18,7 @@ function lengthBetween(min, max, trait) {
19
18
  return [];
20
19
  };
21
20
  }
22
- //#endregion
23
- //#region ../core/src/processing/checks/exactLength.ts
21
+ // ../core/src/processing/checks/exactLength.ts
24
22
  /**
25
23
  * String check: exact length.
26
24
  */
@@ -30,8 +28,7 @@ function exactLength(length, trait) {
30
28
  return [];
31
29
  };
32
30
  }
33
- //#endregion
34
- //#region ../core/src/processing/checks/pattern.ts
31
+ // ../core/src/processing/checks/pattern.ts
35
32
  /**
36
33
  * String check: regex pattern match.
37
34
  */
@@ -41,8 +38,7 @@ function pattern(regex, trait) {
41
38
  return [];
42
39
  };
43
40
  }
44
- //#endregion
45
- //#region ../core/src/processing/checks/url.ts
41
+ // ../core/src/processing/checks/url.ts
46
42
  /**
47
43
  * String check: valid URL.
48
44
  */
@@ -56,8 +52,7 @@ function url(trait) {
56
52
  }
57
53
  };
58
54
  }
59
- //#endregion
60
- //#region ../core/src/processing/checks/oneOf.ts
55
+ // ../core/src/processing/checks/oneOf.ts
61
56
  /**
62
57
  * String check: value must be one of the provided values.
63
58
  */
@@ -67,8 +62,7 @@ function oneOf(values, trait) {
67
62
  return [];
68
63
  };
69
64
  }
70
- //#endregion
71
- //#region ../core/src/processing/checks/integer.ts
65
+ // ../core/src/processing/checks/integer.ts
72
66
  /**
73
67
  * Number check: must be an integer.
74
68
  */
@@ -78,8 +72,7 @@ function integer(trait) {
78
72
  return [];
79
73
  };
80
74
  }
81
- //#endregion
82
- //#region ../core/src/processing/checks/between.ts
75
+ // ../core/src/processing/checks/between.ts
83
76
  /**
84
77
  * Number check: value within a range.
85
78
  */
@@ -89,8 +82,7 @@ function between(minimum, maximum, trait) {
89
82
  return [];
90
83
  };
91
84
  }
92
- //#endregion
93
- //#region ../core/src/processing/checks/custom.ts
85
+ // ../core/src/processing/checks/custom.ts
94
86
  /**
95
87
  * Custom check with user-defined validation function.
96
88
  * Can return multiple traits.
@@ -101,7 +93,6 @@ function custom(fn, ...traits) {
101
93
  return [];
102
94
  };
103
95
  }
104
- //#endregion
105
96
  Object.defineProperty(exports, "between", {
106
97
  enumerable: true,
107
98
  get: function() {
package/dist/files.cjs CHANGED
@@ -2,15 +2,13 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_EnvSource = require("./EnvSource-s8F_M_6O.cjs");
6
- //#region ../files/src/source.ts
5
+ const require_EnvSource = require("./EnvSource-B_7XBrZM.cjs");
6
+ // ../files/src/source.ts
7
7
  function source(filePath) {
8
8
  return new require_EnvSource.EnvSource(filePath);
9
9
  }
10
- //#endregion
11
- //#region src/files.ts
10
+ // src/files.ts
12
11
  var files_default = source;
13
- //#endregion
14
12
  exports.EnvSource = require_EnvSource.EnvSource;
15
13
  exports.default = files_default;
16
14
  exports.get = require_EnvSource.get;
package/dist/files.d.cts CHANGED
@@ -1,9 +1,6 @@
1
- //#region ../files/src/types.d.ts
2
1
  type EnvRecord = Record<string, string>;
3
2
  type EnvSelectionRecord<T extends readonly string[]> = { [K in T[number]]: string | undefined; };
4
3
  type EnvPrimitiveValue = string | number | boolean | bigint;
5
- //#endregion
6
- //#region ../files/src/EnvSource.d.ts
7
4
  export declare class EnvSource {
8
5
  private readonly filePath;
9
6
  constructor(filePath: string);
@@ -22,17 +19,10 @@ export declare class EnvSource {
22
19
  private ensureDirectorySync;
23
20
  private ensureDirectory;
24
21
  }
25
- //#endregion
26
- //#region ../files/src/get.d.ts
27
22
  export declare function get(content: string): EnvRecord;
28
23
  export declare function get(content: string, name: string): string | undefined;
29
24
  export declare function get<const Names extends readonly string[]>(content: string, names: Names): EnvSelectionRecord<Names>;
30
- //#endregion
31
- //#region ../files/src/set.d.ts
32
25
  export declare function set(content: string, name: string, value: EnvPrimitiveValue): string;
33
26
  export declare function set(content: string, values: Record<string, EnvPrimitiveValue>): string;
34
- //#endregion
35
- //#region ../files/src/source.d.ts
36
27
  export declare function source(filePath: string): EnvSource;
37
- //#endregion
38
28
  export { type EnvPrimitiveValue, type EnvRecord, type EnvSelectionRecord, source as default };