@xlameiro/env-typegen 0.1.0

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.
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Supported TypeScript types that env-typegen can infer or generate.
3
+ * The inference engine maps each .env.example value to one of these.
4
+ */
5
+ type EnvVarType = "string" | "number" | "boolean" | "url" | "email" | "semver" | "json" | "unknown";
6
+ /**
7
+ * A single parsed environment variable from a .env.example file.
8
+ * Produced by the parser after reading and associating comment blocks.
9
+ */
10
+ type ParsedEnvVar = {
11
+ /** The variable name as written in .env.example (e.g. DATABASE_URL) */
12
+ key: string;
13
+ /** Raw string value from .env.example before any processing */
14
+ rawValue: string;
15
+ /** Type inferred by the inference engine from key pattern and value */
16
+ inferredType: EnvVarType;
17
+ /** Type explicitly declared with @type in a preceding JSDoc comment block */
18
+ annotatedType?: EnvVarType;
19
+ /** Description from @description annotation or a free-form comment on the preceding line */
20
+ description?: string;
21
+ /** true when the value is non-empty OR the variable has @required annotation */
22
+ isRequired: boolean;
23
+ /** true when the value is empty and there is no @required annotation */
24
+ isOptional: boolean;
25
+ /** true when the key starts with NEXT_PUBLIC_ */
26
+ isClientSide: boolean;
27
+ /** Nearest enclosing section header, e.g. "--- Auth ---" → "Auth" */
28
+ group?: string;
29
+ /** 1-based line number of the KEY=VALUE line in the source file */
30
+ lineNumber: number;
31
+ };
32
+ /**
33
+ * The complete result of parsing a single .env.example file.
34
+ * Passed to generators to produce TypeScript / Zod / t3-env output.
35
+ */
36
+ type ParsedEnvFile = {
37
+ /** Resolved absolute path to the source .env.example file */
38
+ filePath: string;
39
+ /** All parsed variables in source order */
40
+ vars: ParsedEnvVar[];
41
+ /** Unique group names found in the file, in order of appearance */
42
+ groups: string[];
43
+ };
44
+
45
+ /**
46
+ * Structured annotations extracted from a JSDoc-style comment block
47
+ * that precedes an env var declaration.
48
+ *
49
+ * @example
50
+ * ```
51
+ * # @description PostgreSQL connection string
52
+ * # @required
53
+ * # @type string
54
+ * DATABASE_URL=
55
+ * ```
56
+ */
57
+ type CommentAnnotations = {
58
+ /** Type explicitly declared with `@type` in the comment block */
59
+ annotatedType?: EnvVarType;
60
+ /** Description from `@description` or the first free-form comment line */
61
+ description?: string;
62
+ /** true when the `@required` annotation is present in the comment block */
63
+ isRequired: boolean;
64
+ };
65
+ /**
66
+ * Parse a block of consecutive comment lines (each starting with `#`) and
67
+ * extract JSDoc-style annotations.
68
+ *
69
+ * Recognised annotations:
70
+ * - `@description <text>` — sets the variable description
71
+ * - `@required` — marks the variable as required regardless of value
72
+ * - `@optional` — informational (isRequired stays false)
73
+ * - `@type <EnvVarType>` — overrides the inferred type
74
+ *
75
+ * Non-annotation comment lines act as a fallback description when no
76
+ * `@description` annotation is present (first non-empty line wins).
77
+ *
78
+ * @param lines - Raw comment lines from the .env file, e.g. `["# @required"]`
79
+ */
80
+ declare function parseCommentBlock(lines: readonly string[]): CommentAnnotations;
81
+
82
+ type InferenceRule = {
83
+ id: string;
84
+ priority: number;
85
+ match: (key: string, value: string) => boolean;
86
+ type: EnvVarType;
87
+ };
88
+ declare const inferenceRules: readonly InferenceRule[];
89
+
90
+ type InferTypeOptions = {
91
+ fallbackType?: EnvVarType;
92
+ };
93
+ declare function inferType(key: string, value: string, options?: InferTypeOptions): EnvVarType;
94
+ declare function inferTypesFromParsedVars(parsed: {
95
+ vars: Array<{
96
+ key: string;
97
+ rawValue: string;
98
+ }>;
99
+ }, options?: InferTypeOptions): EnvVarType[];
100
+
101
+ /**
102
+ * Parse the string content of a `.env.example` file into a `ParsedEnvFile`.
103
+ *
104
+ * Exposed separately from `parseEnvFile` to enable unit testing without
105
+ * filesystem access.
106
+ *
107
+ * @param content - Raw file content as a UTF-8 string
108
+ * @param filePath - Used to populate `ParsedEnvFile.filePath` only
109
+ */
110
+ declare function parseEnvFileContent(content: string, filePath: string): ParsedEnvFile;
111
+ /**
112
+ * Read and parse a `.env.example` file from disk.
113
+ *
114
+ * @param filePath - Absolute or relative path to the file
115
+ */
116
+ declare function parseEnvFile(filePath: string): ParsedEnvFile;
117
+
118
+ /**
119
+ * Generates a TypeScript source file from a parsed .env.example file.
120
+ *
121
+ * Output structure:
122
+ * 1. Header comments — generated-by notice, source file name, ISO timestamp
123
+ * 2. `declare namespace NodeJS { interface ProcessEnv { ... } }` — global augmentation
124
+ * where all properties are typed as `readonly string` (the runtime reality).
125
+ * Number and boolean vars include an inline coercion hint comment.
126
+ * 3. `export type EnvVars = { ... }` — typed module export using semantic types
127
+ * (number, boolean, string).
128
+ * 4. `ServerEnvVars` / `ClientEnvVars` — emitted only when `NEXT_PUBLIC_` vars exist.
129
+ *
130
+ * The output is valid as both a `.ts` and `.d.ts` file.
131
+ * For an ambient-only `.d.ts` (without `export type` statements), use
132
+ * `generateDeclaration` instead.
133
+ *
134
+ * `annotatedType` takes precedence over `inferredType` when both are set.
135
+ */
136
+ declare function generateTypeScriptTypes(parsed: ParsedEnvFile): string;
137
+ /**
138
+ * Generates a runtime `validateEnv()` function that throws when any required
139
+ * environment variable is absent from `process.env`.
140
+ */
141
+ declare function generateEnvValidation(parsed: ParsedEnvFile): string;
142
+
143
+ /**
144
+ * Generates a Zod schema file from a parsed .env.example file.
145
+ *
146
+ * Output structure:
147
+ * ```
148
+ * // Generated by env-typegen — do not edit manually
149
+ * import { z } from "zod";
150
+ *
151
+ * export const serverEnvSchema = z.object({
152
+ * DATABASE_URL: z.string().url(),
153
+ * PORT: z.coerce.number(),
154
+ * });
155
+ *
156
+ * export const clientEnvSchema = z.object({
157
+ * NEXT_PUBLIC_API_URL: z.string().url(),
158
+ * });
159
+ *
160
+ * export const envSchema = serverEnvSchema.merge(clientEnvSchema);
161
+ * export type Env = z.infer<typeof envSchema>;
162
+ * ```
163
+ *
164
+ * - Server-side vars (non-`NEXT_PUBLIC_`) go into `serverEnvSchema`
165
+ * - Client-side vars (`NEXT_PUBLIC_` prefix) go into `clientEnvSchema`
166
+ * - `envSchema` is the merged union of both, for full-stack validation
167
+ * - `annotatedType` takes precedence over `inferredType` when both are set
168
+ * - Optional vars have `.optional()` appended to their Zod expression
169
+ */
170
+ declare function generateZodSchema(parsed: ParsedEnvFile): string;
171
+
172
+ /**
173
+ * Generates an ambient `.d.ts` declaration file from a parsed .env.example.
174
+ *
175
+ * Output is a pure `NodeJS.ProcessEnv` augmentation — no `export type` statements.
176
+ * This makes the file valid as a global ambient declaration that can be dropped
177
+ * into `lib/` or `types/` without affecting module resolution.
178
+ *
179
+ * Output structure:
180
+ * ```
181
+ * // Generated by env-typegen — do not edit manually
182
+ * // Source: .env.example
183
+ *
184
+ * declare namespace NodeJS {
185
+ * interface ProcessEnv {
186
+ * readonly KEY: string; // all vars are runtime strings
187
+ * readonly OPT?: string; // optional vars use ?: string
188
+ * readonly NUM: string; // coerce to number: Number(process.env.NUM)
189
+ * readonly FLAG: string; // coerce to boolean: process.env.FLAG === 'true'
190
+ * }
191
+ * }
192
+ * ```
193
+ *
194
+ * For a `.ts` output with typed `export type EnvVars` / `ServerEnvVars` /
195
+ * `ClientEnvVars`, use `generateTypeScriptTypes` instead.
196
+ *
197
+ * - `ProcessEnv` uses `readonly string` for every variable (runtime reality)
198
+ * - Number and boolean vars include an inline coercion hint comment
199
+ * - `annotatedType` takes precedence over `inferredType`
200
+ */
201
+ declare function generateDeclaration(parsed: ParsedEnvFile): string;
202
+
203
+ /**
204
+ * Generates a `@t3-oss/env-nextjs` configuration file from a parsed .env.example.
205
+ *
206
+ * Output structure:
207
+ * ```
208
+ * import { createEnv } from "@t3-oss/env-nextjs";
209
+ * import { z } from "zod";
210
+ *
211
+ * export const env = createEnv({
212
+ * server: { /* non-NEXT_PUBLIC_ vars *\/ },
213
+ * client: { /* NEXT_PUBLIC_ vars *\/ },
214
+ * runtimeEnv: { /* all vars mapped to process.env *\/ },
215
+ * });
216
+ * ```
217
+ *
218
+ * - `server:` is omitted when there are no server-side vars
219
+ * - `client:` is omitted when there are no client-side vars (NEXT_PUBLIC_ prefix)
220
+ * - `runtimeEnv:` always includes all vars
221
+ * - `annotatedType` takes precedence over `inferredType`
222
+ * - Optional vars have `.optional()` appended
223
+ * - Vars with a description have `.describe("text")` appended (before `.optional()`)
224
+ */
225
+ declare function generateT3Env(parsed: ParsedEnvFile): string;
226
+
227
+ /** Generator identifiers supported by env-typegen. */
228
+ type GeneratorName = "typescript" | "zod" | "t3" | "declaration";
229
+ /** Configuration shape accepted by env-typegen's CLI and programmatic API. */
230
+ type EnvTypegenConfig = {
231
+ /** Path to the .env.example file to parse. */
232
+ input: string;
233
+ /** Output directory for generated files. Defaults to the input file's directory. */
234
+ output?: string;
235
+ /** Which generators to run. When omitted, all four generators run. */
236
+ generators?: GeneratorName[];
237
+ /** Format generated output with prettier. Defaults to true. */
238
+ format?: boolean;
239
+ };
240
+ /**
241
+ * Type-safe config helper.
242
+ * Returns the config object unchanged — exists purely for IDE autocompletion
243
+ * and compile-time validation of the config shape.
244
+ */
245
+ declare function defineConfig(config: EnvTypegenConfig): EnvTypegenConfig;
246
+ /**
247
+ * Loads env-typegen config by searching for a config file in `cwd`.
248
+ * Searches for env-typegen.config.ts → .mjs → .js in order.
249
+ * Returns `undefined` when no config file is found.
250
+ */
251
+ declare function loadConfig(cwd?: string): Promise<EnvTypegenConfig | undefined>;
252
+
253
+ /** Options accepted by the runGenerate pipeline. */
254
+ type RunGenerateOptions = {
255
+ input: string;
256
+ output: string;
257
+ generators: GeneratorName[];
258
+ format: boolean;
259
+ stdout?: boolean;
260
+ dryRun?: boolean;
261
+ silent?: boolean;
262
+ };
263
+ /**
264
+ * Reads the input file, runs the requested generators, optionally formats each
265
+ * output, and writes the results to disk.
266
+ *
267
+ * Exported for unit testing — call this directly rather than spawning a child process.
268
+ */
269
+ declare function runGenerate(options: RunGenerateOptions): Promise<void>;
270
+
271
+ export { type CommentAnnotations, type EnvTypegenConfig, type EnvVarType, type GeneratorName, type InferenceRule, type ParsedEnvFile, type ParsedEnvVar, type RunGenerateOptions, defineConfig, generateDeclaration, generateEnvValidation, generateT3Env, generateTypeScriptTypes as generateTypeScript, generateTypeScriptTypes, generateZodSchema as generateZod, generateZodSchema, inferType, inferTypesFromParsedVars as inferTypes, inferenceRules, loadConfig, parseCommentBlock, parseEnvFile, parseEnvFileContent, runGenerate };
@@ -0,0 +1,271 @@
1
+ /**
2
+ * Supported TypeScript types that env-typegen can infer or generate.
3
+ * The inference engine maps each .env.example value to one of these.
4
+ */
5
+ type EnvVarType = "string" | "number" | "boolean" | "url" | "email" | "semver" | "json" | "unknown";
6
+ /**
7
+ * A single parsed environment variable from a .env.example file.
8
+ * Produced by the parser after reading and associating comment blocks.
9
+ */
10
+ type ParsedEnvVar = {
11
+ /** The variable name as written in .env.example (e.g. DATABASE_URL) */
12
+ key: string;
13
+ /** Raw string value from .env.example before any processing */
14
+ rawValue: string;
15
+ /** Type inferred by the inference engine from key pattern and value */
16
+ inferredType: EnvVarType;
17
+ /** Type explicitly declared with @type in a preceding JSDoc comment block */
18
+ annotatedType?: EnvVarType;
19
+ /** Description from @description annotation or a free-form comment on the preceding line */
20
+ description?: string;
21
+ /** true when the value is non-empty OR the variable has @required annotation */
22
+ isRequired: boolean;
23
+ /** true when the value is empty and there is no @required annotation */
24
+ isOptional: boolean;
25
+ /** true when the key starts with NEXT_PUBLIC_ */
26
+ isClientSide: boolean;
27
+ /** Nearest enclosing section header, e.g. "--- Auth ---" → "Auth" */
28
+ group?: string;
29
+ /** 1-based line number of the KEY=VALUE line in the source file */
30
+ lineNumber: number;
31
+ };
32
+ /**
33
+ * The complete result of parsing a single .env.example file.
34
+ * Passed to generators to produce TypeScript / Zod / t3-env output.
35
+ */
36
+ type ParsedEnvFile = {
37
+ /** Resolved absolute path to the source .env.example file */
38
+ filePath: string;
39
+ /** All parsed variables in source order */
40
+ vars: ParsedEnvVar[];
41
+ /** Unique group names found in the file, in order of appearance */
42
+ groups: string[];
43
+ };
44
+
45
+ /**
46
+ * Structured annotations extracted from a JSDoc-style comment block
47
+ * that precedes an env var declaration.
48
+ *
49
+ * @example
50
+ * ```
51
+ * # @description PostgreSQL connection string
52
+ * # @required
53
+ * # @type string
54
+ * DATABASE_URL=
55
+ * ```
56
+ */
57
+ type CommentAnnotations = {
58
+ /** Type explicitly declared with `@type` in the comment block */
59
+ annotatedType?: EnvVarType;
60
+ /** Description from `@description` or the first free-form comment line */
61
+ description?: string;
62
+ /** true when the `@required` annotation is present in the comment block */
63
+ isRequired: boolean;
64
+ };
65
+ /**
66
+ * Parse a block of consecutive comment lines (each starting with `#`) and
67
+ * extract JSDoc-style annotations.
68
+ *
69
+ * Recognised annotations:
70
+ * - `@description <text>` — sets the variable description
71
+ * - `@required` — marks the variable as required regardless of value
72
+ * - `@optional` — informational (isRequired stays false)
73
+ * - `@type <EnvVarType>` — overrides the inferred type
74
+ *
75
+ * Non-annotation comment lines act as a fallback description when no
76
+ * `@description` annotation is present (first non-empty line wins).
77
+ *
78
+ * @param lines - Raw comment lines from the .env file, e.g. `["# @required"]`
79
+ */
80
+ declare function parseCommentBlock(lines: readonly string[]): CommentAnnotations;
81
+
82
+ type InferenceRule = {
83
+ id: string;
84
+ priority: number;
85
+ match: (key: string, value: string) => boolean;
86
+ type: EnvVarType;
87
+ };
88
+ declare const inferenceRules: readonly InferenceRule[];
89
+
90
+ type InferTypeOptions = {
91
+ fallbackType?: EnvVarType;
92
+ };
93
+ declare function inferType(key: string, value: string, options?: InferTypeOptions): EnvVarType;
94
+ declare function inferTypesFromParsedVars(parsed: {
95
+ vars: Array<{
96
+ key: string;
97
+ rawValue: string;
98
+ }>;
99
+ }, options?: InferTypeOptions): EnvVarType[];
100
+
101
+ /**
102
+ * Parse the string content of a `.env.example` file into a `ParsedEnvFile`.
103
+ *
104
+ * Exposed separately from `parseEnvFile` to enable unit testing without
105
+ * filesystem access.
106
+ *
107
+ * @param content - Raw file content as a UTF-8 string
108
+ * @param filePath - Used to populate `ParsedEnvFile.filePath` only
109
+ */
110
+ declare function parseEnvFileContent(content: string, filePath: string): ParsedEnvFile;
111
+ /**
112
+ * Read and parse a `.env.example` file from disk.
113
+ *
114
+ * @param filePath - Absolute or relative path to the file
115
+ */
116
+ declare function parseEnvFile(filePath: string): ParsedEnvFile;
117
+
118
+ /**
119
+ * Generates a TypeScript source file from a parsed .env.example file.
120
+ *
121
+ * Output structure:
122
+ * 1. Header comments — generated-by notice, source file name, ISO timestamp
123
+ * 2. `declare namespace NodeJS { interface ProcessEnv { ... } }` — global augmentation
124
+ * where all properties are typed as `readonly string` (the runtime reality).
125
+ * Number and boolean vars include an inline coercion hint comment.
126
+ * 3. `export type EnvVars = { ... }` — typed module export using semantic types
127
+ * (number, boolean, string).
128
+ * 4. `ServerEnvVars` / `ClientEnvVars` — emitted only when `NEXT_PUBLIC_` vars exist.
129
+ *
130
+ * The output is valid as both a `.ts` and `.d.ts` file.
131
+ * For an ambient-only `.d.ts` (without `export type` statements), use
132
+ * `generateDeclaration` instead.
133
+ *
134
+ * `annotatedType` takes precedence over `inferredType` when both are set.
135
+ */
136
+ declare function generateTypeScriptTypes(parsed: ParsedEnvFile): string;
137
+ /**
138
+ * Generates a runtime `validateEnv()` function that throws when any required
139
+ * environment variable is absent from `process.env`.
140
+ */
141
+ declare function generateEnvValidation(parsed: ParsedEnvFile): string;
142
+
143
+ /**
144
+ * Generates a Zod schema file from a parsed .env.example file.
145
+ *
146
+ * Output structure:
147
+ * ```
148
+ * // Generated by env-typegen — do not edit manually
149
+ * import { z } from "zod";
150
+ *
151
+ * export const serverEnvSchema = z.object({
152
+ * DATABASE_URL: z.string().url(),
153
+ * PORT: z.coerce.number(),
154
+ * });
155
+ *
156
+ * export const clientEnvSchema = z.object({
157
+ * NEXT_PUBLIC_API_URL: z.string().url(),
158
+ * });
159
+ *
160
+ * export const envSchema = serverEnvSchema.merge(clientEnvSchema);
161
+ * export type Env = z.infer<typeof envSchema>;
162
+ * ```
163
+ *
164
+ * - Server-side vars (non-`NEXT_PUBLIC_`) go into `serverEnvSchema`
165
+ * - Client-side vars (`NEXT_PUBLIC_` prefix) go into `clientEnvSchema`
166
+ * - `envSchema` is the merged union of both, for full-stack validation
167
+ * - `annotatedType` takes precedence over `inferredType` when both are set
168
+ * - Optional vars have `.optional()` appended to their Zod expression
169
+ */
170
+ declare function generateZodSchema(parsed: ParsedEnvFile): string;
171
+
172
+ /**
173
+ * Generates an ambient `.d.ts` declaration file from a parsed .env.example.
174
+ *
175
+ * Output is a pure `NodeJS.ProcessEnv` augmentation — no `export type` statements.
176
+ * This makes the file valid as a global ambient declaration that can be dropped
177
+ * into `lib/` or `types/` without affecting module resolution.
178
+ *
179
+ * Output structure:
180
+ * ```
181
+ * // Generated by env-typegen — do not edit manually
182
+ * // Source: .env.example
183
+ *
184
+ * declare namespace NodeJS {
185
+ * interface ProcessEnv {
186
+ * readonly KEY: string; // all vars are runtime strings
187
+ * readonly OPT?: string; // optional vars use ?: string
188
+ * readonly NUM: string; // coerce to number: Number(process.env.NUM)
189
+ * readonly FLAG: string; // coerce to boolean: process.env.FLAG === 'true'
190
+ * }
191
+ * }
192
+ * ```
193
+ *
194
+ * For a `.ts` output with typed `export type EnvVars` / `ServerEnvVars` /
195
+ * `ClientEnvVars`, use `generateTypeScriptTypes` instead.
196
+ *
197
+ * - `ProcessEnv` uses `readonly string` for every variable (runtime reality)
198
+ * - Number and boolean vars include an inline coercion hint comment
199
+ * - `annotatedType` takes precedence over `inferredType`
200
+ */
201
+ declare function generateDeclaration(parsed: ParsedEnvFile): string;
202
+
203
+ /**
204
+ * Generates a `@t3-oss/env-nextjs` configuration file from a parsed .env.example.
205
+ *
206
+ * Output structure:
207
+ * ```
208
+ * import { createEnv } from "@t3-oss/env-nextjs";
209
+ * import { z } from "zod";
210
+ *
211
+ * export const env = createEnv({
212
+ * server: { /* non-NEXT_PUBLIC_ vars *\/ },
213
+ * client: { /* NEXT_PUBLIC_ vars *\/ },
214
+ * runtimeEnv: { /* all vars mapped to process.env *\/ },
215
+ * });
216
+ * ```
217
+ *
218
+ * - `server:` is omitted when there are no server-side vars
219
+ * - `client:` is omitted when there are no client-side vars (NEXT_PUBLIC_ prefix)
220
+ * - `runtimeEnv:` always includes all vars
221
+ * - `annotatedType` takes precedence over `inferredType`
222
+ * - Optional vars have `.optional()` appended
223
+ * - Vars with a description have `.describe("text")` appended (before `.optional()`)
224
+ */
225
+ declare function generateT3Env(parsed: ParsedEnvFile): string;
226
+
227
+ /** Generator identifiers supported by env-typegen. */
228
+ type GeneratorName = "typescript" | "zod" | "t3" | "declaration";
229
+ /** Configuration shape accepted by env-typegen's CLI and programmatic API. */
230
+ type EnvTypegenConfig = {
231
+ /** Path to the .env.example file to parse. */
232
+ input: string;
233
+ /** Output directory for generated files. Defaults to the input file's directory. */
234
+ output?: string;
235
+ /** Which generators to run. When omitted, all four generators run. */
236
+ generators?: GeneratorName[];
237
+ /** Format generated output with prettier. Defaults to true. */
238
+ format?: boolean;
239
+ };
240
+ /**
241
+ * Type-safe config helper.
242
+ * Returns the config object unchanged — exists purely for IDE autocompletion
243
+ * and compile-time validation of the config shape.
244
+ */
245
+ declare function defineConfig(config: EnvTypegenConfig): EnvTypegenConfig;
246
+ /**
247
+ * Loads env-typegen config by searching for a config file in `cwd`.
248
+ * Searches for env-typegen.config.ts → .mjs → .js in order.
249
+ * Returns `undefined` when no config file is found.
250
+ */
251
+ declare function loadConfig(cwd?: string): Promise<EnvTypegenConfig | undefined>;
252
+
253
+ /** Options accepted by the runGenerate pipeline. */
254
+ type RunGenerateOptions = {
255
+ input: string;
256
+ output: string;
257
+ generators: GeneratorName[];
258
+ format: boolean;
259
+ stdout?: boolean;
260
+ dryRun?: boolean;
261
+ silent?: boolean;
262
+ };
263
+ /**
264
+ * Reads the input file, runs the requested generators, optionally formats each
265
+ * output, and writes the results to disk.
266
+ *
267
+ * Exported for unit testing — call this directly rather than spawning a child process.
268
+ */
269
+ declare function runGenerate(options: RunGenerateOptions): Promise<void>;
270
+
271
+ export { type CommentAnnotations, type EnvTypegenConfig, type EnvVarType, type GeneratorName, type InferenceRule, type ParsedEnvFile, type ParsedEnvVar, type RunGenerateOptions, defineConfig, generateDeclaration, generateEnvValidation, generateT3Env, generateTypeScriptTypes as generateTypeScript, generateTypeScriptTypes, generateZodSchema as generateZod, generateZodSchema, inferType, inferTypesFromParsedVars as inferTypes, inferenceRules, loadConfig, parseCommentBlock, parseEnvFile, parseEnvFileContent, runGenerate };