@arkenv/vite-plugin 0.0.26 → 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 +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +236 -66
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +236 -66
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
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(
|
|
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,46 +1,5 @@
|
|
|
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
|
-
import * as arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
44
3
|
import * as arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
|
|
45
4
|
import * as arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
|
|
46
5
|
import { Plugin } from "vite";
|
|
@@ -55,17 +14,105 @@ import { Plugin } from "vite";
|
|
|
55
14
|
*/
|
|
56
15
|
type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = { [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K] };
|
|
57
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
|
|
58
100
|
//#region ../internal/types/dist/infer-type.d.ts
|
|
59
101
|
/**
|
|
60
|
-
* Extract the inferred type from
|
|
61
|
-
*
|
|
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.
|
|
62
107
|
*
|
|
63
|
-
* @template T - The
|
|
108
|
+
* @template T - The schema definition to infer from
|
|
64
109
|
*/
|
|
65
|
-
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 {
|
|
111
|
+
t: infer U;
|
|
112
|
+
} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
|
|
66
113
|
//#endregion
|
|
67
114
|
//#region ../internal/scope/dist/index.d.ts
|
|
68
|
-
//#region src/
|
|
115
|
+
//#region src/root.d.ts
|
|
69
116
|
/**
|
|
70
117
|
* The root scope for the ArkEnv library,
|
|
71
118
|
* containing extensions to the ArkType scopes with ArkEnv-specific types
|
|
@@ -146,16 +193,37 @@ type $$1 = (typeof $$1)["t"];
|
|
|
146
193
|
//#endregion
|
|
147
194
|
//#endregion
|
|
148
195
|
//#region ../internal/types/dist/schema.d.ts
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
196
|
+
type SchemaShape = Record<string, unknown>;
|
|
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>;
|
|
154
210
|
//#endregion
|
|
155
|
-
//#region ../arkenv/dist/
|
|
156
|
-
//#region ../internal/
|
|
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. */
|
|
157
223
|
|
|
158
|
-
//#
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region ../internal/scope/dist/index.d.ts
|
|
226
|
+
//#region src/root.d.ts
|
|
159
227
|
/**
|
|
160
228
|
* The root scope for the ArkEnv library,
|
|
161
229
|
* containing extensions to the ArkType scopes with ArkEnv-specific types
|
|
@@ -235,19 +303,100 @@ declare const $: arktype0.Scope<{
|
|
|
235
303
|
type $ = (typeof $)["t"];
|
|
236
304
|
//#endregion
|
|
237
305
|
//#endregion
|
|
238
|
-
//#region ../internal/types/dist/
|
|
239
|
-
/**
|
|
240
|
-
* Extract the inferred type from an ArkType type definition by checking its call signature.
|
|
241
|
-
* When a type definition is called, it returns either the validated value or type.errors.
|
|
242
|
-
*
|
|
243
|
-
* @template T - The ArkType type definition to infer from
|
|
244
|
-
*/
|
|
306
|
+
//#region ../internal/types/dist/schema.d.ts
|
|
245
307
|
|
|
246
308
|
//#endregion
|
|
247
309
|
//#region src/create-env.d.ts
|
|
248
|
-
|
|
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
|
+
*/
|
|
249
384
|
//#endregion
|
|
250
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
|
+
*/
|
|
251
400
|
type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "VITE_"> = FilterByPrefix<InferType<TSchema>, Prefix>;
|
|
252
401
|
//#endregion
|
|
253
402
|
//#region src/index.d.ts
|
|
@@ -263,7 +412,9 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
|
|
|
263
412
|
* Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.
|
|
264
413
|
*
|
|
265
414
|
* @param options - The environment variable schema definition. Can be an `EnvSchema` object
|
|
266
|
-
* for typesafe validation or an ArkType `
|
|
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.
|
|
267
418
|
* @returns A Vite plugin that validates environment variables and exposes them to the client.
|
|
268
419
|
*
|
|
269
420
|
* @example
|
|
@@ -287,9 +438,28 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
|
|
|
287
438
|
* // In your client code
|
|
288
439
|
* console.log(import.meta.env.VITE_API_URL); // Typesafe access
|
|
289
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
|
+
* ```
|
|
290
460
|
*/
|
|
291
|
-
declare function arkenv(options:
|
|
292
|
-
declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T
|
|
461
|
+
declare function arkenv(options: CompiledEnvSchema, arkenvConfig?: ArkEnvConfig): Plugin;
|
|
462
|
+
declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>, arkenvConfig?: ArkEnvConfig): Plugin;
|
|
293
463
|
//#endregion
|
|
294
464
|
export { type ImportMetaEnvAugmented, arkenv as default };
|
|
295
465
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -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","arktype_internal_variants_object_ts0","ObjectType","infer","EnvSchemaWithType","arktype0","ArkErrors","Type","distill","type","type$1","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","arktype_internal_variants_object_ts0","arktype_internal_type_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","InferType","T","Record","errors","Any","SchemaShape","ObjectType","infer","EnvSchemaWithType","CoerceOptions","EnvSchema","def$1","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","Out","def","TypeParser","ArkEnvError","Error","arkenv","default"],"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/index.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 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/index.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 declare const SchemaShape: import(\"arktype/internal/variants/object.ts\").ObjectType<{\n [x: string]: unknown;\n}, {}>;\nexport type SchemaShape = typeof SchemaShape.infer;\nexport type EnvSchemaWithType = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { ArkErrors, Type, distill, type as type$1 } 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\";\nimport * as arktype_internal_variants_object_ts0 from \"arktype/internal/variants/object.ts\";\nimport * as arktype_internal_type_ts0 from \"arktype/internal/type.ts\";\n\n//#region ../internal/scope/dist/index.d.ts\n\n//#region src/index.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/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$1.errors ? never : R : T extends type$1.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ndeclare const SchemaShape: arktype_internal_variants_object_ts0.ObjectType<{\n [x: string]: unknown;\n}, {}>;\ntype SchemaShape = typeof SchemaShape.infer;\ntype EnvSchemaWithType = Type<SchemaShape, $>;\n//#endregion\n//#region src/utils/coerce.d.ts\n/**\n * Options for coercion behavior.\n */\ntype CoerceOptions = {\n /**\n * format to use for array parsing\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n};\n//#endregion\n//#region src/create-env.d.ts\ntype EnvSchema<def$1> = type$1.validate<def$1, $>;\ntype RuntimeEnvironment = Record<string, string | undefined>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to validate. 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?: CoerceOptions[\"arrayFormat\"];\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 * Create an environment variables object from a schema and an environment\n * @param def - The environment variable schema (raw object or type definition created with `type()`)\n * @param config - Configuration options, see {@link ArkEnvConfig}\n * @returns The validated environment variable schema\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$1.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$1.infer<T, $>> | InferType<typeof def>;\n//#endregion\n//#region src/type.d.ts\ndeclare const type: arktype_internal_type_ts0.TypeParser<{\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}>;\n//#endregion\n//#region src/errors.d.ts\ndeclare class ArkEnvError extends Error {\n constructor(errors: ArkErrors, message?: string);\n}\n//#endregion\n//#region src/index.d.ts\n/**\n * `arkenv`'s main export, an alias for {@link createEnv}\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\ndeclare const arkenv: typeof createEnv;\n//#endregion\nexport { ArkEnvError, type EnvSchema, createEnv, arkenv as default, type };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAOA;;;;;;;;;;;;ACAA;;;;;;;;;;ACLkF;;;;;;;;;;;;;;;;;;;;;;;;;;;KFKtEA,yBAAyBG,0DAAzBH,MACIC,CADJD,IACSI,CADK,SAAAF,GACQA,MADRA,GAAA,MAAA,EAAA,GAC4BE,CAD5B,GAAA,KAAA,GACwCH,CADxC,CAC0CG,CAD1C,CAAA,EAAWD;;;;;;;;;KCAzBG,eAAeC,mBAAkBC,4DAA2DH,IAAAA,CAAKI,qBAAqBF,UAAUF,IAAAA,CAAKK;;;;;;;ADAjJ;;cEGcI,GFFEb,EEECU,QAAAA,CAASiB,KFFV3B,CAAAA;EAAKG,MAAAA,EEGXO,QAAAA,CAASM,SFHEb,CAAAA;IAAaF,IAAAA,EEI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BA,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,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,KAfuB;IAEtBD;IAEqBC,SAAAA,MAAAA,EAarBC,MA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AAA,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,47 +1,6 @@
|
|
|
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
|
-
import * as arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
45
4
|
import * as arktype_internal_keywords_string_ts0 from "arktype/internal/keywords/string.ts";
|
|
46
5
|
import * as arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts";
|
|
47
6
|
|
|
@@ -55,17 +14,105 @@ import * as arktype_internal_attributes_ts0 from "arktype/internal/attributes.ts
|
|
|
55
14
|
*/
|
|
56
15
|
type FilterByPrefix<T extends Record<string, unknown>, Prefix extends string> = { [K in keyof T as K extends `${Prefix}${string}` ? K : never]: T[K] };
|
|
57
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
|
|
58
100
|
//#region ../internal/types/dist/infer-type.d.ts
|
|
59
101
|
/**
|
|
60
|
-
* Extract the inferred type from
|
|
61
|
-
*
|
|
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.
|
|
62
107
|
*
|
|
63
|
-
* @template T - The
|
|
108
|
+
* @template T - The schema definition to infer from
|
|
64
109
|
*/
|
|
65
|
-
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 {
|
|
111
|
+
t: infer U;
|
|
112
|
+
} ? U : T extends type.Any<infer U, infer _Scope> ? U : never;
|
|
66
113
|
//#endregion
|
|
67
114
|
//#region ../internal/scope/dist/index.d.ts
|
|
68
|
-
//#region src/
|
|
115
|
+
//#region src/root.d.ts
|
|
69
116
|
/**
|
|
70
117
|
* The root scope for the ArkEnv library,
|
|
71
118
|
* containing extensions to the ArkType scopes with ArkEnv-specific types
|
|
@@ -146,16 +193,37 @@ type $$1 = (typeof $$1)["t"];
|
|
|
146
193
|
//#endregion
|
|
147
194
|
//#endregion
|
|
148
195
|
//#region ../internal/types/dist/schema.d.ts
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
196
|
+
type SchemaShape = Record<string, unknown>;
|
|
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>;
|
|
154
210
|
//#endregion
|
|
155
|
-
//#region ../arkenv/dist/
|
|
156
|
-
//#region ../internal/
|
|
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. */
|
|
157
223
|
|
|
158
|
-
//#
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region ../internal/scope/dist/index.d.ts
|
|
226
|
+
//#region src/root.d.ts
|
|
159
227
|
/**
|
|
160
228
|
* The root scope for the ArkEnv library,
|
|
161
229
|
* containing extensions to the ArkType scopes with ArkEnv-specific types
|
|
@@ -235,19 +303,100 @@ declare const $: arktype0.Scope<{
|
|
|
235
303
|
type $ = (typeof $)["t"];
|
|
236
304
|
//#endregion
|
|
237
305
|
//#endregion
|
|
238
|
-
//#region ../internal/types/dist/
|
|
239
|
-
/**
|
|
240
|
-
* Extract the inferred type from an ArkType type definition by checking its call signature.
|
|
241
|
-
* When a type definition is called, it returns either the validated value or type.errors.
|
|
242
|
-
*
|
|
243
|
-
* @template T - The ArkType type definition to infer from
|
|
244
|
-
*/
|
|
306
|
+
//#region ../internal/types/dist/schema.d.ts
|
|
245
307
|
|
|
246
308
|
//#endregion
|
|
247
309
|
//#region src/create-env.d.ts
|
|
248
|
-
|
|
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
|
+
*/
|
|
249
384
|
//#endregion
|
|
250
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
|
+
*/
|
|
251
400
|
type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "VITE_"> = FilterByPrefix<InferType<TSchema>, Prefix>;
|
|
252
401
|
//#endregion
|
|
253
402
|
//#region src/index.d.ts
|
|
@@ -263,7 +412,9 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
|
|
|
263
412
|
* Only environment variables matching the prefix are exposed to client code via `import.meta.env.*`.
|
|
264
413
|
*
|
|
265
414
|
* @param options - The environment variable schema definition. Can be an `EnvSchema` object
|
|
266
|
-
* for typesafe validation or an ArkType `
|
|
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.
|
|
267
418
|
* @returns A Vite plugin that validates environment variables and exposes them to the client.
|
|
268
419
|
*
|
|
269
420
|
* @example
|
|
@@ -287,9 +438,28 @@ type ImportMetaEnvAugmented<TSchema extends type.Any, Prefix extends string = "V
|
|
|
287
438
|
* // In your client code
|
|
288
439
|
* console.log(import.meta.env.VITE_API_URL); // Typesafe access
|
|
289
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
|
+
* ```
|
|
290
460
|
*/
|
|
291
|
-
declare function arkenv(options:
|
|
292
|
-
declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T
|
|
461
|
+
declare function arkenv(options: CompiledEnvSchema, arkenvConfig?: ArkEnvConfig): Plugin;
|
|
462
|
+
declare function arkenv<const T extends SchemaShape>(options: EnvSchema<T>, arkenvConfig?: ArkEnvConfig): Plugin;
|
|
293
463
|
//#endregion
|
|
294
464
|
export { type ImportMetaEnvAugmented, arkenv as default };
|
|
295
465
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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","arktype_internal_variants_object_ts0","ObjectType","infer","EnvSchemaWithType","arktype0","ArkErrors","Type","distill","type","type$1","arktype_internal_keywords_string_ts0","arktype_internal_attributes_ts0","arktype_internal_variants_object_ts0","arktype_internal_type_ts0","$","trim","To","Submodule","normalize","capitalize","stringDate","stringInteger","ip","stringJson","lower","stringNumeric","url","uuid","Scope","InferType","T","Record","errors","Any","SchemaShape","ObjectType","infer","EnvSchemaWithType","CoerceOptions","EnvSchema","def$1","validate","RuntimeEnvironment","ArkEnvConfig","createEnv","Out","def","TypeParser","ArkEnvError","Error","arkenv","default"],"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/index.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 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/index.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 declare const SchemaShape: import(\"arktype/internal/variants/object.ts\").ObjectType<{\n [x: string]: unknown;\n}, {}>;\nexport type SchemaShape = typeof SchemaShape.infer;\nexport type EnvSchemaWithType = Type<SchemaShape, $>;\n//# sourceMappingURL=schema.d.ts.map","import * as arktype0 from \"arktype\";\nimport { ArkErrors, Type, distill, type as type$1 } 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\";\nimport * as arktype_internal_variants_object_ts0 from \"arktype/internal/variants/object.ts\";\nimport * as arktype_internal_type_ts0 from \"arktype/internal/type.ts\";\n\n//#region ../internal/scope/dist/index.d.ts\n\n//#region src/index.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/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$1.errors ? never : R : T extends type$1.Any<infer U, infer _Scope> ? U : never;\n//#endregion\n//#region ../internal/types/dist/schema.d.ts\ndeclare const SchemaShape: arktype_internal_variants_object_ts0.ObjectType<{\n [x: string]: unknown;\n}, {}>;\ntype SchemaShape = typeof SchemaShape.infer;\ntype EnvSchemaWithType = Type<SchemaShape, $>;\n//#endregion\n//#region src/utils/coerce.d.ts\n/**\n * Options for coercion behavior.\n */\ntype CoerceOptions = {\n /**\n * format to use for array parsing\n * @default \"comma\"\n */\n arrayFormat?: \"comma\" | \"json\";\n};\n//#endregion\n//#region src/create-env.d.ts\ntype EnvSchema<def$1> = type$1.validate<def$1, $>;\ntype RuntimeEnvironment = Record<string, string | undefined>;\n/**\n * Configuration options for `createEnv`\n */\ntype ArkEnvConfig = {\n /**\n * The environment variables to validate. 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?: CoerceOptions[\"arrayFormat\"];\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 * Create an environment variables object from a schema and an environment\n * @param def - The environment variable schema (raw object or type definition created with `type()`)\n * @param config - Configuration options, see {@link ArkEnvConfig}\n * @returns The validated environment variable schema\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$1.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$1.infer<T, $>> | InferType<typeof def>;\n//#endregion\n//#region src/type.d.ts\ndeclare const type: arktype_internal_type_ts0.TypeParser<{\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}>;\n//#endregion\n//#region src/errors.d.ts\ndeclare class ArkEnvError extends Error {\n constructor(errors: ArkErrors, message?: string);\n}\n//#endregion\n//#region src/index.d.ts\n/**\n * `arkenv`'s main export, an alias for {@link createEnv}\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\ndeclare const arkenv: typeof createEnv;\n//#endregion\nexport { ArkEnvError, type EnvSchema, createEnv, arkenv as default, type };\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAOA;;;;;;;;;;;;ACAA;;;;;;;;;;ACLkF;;;;;;;;;;;;;;;;;;;;;;;;;;;KFKtEA,yBAAyBG,0DAAzBH,MACIC,CADJD,IAC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AAAA,EAAAA,MAAAA;IAD5BP,gBAASa,EAAAA,MAAAA;IAGeP,IAAAA,EAAAA,MAAAA;EACIC,CAAAA,CAAAA;CADvBP,CAAAA;KAkEVU,CAAAA,GA3DOV,CAASa,OA2DJH,CA3DIG,CAAAA,CAAAA,GAAAA,CAAAA;;;;;;;;;;;;;KA2FhBsB,SAA0BE,CAAAA,KAAAA,CAAAA,GAAPhC,IAAAA,CAAOgC,QAAAA,CAASD,KAATC,EAAgB3B,CAAhB2B,CAAAA;;;AFjFC7D,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,S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,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.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(
|
|
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 {
|
|
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.
|
|
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.
|
|
12
|
+
"arkenv": "0.9.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@size-limit/preset-small-lib": "12.0.0",
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
"size-limit": "12.0.0",
|
|
19
19
|
"tsdown": "0.18.4",
|
|
20
20
|
"typescript": "5.9.3",
|
|
21
|
-
"vite": "7.3.
|
|
22
|
-
"vite-tsconfig-paths": "6.0.
|
|
23
|
-
"vitest": "4.0.
|
|
24
|
-
"@repo/types": "0.0
|
|
21
|
+
"vite": "7.3.1",
|
|
22
|
+
"vite-tsconfig-paths": "6.0.4",
|
|
23
|
+
"vitest": "4.0.17",
|
|
24
|
+
"@repo/types": "0.1.0",
|
|
25
|
+
"@repo/scope": "0.1.3"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"arktype": "^2.1.22",
|
|
@@ -58,7 +59,8 @@
|
|
|
58
59
|
"import": "*",
|
|
59
60
|
"ignore": [
|
|
60
61
|
"vite",
|
|
61
|
-
"arktype"
|
|
62
|
+
"arktype",
|
|
63
|
+
"node:module"
|
|
62
64
|
]
|
|
63
65
|
}
|
|
64
66
|
],
|
|
@@ -69,6 +71,6 @@
|
|
|
69
71
|
"test": "vitest",
|
|
70
72
|
"fix": "pnpm -w run fix",
|
|
71
73
|
"changeset": "pnpm -w run changeset",
|
|
72
|
-
"size": "size-limit"
|
|
74
|
+
"size": "size-limit --json > .size-limit.json"
|
|
73
75
|
}
|
|
74
76
|
}
|