@arkenv/vite-plugin 0.0.27 → 0.0.28

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/README.md CHANGED
@@ -17,6 +17,14 @@
17
17
  - Typesafe environment variables backed by TypeScript
18
18
  - Access to ArkType's powerful type system
19
19
 
20
+ > [!IMPORTANT]
21
+ > This plugin requires `arktype` to be installed in your project.
22
+ >
23
+ > It does not support `validator: "standard"`.
24
+ > You can still use Zod or Valibot schemas alongside ArkType's DSL, since ArkType natively supports Standard Schema.
25
+ >
26
+ > See the [docs](https://arkenv.js.org/docs/arkenv/integrations/standard-schema) for details.
27
+
20
28
  ## Installation
21
29
 
22
30
  <details open>
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- let e=require(`arkenv`),t=require(`vite`);function n(n){return{name:`@arkenv/vite-plugin`,config(r,{mode:i}){let a=r.envPrefix??`VITE_`,o=Array.isArray(a)?a:[a],s=(0,e.createEnv)(n,{env:(0,t.loadEnv)(i,r.envDir??r.root??process.cwd(),``)}),c=Object.fromEntries(Object.entries(s).filter(([e])=>o.some(t=>e.startsWith(t))));return{define:Object.fromEntries(Object.entries(c).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}module.exports=n;
1
+ let e=require(`arkenv`),t=require(`vite`);function n(n,r){return{name:`@arkenv/vite-plugin`,config(i,{mode:a}){let o=i.envPrefix??`VITE_`,s=Array.isArray(o)?o:[o],c=i.envDir??i.root??process.cwd(),l=(0,e.createEnv)(n,{...r,env:r?.env??(0,t.loadEnv)(a,c,``)}),u=Object.fromEntries(Object.entries(l).filter(([e])=>s.some(t=>e.startsWith(t))));return{define:Object.fromEntries(Object.entries(u).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}module.exports=n;
package/dist/index.d.cts CHANGED
@@ -1,44 +1,4 @@
1
- /**
2
- * Augment the `import.meta.env` object with typesafe environment variables
3
- * based on the schema validator.
4
- *
5
- * This type extracts the inferred type from the schema (result of `type()` from arkenv),
6
- * filters it to only include variables matching the Vite prefix (defaults to "VITE_"),
7
- * and makes them available on `import.meta.env`.
8
- *
9
- * @template TSchema - The environment variable schema (result of `type()` from arkenv)
10
- * @template Prefix - The prefix to filter by (defaults to "VITE_")
11
- *
12
- * @example
13
- * ```ts
14
- * // vite.config.ts
15
- * import arkenv from '@arkenv/vite-plugin';
16
- * import { type } from 'arkenv';
17
- *
18
- * export const Env = type({
19
- * VITE_API_URL: 'string',
20
- * VITE_API_KEY: 'string',
21
- * PORT: 'number.port', // Server-only, won't be in ImportMetaEnvAugmented
22
- * });
23
- *
24
- * export default defineConfig({
25
- * plugins: [arkenv(Env)],
26
- * });
27
- * ```
28
- *
29
- * @example
30
- * ```ts
31
- * // src/vite-env.d.ts
32
- * /// <reference types="vite/client" />
33
- *
34
- * import type { ImportMetaEnvAugmented } from '@arkenv/vite-plugin';
35
- * import type { Env } from './env'; // or from vite.config.ts
36
- *
37
- * interface ImportMetaEnv extends ImportMetaEnvAugmented<typeof Env> {}
38
- * ```
39
- *
40
- * @see {@link https://github.com/Julien-R44/vite-plugin-validate-env#typing-importmetaenv | Original implementation by Julien-R44}
41
- */import * as arktype0 from "arktype";
1
+ import * as arktype0 from "arktype";
42
2
  import { Type, type } from "arktype";
43
3
  import * as arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
44
4
  import * as arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
@@ -54,14 +14,100 @@ import { Plugin } from "vite";
54
14
  */
55
15
  type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = { [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K] };
56
16
  //#endregion
17
+ //#region ../internal/types/dist/standard-schema.d.ts
18
+ /**
19
+ * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
20
+ *
21
+ * Copied from standard-schema (MIT License)
22
+ * Copyright (c) 2024 Colin McDannell
23
+ */
24
+ /** The Standard Typed interface. This is a base type extended by other specs. */
25
+ interface StandardTypedV1<Input = unknown, Output = Input> {
26
+ /** The Standard properties. */
27
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
28
+ }
29
+ declare namespace StandardTypedV1 {
30
+ /** The Standard Typed properties interface. */
31
+ interface Props<Input = unknown, Output = Input> {
32
+ /** The version number of the standard. */
33
+ readonly version: 1;
34
+ /** The vendor name of the schema library. */
35
+ readonly vendor: string;
36
+ /** Inferred types associated with the schema. */
37
+ readonly types?: Types<Input, Output> | undefined;
38
+ }
39
+ /** The Standard Typed types interface. */
40
+ interface Types<Input = unknown, Output = Input> {
41
+ /** The input type of the schema. */
42
+ readonly input: Input;
43
+ /** The output type of the schema. */
44
+ readonly output: Output;
45
+ }
46
+ /** Infers the input type of a Standard Typed. */
47
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
48
+ /** Infers the output type of a Standard Typed. */
49
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
50
+ }
51
+ /** The Standard Schema interface. */
52
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
53
+ /** The Standard Schema properties. */
54
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
55
+ }
56
+ declare namespace StandardSchemaV1 {
57
+ /** The Standard Schema properties interface. */
58
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
59
+ /** Validates unknown input values. */
60
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
61
+ }
62
+ /** The result interface of the validate function. */
63
+ type Result<Output> = SuccessResult<Output> | FailureResult;
64
+ /** The result interface if validation succeeds. */
65
+ interface SuccessResult<Output> {
66
+ /** The typed output value. */
67
+ readonly value: Output;
68
+ /** A falsy value for `issues` indicates success. */
69
+ readonly issues?: undefined;
70
+ }
71
+ interface Options {
72
+ /** Explicit support for additional vendor-specific parameters, if needed. */
73
+ readonly libraryOptions?: Record<string, unknown> | undefined;
74
+ }
75
+ /** The result interface if validation fails. */
76
+ interface FailureResult {
77
+ /** The issues of failed validation. */
78
+ readonly issues: ReadonlyArray<Issue>;
79
+ }
80
+ /** The issue interface of the failure output. */
81
+ interface Issue {
82
+ /** The error message of the issue. */
83
+ readonly message: string;
84
+ /** The path of the issue, if any. */
85
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
86
+ }
87
+ /** The path segment interface of the issue. */
88
+ interface PathSegment {
89
+ /** The key representing a path segment. */
90
+ readonly key: PropertyKey;
91
+ }
92
+ /** The Standard types interface. */
93
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
94
+ /** Infers the input type of a Standard. */
95
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
96
+ /** Infers the output type of a Standard. */
97
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
98
+ }
99
+ //#endregion
57
100
  //#region ../internal/types/dist/infer-type.d.ts
58
101
  /**
59
- * Extract the inferred type from an ArkType type definition by checking its call signature.
60
- * When a type definition is called, it returns either the validated value or type.errors.
102
+ * Extract the inferred type from a schema definition.
103
+ * Supports both ArkType type definitions and Standard Schema 1.0 validators.
104
+ *
105
+ * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.
106
+ * For ArkType definitions, checks the call signature or type properties.
61
107
  *
62
- * @template T - The ArkType type definition to infer from
108
+ * @template T - The schema definition to infer from
63
109
  */
64
- type InferType<T> = T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
110
+ type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
65
111
  t: infer U;
66
112
  } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
67
113
  //#endregion
@@ -148,9 +194,33 @@ type $$1 = (typeof $$1)["t"];
148
194
  //#endregion
149
195
  //#region ../internal/types/dist/schema.d.ts
150
196
  type SchemaShape = Record<string, unknown>;
151
- type EnvSchemaWithType = Type<SchemaShape, $$1>;
197
+ /**
198
+ * @internal
199
+ *
200
+ * Compiled ArkType schema accepted by ArkEnv.
201
+ * Produced by `arktype.type(...)` or `scope(...)`.
202
+ *
203
+ * Represents an already-constructed ArkType `Type` instance that
204
+ * defines the full environment schema.
205
+ *
206
+ * This form bypasses schema validation and is intended for advanced
207
+ * or programmatic use cases where schemas are constructed dynamically.
208
+ */
209
+ type CompiledEnvSchema = Type<SchemaShape, $$1>;
152
210
  //#endregion
153
- //#region ../arkenv/dist/create-env-Dk1I0Ftq.d.ts
211
+ //#region ../arkenv/dist/create-env-CFw1N3G1.d.ts
212
+ //#region ../internal/types/dist/helpers.d.ts
213
+ type Dict<T> = Record<string, T | undefined>;
214
+ //#endregion
215
+ //#region ../internal/types/dist/standard-schema.d.ts
216
+ /**
217
+ * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
218
+ *
219
+ * Copied from standard-schema (MIT License)
220
+ * Copyright (c) 2024 Colin McDannell
221
+ */
222
+ /** The Standard Typed interface. This is a base type extended by other specs. */
223
+
154
224
  //#endregion
155
225
  //#region ../internal/scope/dist/index.d.ts
156
226
  //#region src/root.d.ts
@@ -237,9 +307,96 @@ type $ = (typeof $)["t"];
237
307
 
238
308
  //#endregion
239
309
  //#region src/create-env.d.ts
240
- type EnvSchema<def$1> = type.validate<def$1, $>;
310
+ /**
311
+ * Declarative environment schema definition accepted by ArkEnv.
312
+ *
313
+ * Represents a declarative schema object mapping environment
314
+ * variable names to schema definitions (e.g. ArkType DSL strings
315
+ * or Standard Schema validators).
316
+ *
317
+ * This type is used to validate that a schema object is compatible with
318
+ * ArkEnv’s validator scope before being compiled or parsed.
319
+ *
320
+ * Most users will provide schemas in this form.
321
+ *
322
+ * @template def - The schema shape object
323
+ */
324
+ type EnvSchema<def> = type.validate<def, $>;
325
+ type RuntimeEnvironment = Dict<string>;
326
+ /**
327
+ * Configuration options for `createEnv`
328
+ */
329
+ type ArkEnvConfig = {
330
+ /**
331
+ * The environment variables to parse. Defaults to `process.env`
332
+ */
333
+ env?: RuntimeEnvironment;
334
+ /**
335
+ * Whether to coerce environment variables to their defined types. Defaults to `true`
336
+ */
337
+ coerce?: boolean;
338
+ /**
339
+ * Control how ArkEnv handles environment variables that are not defined in your schema.
340
+ *
341
+ * Defaults to `'delete'` to ensure your output object only contains
342
+ * keys you've explicitly declared. This differs from ArkType's standard behavior, which
343
+ * mirrors TypeScript by defaulting to `'ignore'`.
344
+ *
345
+ * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.
346
+ * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.
347
+ * - `reject`: Undeclared keys will cause validation to fail.
348
+ *
349
+ * @default "delete"
350
+ * @see https://arktype.io/docs/configuration#onundeclaredkey
351
+ */
352
+ onUndeclaredKey?: "ignore" | "delete" | "reject";
353
+ /**
354
+ * The format to use for array parsing when coercion is enabled.
355
+ *
356
+ * - `comma` (default): Strings are split by comma and trimmed.
357
+ * - `json`: Strings are parsed as JSON.
358
+ *
359
+ * @default "comma"
360
+ */
361
+ arrayFormat?: "comma" | "json";
362
+ /**
363
+ * Choose the validator engine to use.
364
+ *
365
+ * - `arktype` (default): Uses ArkType for all validation and coercion.
366
+ * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.
367
+ *
368
+ * @default "arktype"
369
+ */
370
+ validator?: "arktype" | "standard";
371
+ };
372
+ /**
373
+ * TODO: `SchemaShape` is basically `Record<string, unknown>`.
374
+ * If possible, find a better type than "const T extends Record<string, unknown>",
375
+ * and be as close as possible to the type accepted by ArkType's `type`.
376
+ */
377
+ /**
378
+ * Utility to parse environment variables using ArkType or Standard Schema
379
+ * @param def - The schema definition
380
+ * @param config - The evaluation configuration
381
+ * @returns The parsed environment variables
382
+ * @throws An {@link ArkEnvError | error} if the environment variables are invalid.
383
+ */
241
384
  //#endregion
242
385
  //#region src/types.d.ts
386
+ /**
387
+ * Augment the `import.meta.env` object with typesafe environment variables
388
+ * based on the schema validator.
389
+ *
390
+ * This type extracts the inferred type from the schema (result of `type()` from arkenv),
391
+ * filters it to only include variables matching the Vite prefix (defaults to "VITE_"),
392
+ * and makes them available on `import.meta.env`.
393
+ *
394
+ * @template TSchema - The environment variable schema (result of `type()` from arkenv)
395
+ * @template Prefix - The prefix to filter by (defaults to "VITE_")
396
+ *
397
+ * @see {@link https://arkenv.js.org/docs/vite-plugin/typing-import-meta-env | Documentation: Typing import.meta.env}
398
+ * @see {@link https://github.com/Julien-R44/vite-plugin-validate-env#typing-importmetaenv | Original implementation by Julien-R44}
399
+ */
243
400
  type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "VITE_"> = FilterByPrefix<InferType<TSchema>, Prefix>;
244
401
  //#endregion
245
402
  //#region src/index.d.ts
@@ -255,7 +412,9 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
255
412
  * Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.
256
413
  *
257
414
  * @param options - The environment variable schema definition. Can be an `EnvSchema` object
258
- * for typesafe validation or an ArkType `EnvSchemaWithType` for dynamic schemas.
415
+ * for typesafe validation or an ArkType `CompiledEnvSchema` for dynamic schemas.
416
+ * @param arkenvConfig - Optional configuration for ArkEnv, including validator mode selection.
417
+ * Use `{ validator: "standard" }` to use Standard Schema validators (e.g., Zod, Valibot) instead of ArkType.
259
418
  * @returns A Vite plugin that validates environment variables and exposes them to the client.
260
419
  *
261
420
  * @example
@@ -279,9 +438,28 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
279
438
  * // In your client code
280
439
  * console.log(import.meta.env.VITE_API_URL); // Typesafe access
281
440
  * ```
441
+ *
442
+ * @example
443
+ * ```ts
444
+ * // Using Standard Schema validators (e.g., Zod)
445
+ * import { defineConfig } from 'vite';
446
+ * import { z } from 'zod';
447
+ * import arkenv from '@arkenv/vite-plugin';
448
+ *
449
+ * export default defineConfig({
450
+ * plugins: [
451
+ * arkenv({
452
+ * VITE_API_URL: z.string().url(),
453
+ * VITE_API_KEY: z.string().min(1),
454
+ * }, {
455
+ * validator: 'standard'
456
+ * }),
457
+ * ],
458
+ * });
459
+ * ```
282
460
  */
283
- declare function arkenv(options: EnvSchemaWithType): Plugin;
284
- declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>): Plugin;
461
+ declare function arkenv(options: CompiledEnvSchema, arkenvConfig?: ArkEnvConfig): Plugin;
462
+ declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>, arkenvConfig?: ArkEnvConfig): Plugin;
285
463
  //#endregion
286
464
  export { type ImportMetaEnvAugmented, arkenv as default };
287
465
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["FilterByPrefix","T","Prefix","Record","K","type","InferType","T","Record","errors","Any","arktype0","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","$","Type","SchemaShape","Record","EnvSchemaWithType","arktype0","Type","distill","type","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","Dict","T","Record","InferType","errors","Any","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","SchemaShape","EnvSchemaWithType","EnvSchema","def$1","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","infer","Out","def","i","n","r","t"],"sources":["../../internal/types/dist/filter-by-prefix.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/scope/dist/index.d.ts","../../internal/types/dist/schema.d.ts","../../arkenv/dist/create-env-Dk1I0Ftq.d.ts","../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * Filter environment variables to only include those that start with the given prefix.\n * This ensures only client-exposed variables (e.g., VITE_*, BUN_PUBLIC_*) are included.\n *\n * @template T - The record of environment variables\n * @template Prefix - The prefix to filter by\n */\nexport type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K];\n};\n//# sourceMappingURL=filter-by-prefix.d.ts.map","import type { type } from \"arktype\";\n/**\n * Extract the inferred type from an ArkType type definition by checking its call signature.\n * When a type definition is called, it returns either the validated value or type.errors.\n *\n * @template T - The ArkType type definition to infer from\n */\nexport type InferType<T> = T extends (value: Record<string, string | undefined>) => infer R ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//# sourceMappingURL=infer-type.d.ts.map","import * as arktype0 from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\nexport { $ };\n//# sourceMappingURL=index.d.ts.map","import type { $ } from \"@repo/scope\";\nimport type { Type } from \"arktype\";\nexport type SchemaShape = Record<string, unknown>;\nexport type EnvSchemaWithType = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { Type, distill, type } from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region ../internal/types/dist/helpers.d.ts\ntype Dict<T> = Record<string, T | undefined>;\n//#endregion\n//#region ../internal/types/dist/infer-type.d.ts\n/**\n * Extract the inferred type from an ArkType type definition by checking its call signature.\n * When a type definition is called, it returns either the validated value or type.errors.\n *\n * @template T - The ArkType type definition to infer from\n */\ntype InferType<T> = T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/scope/dist/index.d.ts\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ntype SchemaShape = Record<string, unknown>;\ntype EnvSchemaWithType = Type<SchemaShape, $>;\n//#endregion\n//#region src/create-env.d.ts\ntype EnvSchema<def$1> = type.validate<def$1, $>;\ntype RuntimeEnvironment = Dict<string>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to parse. Defaults to `process.env`\n */\n env?: RuntimeEnvironment;\n /**\n * Whether to coerce environment variables to their defined types. Defaults to `true`\n */\n coerce?: boolean;\n /**\n * Control how ArkEnv handles environment variables that are not defined in your schema.\n *\n * Defaults to `'delete'` to ensure your output object only contains\n * keys you've explicitly declared. This differs from ArkType's standard behavior, which\n * mirrors TypeScript by defaulting to `'ignore'`.\n *\n * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.\n * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.\n * - `reject`: Undeclared keys will cause validation to fail.\n *\n * @default \"delete\"\n * @see https://arktype.io/docs/configuration#onundeclaredkey\n */\n onUndeclaredKey?: \"ignore\" | \"delete\" | \"reject\";\n /**\n * The format to use for array parsing when coercion is enabled.\n *\n * - `comma` (default): Strings are split by comma and trimmed.\n * - `json`: Strings are parsed as JSON.\n *\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n /**\n * Choose the validator engine to use.\n *\n * - `arktype` (default): Uses ArkType for all validation and coercion.\n * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.\n *\n * @default \"arktype\"\n */\n validator?: \"arktype\" | \"standard\";\n};\n/**\n * TODO: `SchemaShape` is basically `Record<string, unknown>`.\n * If possible, find a better type than \"const T extends Record<string, unknown>\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n/**\n * Utility to parse environment variables using ArkType or Standard Schema\n * @param def - The schema definition\n * @param config - The evaluation configuration\n * @returns The parsed environment variables\n * @throws An {@link ArkEnvError | error} if the environment variables are invalid.\n */\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T>, config?: ArkEnvConfig): distill.Out<type.infer<T, $>>;\ndeclare function createEnv<T extends EnvSchemaWithType>(def: T, config?: ArkEnvConfig): InferType<T>;\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T> | EnvSchemaWithType, config?: ArkEnvConfig): distill.Out<type.infer<T, $>> | InferType<typeof def>;\n//#endregion\nexport { SchemaShape as i, EnvSchema as n, createEnv as r, ArkEnvConfig as t };\n//# sourceMappingURL=create-env-Dk1I0Ftq.d.ts.map"],"mappings":";;;;;AAOA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACLkF;;;;;;;;;;;;;;;;;;;;;;;;;;AFKtEA,KAAAA,cAAc,CAAAC,UAAWE,MAAX,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,eAAA,MAAA,CAAA,GAAA,QAAWA,MACrBF,CADqBE,IAChBC,CADgBD,SAAAA,GACHD,MADGC,GAAAA,MAAAA,EAAAA,GACiBC,CADjBD,GAAAA,KAAAA,GAC6BF,CAD7BE,CAC+BC,CAD/BD,CAAAA,EACrBF;;;;;;;;;AADJD,KCAAM,SDAc,CAAA,CAAA,CAAA,GCACC,CDADN,UAAAC,CAAAA,KAAA,ECAmBM,M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IAAAA,EAASe,MAAAA;IAIIX,OAAAA,EAAAA,MAAAA;IAAnBJ,cAASe,EAAAA,MAAAA;IAKaX,KAAAA,EAAAA,MAAAA;IAAnBJ,IAAAA,EAASe,MAAAA;IAGKX,gBAAAA,EAAAA,MAAAA;IAAnBJ,IAAAA,EAASe,MAAAA;EAGYX,CAAAA,CAAAA;CAAnBJ,CAAAA;KAsCLY,CAAAA,GAnCyBR,CAAAA,OAmCbQ,CAnCaR,CAAAA,CAAAA,GAAAA,CAAAA;;;;;;;KA2CzByB,SA7BuBzB,CAAAA,KAAAA,CAAAA,GA6BJD,IAAAA,CAAK4B,QA7BD3B,CA6BU0B,KA7B+BlB,EA6BxBA,CA7BwBA,CAAAA;;;AFvCrClC,KGOpB,sBHPoBA,CAAAA,gBGQf,IAAA,CAAK,GHR6DE,EAAAA,eAAAA,MAAAA,GAAAA,OAAAA,CAAAA,GGU/E,cHV+EA,CGUhE,SHVgEA,CGUtD,OHVsDA,CAAAA,EGU5C,MHV4CA,CAAAA;;;;;;AF9BnF;;;;;;;;;;;;ACAA;;;;;;;;;;;ACLkF;;;;;;;;;;;AA8BrDF,iBIYL,MAAA,CJZKA,OAAqCQ,EIY1B,iBJZqCN,CAAAA,EIYjB,MJZiBA;AAA1DG,iBIaK,MJbLA,CAAAA,gBIa4B,WJb5BA,CAAAA,CAAAA,OAAAA,EIcT,SJdSA,CIcC,CJdDA,CAAAA,CAAAA,EIehB,MJfgBA"}
1
+ {"version":3,"file":"index.d.cts","names":["FilterByPrefix","T","Prefix","Record","K","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","InferInput","InferOutput","StandardJSONSchemaV1","Converter","Target","type","StandardSchemaV1","InferType","T","Record","errors","Any","arktype0","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","$","Type","SchemaShape","Record","CompiledEnvSchema","arktype0","Type","distill","type","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Issue","ReadonlyArray","PropertyKey","PathSegment","InferInput","InferOutput","InferType","errors","Any","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","SchemaShape","CompiledEnvSchema","EnvSchema","def","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","K","infer","Out","i","n","r","t"],"sources":["../../internal/types/dist/filter-by-prefix.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/scope/dist/index.d.ts","../../internal/types/dist/schema.d.ts","../../arkenv/dist/create-env-CFw1N3G1.d.ts","../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * Filter environment variables to only include those that start with the given prefix.\n * This ensures only client-exposed variables (e.g., VITE_*, BUN_PUBLIC_*) are included.\n *\n * @template T - The record of environment variables\n * @template Prefix - The prefix to filter by\n */\nexport type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K];\n};\n//# sourceMappingURL=filter-by-prefix.d.ts.map","/**\n * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec\n *\n * Copied from standard-schema (MIT License)\n * Copyright (c) 2024 Colin McDannell\n */\n/** The Standard Typed interface. This is a base type extended by other specs. */\nexport interface StandardTypedV1<Input = unknown, Output = Input> {\n /** The Standard properties. */\n readonly \"~standard\": StandardTypedV1.Props<Input, Output>;\n}\nexport declare namespace StandardTypedV1 {\n /** The Standard Typed properties interface. */\n interface Props<Input = unknown, Output = Input> {\n /** The version number of the standard. */\n readonly version: 1;\n /** The vendor name of the schema library. */\n readonly vendor: string;\n /** Inferred types associated with the schema. */\n readonly types?: Types<Input, Output> | undefined;\n }\n /** The Standard Typed types interface. */\n interface Types<Input = unknown, Output = Input> {\n /** The input type of the schema. */\n readonly input: Input;\n /** The output type of the schema. */\n readonly output: Output;\n }\n /** Infers the input type of a Standard Typed. */\n type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\n /** Infers the output type of a Standard Typed. */\n type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\n}\n/** The Standard Schema interface. */\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n /** The Standard Schema properties. */\n readonly \"~standard\": StandardSchemaV1.Props<Input, Output>;\n}\nexport declare namespace StandardSchemaV1 {\n /** The Standard Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Validates unknown input values. */\n readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;\n }\n /** The result interface of the validate function. */\n type Result<Output> = SuccessResult<Output> | FailureResult;\n /** The result interface if validation succeeds. */\n interface SuccessResult<Output> {\n /** The typed output value. */\n readonly value: Output;\n /** A falsy value for `issues` indicates success. */\n readonly issues?: undefined;\n }\n interface Options {\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The result interface if validation fails. */\n interface FailureResult {\n /** The issues of failed validation. */\n readonly issues: ReadonlyArray<Issue>;\n }\n /** The issue interface of the failure output. */\n interface Issue {\n /** The error message of the issue. */\n readonly message: string;\n /** The path of the issue, if any. */\n readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;\n }\n /** The path segment interface of the issue. */\n interface PathSegment {\n /** The key representing a path segment. */\n readonly key: PropertyKey;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {\n }\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n/** The Standard JSON Schema interface. */\nexport interface StandardJSONSchemaV1<Input = unknown, Output = Input> {\n /** The Standard JSON Schema properties. */\n readonly \"~standard\": StandardJSONSchemaV1.Props<Input, Output>;\n}\nexport declare namespace StandardJSONSchemaV1 {\n /** The Standard JSON Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Methods for generating the input/output JSON Schema. */\n readonly jsonSchema: StandardJSONSchemaV1.Converter;\n }\n /** The Standard JSON Schema converter interface. */\n interface Converter {\n /** Converts the input type to JSON Schema. May throw if conversion is not supported. */\n readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;\n /** Converts the output type to JSON Schema. May throw if conversion is not supported. */\n readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;\n }\n /**\n * The target version of the generated JSON Schema.\n *\n * It is *strongly recommended* that implementers support `\"draft-2020-12\"` and `\"draft-07\"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.\n *\n * The `\"openapi-3.0\"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `\"draft-04\"`.\n */\n type Target = \"draft-2020-12\" | \"draft-07\" | \"openapi-3.0\" | ({} & string);\n /** The options for the input/output methods. */\n interface Options {\n /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */\n readonly target: Target;\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {\n }\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n//# sourceMappingURL=standard-schema.d.ts.map","import type { type } from \"arktype\";\nimport type { StandardSchemaV1 } from \"./standard-schema\";\n/**\n * Extract the inferred type from a schema definition.\n * Supports both ArkType type definitions and Standard Schema 1.0 validators.\n *\n * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.\n * For ArkType definitions, checks the call signature or type properties.\n *\n * @template T - The schema definition to infer from\n */\nexport type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends (value: Record<string, string | undefined>) => infer R ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//# sourceMappingURL=infer-type.d.ts.map","import * as arktype0 from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\nexport { $ };\n//# sourceMappingURL=index.d.ts.map","import type { $ } from \"@repo/scope\";\nimport type { Type } from \"arktype\";\nexport type SchemaShape = Record<string, unknown>;\n/**\n * @internal\n *\n * Compiled ArkType schema accepted by ArkEnv.\n * Produced by `arktype.type(...)` or `scope(...)`.\n *\n * Represents an already-constructed ArkType `Type` instance that\n * defines the full environment schema.\n *\n * This form bypasses schema validation and is intended for advanced\n * or programmatic use cases where schemas are constructed dynamically.\n */\nexport type CompiledEnvSchema = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { Type, distill, type } from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region ../internal/types/dist/helpers.d.ts\ntype Dict<T> = Record<string, T | undefined>;\n//#endregion\n//#region ../internal/types/dist/standard-schema.d.ts\n/**\n * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec\n *\n * Copied from standard-schema (MIT License)\n * Copyright (c) 2024 Colin McDannell\n */\n/** The Standard Typed interface. This is a base type extended by other specs. */\ninterface StandardTypedV1<Input = unknown, Output = Input> {\n /** The Standard properties. */\n readonly \"~standard\": StandardTypedV1.Props<Input, Output>;\n}\ndeclare namespace StandardTypedV1 {\n /** The Standard Typed properties interface. */\n interface Props<Input = unknown, Output = Input> {\n /** The version number of the standard. */\n readonly version: 1;\n /** The vendor name of the schema library. */\n readonly vendor: string;\n /** Inferred types associated with the schema. */\n readonly types?: Types<Input, Output> | undefined;\n }\n /** The Standard Typed types interface. */\n interface Types<Input = unknown, Output = Input> {\n /** The input type of the schema. */\n readonly input: Input;\n /** The output type of the schema. */\n readonly output: Output;\n }\n /** Infers the input type of a Standard Typed. */\n type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\n /** Infers the output type of a Standard Typed. */\n type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\n}\n/** The Standard Schema interface. */\ninterface StandardSchemaV1<Input = unknown, Output = Input> {\n /** The Standard Schema properties. */\n readonly \"~standard\": StandardSchemaV1.Props<Input, Output>;\n}\ndeclare namespace StandardSchemaV1 {\n /** The Standard Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Validates unknown input values. */\n readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;\n }\n /** The result interface of the validate function. */\n type Result<Output> = SuccessResult<Output> | FailureResult;\n /** The result interface if validation succeeds. */\n interface SuccessResult<Output> {\n /** The typed output value. */\n readonly value: Output;\n /** A falsy value for `issues` indicates success. */\n readonly issues?: undefined;\n }\n interface Options {\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The result interface if validation fails. */\n interface FailureResult {\n /** The issues of failed validation. */\n readonly issues: ReadonlyArray<Issue>;\n }\n /** The issue interface of the failure output. */\n interface Issue {\n /** The error message of the issue. */\n readonly message: string;\n /** The path of the issue, if any. */\n readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;\n }\n /** The path segment interface of the issue. */\n interface PathSegment {\n /** The key representing a path segment. */\n readonly key: PropertyKey;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n//#endregion\n//#region ../internal/types/dist/infer-type.d.ts\n/**\n * Extract the inferred type from a schema definition.\n * Supports both ArkType type definitions and Standard Schema 1.0 validators.\n *\n * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.\n * For ArkType definitions, checks the call signature or type properties.\n *\n * @template T - The schema definition to infer from\n */\ntype InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/scope/dist/index.d.ts\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ntype SchemaShape = Record<string, unknown>;\n/**\n * @internal\n *\n * Compiled ArkType schema accepted by ArkEnv.\n * Produced by `arktype.type(...)` or `scope(...)`.\n *\n * Represents an already-constructed ArkType `Type` instance that\n * defines the full environment schema.\n *\n * This form bypasses schema validation and is intended for advanced\n * or programmatic use cases where schemas are constructed dynamically.\n */\ntype CompiledEnvSchema = Type<SchemaShape, $>;\n//#endregion\n//#region src/create-env.d.ts\n/**\n * Declarative environment schema definition accepted by ArkEnv.\n *\n * Represents a declarative schema object mapping environment\n * variable names to schema definitions (e.g. ArkType DSL strings\n * or Standard Schema validators).\n *\n * This type is used to validate that a schema object is compatible with\n * ArkEnv’s validator scope before being compiled or parsed.\n *\n * Most users will provide schemas in this form.\n *\n * @template def - The schema shape object\n */\ntype EnvSchema<def> = type.validate<def, $>;\ntype RuntimeEnvironment = Dict<string>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to parse. Defaults to `process.env`\n */\n env?: RuntimeEnvironment;\n /**\n * Whether to coerce environment variables to their defined types. Defaults to `true`\n */\n coerce?: boolean;\n /**\n * Control how ArkEnv handles environment variables that are not defined in your schema.\n *\n * Defaults to `'delete'` to ensure your output object only contains\n * keys you've explicitly declared. This differs from ArkType's standard behavior, which\n * mirrors TypeScript by defaulting to `'ignore'`.\n *\n * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.\n * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.\n * - `reject`: Undeclared keys will cause validation to fail.\n *\n * @default \"delete\"\n * @see https://arktype.io/docs/configuration#onundeclaredkey\n */\n onUndeclaredKey?: \"ignore\" | \"delete\" | \"reject\";\n /**\n * The format to use for array parsing when coercion is enabled.\n *\n * - `comma` (default): Strings are split by comma and trimmed.\n * - `json`: Strings are parsed as JSON.\n *\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n /**\n * Choose the validator engine to use.\n *\n * - `arktype` (default): Uses ArkType for all validation and coercion.\n * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.\n *\n * @default \"arktype\"\n */\n validator?: \"arktype\" | \"standard\";\n};\n/**\n * TODO: `SchemaShape` is basically `Record<string, unknown>`.\n * If possible, find a better type than \"const T extends Record<string, unknown>\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n/**\n * Utility to parse environment variables using ArkType or Standard Schema\n * @param def - The schema definition\n * @param config - The evaluation configuration\n * @returns The parsed environment variables\n * @throws An {@link ArkEnvError | error} if the environment variables are invalid.\n */\ndeclare function createEnv<const T extends Record<string, StandardSchemaV1>>(def: T, config: ArkEnvConfig & {\n validator: \"standard\";\n}): { [K in keyof T]: StandardSchemaV1.InferOutput<T[K]> };\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T>, config?: ArkEnvConfig): distill.Out<type.infer<T, $>>;\ndeclare function createEnv<T extends CompiledEnvSchema>(def: T, config?: ArkEnvConfig): InferType<T>;\n//#endregion\nexport { SchemaShape as i, EnvSchema as n, createEnv as r, ArkEnvConfig as t };\n//# sourceMappingURL=create-env-CFw1N3G1.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAOYA,KAAAA,cAAc,CAAAC,UAAWE,MAAX,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,eAAA,MAAA,CAAA,GAAA,QAAWA,MACrBF,CADqBE,IAChBC,CADgBD,SAAAA,GACHD,MADGC,GAAAA,MAAAA,EAAAA,GACiBC,CADjBD,GAAAA,KAAAA,GAC6BF,CAD7BE,CAC+BC,CAD/BD,CAAAA,EACrBF;;;;;;;;;;AADJD,UCAKK,eDASH,CAAAA,QAAA,OAAA,EAAA,SCAiCI,KDAjC,CAAA,CAAA;EAAWH;EACrBF,SAAAA,WAAAA,ECCUI,eAAAA,CAAgBG,KDD1BP,CCCgCK,K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,OAlCVnB,CAkCUmB,CAAAA,CAAAA,GAAAA,CAAAA;;AAAQ;AACL;;;;;;AEtJrB;;;;;;;;;;;;KFqJJF,iBAAiB7C,IAAAA,CAAK+C,SAASD,KAAKlB;KACpCoB,kBAAAA,GAAqB7C;;;;KAIrB8C,YAAAA;;;;QAIGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AL3NR;;;;;;;;;KMUY,uCACK,IAAA,CAAK,wCAElB,eAAe,UAAU,UAAU;;;;;;ANbvC;;;;;;;;;;;;ACAA;;;;;;AAIA;;;;;;;;;;;;;;;AAuBA;;;;;;AAIA;;;;;;;;;;;;;;;;AAsBuC1F,iBMKf,MAAA,CNLeA,OAAAA,EMM7B,iBNN6BA,EAAAA,YAAAA,CAAAA,EMOvB,YNPuBA,CAAAA,EMQpC,MNRoCA;AAAdC,iBMSD,MNTCA,CAAAA,gBMSsB,WNTtBA,CAAAA,CAAAA,OAAAA,EMUf,SNVeA,CMUL,CNVKA,CAAAA,EAAAA,YAAAA,CAAAA,EMWT,YNXSA,CAAAA,EMYtB,MNZsBA"}
package/dist/index.d.ts CHANGED
@@ -1,44 +1,4 @@
1
- /**
2
- * Augment the `import.meta.env` object with typesafe environment variables
3
- * based on the schema validator.
4
- *
5
- * This type extracts the inferred type from the schema (result of `type()` from arkenv),
6
- * filters it to only include variables matching the Vite prefix (defaults to "VITE_"),
7
- * and makes them available on `import.meta.env`.
8
- *
9
- * @template TSchema - The environment variable schema (result of `type()` from arkenv)
10
- * @template Prefix - The prefix to filter by (defaults to "VITE_")
11
- *
12
- * @example
13
- * ```ts
14
- * // vite.config.ts
15
- * import arkenv from '@arkenv/vite-plugin';
16
- * import { type } from 'arkenv';
17
- *
18
- * export const Env = type({
19
- * VITE_API_URL: 'string',
20
- * VITE_API_KEY: 'string',
21
- * PORT: 'number.port', // Server-only, won't be in ImportMetaEnvAugmented
22
- * });
23
- *
24
- * export default defineConfig({
25
- * plugins: [arkenv(Env)],
26
- * });
27
- * ```
28
- *
29
- * @example
30
- * ```ts
31
- * // src/vite-env.d.ts
32
- * /// <reference types="vite/client" />
33
- *
34
- * import type { ImportMetaEnvAugmented } from '@arkenv/vite-plugin';
35
- * import type { Env } from './env'; // or from vite.config.ts
36
- *
37
- * interface ImportMetaEnv extends ImportMetaEnvAugmented<typeof Env> {}
38
- * ```
39
- *
40
- * @see {@link https://github.com/Julien-R44/vite-plugin-validate-env#typing-importmetaenv | Original implementation by Julien-R44}
41
- */import { Plugin } from "vite";
1
+ import { Plugin } from "vite";
42
2
  import * as arktype0 from "arktype";
43
3
  import { Type, type } from "arktype";
44
4
  import * as arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
@@ -54,14 +14,100 @@ import * as arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts
54
14
  */
55
15
  type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = { [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K] };
56
16
  //#endregion
17
+ //#region ../internal/types/dist/standard-schema.d.ts
18
+ /**
19
+ * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
20
+ *
21
+ * Copied from standard-schema (MIT License)
22
+ * Copyright (c) 2024 Colin McDannell
23
+ */
24
+ /** The Standard Typed interface. This is a base type extended by other specs. */
25
+ interface StandardTypedV1<Input = unknown, Output = Input> {
26
+ /** The Standard properties. */
27
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
28
+ }
29
+ declare namespace StandardTypedV1 {
30
+ /** The Standard Typed properties interface. */
31
+ interface Props<Input = unknown, Output = Input> {
32
+ /** The version number of the standard. */
33
+ readonly version: 1;
34
+ /** The vendor name of the schema library. */
35
+ readonly vendor: string;
36
+ /** Inferred types associated with the schema. */
37
+ readonly types?: Types<Input, Output> | undefined;
38
+ }
39
+ /** The Standard Typed types interface. */
40
+ interface Types<Input = unknown, Output = Input> {
41
+ /** The input type of the schema. */
42
+ readonly input: Input;
43
+ /** The output type of the schema. */
44
+ readonly output: Output;
45
+ }
46
+ /** Infers the input type of a Standard Typed. */
47
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
48
+ /** Infers the output type of a Standard Typed. */
49
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
50
+ }
51
+ /** The Standard Schema interface. */
52
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
53
+ /** The Standard Schema properties. */
54
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
55
+ }
56
+ declare namespace StandardSchemaV1 {
57
+ /** The Standard Schema properties interface. */
58
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
59
+ /** Validates unknown input values. */
60
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
61
+ }
62
+ /** The result interface of the validate function. */
63
+ type Result<Output> = SuccessResult<Output> | FailureResult;
64
+ /** The result interface if validation succeeds. */
65
+ interface SuccessResult<Output> {
66
+ /** The typed output value. */
67
+ readonly value: Output;
68
+ /** A falsy value for `issues` indicates success. */
69
+ readonly issues?: undefined;
70
+ }
71
+ interface Options {
72
+ /** Explicit support for additional vendor-specific parameters, if needed. */
73
+ readonly libraryOptions?: Record<string, unknown> | undefined;
74
+ }
75
+ /** The result interface if validation fails. */
76
+ interface FailureResult {
77
+ /** The issues of failed validation. */
78
+ readonly issues: ReadonlyArray<Issue>;
79
+ }
80
+ /** The issue interface of the failure output. */
81
+ interface Issue {
82
+ /** The error message of the issue. */
83
+ readonly message: string;
84
+ /** The path of the issue, if any. */
85
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
86
+ }
87
+ /** The path segment interface of the issue. */
88
+ interface PathSegment {
89
+ /** The key representing a path segment. */
90
+ readonly key: PropertyKey;
91
+ }
92
+ /** The Standard types interface. */
93
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
94
+ /** Infers the input type of a Standard. */
95
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
96
+ /** Infers the output type of a Standard. */
97
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
98
+ }
99
+ //#endregion
57
100
  //#region ../internal/types/dist/infer-type.d.ts
58
101
  /**
59
- * Extract the inferred type from an ArkType type definition by checking its call signature.
60
- * When a type definition is called, it returns either the validated value or type.errors.
102
+ * Extract the inferred type from a schema definition.
103
+ * Supports both ArkType type definitions and Standard Schema 1.0 validators.
104
+ *
105
+ * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.
106
+ * For ArkType definitions, checks the call signature or type properties.
61
107
  *
62
- * @template T - The ArkType type definition to infer from
108
+ * @template T - The schema definition to infer from
63
109
  */
64
- type InferType<T> = T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
110
+ type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {
65
111
  t: infer U;
66
112
  } ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
67
113
  //#endregion
@@ -148,9 +194,33 @@ type $$1 = (typeof $$1)["t"];
148
194
  //#endregion
149
195
  //#region ../internal/types/dist/schema.d.ts
150
196
  type SchemaShape = Record<string, unknown>;
151
- type EnvSchemaWithType = Type<SchemaShape, $$1>;
197
+ /**
198
+ * @internal
199
+ *
200
+ * Compiled ArkType schema accepted by ArkEnv.
201
+ * Produced by `arktype.type(...)` or `scope(...)`.
202
+ *
203
+ * Represents an already-constructed ArkType `Type` instance that
204
+ * defines the full environment schema.
205
+ *
206
+ * This form bypasses schema validation and is intended for advanced
207
+ * or programmatic use cases where schemas are constructed dynamically.
208
+ */
209
+ type CompiledEnvSchema = Type<SchemaShape, $$1>;
152
210
  //#endregion
153
- //#region ../arkenv/dist/create-env-Dk1I0Ftq.d.ts
211
+ //#region ../arkenv/dist/create-env-CFw1N3G1.d.ts
212
+ //#region ../internal/types/dist/helpers.d.ts
213
+ type Dict<T> = Record<string, T | undefined>;
214
+ //#endregion
215
+ //#region ../internal/types/dist/standard-schema.d.ts
216
+ /**
217
+ * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec
218
+ *
219
+ * Copied from standard-schema (MIT License)
220
+ * Copyright (c) 2024 Colin McDannell
221
+ */
222
+ /** The Standard Typed interface. This is a base type extended by other specs. */
223
+
154
224
  //#endregion
155
225
  //#region ../internal/scope/dist/index.d.ts
156
226
  //#region src/root.d.ts
@@ -237,9 +307,96 @@ type $ = (typeof $)["t"];
237
307
 
238
308
  //#endregion
239
309
  //#region src/create-env.d.ts
240
- type EnvSchema<def$1> = type.validate<def$1, $>;
310
+ /**
311
+ * Declarative environment schema definition accepted by ArkEnv.
312
+ *
313
+ * Represents a declarative schema object mapping environment
314
+ * variable names to schema definitions (e.g. ArkType DSL strings
315
+ * or Standard Schema validators).
316
+ *
317
+ * This type is used to validate that a schema object is compatible with
318
+ * ArkEnv’s validator scope before being compiled or parsed.
319
+ *
320
+ * Most users will provide schemas in this form.
321
+ *
322
+ * @template def - The schema shape object
323
+ */
324
+ type EnvSchema<def> = type.validate<def, $>;
325
+ type RuntimeEnvironment = Dict<string>;
326
+ /**
327
+ * Configuration options for `createEnv`
328
+ */
329
+ type ArkEnvConfig = {
330
+ /**
331
+ * The environment variables to parse. Defaults to `process.env`
332
+ */
333
+ env?: RuntimeEnvironment;
334
+ /**
335
+ * Whether to coerce environment variables to their defined types. Defaults to `true`
336
+ */
337
+ coerce?: boolean;
338
+ /**
339
+ * Control how ArkEnv handles environment variables that are not defined in your schema.
340
+ *
341
+ * Defaults to `'delete'` to ensure your output object only contains
342
+ * keys you've explicitly declared. This differs from ArkType's standard behavior, which
343
+ * mirrors TypeScript by defaulting to `'ignore'`.
344
+ *
345
+ * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.
346
+ * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.
347
+ * - `reject`: Undeclared keys will cause validation to fail.
348
+ *
349
+ * @default "delete"
350
+ * @see https://arktype.io/docs/configuration#onundeclaredkey
351
+ */
352
+ onUndeclaredKey?: "ignore" | "delete" | "reject";
353
+ /**
354
+ * The format to use for array parsing when coercion is enabled.
355
+ *
356
+ * - `comma` (default): Strings are split by comma and trimmed.
357
+ * - `json`: Strings are parsed as JSON.
358
+ *
359
+ * @default "comma"
360
+ */
361
+ arrayFormat?: "comma" | "json";
362
+ /**
363
+ * Choose the validator engine to use.
364
+ *
365
+ * - `arktype` (default): Uses ArkType for all validation and coercion.
366
+ * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.
367
+ *
368
+ * @default "arktype"
369
+ */
370
+ validator?: "arktype" | "standard";
371
+ };
372
+ /**
373
+ * TODO: `SchemaShape` is basically `Record<string, unknown>`.
374
+ * If possible, find a better type than "const T extends Record<string, unknown>",
375
+ * and be as close as possible to the type accepted by ArkType's `type`.
376
+ */
377
+ /**
378
+ * Utility to parse environment variables using ArkType or Standard Schema
379
+ * @param def - The schema definition
380
+ * @param config - The evaluation configuration
381
+ * @returns The parsed environment variables
382
+ * @throws An {@link ArkEnvError | error} if the environment variables are invalid.
383
+ */
241
384
  //#endregion
242
385
  //#region src/types.d.ts
386
+ /**
387
+ * Augment the `import.meta.env` object with typesafe environment variables
388
+ * based on the schema validator.
389
+ *
390
+ * This type extracts the inferred type from the schema (result of `type()` from arkenv),
391
+ * filters it to only include variables matching the Vite prefix (defaults to "VITE_"),
392
+ * and makes them available on `import.meta.env`.
393
+ *
394
+ * @template TSchema - The environment variable schema (result of `type()` from arkenv)
395
+ * @template Prefix - The prefix to filter by (defaults to "VITE_")
396
+ *
397
+ * @see {@link https://arkenv.js.org/docs/vite-plugin/typing-import-meta-env | Documentation: Typing import.meta.env}
398
+ * @see {@link https://github.com/Julien-R44/vite-plugin-validate-env#typing-importmetaenv | Original implementation by Julien-R44}
399
+ */
243
400
  type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "VITE_"> = FilterByPrefix<InferType<TSchema>, Prefix>;
244
401
  //#endregion
245
402
  //#region src/index.d.ts
@@ -255,7 +412,9 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
255
412
  * Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.
256
413
  *
257
414
  * @param options - The environment variable schema definition. Can be an `EnvSchema` object
258
- * for typesafe validation or an ArkType `EnvSchemaWithType` for dynamic schemas.
415
+ * for typesafe validation or an ArkType `CompiledEnvSchema` for dynamic schemas.
416
+ * @param arkenvConfig - Optional configuration for ArkEnv, including validator mode selection.
417
+ * Use `{ validator: "standard" }` to use Standard Schema validators (e.g., Zod, Valibot) instead of ArkType.
259
418
  * @returns A Vite plugin that validates environment variables and exposes them to the client.
260
419
  *
261
420
  * @example
@@ -279,9 +438,28 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
279
438
  * // In your client code
280
439
  * console.log(import.meta.env.VITE_API_URL); // Typesafe access
281
440
  * ```
441
+ *
442
+ * @example
443
+ * ```ts
444
+ * // Using Standard Schema validators (e.g., Zod)
445
+ * import { defineConfig } from 'vite';
446
+ * import { z } from 'zod';
447
+ * import arkenv from '@arkenv/vite-plugin';
448
+ *
449
+ * export default defineConfig({
450
+ * plugins: [
451
+ * arkenv({
452
+ * VITE_API_URL: z.string().url(),
453
+ * VITE_API_KEY: z.string().min(1),
454
+ * }, {
455
+ * validator: 'standard'
456
+ * }),
457
+ * ],
458
+ * });
459
+ * ```
282
460
  */
283
- declare function arkenv(options: EnvSchemaWithType): Plugin;
284
- declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>): Plugin;
461
+ declare function arkenv(options: CompiledEnvSchema, arkenvConfig?: ArkEnvConfig): Plugin;
462
+ declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>, arkenvConfig?: ArkEnvConfig): Plugin;
285
463
  //#endregion
286
464
  export { type ImportMetaEnvAugmented, arkenv as default };
287
465
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["FilterByPrefix","T","Prefix","Record","K","type","InferType","T","Record","errors","Any","arktype0","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","$","Type","SchemaShape","Record","EnvSchemaWithType","arktype0","Type","distill","type","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","Dict","T","Record","InferType","errors","Any","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","SchemaShape","EnvSchemaWithType","EnvSchema","def$1","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","infer","Out","def","i","n","r","t"],"sources":["../../internal/types/dist/filter-by-prefix.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/scope/dist/index.d.ts","../../internal/types/dist/schema.d.ts","../../arkenv/dist/create-env-Dk1I0Ftq.d.ts","../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * Filter environment variables to only include those that start with the given prefix.\n * This ensures only client-exposed variables (e.g., VITE_*, BUN_PUBLIC_*) are included.\n *\n * @template T - The record of environment variables\n * @template Prefix - The prefix to filter by\n */\nexport type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K];\n};\n//# sourceMappingURL=filter-by-prefix.d.ts.map","import type { type } from \"arktype\";\n/**\n * Extract the inferred type from an ArkType type definition by checking its call signature.\n * When a type definition is called, it returns either the validated value or type.errors.\n *\n * @template T - The ArkType type definition to infer from\n */\nexport type InferType<T> = T extends (value: Record<string, string | undefined>) => infer R ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//# sourceMappingURL=infer-type.d.ts.map","import * as arktype0 from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\nexport { $ };\n//# sourceMappingURL=index.d.ts.map","import type { $ } from \"@repo/scope\";\nimport type { Type } from \"arktype\";\nexport type SchemaShape = Record<string, unknown>;\nexport type EnvSchemaWithType = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { Type, distill, type } from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region ../internal/types/dist/helpers.d.ts\ntype Dict<T> = Record<string, T | undefined>;\n//#endregion\n//#region ../internal/types/dist/infer-type.d.ts\n/**\n * Extract the inferred type from an ArkType type definition by checking its call signature.\n * When a type definition is called, it returns either the validated value or type.errors.\n *\n * @template T - The ArkType type definition to infer from\n */\ntype InferType<T> = T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/scope/dist/index.d.ts\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ntype SchemaShape = Record<string, unknown>;\ntype EnvSchemaWithType = Type<SchemaShape, $>;\n//#endregion\n//#region src/create-env.d.ts\ntype EnvSchema<def$1> = type.validate<def$1, $>;\ntype RuntimeEnvironment = Dict<string>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to parse. Defaults to `process.env`\n */\n env?: RuntimeEnvironment;\n /**\n * Whether to coerce environment variables to their defined types. Defaults to `true`\n */\n coerce?: boolean;\n /**\n * Control how ArkEnv handles environment variables that are not defined in your schema.\n *\n * Defaults to `'delete'` to ensure your output object only contains\n * keys you've explicitly declared. This differs from ArkType's standard behavior, which\n * mirrors TypeScript by defaulting to `'ignore'`.\n *\n * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.\n * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.\n * - `reject`: Undeclared keys will cause validation to fail.\n *\n * @default \"delete\"\n * @see https://arktype.io/docs/configuration#onundeclaredkey\n */\n onUndeclaredKey?: \"ignore\" | \"delete\" | \"reject\";\n /**\n * The format to use for array parsing when coercion is enabled.\n *\n * - `comma` (default): Strings are split by comma and trimmed.\n * - `json`: Strings are parsed as JSON.\n *\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n /**\n * Choose the validator engine to use.\n *\n * - `arktype` (default): Uses ArkType for all validation and coercion.\n * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.\n *\n * @default \"arktype\"\n */\n validator?: \"arktype\" | \"standard\";\n};\n/**\n * TODO: `SchemaShape` is basically `Record<string, unknown>`.\n * If possible, find a better type than \"const T extends Record<string, unknown>\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n/**\n * Utility to parse environment variables using ArkType or Standard Schema\n * @param def - The schema definition\n * @param config - The evaluation configuration\n * @returns The parsed environment variables\n * @throws An {@link ArkEnvError | error} if the environment variables are invalid.\n */\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T>, config?: ArkEnvConfig): distill.Out<type.infer<T, $>>;\ndeclare function createEnv<T extends EnvSchemaWithType>(def: T, config?: ArkEnvConfig): InferType<T>;\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T> | EnvSchemaWithType, config?: ArkEnvConfig): distill.Out<type.infer<T, $>> | InferType<typeof def>;\n//#endregion\nexport { SchemaShape as i, EnvSchema as n, createEnv as r, ArkEnvConfig as t };\n//# sourceMappingURL=create-env-Dk1I0Ftq.d.ts.map"],"mappings":";;;;;AAOA;;;;;;;;;;;;ACAA;;;;;;;;;;;ACLkF;;;;;;;;;;;;;;;;;;;;;;;;;;AFKtEA,KAAAA,cAAcC,CAAAA,UAAWE,MAAX,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,eAAA,MAAA,CAAA,GAAA,QAAWA,MACrBF,CADqBE,IAChBC,CADgBD,SAAAA,GACHD,MADGC,GAAAA,MAAAA,EAAAA,GACiBC,CADjBD,GAAAA,KAAAA,GAC6BF,CAD7BE,CAC+BC,CAD/BD,CAAAA,EACrBF;;;;;;;;;AADJD,KCAAM,SDAc,CAAA,CAAA,CAAA,GCACC,CDADN,UAAAC,CAAAA,KAAA,ECAmBM,MDAnB,CAAA,MAAA,EAAA,MAAA,GAAA,SAAA,CAAA,EAAA,GAAA,KAAA,EAAA,IAAA,CAAA,SCA8EH,IAAAA,CAAKI,MDAnF,GAAA,KAAA,GAAA,CAAA,GCAwGF,CDAxG,SAAA;EAAWJ,CAAAA,EAAAA,KAAAA,EAAAA;CACrBF,GAAAA,CAAAA,GCCRM,CDDQN,SCCEI,IAAAA,CAAKK,GDDPT,CAAAA,KAAAA,EAAAA,EAAAA,KAAAA,OAAAA,CAAAA,GAAAA,CAAAA,GAAAA,KAAAA;;;;;;AADhB;;;cEGca,GFFOV,EEEJO,QAAAA,CAASiB,KFFLxB,CAAAA;EAAaF,M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BlB,EA6BxBA,CA7BwBA,CAAAA;;;AFvCrClC,KGOpB,sBHPoBA,CAAAA,gBGQf,IAAA,CAAK,GHR6DE,EAAAA,eAAAA,MAAAA,GAAAA,OAAAA,CAAAA,GGU/E,cHV+EA,CGUhE,SHVgEA,CGUtD,OHVsDA,CAAAA,EGU5C,MHV4CA,CAAAA;;;;;;AF9BnF;;;;;;;;;;;;ACAA;;;;;;;;;;;ACLkF;;;;;;;;;;;AA8BrDF,iBIYL,MAAA,CJZKA,OAAqCQ,EIY1B,iBJZqCN,CAAAA,EIYjB,MJZiBA;AAA1DG,iBIaK,MJbLA,CAAAA,gBIa4B,WJb5BA,CAAAA,CAAAA,OAAAA,EIcT,SJdSA,CIcC,CJdDA,CAAAA,CAAAA,EIehB,MJfgBA"}
1
+ {"version":3,"file":"index.d.ts","names":["FilterByPrefix","T","Prefix","Record","K","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Record","Issue","ReadonlyArray","PropertyKey","PathSegment","InferInput","InferOutput","StandardJSONSchemaV1","Converter","Target","type","StandardSchemaV1","InferType","T","Record","errors","Any","arktype0","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","$","Type","SchemaShape","Record","CompiledEnvSchema","arktype0","Type","distill","type","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","Dict","T","Record","StandardTypedV1","Input","Output","Props","Schema","Types","NonNullable","StandardSchemaV1","Options","Result","Promise","SuccessResult","FailureResult","Issue","ReadonlyArray","PropertyKey","PathSegment","InferInput","InferOutput","InferType","errors","Any","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","SchemaShape","CompiledEnvSchema","EnvSchema","def","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","K","infer","Out","i","n","r","t"],"sources":["../../internal/types/dist/filter-by-prefix.d.ts","../../internal/types/dist/standard-schema.d.ts","../../internal/types/dist/infer-type.d.ts","../../internal/scope/dist/index.d.ts","../../internal/types/dist/schema.d.ts","../../arkenv/dist/create-env-CFw1N3G1.d.ts","../src/types.ts","../src/index.ts"],"sourcesContent":["/**\n * Filter environment variables to only include those that start with the given prefix.\n * This ensures only client-exposed variables (e.g., VITE_*, BUN_PUBLIC_*) are included.\n *\n * @template T - The record of environment variables\n * @template Prefix - The prefix to filter by\n */\nexport type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = {\n [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K];\n};\n//# sourceMappingURL=filter-by-prefix.d.ts.map","/**\n * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec\n *\n * Copied from standard-schema (MIT License)\n * Copyright (c) 2024 Colin McDannell\n */\n/** The Standard Typed interface. This is a base type extended by other specs. */\nexport interface StandardTypedV1<Input = unknown, Output = Input> {\n /** The Standard properties. */\n readonly \"~standard\": StandardTypedV1.Props<Input, Output>;\n}\nexport declare namespace StandardTypedV1 {\n /** The Standard Typed properties interface. */\n interface Props<Input = unknown, Output = Input> {\n /** The version number of the standard. */\n readonly version: 1;\n /** The vendor name of the schema library. */\n readonly vendor: string;\n /** Inferred types associated with the schema. */\n readonly types?: Types<Input, Output> | undefined;\n }\n /** The Standard Typed types interface. */\n interface Types<Input = unknown, Output = Input> {\n /** The input type of the schema. */\n readonly input: Input;\n /** The output type of the schema. */\n readonly output: Output;\n }\n /** Infers the input type of a Standard Typed. */\n type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\n /** Infers the output type of a Standard Typed. */\n type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\n}\n/** The Standard Schema interface. */\nexport interface StandardSchemaV1<Input = unknown, Output = Input> {\n /** The Standard Schema properties. */\n readonly \"~standard\": StandardSchemaV1.Props<Input, Output>;\n}\nexport declare namespace StandardSchemaV1 {\n /** The Standard Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Validates unknown input values. */\n readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;\n }\n /** The result interface of the validate function. */\n type Result<Output> = SuccessResult<Output> | FailureResult;\n /** The result interface if validation succeeds. */\n interface SuccessResult<Output> {\n /** The typed output value. */\n readonly value: Output;\n /** A falsy value for `issues` indicates success. */\n readonly issues?: undefined;\n }\n interface Options {\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The result interface if validation fails. */\n interface FailureResult {\n /** The issues of failed validation. */\n readonly issues: ReadonlyArray<Issue>;\n }\n /** The issue interface of the failure output. */\n interface Issue {\n /** The error message of the issue. */\n readonly message: string;\n /** The path of the issue, if any. */\n readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;\n }\n /** The path segment interface of the issue. */\n interface PathSegment {\n /** The key representing a path segment. */\n readonly key: PropertyKey;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {\n }\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n/** The Standard JSON Schema interface. */\nexport interface StandardJSONSchemaV1<Input = unknown, Output = Input> {\n /** The Standard JSON Schema properties. */\n readonly \"~standard\": StandardJSONSchemaV1.Props<Input, Output>;\n}\nexport declare namespace StandardJSONSchemaV1 {\n /** The Standard JSON Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Methods for generating the input/output JSON Schema. */\n readonly jsonSchema: StandardJSONSchemaV1.Converter;\n }\n /** The Standard JSON Schema converter interface. */\n interface Converter {\n /** Converts the input type to JSON Schema. May throw if conversion is not supported. */\n readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;\n /** Converts the output type to JSON Schema. May throw if conversion is not supported. */\n readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;\n }\n /**\n * The target version of the generated JSON Schema.\n *\n * It is *strongly recommended* that implementers support `\"draft-2020-12\"` and `\"draft-07\"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.\n *\n * The `\"openapi-3.0\"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `\"draft-04\"`.\n */\n type Target = \"draft-2020-12\" | \"draft-07\" | \"openapi-3.0\" | ({} & string);\n /** The options for the input/output methods. */\n interface Options {\n /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */\n readonly target: Target;\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {\n }\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n//# sourceMappingURL=standard-schema.d.ts.map","import type { type } from \"arktype\";\nimport type { StandardSchemaV1 } from \"./standard-schema\";\n/**\n * Extract the inferred type from a schema definition.\n * Supports both ArkType type definitions and Standard Schema 1.0 validators.\n *\n * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.\n * For ArkType definitions, checks the call signature or type properties.\n *\n * @template T - The schema definition to infer from\n */\nexport type InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends (value: Record<string, string | undefined>) => infer R ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//# sourceMappingURL=infer-type.d.ts.map","import * as arktype0 from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\nexport { $ };\n//# sourceMappingURL=index.d.ts.map","import type { $ } from \"@repo/scope\";\nimport type { Type } from \"arktype\";\nexport type SchemaShape = Record<string, unknown>;\n/**\n * @internal\n *\n * Compiled ArkType schema accepted by ArkEnv.\n * Produced by `arktype.type(...)` or `scope(...)`.\n *\n * Represents an already-constructed ArkType `Type` instance that\n * defines the full environment schema.\n *\n * This form bypasses schema validation and is intended for advanced\n * or programmatic use cases where schemas are constructed dynamically.\n */\nexport type CompiledEnvSchema = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { Type, distill, type } from \"arktype\";\nimport * as arktype_internal_keywords_string_ts0 from \"arktype/internal/keywords/string.ts\";\nimport * as arktype_internal_attributes_ts0 from \"arktype/internal/attributes.ts\";\n\n//#region ../internal/types/dist/helpers.d.ts\ntype Dict<T> = Record<string, T | undefined>;\n//#endregion\n//#region ../internal/types/dist/standard-schema.d.ts\n/**\n * @see https://github.com/standard-schema/standard-schema/tree/3130ce43fdd848d9ab49dbb0458d04f18459961c/packages/spec\n *\n * Copied from standard-schema (MIT License)\n * Copyright (c) 2024 Colin McDannell\n */\n/** The Standard Typed interface. This is a base type extended by other specs. */\ninterface StandardTypedV1<Input = unknown, Output = Input> {\n /** The Standard properties. */\n readonly \"~standard\": StandardTypedV1.Props<Input, Output>;\n}\ndeclare namespace StandardTypedV1 {\n /** The Standard Typed properties interface. */\n interface Props<Input = unknown, Output = Input> {\n /** The version number of the standard. */\n readonly version: 1;\n /** The vendor name of the schema library. */\n readonly vendor: string;\n /** Inferred types associated with the schema. */\n readonly types?: Types<Input, Output> | undefined;\n }\n /** The Standard Typed types interface. */\n interface Types<Input = unknown, Output = Input> {\n /** The input type of the schema. */\n readonly input: Input;\n /** The output type of the schema. */\n readonly output: Output;\n }\n /** Infers the input type of a Standard Typed. */\n type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"input\"];\n /** Infers the output type of a Standard Typed. */\n type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema[\"~standard\"][\"types\"]>[\"output\"];\n}\n/** The Standard Schema interface. */\ninterface StandardSchemaV1<Input = unknown, Output = Input> {\n /** The Standard Schema properties. */\n readonly \"~standard\": StandardSchemaV1.Props<Input, Output>;\n}\ndeclare namespace StandardSchemaV1 {\n /** The Standard Schema properties interface. */\n interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {\n /** Validates unknown input values. */\n readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;\n }\n /** The result interface of the validate function. */\n type Result<Output> = SuccessResult<Output> | FailureResult;\n /** The result interface if validation succeeds. */\n interface SuccessResult<Output> {\n /** The typed output value. */\n readonly value: Output;\n /** A falsy value for `issues` indicates success. */\n readonly issues?: undefined;\n }\n interface Options {\n /** Explicit support for additional vendor-specific parameters, if needed. */\n readonly libraryOptions?: Record<string, unknown> | undefined;\n }\n /** The result interface if validation fails. */\n interface FailureResult {\n /** The issues of failed validation. */\n readonly issues: ReadonlyArray<Issue>;\n }\n /** The issue interface of the failure output. */\n interface Issue {\n /** The error message of the issue. */\n readonly message: string;\n /** The path of the issue, if any. */\n readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;\n }\n /** The path segment interface of the issue. */\n interface PathSegment {\n /** The key representing a path segment. */\n readonly key: PropertyKey;\n }\n /** The Standard types interface. */\n interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}\n /** Infers the input type of a Standard. */\n type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;\n /** Infers the output type of a Standard. */\n type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;\n}\n//#endregion\n//#region ../internal/types/dist/infer-type.d.ts\n/**\n * Extract the inferred type from a schema definition.\n * Supports both ArkType type definitions and Standard Schema 1.0 validators.\n *\n * For Standard Schema validators (e.g., Zod, Valibot), extracts the output type.\n * For ArkType definitions, checks the call signature or type properties.\n *\n * @template T - The schema definition to infer from\n */\ntype InferType<T> = T extends StandardSchemaV1<infer _Input, infer Output> ? Output : T extends ((value: Record<string, string | undefined>) => infer R) ? R extends type.errors ? never : R : T extends {\n t: infer U;\n} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/scope/dist/index.d.ts\n//#region src/root.d.ts\n/**\n * The root scope for the ArkEnv library,\n * containing extensions to the ArkType scopes with ArkEnv-specific types\n * like `string.host` and `number.port`.\n */\ndeclare const $: arktype0.Scope<{\n string: arktype0.Submodule<{\n trim: arktype0.Submodule<arktype_internal_keywords_string_ts0.trim.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n normalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.normalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n root: string;\n alpha: string;\n alphanumeric: string;\n hex: string;\n base64: arktype0.Submodule<{\n root: string;\n url: string;\n } & {\n \" arkInferred\": string;\n }>;\n capitalize: arktype0.Submodule<arktype_internal_keywords_string_ts0.capitalize.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n creditCard: string;\n date: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringDate.$ & {\n \" arkInferred\": string;\n }>;\n digits: string;\n email: string;\n integer: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringInteger.$ & {\n \" arkInferred\": string;\n }>;\n ip: arktype0.Submodule<arktype_internal_keywords_string_ts0.ip.$ & {\n \" arkInferred\": string;\n }>;\n json: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringJson.$ & {\n \" arkInferred\": string;\n }>;\n lower: arktype0.Submodule<arktype_internal_keywords_string_ts0.lower.$ & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n numeric: arktype0.Submodule<arktype_internal_keywords_string_ts0.stringNumeric.$ & {\n \" arkInferred\": string;\n }>;\n regex: string;\n semver: string;\n upper: arktype0.Submodule<{\n root: (In: string) => arktype_internal_attributes_ts0.To<string>;\n preformatted: string;\n } & {\n \" arkInferred\": (In: string) => arktype_internal_attributes_ts0.To<string>;\n }>;\n url: arktype0.Submodule<arktype_internal_keywords_string_ts0.url.$ & {\n \" arkInferred\": string;\n }>;\n uuid: arktype0.Submodule<arktype_internal_keywords_string_ts0.uuid.$ & {\n \" arkInferred\": string;\n }>;\n \" arkInferred\": string;\n host: string;\n }>;\n number: arktype0.Submodule<{\n NaN: number;\n Infinity: number;\n root: number;\n integer: number;\n \" arkInferred\": number;\n epoch: number;\n safe: number;\n NegativeInfinity: number;\n port: number;\n }>;\n}>;\ntype $ = (typeof $)[\"t\"];\n//#endregion\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ntype SchemaShape = Record<string, unknown>;\n/**\n * @internal\n *\n * Compiled ArkType schema accepted by ArkEnv.\n * Produced by `arktype.type(...)` or `scope(...)`.\n *\n * Represents an already-constructed ArkType `Type` instance that\n * defines the full environment schema.\n *\n * This form bypasses schema validation and is intended for advanced\n * or programmatic use cases where schemas are constructed dynamically.\n */\ntype CompiledEnvSchema = Type<SchemaShape, $>;\n//#endregion\n//#region src/create-env.d.ts\n/**\n * Declarative environment schema definition accepted by ArkEnv.\n *\n * Represents a declarative schema object mapping environment\n * variable names to schema definitions (e.g. ArkType DSL strings\n * or Standard Schema validators).\n *\n * This type is used to validate that a schema object is compatible with\n * ArkEnv’s validator scope before being compiled or parsed.\n *\n * Most users will provide schemas in this form.\n *\n * @template def - The schema shape object\n */\ntype EnvSchema<def> = type.validate<def, $>;\ntype RuntimeEnvironment = Dict<string>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to parse. Defaults to `process.env`\n */\n env?: RuntimeEnvironment;\n /**\n * Whether to coerce environment variables to their defined types. Defaults to `true`\n */\n coerce?: boolean;\n /**\n * Control how ArkEnv handles environment variables that are not defined in your schema.\n *\n * Defaults to `'delete'` to ensure your output object only contains\n * keys you've explicitly declared. This differs from ArkType's standard behavior, which\n * mirrors TypeScript by defaulting to `'ignore'`.\n *\n * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.\n * - `ignore` (ArkType default): Undeclared keys are allowed and preserved in the output.\n * - `reject`: Undeclared keys will cause validation to fail.\n *\n * @default \"delete\"\n * @see https://arktype.io/docs/configuration#onundeclaredkey\n */\n onUndeclaredKey?: \"ignore\" | \"delete\" | \"reject\";\n /**\n * The format to use for array parsing when coercion is enabled.\n *\n * - `comma` (default): Strings are split by comma and trimmed.\n * - `json`: Strings are parsed as JSON.\n *\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n /**\n * Choose the validator engine to use.\n *\n * - `arktype` (default): Uses ArkType for all validation and coercion.\n * - `standard`: Uses Standard Schema 1.0 directly for validation. Coercion is not supported in this mode.\n *\n * @default \"arktype\"\n */\n validator?: \"arktype\" | \"standard\";\n};\n/**\n * TODO: `SchemaShape` is basically `Record<string, unknown>`.\n * If possible, find a better type than \"const T extends Record<string, unknown>\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n/**\n * Utility to parse environment variables using ArkType or Standard Schema\n * @param def - The schema definition\n * @param config - The evaluation configuration\n * @returns The parsed environment variables\n * @throws An {@link ArkEnvError | error} if the environment variables are invalid.\n */\ndeclare function createEnv<const T extends Record<string, StandardSchemaV1>>(def: T, config: ArkEnvConfig & {\n validator: \"standard\";\n}): { [K in keyof T]: StandardSchemaV1.InferOutput<T[K]> };\ndeclare function createEnv<const T extends SchemaShape>(def: EnvSchema<T>, config?: ArkEnvConfig): distill.Out<type.infer<T, $>>;\ndeclare function createEnv<T extends CompiledEnvSchema>(def: T, config?: ArkEnvConfig): InferType<T>;\n//#endregion\nexport { SchemaShape as i, EnvSchema as n, createEnv as r, ArkEnvConfig as t };\n//# sourceMappingURL=create-env-CFw1N3G1.d.ts.map"],"mappings":";;;;;;;;;;;;;;AAOYA,KAAAA,cAAc,CAAAC,UAAWE,MAAX,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,eAAA,MAAA,CAAA,GAAA,QAAWA,MACrBF,CADqBE,IAChBC,CADgBD,SAAAA,GACHD,MADGC,GAAAA,MAAAA,EAAAA,GACiBC,CADjBD,GAAAA,KAAAA,GAC6BF,CAD7BE,CAC+BC,CAD/BD,CAAAA,EACrBF;;;;;;;;;;AADJD,UCAKK,eDASH,CAAAA,QAAA,OAAA,EAAA,SCAiCI,KDAjC,CAAA,CAAA;EAAWH;EACrBF,SAAAA,WAAAA,ECCUI,eAAAA,CAAgBG,KDD1BP,CCCgCK,KDDhCL,ECCuCM,MDDvCN,CAAAA;;AAAkBC,kBCGTG,eAAAA,CDHSH;EAAoBE;EAAYH,UAAAA,KAAAA,CAAAA,QAAAA,OAAAA,EAAAA,SCKpBK,KDLoBL,CAAAA,CAAAA;IAAEG;IAAC,SAAA,OAAA,EAAA,CAAA;;;;ICDpDC,SAAAA,KAAe,CAAA,EAYPK,KAZOJ,CAYDA,KAZCC,EAYMA,MAZNA,CAAAA,GAAA,SAAA;EAA2BD;EAEXA;EAAOC,UAAAA,KAAAA,CAAAA,QAAAA,OAAAA,EAAAA,SAaTD,KAbSC,CAAAA,CAAAA;IAA7BF;IAAqB,SAAA,KAAA,EAevBC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;;;;;;;;;;;;;AAsBuC1F,iBMKf,MAAA,CNLeA,OAAAA,EMM7B,iBNN6BA,EAAAA,YAAAA,CAAAA,EMOvB,YNPuBA,CAAAA,EMQpC,MNRoCA;AAAdC,iBMSD,MNTCA,CAAAA,gBMSsB,WNTtBA,CAAAA,CAAAA,OAAAA,EMUf,SNVeA,CMUL,CNVKA,CAAAA,EAAAA,YAAAA,CAAAA,EMWT,YNXSA,CAAAA,EMYtB,MNZsBA"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{createEnv as e}from"arkenv";import{loadEnv as t}from"vite";function n(n){return{name:`@arkenv/vite-plugin`,config(r,{mode:i}){let a=r.envPrefix??`VITE_`,o=Array.isArray(a)?a:[a],s=e(n,{env:t(i,r.envDir??r.root??process.cwd(),``)}),c=Object.fromEntries(Object.entries(s).filter(([e])=>o.some(t=>e.startsWith(t))));return{define:Object.fromEntries(Object.entries(c).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}export{n as default};
1
+ import{createEnv as e}from"arkenv";import{loadEnv as t}from"vite";function n(n,r){return{name:`@arkenv/vite-plugin`,config(i,{mode:a}){let o=i.envPrefix??`VITE_`,s=Array.isArray(o)?o:[o],c=i.envDir??i.root??process.cwd(),l=e(n,{...r,env:r?.env??t(a,c,``)}),u=Object.fromEntries(Object.entries(l).filter(([e])=>s.some(t=>e.startsWith(t))));return{define:Object.fromEntries(Object.entries(u).map(([e,t])=>[`import.meta.env.${e}`,JSON.stringify(t)]))}}}}export{n as default};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { EnvSchemaWithType, SchemaShape } from \"@repo/types\";\nimport { createEnv, type EnvSchema } from \"arkenv\";\nimport { loadEnv, type Plugin } from \"vite\";\n\nexport type { ImportMetaEnvAugmented } from \"./types\";\n\n/**\n * TODO: If possible, find a better type than \"const T extends SchemaShape\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n\n/**\n * Vite plugin to validate environment variables using ArkEnv and expose them to client code.\n *\n * The plugin validates environment variables using ArkEnv's schema validation and\n * automatically filters them based on Vite's `envPrefix` configuration (defaults to `\"VITE_\"`).\n * Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.\n *\n * @param options - The environment variable schema definition. Can be an `EnvSchema` object\n * for typesafe validation or an ArkType `EnvSchemaWithType` for dynamic schemas.\n * @returns A Vite plugin that validates environment variables and exposes them to the client.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import arkenv from '@arkenv/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [\n * arkenv({\n * VITE_API_URL: 'string',\n * VITE_API_KEY: 'string',\n * }),\n * ],\n * });\n * ```\n *\n * @example\n * ```ts\n * // In your client code\n * console.log(import.meta.env.VITE_API_URL); // Typesafe access\n * ```\n */\nexport default function arkenv(options: EnvSchemaWithType): Plugin;\nexport default function arkenv<const T extends SchemaShape>(\n\toptions: EnvSchema<T>,\n): Plugin;\nexport default function arkenv<const T extends SchemaShape>(\n\toptions: EnvSchema<T> | EnvSchemaWithType,\n): Plugin {\n\treturn {\n\t\tname: \"@arkenv/vite-plugin\",\n\t\tconfig(config, { mode }) {\n\t\t\t// Get the Vite prefix for client-exposed environment variables\n\t\t\t// Defaults to \"VITE_\" if not specified\n\t\t\t// Vite allows envPrefix to be a string or array of strings\n\t\t\tconst envPrefix = config.envPrefix ?? \"VITE_\";\n\t\t\tconst prefixes = Array.isArray(envPrefix) ? envPrefix : [envPrefix];\n\n\t\t\t// Load environment based on the custom config\n\t\t\tconst envDir = config.envDir ?? config.root ?? process.cwd();\n\t\t\t// TODO: We're using type assertions and explicitly pass in the type arguments here to avoid\n\t\t\t// \"Type instantiation is excessively deep and possibly infinite\" errors.\n\t\t\t// Ideally, we should find a way to avoid these assertions while maintaining type safety.\n\t\t\tconst env = createEnv<T>(options, {\n\t\t\t\tenv: loadEnv(mode, envDir, \"\"),\n\t\t\t});\n\n\t\t\t// Filter to only include environment variables matching the prefix\n\t\t\t// This prevents server-only variables from being exposed to client code\n\t\t\tconst filteredEnv = Object.fromEntries(\n\t\t\t\tObject.entries(<SchemaShape>env).filter(([key]) =>\n\t\t\t\t\tprefixes.some((prefix) => key.startsWith(prefix)),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// Expose transformed environment variables through Vite's define option\n\t\t\t// Only prefixed variables are exposed to client code\n\t\t\tconst define = Object.fromEntries(\n\t\t\t\tObject.entries(filteredEnv).map(([key, value]) => [\n\t\t\t\t\t`import.meta.env.${key}`,\n\t\t\t\t\tJSON.stringify(value),\n\t\t\t\t]),\n\t\t\t);\n\n\t\t\treturn { define };\n\t\t},\n\t};\n}\n"],"mappings":"kEAgDA,SAAwB,EACvB,EACS,CACT,MAAO,CACN,KAAM,sBACN,OAAO,EAAQ,CAAE,QAAQ,CAIxB,IAAM,EAAY,EAAO,WAAa,QAChC,EAAW,MAAM,QAAQ,EAAU,CAAG,EAAY,CAAC,EAAU,CAO7D,EAAM,EAAa,EAAS,CACjC,IAAK,EAAQ,EALC,EAAO,QAAU,EAAO,MAAQ,QAAQ,KAAK,CAKhC,GAAG,CAC9B,CAAC,CAII,EAAc,OAAO,YAC1B,OAAO,QAAqB,EAAI,CAAC,QAAQ,CAAC,KACzC,EAAS,KAAM,GAAW,EAAI,WAAW,EAAO,CAAC,CACjD,CACD,CAWD,MAAO,CAAE,OAPM,OAAO,YACrB,OAAO,QAAQ,EAAY,CAAC,KAAK,CAAC,EAAK,KAAW,CACjD,mBAAmB,IACnB,KAAK,UAAU,EAAM,CACrB,CAAC,CACF,CAEgB,EAElB"}
1
+ {"version":3,"file":"index.js","names":["env: SchemaShape"],"sources":["../src/index.ts"],"sourcesContent":["import type { CompiledEnvSchema, SchemaShape } from \"@repo/types\";\nimport { type ArkEnvConfig, createEnv, type EnvSchema } from \"arkenv\";\nimport { loadEnv, type Plugin } from \"vite\";\n\nexport type { ImportMetaEnvAugmented } from \"./types\";\n\n/**\n * TODO: If possible, find a better type than \"const T extends SchemaShape\",\n * and be as close as possible to the type accepted by ArkType's `type`.\n */\n\n/**\n * Vite plugin to validate environment variables using ArkEnv and expose them to client code.\n *\n * The plugin validates environment variables using ArkEnv's schema validation and\n * automatically filters them based on Vite's `envPrefix` configuration (defaults to `\"VITE_\"`).\n * Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.\n *\n * @param options - The environment variable schema definition. Can be an `EnvSchema` object\n * for typesafe validation or an ArkType `CompiledEnvSchema` for dynamic schemas.\n * @param arkenvConfig - Optional configuration for ArkEnv, including validator mode selection.\n * Use `{ validator: \"standard\" }` to use Standard Schema validators (e.g., Zod, Valibot) instead of ArkType.\n * @returns A Vite plugin that validates environment variables and exposes them to the client.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import arkenv from '@arkenv/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [\n * arkenv({\n * VITE_API_URL: 'string',\n * VITE_API_KEY: 'string',\n * }),\n * ],\n * });\n * ```\n *\n * @example\n * ```ts\n * // In your client code\n * console.log(import.meta.env.VITE_API_URL); // Typesafe access\n * ```\n *\n * @example\n * ```ts\n * // Using Standard Schema validators (e.g., Zod)\n * import { defineConfig } from 'vite';\n * import { z } from 'zod';\n * import arkenv from '@arkenv/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [\n * arkenv({\n * VITE_API_URL: z.string().url(),\n * VITE_API_KEY: z.string().min(1),\n * }, {\n * validator: 'standard'\n * }),\n * ],\n * });\n * ```\n */\nexport default function arkenv(\n\toptions: CompiledEnvSchema,\n\tarkenvConfig?: ArkEnvConfig,\n): Plugin;\nexport default function arkenv<const T extends SchemaShape>(\n\toptions: EnvSchema<T>,\n\tarkenvConfig?: ArkEnvConfig,\n): Plugin;\nexport default function arkenv<const T extends SchemaShape>(\n\toptions: EnvSchema<T> | CompiledEnvSchema,\n\tarkenvConfig?: ArkEnvConfig,\n): Plugin {\n\treturn {\n\t\tname: \"@arkenv/vite-plugin\",\n\t\tconfig(config, { mode }) {\n\t\t\t// Get the Vite prefix for client-exposed environment variables\n\t\t\t// Defaults to \"VITE_\" if not specified\n\t\t\t// Vite allows envPrefix to be a string or array of strings\n\t\t\tconst envPrefix = config.envPrefix ?? \"VITE_\";\n\t\t\tconst prefixes = Array.isArray(envPrefix) ? envPrefix : [envPrefix];\n\n\t\t\t// Load environment based on the custom config\n\t\t\tconst envDir = config.envDir ?? config.root ?? process.cwd();\n\t\t\t// Use type assertion because options could be either EnvSchema<T> or CompiledEnvSchema\n\t\t\t// The union type can't match the overloads directly\n\t\t\tconst env: SchemaShape = createEnv(options as any, {\n\t\t\t\t...arkenvConfig,\n\t\t\t\tenv: arkenvConfig?.env ?? loadEnv(mode, envDir, \"\"),\n\t\t\t});\n\n\t\t\t// Filter to only include environment variables matching the prefix\n\t\t\t// This prevents server-only variables from being exposed to client code\n\t\t\tconst filteredEnv = Object.fromEntries(\n\t\t\t\tObject.entries(env).filter(([key]) =>\n\t\t\t\t\tprefixes.some((prefix) => key.startsWith(prefix)),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// Expose transformed environment variables through Vite's define option\n\t\t\t// Only prefixed variables are exposed to client code\n\t\t\tconst define = Object.fromEntries(\n\t\t\t\tObject.entries(filteredEnv).map(([key, value]) => [\n\t\t\t\t\t`import.meta.env.${key}`,\n\t\t\t\t\tJSON.stringify(value),\n\t\t\t\t]),\n\t\t\t);\n\n\t\t\treturn { define };\n\t\t},\n\t};\n}\n"],"mappings":"kEAyEA,SAAwB,EACvB,EACA,EACS,CACT,MAAO,CACN,KAAM,sBACN,OAAO,EAAQ,CAAE,QAAQ,CAIxB,IAAM,EAAY,EAAO,WAAa,QAChC,EAAW,MAAM,QAAQ,EAAU,CAAG,EAAY,CAAC,EAAU,CAG7D,EAAS,EAAO,QAAU,EAAO,MAAQ,QAAQ,KAAK,CAGtDA,EAAmB,EAAU,EAAgB,CAClD,GAAG,EACH,IAAK,GAAc,KAAO,EAAQ,EAAM,EAAQ,GAAG,CACnD,CAAC,CAII,EAAc,OAAO,YAC1B,OAAO,QAAQ,EAAI,CAAC,QAAQ,CAAC,KAC5B,EAAS,KAAM,GAAW,EAAI,WAAW,EAAO,CAAC,CACjD,CACD,CAWD,MAAO,CAAE,OAPM,OAAO,YACrB,OAAO,QAAQ,EAAY,CAAC,KAAK,CAAC,EAAK,KAAW,CACjD,mBAAmB,IACnB,KAAK,UAAU,EAAM,CACrB,CAAC,CACF,CAEgB,EAElB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkenv/vite-plugin",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "author": "Yam Borodetsky <yam@yam.codes>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  "main": "./dist/index.cjs",
10
10
  "module": "./dist/index.js",
11
11
  "dependencies": {
12
- "arkenv": "0.9.0"
12
+ "arkenv": "0.9.1"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@size-limit/preset-small-lib": "12.0.0",
@@ -21,8 +21,8 @@
21
21
  "vite": "7.3.1",
22
22
  "vite-tsconfig-paths": "6.0.4",
23
23
  "vitest": "4.0.17",
24
- "@repo/scope": "0.1.3",
25
- "@repo/types": "0.0.7"
24
+ "@repo/types": "0.1.0",
25
+ "@repo/scope": "0.1.3"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "arktype": "^2.1.22",