envin 1.1.11 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,280 @@
1
+ import { d as InferPresetOutput } from "../types-5fo7WST9.mjs";
2
+ import * as z from "zod";
3
+
4
+ //#region src/presets/zod.d.ts
5
+
6
+ /**
7
+ * Vercel System Environment Variables
8
+ * @see https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables
9
+ */
10
+ declare const vercel: {
11
+ readonly id: "vercel";
12
+ readonly server: {
13
+ readonly VERCEL: z.ZodOptional<z.ZodString>;
14
+ readonly CI: z.ZodOptional<z.ZodString>;
15
+ readonly VERCEL_ENV: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
16
+ development: "development";
17
+ preview: "preview";
18
+ production: "production";
19
+ }>>>;
20
+ readonly VERCEL_TARGET_ENV: z.ZodOptional<z.ZodString>;
21
+ readonly VERCEL_URL: z.ZodOptional<z.ZodString>;
22
+ readonly VERCEL_PROJECT_PRODUCTION_URL: z.ZodOptional<z.ZodString>;
23
+ readonly VERCEL_BRANCH_URL: z.ZodOptional<z.ZodString>;
24
+ readonly VERCEL_REGION: z.ZodOptional<z.ZodString>;
25
+ readonly VERCEL_DEPLOYMENT_ID: z.ZodOptional<z.ZodString>;
26
+ readonly VERCEL_SKEW_PROTECTION_ENABLED: z.ZodOptional<z.ZodString>;
27
+ readonly VERCEL_AUTOMATION_BYPASS_SECRET: z.ZodOptional<z.ZodString>;
28
+ readonly VERCEL_GIT_PROVIDER: z.ZodOptional<z.ZodString>;
29
+ readonly VERCEL_GIT_REPO_SLUG: z.ZodOptional<z.ZodString>;
30
+ readonly VERCEL_GIT_REPO_OWNER: z.ZodOptional<z.ZodString>;
31
+ readonly VERCEL_GIT_REPO_ID: z.ZodOptional<z.ZodString>;
32
+ readonly VERCEL_GIT_COMMIT_REF: z.ZodOptional<z.ZodString>;
33
+ readonly VERCEL_GIT_COMMIT_SHA: z.ZodOptional<z.ZodString>;
34
+ readonly VERCEL_GIT_COMMIT_MESSAGE: z.ZodOptional<z.ZodString>;
35
+ readonly VERCEL_GIT_COMMIT_AUTHOR_LOGIN: z.ZodOptional<z.ZodString>;
36
+ readonly VERCEL_GIT_COMMIT_AUTHOR_NAME: z.ZodOptional<z.ZodString>;
37
+ readonly VERCEL_GIT_PREVIOUS_SHA: z.ZodOptional<z.ZodString>;
38
+ readonly VERCEL_GIT_PULL_REQUEST_ID: z.ZodOptional<z.ZodString>;
39
+ };
40
+ };
41
+ type VercelEnv = InferPresetOutput<typeof vercel>;
42
+ /**
43
+ * Neon for Vercel Environment Variables
44
+ * @see https://neon.tech/docs/guides/vercel-native-integration#environment-variables-set-by-the-integration
45
+ */
46
+ declare const neonVercel: {
47
+ readonly id: "neon-vercel";
48
+ readonly server: {
49
+ readonly DATABASE_URL: z.ZodString;
50
+ readonly DATABASE_URL_UNPOOLED: z.ZodOptional<z.ZodString>;
51
+ readonly PGHOST: z.ZodOptional<z.ZodString>;
52
+ readonly PGHOST_UNPOOLED: z.ZodOptional<z.ZodString>;
53
+ readonly PGUSER: z.ZodOptional<z.ZodString>;
54
+ readonly PGDATABASE: z.ZodOptional<z.ZodString>;
55
+ readonly PGPASSWORD: z.ZodOptional<z.ZodString>;
56
+ readonly POSTGRES_URL: z.ZodOptional<z.ZodURL>;
57
+ readonly POSTGRES_URL_NON_POOLING: z.ZodOptional<z.ZodURL>;
58
+ readonly POSTGRES_USER: z.ZodOptional<z.ZodString>;
59
+ readonly POSTGRES_HOST: z.ZodOptional<z.ZodString>;
60
+ readonly POSTGRES_PASSWORD: z.ZodOptional<z.ZodString>;
61
+ readonly POSTGRES_DATABASE: z.ZodOptional<z.ZodString>;
62
+ readonly POSTGRES_URL_NO_SSL: z.ZodOptional<z.ZodURL>;
63
+ readonly POSTGRES_PRISMA_URL: z.ZodOptional<z.ZodURL>;
64
+ };
65
+ };
66
+ type NeonVercelEnv = InferPresetOutput<typeof neonVercel>;
67
+ /**
68
+ * @see https://docs.uploadthing.com/getting-started/appdir#add-env-variables
69
+ */
70
+ declare const uploadthing: {
71
+ readonly id: "uploadthing";
72
+ readonly server: {
73
+ readonly UPLOADTHING_TOKEN: z.ZodString;
74
+ };
75
+ };
76
+ type UploadthingEnv = InferPresetOutput<typeof uploadthing>;
77
+ /**
78
+ * Render System Environment Variables
79
+ * @see https://docs.render.com/environment-variables#all-runtimes
80
+ */
81
+ declare const render: {
82
+ readonly id: "render";
83
+ readonly server: {
84
+ readonly IS_PULL_REQUEST: z.ZodOptional<z.ZodString>;
85
+ readonly RENDER_DISCOVERY_SERVICE: z.ZodOptional<z.ZodString>;
86
+ readonly RENDER_EXTERNAL_HOSTNAME: z.ZodOptional<z.ZodString>;
87
+ readonly RENDER_EXTERNAL_URL: z.ZodOptional<z.ZodURL>;
88
+ readonly RENDER_GIT_BRANCH: z.ZodOptional<z.ZodString>;
89
+ readonly RENDER_GIT_COMMIT: z.ZodOptional<z.ZodString>;
90
+ readonly RENDER_GIT_REPO_SLUG: z.ZodOptional<z.ZodString>;
91
+ readonly RENDER_INSTANCE_ID: z.ZodOptional<z.ZodString>;
92
+ readonly RENDER_SERVICE_ID: z.ZodOptional<z.ZodString>;
93
+ readonly RENDER_SERVICE_NAME: z.ZodOptional<z.ZodString>;
94
+ readonly RENDER_SERVICE_TYPE: z.ZodOptional<z.ZodEnum<{
95
+ web: "web";
96
+ pserv: "pserv";
97
+ cron: "cron";
98
+ worker: "worker";
99
+ static: "static";
100
+ }>>;
101
+ readonly RENDER: z.ZodOptional<z.ZodString>;
102
+ };
103
+ };
104
+ type RenderEnv = InferPresetOutput<typeof render>;
105
+ /**
106
+ * Railway Environment Variables
107
+ * @see https://docs.railway.app/reference/variables#railway-provided-variables
108
+ */
109
+ declare const railway: {
110
+ readonly id: "railway";
111
+ readonly server: {
112
+ readonly RAILWAY_PUBLIC_DOMAIN: z.ZodOptional<z.ZodString>;
113
+ readonly RAILWAY_PRIVATE_DOMAIN: z.ZodOptional<z.ZodString>;
114
+ readonly RAILWAY_TCP_PROXY_DOMAIN: z.ZodOptional<z.ZodString>;
115
+ readonly RAILWAY_TCP_PROXY_PORT: z.ZodOptional<z.ZodString>;
116
+ readonly RAILWAY_TCP_APPLICATION_PORT: z.ZodOptional<z.ZodString>;
117
+ readonly RAILWAY_PROJECT_NAME: z.ZodOptional<z.ZodString>;
118
+ readonly RAILWAY_PROJECT_ID: z.ZodOptional<z.ZodString>;
119
+ readonly RAILWAY_ENVIRONMENT_NAME: z.ZodOptional<z.ZodString>;
120
+ readonly RAILWAY_ENVIRONMENT_ID: z.ZodOptional<z.ZodString>;
121
+ readonly RAILWAY_SERVICE_NAME: z.ZodOptional<z.ZodString>;
122
+ readonly RAILWAY_SERVICE_ID: z.ZodOptional<z.ZodString>;
123
+ readonly RAILWAY_REPLICA_ID: z.ZodOptional<z.ZodString>;
124
+ readonly RAILWAY_DEPLOYMENT_ID: z.ZodOptional<z.ZodString>;
125
+ readonly RAILWAY_SNAPSHOT_ID: z.ZodOptional<z.ZodString>;
126
+ readonly RAILWAY_VOLUME_NAME: z.ZodOptional<z.ZodString>;
127
+ readonly RAILWAY_VOLUME_MOUNT_PATH: z.ZodOptional<z.ZodString>;
128
+ readonly RAILWAY_RUN_UID: z.ZodOptional<z.ZodString>;
129
+ readonly RAILWAY_GIT_COMMIT_SHA: z.ZodOptional<z.ZodString>;
130
+ readonly RAILWAY_GIT_AUTHOR_EMAIL: z.ZodOptional<z.ZodString>;
131
+ readonly RAILWAY_GIT_BRANCH: z.ZodOptional<z.ZodString>;
132
+ readonly RAILWAY_GIT_REPO_NAME: z.ZodOptional<z.ZodString>;
133
+ readonly RAILWAY_GIT_REPO_OWNER: z.ZodOptional<z.ZodString>;
134
+ readonly RAILWAY_GIT_COMMIT_MESSAGE: z.ZodOptional<z.ZodString>;
135
+ };
136
+ };
137
+ type RailwayEnv = InferPresetOutput<typeof railway>;
138
+ /**
139
+ * Fly.io Environment Variables
140
+ * @see https://fly.io/docs/machines/runtime-environment/#environment-variables
141
+ */
142
+ declare const fly: {
143
+ readonly id: "fly";
144
+ readonly server: {
145
+ readonly FLY_APP_NAME: z.ZodOptional<z.ZodString>;
146
+ readonly FLY_MACHINE_ID: z.ZodOptional<z.ZodString>;
147
+ readonly FLY_ALLOC_ID: z.ZodOptional<z.ZodString>;
148
+ readonly FLY_REGION: z.ZodOptional<z.ZodString>;
149
+ readonly FLY_PUBLIC_IP: z.ZodOptional<z.ZodString>;
150
+ readonly FLY_IMAGE_REF: z.ZodOptional<z.ZodString>;
151
+ readonly FLY_MACHINE_VERSION: z.ZodOptional<z.ZodString>;
152
+ readonly FLY_PRIVATE_IP: z.ZodOptional<z.ZodString>;
153
+ readonly FLY_PROCESS_GROUP: z.ZodOptional<z.ZodString>;
154
+ readonly FLY_VM_MEMORY_MB: z.ZodOptional<z.ZodString>;
155
+ readonly PRIMARY_REGION: z.ZodOptional<z.ZodString>;
156
+ };
157
+ };
158
+ type FlyEnv = InferPresetOutput<typeof fly>;
159
+ /**
160
+ * Netlify Environment Variables
161
+ * @see https://docs.netlify.com/configure-builds/environment-variables
162
+ */
163
+ declare const netlify: {
164
+ readonly id: "netlify";
165
+ readonly server: {
166
+ readonly NETLIFY: z.ZodOptional<z.ZodString>;
167
+ readonly BUILD_ID: z.ZodOptional<z.ZodString>;
168
+ readonly CONTEXT: z.ZodOptional<z.ZodEnum<{
169
+ dev: "dev";
170
+ production: "production";
171
+ "deploy-preview": "deploy-preview";
172
+ "branch-deploy": "branch-deploy";
173
+ }>>;
174
+ readonly REPOSITORY_URL: z.ZodOptional<z.ZodString>;
175
+ readonly BRANCH: z.ZodOptional<z.ZodString>;
176
+ readonly URL: z.ZodOptional<z.ZodString>;
177
+ readonly DEPLOY_URL: z.ZodOptional<z.ZodString>;
178
+ readonly DEPLOY_PRIME_URL: z.ZodOptional<z.ZodString>;
179
+ readonly DEPLOY_ID: z.ZodOptional<z.ZodString>;
180
+ readonly SITE_NAME: z.ZodOptional<z.ZodString>;
181
+ readonly SITE_ID: z.ZodOptional<z.ZodString>;
182
+ };
183
+ };
184
+ type NetlifyEnv = InferPresetOutput<typeof netlify>;
185
+ /**
186
+ * Upstash redis Environment Variables
187
+ * @see https://upstash.com/docs/redis/howto/connectwithupstashredis
188
+ */
189
+ declare const upstashRedis: {
190
+ readonly id: "upstash-redis";
191
+ readonly server: {
192
+ readonly UPSTASH_REDIS_REST_URL: z.ZodURL;
193
+ readonly UPSTASH_REDIS_REST_TOKEN: z.ZodString;
194
+ };
195
+ };
196
+ type UpstashRedisEnv = InferPresetOutput<typeof upstashRedis>;
197
+ /**
198
+ * Coolify Environment Variables
199
+ * @see https://coolify.io/docs/knowledge-base/environment-variables#predefined-variables
200
+ */
201
+ declare const coolify: {
202
+ readonly id: "coolify";
203
+ readonly server: {
204
+ readonly COOLIFY_FQDN: z.ZodOptional<z.ZodString>;
205
+ readonly COOLIFY_URL: z.ZodOptional<z.ZodString>;
206
+ readonly COOLIFY_BRANCH: z.ZodOptional<z.ZodString>;
207
+ readonly COOLIFY_RESOURCE_UUID: z.ZodOptional<z.ZodString>;
208
+ readonly COOLIFY_CONTAINER_NAME: z.ZodOptional<z.ZodString>;
209
+ readonly SOURCE_COMMIT: z.ZodOptional<z.ZodString>;
210
+ readonly PORT: z.ZodOptional<z.ZodString>;
211
+ readonly HOST: z.ZodOptional<z.ZodString>;
212
+ };
213
+ };
214
+ type CoolifyEnv = InferPresetOutput<typeof coolify>;
215
+ /**
216
+ * Supabase for Vercel Environment Variables
217
+ * @see https://vercel.com/marketplace/supabase
218
+ */
219
+ declare const supabaseVercel: {
220
+ readonly id: "supabase-vercel";
221
+ readonly clientPrefix: "NEXT_PUBLIC_";
222
+ readonly server: {
223
+ readonly POSTGRES_URL: z.ZodURL;
224
+ readonly POSTGRES_PRISMA_URL: z.ZodOptional<z.ZodURL>;
225
+ readonly POSTGRES_URL_NON_POOLING: z.ZodOptional<z.ZodURL>;
226
+ readonly POSTGRES_USER: z.ZodOptional<z.ZodString>;
227
+ readonly POSTGRES_HOST: z.ZodOptional<z.ZodString>;
228
+ readonly POSTGRES_PASSWORD: z.ZodOptional<z.ZodString>;
229
+ readonly POSTGRES_DATABASE: z.ZodOptional<z.ZodString>;
230
+ readonly SUPABASE_SERVICE_ROLE_KEY: z.ZodOptional<z.ZodString>;
231
+ readonly SUPABASE_ANON_KEY: z.ZodOptional<z.ZodString>;
232
+ readonly SUPABASE_URL: z.ZodOptional<z.ZodURL>;
233
+ readonly SUPABASE_JWT_SECRET: z.ZodOptional<z.ZodString>;
234
+ };
235
+ readonly client: {
236
+ readonly NEXT_PUBLIC_SUPABASE_ANON_KEY: z.ZodOptional<z.ZodString>;
237
+ readonly NEXT_PUBLIC_SUPABASE_URL: z.ZodOptional<z.ZodURL>;
238
+ };
239
+ };
240
+ type SupabaseVercelEnv = InferPresetOutput<typeof supabaseVercel>;
241
+ /**
242
+ * Vite Environment Variables
243
+ * @see https://vite.dev/guide/env-and-mode
244
+ */
245
+ declare const vite: {
246
+ readonly id: "vite";
247
+ readonly shared: {
248
+ readonly BASE_URL: z.ZodOptional<z.ZodString>;
249
+ readonly MODE: z.ZodOptional<z.ZodString>;
250
+ readonly DEV: z.ZodOptional<z.ZodBoolean>;
251
+ readonly PROD: z.ZodOptional<z.ZodBoolean>;
252
+ readonly SSR: z.ZodOptional<z.ZodBoolean>;
253
+ };
254
+ };
255
+ type ViteEnv = InferPresetOutput<typeof vite>;
256
+ /**
257
+ * WXT Environment Variables
258
+ * @see https://wxt.dev/guide/essentials/config/environment-variables.html#built-in-environment-variables
259
+ */
260
+ declare const wxt: {
261
+ readonly id: "wxt";
262
+ readonly server: {
263
+ readonly MANIFEST_VERSION: z.ZodOptional<z.ZodPipe<z.ZodTransform<number, any>, z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>]>>>;
264
+ readonly BROWSER: z.ZodOptional<z.ZodEnum<{
265
+ chrome: "chrome";
266
+ firefox: "firefox";
267
+ safari: "safari";
268
+ edge: "edge";
269
+ opera: "opera";
270
+ }>>;
271
+ readonly CHROME: z.ZodOptional<z.ZodBoolean>;
272
+ readonly FIREFOX: z.ZodOptional<z.ZodBoolean>;
273
+ readonly SAFARI: z.ZodOptional<z.ZodBoolean>;
274
+ readonly EDGE: z.ZodOptional<z.ZodBoolean>;
275
+ readonly OPERA: z.ZodOptional<z.ZodBoolean>;
276
+ };
277
+ };
278
+ type WxtEnv = InferPresetOutput<typeof wxt>;
279
+ //#endregion
280
+ export { CoolifyEnv, FlyEnv, NeonVercelEnv, NetlifyEnv, RailwayEnv, RenderEnv, SupabaseVercelEnv, UploadthingEnv, UpstashRedisEnv, VercelEnv, ViteEnv, WxtEnv, coolify, fly, neonVercel, netlify, railway, render, supabaseVercel, uploadthing, upstashRedis, vercel, vite, wxt };
@@ -0,0 +1 @@
1
+ import*as e from"zod";const t={id:`vercel`,server:{VERCEL:e.string().optional(),CI:e.string().optional(),VERCEL_ENV:e.enum([`development`,`preview`,`production`]).optional().default(`development`),VERCEL_TARGET_ENV:e.string().optional(),VERCEL_URL:e.string().optional(),VERCEL_PROJECT_PRODUCTION_URL:e.string().optional(),VERCEL_BRANCH_URL:e.string().optional(),VERCEL_REGION:e.string().optional(),VERCEL_DEPLOYMENT_ID:e.string().optional(),VERCEL_SKEW_PROTECTION_ENABLED:e.string().optional(),VERCEL_AUTOMATION_BYPASS_SECRET:e.string().optional(),VERCEL_GIT_PROVIDER:e.string().optional(),VERCEL_GIT_REPO_SLUG:e.string().optional(),VERCEL_GIT_REPO_OWNER:e.string().optional(),VERCEL_GIT_REPO_ID:e.string().optional(),VERCEL_GIT_COMMIT_REF:e.string().optional(),VERCEL_GIT_COMMIT_SHA:e.string().optional(),VERCEL_GIT_COMMIT_MESSAGE:e.string().optional(),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:e.string().optional(),VERCEL_GIT_COMMIT_AUTHOR_NAME:e.string().optional(),VERCEL_GIT_PREVIOUS_SHA:e.string().optional(),VERCEL_GIT_PULL_REQUEST_ID:e.string().optional()}},n={id:`neon-vercel`,server:{DATABASE_URL:e.string(),DATABASE_URL_UNPOOLED:e.string().optional(),PGHOST:e.string().optional(),PGHOST_UNPOOLED:e.string().optional(),PGUSER:e.string().optional(),PGDATABASE:e.string().optional(),PGPASSWORD:e.string().optional(),POSTGRES_URL:e.url().optional(),POSTGRES_URL_NON_POOLING:e.url().optional(),POSTGRES_USER:e.string().optional(),POSTGRES_HOST:e.string().optional(),POSTGRES_PASSWORD:e.string().optional(),POSTGRES_DATABASE:e.string().optional(),POSTGRES_URL_NO_SSL:e.url().optional(),POSTGRES_PRISMA_URL:e.url().optional()}},r={id:`uploadthing`,server:{UPLOADTHING_TOKEN:e.string()}},i={id:`render`,server:{IS_PULL_REQUEST:e.string().optional(),RENDER_DISCOVERY_SERVICE:e.string().optional(),RENDER_EXTERNAL_HOSTNAME:e.string().optional(),RENDER_EXTERNAL_URL:e.url().optional(),RENDER_GIT_BRANCH:e.string().optional(),RENDER_GIT_COMMIT:e.string().optional(),RENDER_GIT_REPO_SLUG:e.string().optional(),RENDER_INSTANCE_ID:e.string().optional(),RENDER_SERVICE_ID:e.string().optional(),RENDER_SERVICE_NAME:e.string().optional(),RENDER_SERVICE_TYPE:e.enum([`web`,`pserv`,`cron`,`worker`,`static`]).optional(),RENDER:e.string().optional()}},a={id:`railway`,server:{RAILWAY_PUBLIC_DOMAIN:e.string().optional(),RAILWAY_PRIVATE_DOMAIN:e.string().optional(),RAILWAY_TCP_PROXY_DOMAIN:e.string().optional(),RAILWAY_TCP_PROXY_PORT:e.string().optional(),RAILWAY_TCP_APPLICATION_PORT:e.string().optional(),RAILWAY_PROJECT_NAME:e.string().optional(),RAILWAY_PROJECT_ID:e.string().optional(),RAILWAY_ENVIRONMENT_NAME:e.string().optional(),RAILWAY_ENVIRONMENT_ID:e.string().optional(),RAILWAY_SERVICE_NAME:e.string().optional(),RAILWAY_SERVICE_ID:e.string().optional(),RAILWAY_REPLICA_ID:e.string().optional(),RAILWAY_DEPLOYMENT_ID:e.string().optional(),RAILWAY_SNAPSHOT_ID:e.string().optional(),RAILWAY_VOLUME_NAME:e.string().optional(),RAILWAY_VOLUME_MOUNT_PATH:e.string().optional(),RAILWAY_RUN_UID:e.string().optional(),RAILWAY_GIT_COMMIT_SHA:e.string().optional(),RAILWAY_GIT_AUTHOR_EMAIL:e.string().optional(),RAILWAY_GIT_BRANCH:e.string().optional(),RAILWAY_GIT_REPO_NAME:e.string().optional(),RAILWAY_GIT_REPO_OWNER:e.string().optional(),RAILWAY_GIT_COMMIT_MESSAGE:e.string().optional()}},o={id:`fly`,server:{FLY_APP_NAME:e.string().optional(),FLY_MACHINE_ID:e.string().optional(),FLY_ALLOC_ID:e.string().optional(),FLY_REGION:e.string().optional(),FLY_PUBLIC_IP:e.string().optional(),FLY_IMAGE_REF:e.string().optional(),FLY_MACHINE_VERSION:e.string().optional(),FLY_PRIVATE_IP:e.string().optional(),FLY_PROCESS_GROUP:e.string().optional(),FLY_VM_MEMORY_MB:e.string().optional(),PRIMARY_REGION:e.string().optional()}},s={id:`netlify`,server:{NETLIFY:e.string().optional(),BUILD_ID:e.string().optional(),CONTEXT:e.enum([`production`,`deploy-preview`,`branch-deploy`,`dev`]).optional(),REPOSITORY_URL:e.string().optional(),BRANCH:e.string().optional(),URL:e.string().optional(),DEPLOY_URL:e.string().optional(),DEPLOY_PRIME_URL:e.string().optional(),DEPLOY_ID:e.string().optional(),SITE_NAME:e.string().optional(),SITE_ID:e.string().optional()}},c={id:`upstash-redis`,server:{UPSTASH_REDIS_REST_URL:e.url(),UPSTASH_REDIS_REST_TOKEN:e.string()}},l={id:`coolify`,server:{COOLIFY_FQDN:e.string().optional(),COOLIFY_URL:e.string().optional(),COOLIFY_BRANCH:e.string().optional(),COOLIFY_RESOURCE_UUID:e.string().optional(),COOLIFY_CONTAINER_NAME:e.string().optional(),SOURCE_COMMIT:e.string().optional(),PORT:e.string().optional(),HOST:e.string().optional()}},u={id:`supabase-vercel`,clientPrefix:`NEXT_PUBLIC_`,server:{POSTGRES_URL:e.url(),POSTGRES_PRISMA_URL:e.url().optional(),POSTGRES_URL_NON_POOLING:e.url().optional(),POSTGRES_USER:e.string().optional(),POSTGRES_HOST:e.string().optional(),POSTGRES_PASSWORD:e.string().optional(),POSTGRES_DATABASE:e.string().optional(),SUPABASE_SERVICE_ROLE_KEY:e.string().optional(),SUPABASE_ANON_KEY:e.string().optional(),SUPABASE_URL:e.url().optional(),SUPABASE_JWT_SECRET:e.string().optional()},client:{NEXT_PUBLIC_SUPABASE_ANON_KEY:e.string().optional(),NEXT_PUBLIC_SUPABASE_URL:e.url().optional()}},d={id:`vite`,shared:{BASE_URL:e.string().optional(),MODE:e.string().optional(),DEV:e.boolean().optional(),PROD:e.boolean().optional(),SSR:e.boolean().optional()}},f={id:`wxt`,server:{MANIFEST_VERSION:e.preprocess(Number,e.union([e.literal(2),e.literal(3)])).optional(),BROWSER:e.enum([`chrome`,`firefox`,`safari`,`edge`,`opera`]).optional(),CHROME:e.boolean().optional(),FIREFOX:e.boolean().optional(),SAFARI:e.boolean().optional(),EDGE:e.boolean().optional(),OPERA:e.boolean().optional()}};export{l as coolify,o as fly,n as neonVercel,s as netlify,a as railway,i as render,u as supabaseVercel,r as uploadthing,c as upstashRedis,t as vercel,d as vite,f as wxt};
@@ -0,0 +1,200 @@
1
+ //#region src/standard.d.ts
2
+ /** The Standard Schema interface. */
3
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
4
+ /** The Standard Schema properties. */
5
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
6
+ }
7
+ declare namespace StandardSchemaV1 {
8
+ /** The Standard Schema properties interface. */
9
+ interface Props<Input = unknown, Output = Input> {
10
+ /** The version number of the standard. */
11
+ readonly version: 1;
12
+ /** The vendor name of the schema library. */
13
+ readonly vendor: string;
14
+ /** Validates unknown input values. */
15
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
16
+ /** Inferred types associated with the schema. */
17
+ readonly types?: Types<Input, Output> | undefined;
18
+ }
19
+ /** The result interface of the validate function. */
20
+ type Result<Output> = SuccessResult<Output> | FailureResult;
21
+ /** The result interface if validation succeeds. */
22
+ interface SuccessResult<Output> {
23
+ /** The typed output value. */
24
+ readonly value: Output;
25
+ /** The non-existent issues. */
26
+ readonly issues?: undefined;
27
+ }
28
+ /** The result interface if validation fails. */
29
+ interface FailureResult {
30
+ /** The issues of failed validation. */
31
+ readonly issues: ReadonlyArray<Issue>;
32
+ }
33
+ /** The issue interface of the failure output. */
34
+ interface Issue {
35
+ /** The error message of the issue. */
36
+ readonly message: string;
37
+ /** The path of the issue, if any. */
38
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
39
+ }
40
+ /** The path segment interface of the issue. */
41
+ interface PathSegment {
42
+ /** The key representing a path segment. */
43
+ readonly key: PropertyKey;
44
+ }
45
+ /** The Standard Schema types interface. */
46
+ interface Types<Input = unknown, Output = Input> {
47
+ /** The input type of the schema. */
48
+ readonly input: Input;
49
+ /** The output type of the schema. */
50
+ readonly output: Output;
51
+ }
52
+ /** Infers the input type of a Standard Schema. */
53
+ type InferInput<Schema$1 extends StandardSchemaV1> = NonNullable<Schema$1["~standard"]["types"]>["input"];
54
+ /** Infers the output type of a Standard Schema. */
55
+ type InferOutput<Schema$1 extends StandardSchemaV1> = NonNullable<Schema$1["~standard"]["types"]>["output"];
56
+ }
57
+ /** A dictionary of Standard Schema objects mapping input keys to their corresponding schemas. */
58
+ type StandardSchemaDictionary<Input = Record<string, unknown>, Output extends Record<keyof Input, unknown> = Input> = { [K in keyof Input]-?: StandardSchemaV1<Input[K], Output[K]> };
59
+ declare namespace StandardSchemaDictionary {
60
+ /** Infers the input types from a Standard Schema Dictionary. */
61
+ type InferInput<T extends StandardSchemaDictionary> = { [K in keyof T]: StandardSchemaV1.InferInput<T[K]> };
62
+ /** Infers the output types from a Standard Schema Dictionary. */
63
+ type InferOutput<T extends StandardSchemaDictionary> = { [K in keyof T]: StandardSchemaV1.InferOutput<T[K]> };
64
+ }
65
+ //#endregion
66
+ //#region src/types.d.ts
67
+ /** Type for error messages that must be strings */
68
+ type ErrorMessage<T extends string> = T;
69
+ /** Creates a type where all properties are impossible to set */
70
+ type Impossible<T extends Record<string, any>> = Partial<Record<keyof T, never>>;
71
+ /** Merges two types, with B taking precedence over A */
72
+ type Merge<A, B> = Omit<A, keyof B> & B;
73
+ /** Simplifies a type by removing intersections and making it more readable */
74
+ type Simplify<T> = { [P in keyof T]: T[P] } & {};
75
+ /** Gets all keys from T that can be undefined */
76
+ type PossiblyUndefinedKeys<T> = { [K in keyof T]: undefined extends T[K] ? K : never }[keyof T];
77
+ /** Makes properties that can be undefined optional */
78
+ type UndefinedOptional<T> = Partial<Pick<T, PossiblyUndefinedKeys<T>>> & Omit<T, PossiblyUndefinedKeys<T>>;
79
+ /** Converts a readonly type to a mutable type */
80
+ type Mutable<T> = T extends Readonly<infer U> ? U : T;
81
+ /** Extracts the combined schema from validation options */
82
+ type ExtractExtendsArray<T> = T extends {
83
+ extends?: infer E;
84
+ } ? E extends ExtendsFormat ? E : [] : [];
85
+ type Depth = 0 | 1 | 2 | 3 | 4;
86
+ type DefaultDepth = 2;
87
+ type Prev = [0, 0, 1, 2, 3];
88
+ type Dec<N extends Depth> = Prev[N];
89
+ type AsDictionary<T> = T extends object ? StandardSchemaDictionary<object, object> & T : StandardSchemaDictionary<object, object>;
90
+ type ExtractCombinedSchema<T, D extends Depth = DefaultDepth> = T extends ValidationOptions<PrefixFormat, infer Shared, infer Server, infer Client> ? CombinedSchema<AsDictionary<Reduce<ExtractExtendsArray<T>, StandardSchemaDictionary<object, object>, D>>, AsDictionary<CombinedSchema<Shared, Server, Client>>> : T extends Readonly<ValidationOptions<PrefixFormat, infer Shared, infer Server, infer Client>> ? CombinedSchema<AsDictionary<Reduce<ExtractExtendsArray<T>, StandardSchemaDictionary<object, object>, D>>, AsDictionary<CombinedSchema<Shared, Server, Client>>> : CombinedSchema<AsDictionary<Reduce<ExtractExtendsArray<T>, StandardSchemaDictionary<object, object>, D>>, AsDictionary<CombinedSchema<T extends {
91
+ shared: infer S;
92
+ } ? S extends SharedFormat ? S : StandardSchemaDictionary<object, object> : StandardSchemaDictionary<object, object>, T extends {
93
+ server: infer Sv;
94
+ } ? Sv extends ServerFormat ? Sv : StandardSchemaDictionary<object, object> : StandardSchemaDictionary<object, object>, T extends {
95
+ client: infer C;
96
+ } ? C extends ClientFormat ? C : StandardSchemaDictionary<object, object> : StandardSchemaDictionary<object, object>>>>;
97
+ /** Reduces an array of schemas to a single schema */
98
+ type Reduce<Arr extends readonly unknown[] | unknown[], Acc extends StandardSchemaDictionary<object, object> = StandardSchemaDictionary<object, object>, D extends Depth = DefaultDepth> = D extends 0 ? Acc : Arr extends readonly [] | [] ? Acc : Arr extends readonly [infer Head, ...infer Tail] | [infer Head, ...infer Tail] ? Tail extends readonly unknown[] | unknown[] ? Mutable<Reduce<Tail, CombinedSchema<AsDictionary<Acc>, AsDictionary<ExtractCombinedSchema<Head, Dec<D>>>>, D>> : never : never;
99
+ type InferPresetOutput<T extends ExtendsFormat[number]> = StandardSchemaDictionary.InferOutput<ExtractCombinedSchema<T>>;
100
+ type CombinedSchema<Shared$1 extends SharedFormat = SharedFormat, Server$1 extends ServerFormat = ServerFormat, Client$1 extends ClientFormat = ClientFormat> = StandardSchemaDictionary<object, object> & Merge<Shared$1, Merge<Server$1, Client$1>>;
101
+ type PrefixFormat = string | undefined;
102
+ type SharedFormat = StandardSchemaDictionary<object, object>;
103
+ type ServerFormat = StandardSchemaDictionary<object, object>;
104
+ type ClientFormat = StandardSchemaDictionary<object, object>;
105
+ type ExtendsFormat = (Preset | Readonly<Preset>)[] | ReadonlyArray<Preset>;
106
+ type Preset<Prefix extends PrefixFormat = PrefixFormat, Shared$1 extends SharedFormat = SharedFormat, Server$1 extends ServerFormat = ServerFormat, Client$1 extends ClientFormat = ClientFormat, Extends extends ExtendsFormat = ExtendsFormat> = ValidationOptions<Prefix, Shared$1, Server$1, Client$1> & {
107
+ id?: string;
108
+ extends?: Extends;
109
+ };
110
+ type Schema = StandardSchemaV1<object, object>;
111
+ interface BaseOptions<Extends extends ExtendsFormat> {
112
+ /**
113
+ * Array of preset configurations to extend from.
114
+ */
115
+ extends?: Extends;
116
+ /**
117
+ * Whether to skip validation of environment variables.
118
+ * @default false
119
+ */
120
+ skip?: boolean;
121
+ /**
122
+ * Whether to treat environment as server-side.
123
+ * @default typeof window === "undefined" || "Deno" in window
124
+ */
125
+ isServer?: boolean;
126
+ /**
127
+ * Called when validation fails. By default the error is logged,
128
+ * and an error is thrown telling what environment variables are invalid.
129
+ */
130
+ onError?: (issues: StandardSchemaV1.FailureResult["issues"]) => never;
131
+ /**
132
+ * Called when a server-side environment variable is accessed on the client.
133
+ * By default an error is thrown.
134
+ */
135
+ onInvalidAccess?: (variable: string) => never;
136
+ }
137
+ interface LooseOptions<Extends extends ExtendsFormat> extends BaseOptions<Extends> {
138
+ /**
139
+ * Must be undefined when using loose options. Use `env` instead.
140
+ */
141
+ envStrict?: never;
142
+ /**
143
+ * What object holds the environment variables at runtime. This is usually
144
+ * `process.env` or `import.meta.env`.
145
+ * This doesn't enforce that all environment variables are set.
146
+ */
147
+ env?: Record<string, string | boolean | number | undefined>;
148
+ }
149
+ interface StrictOptions<Prefix extends PrefixFormat, Server$1 extends ServerFormat, Client$1 extends ClientFormat, Shared$1 extends SharedFormat, Extends extends ExtendsFormat> extends BaseOptions<Extends> {
150
+ /**
151
+ * Runtime Environment variables to use for validation - `process.env`, `import.meta.env` or similar.
152
+ * Enforces all environment variables to be set. Required in for example Next.js Edge and Client runtimes.
153
+ */
154
+ envStrict?: Record<{ [Key in keyof Client$1]: Prefix extends undefined ? never : Key extends `${Prefix}${string}` ? Key : never }[keyof Client$1] | { [Key in keyof Server$1]: Prefix extends undefined ? Key : Key extends `${Prefix}${string}` ? never : Key }[keyof Server$1] | { [Key in keyof Shared$1]: Key extends string ? Key : never }[keyof Shared$1] | keyof StandardSchemaDictionary.InferOutput<FullSchemaShape<Shared$1, Server$1, Client$1, Extends>>, string | boolean | number | undefined>;
155
+ /**
156
+ * Must be undefined when using strict options. Use `envStrict` instead.
157
+ */
158
+ env?: never;
159
+ }
160
+ interface SharedOptions<Shared$1 extends SharedFormat> {
161
+ /**
162
+ * Specify your shared environment variables schema here. These variables are available on both client and server.
163
+ */
164
+ shared?: Shared$1;
165
+ }
166
+ interface ClientOptions<Prefix extends PrefixFormat, Client$1 extends ClientFormat> {
167
+ /**
168
+ * The prefix that client-side variables must have. This is enforced both at
169
+ * a type-level and at runtime.
170
+ */
171
+ clientPrefix?: Prefix;
172
+ /**
173
+ * Specify your client-side environment variables schema here. This way you can ensure the app isn't
174
+ * built with invalid env vars.
175
+ */
176
+ client?: Partial<{ [Key in keyof Client$1]: Key extends `${Prefix}${string}` ? Client$1[Key] : ErrorMessage<`${Key extends string ? Key : never} is not prefixed with ${Prefix}.`> }>;
177
+ }
178
+ interface ServerOptions<Prefix extends PrefixFormat, Server$1 extends ServerFormat> {
179
+ /**
180
+ * Specify your server-side environment variables schema here. This way you can ensure the app isn't
181
+ * built with invalid env vars.
182
+ */
183
+ server: Partial<{ [Key in keyof Server$1]: Prefix extends undefined ? Server$1[Key] : Prefix extends "" ? Server$1[Key] : Key extends `${Prefix}${string}` ? ErrorMessage<`${Key extends `${Prefix}${string}` ? Key : never} should not prefixed with ${Prefix}.`> : Server$1[Key] }>;
184
+ }
185
+ type ValidationOptions<Prefix extends PrefixFormat = PrefixFormat, Shared$1 extends SharedFormat = SharedFormat, Server$1 extends ServerFormat = ServerFormat, Client$1 extends ClientFormat = ClientFormat> = ((ClientOptions<Prefix, Client$1> & ServerOptions<Prefix, Server$1>) | (ServerOptions<Prefix, Server$1> & Impossible<ClientOptions<never, never>>) | (ClientOptions<Prefix, Client$1> & Impossible<ServerOptions<never, never>>)) & SharedOptions<Shared$1>;
186
+ interface TransformSchemaOptions<Shared$1 extends SharedFormat, Server$1 extends ServerFormat, Client$1 extends ClientFormat, Extends extends ExtendsFormat, FinalSchema$1 extends Schema> {
187
+ /**
188
+ * A custom function to combine the schemas.
189
+ * Can be used to add further refinement or transformation.
190
+ */
191
+ transform?: (shape: Simplify<FullSchemaShape<Shared$1, Server$1, Client$1, Extends>>, isServer: boolean) => FinalSchema$1;
192
+ }
193
+ type EnvOptions<Prefix extends PrefixFormat = PrefixFormat, Shared$1 extends SharedFormat = SharedFormat, Server$1 extends ServerFormat = ServerFormat, Client$1 extends ClientFormat = ClientFormat, Extends extends ExtendsFormat = ExtendsFormat, FinalSchema$1 extends Schema = Schema> = (LooseOptions<Extends> | StrictOptions<Prefix, Server$1, Client$1, Shared$1, Extends>) & ValidationOptions<Prefix, Shared$1, Server$1, Client$1> & TransformSchemaOptions<Shared$1, Server$1, Client$1, Extends, FinalSchema$1>;
194
+ type FullSchemaShape<Shared$1 extends SharedFormat, Server$1 extends ServerFormat, Client$1 extends ClientFormat, Extends extends ExtendsFormat, D extends Depth = DefaultDepth> = CombinedSchema<AsDictionary<Reduce<Extends, StandardSchemaDictionary<object, object>, D>>, CombinedSchema<Shared$1, Server$1, Client$1>>;
195
+ type FinalSchema<Shared$1 extends SharedFormat, Server$1 extends ServerFormat, Client$1 extends ClientFormat, Extends extends ExtendsFormat, D extends Depth = DefaultDepth> = StandardSchemaV1<object, UndefinedOptional<StandardSchemaDictionary.InferOutput<FullSchemaShape<Shared$1, Server$1, Client$1, Extends, D>>>>;
196
+ type DefineEnv<FinalSchema$1 extends Schema = Schema> = Simplify<Readonly<StandardSchemaV1.InferOutput<FinalSchema$1> & {
197
+ _schema: FinalSchema$1;
198
+ }>>;
199
+ //#endregion
200
+ export { ValidationOptions as C, TransformSchemaOptions as S, ServerOptions as _, DefineEnv as a, Simplify as b, ExtendsFormat as c, InferPresetOutput as d, LooseOptions as f, ServerFormat as g, Schema as h, CombinedSchema as i, FinalSchema as l, Preset as m, ClientFormat as n, EnvOptions as o, PrefixFormat as p, ClientOptions as r, ErrorMessage as s, BaseOptions as t, FullSchemaShape as u, SharedFormat as v, StrictOptions as x, SharedOptions as y };
@@ -0,0 +1,2 @@
1
+ import { C as ValidationOptions, S as TransformSchemaOptions, _ as ServerOptions, a as DefineEnv, b as Simplify, c as ExtendsFormat, d as InferPresetOutput, f as LooseOptions, g as ServerFormat, h as Schema, i as CombinedSchema, l as FinalSchema, m as Preset, n as ClientFormat, o as EnvOptions, p as PrefixFormat, r as ClientOptions, s as ErrorMessage, t as BaseOptions, u as FullSchemaShape, v as SharedFormat, x as StrictOptions, y as SharedOptions } from "./types-5fo7WST9.mjs";
2
+ export { BaseOptions, ClientFormat, ClientOptions, CombinedSchema, DefineEnv, EnvOptions, ErrorMessage, ExtendsFormat, FinalSchema, FullSchemaShape, InferPresetOutput, LooseOptions, PrefixFormat, Preset, Schema, ServerFormat, ServerOptions, SharedFormat, SharedOptions, Simplify, StrictOptions, TransformSchemaOptions, ValidationOptions };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envin",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Type-safe env validation with live previews",
5
5
  "keywords": [
6
6
  "turbostarter",
@@ -25,16 +25,16 @@
25
25
  "exports": {
26
26
  "./package.json": "./package.json",
27
27
  ".": {
28
- "types": "./dist/index.d.ts",
29
- "default": "./dist/index.js"
28
+ "types": "./dist/index.d.mts",
29
+ "default": "./dist/index.mjs"
30
30
  },
31
31
  "./presets/*": {
32
- "types": "./dist/presets/*.d.ts",
33
- "default": "./dist/presets/*.js"
32
+ "types": "./dist/presets/*.d.mts",
33
+ "default": "./dist/presets/*.mjs"
34
34
  },
35
35
  "./types": {
36
- "types": "./dist/types.d.ts",
37
- "default": "./dist/types.js"
36
+ "types": "./dist/types.d.mts",
37
+ "default": "./dist/types.mjs"
38
38
  }
39
39
  },
40
40
  "files": [
@@ -44,9 +44,9 @@
44
44
  "README.md"
45
45
  ],
46
46
  "scripts": {
47
- "build": "tsup",
47
+ "build": "tsdown",
48
48
  "clean": "rm -rf dist .turbo node_modules",
49
- "dev": "tsup --watch",
49
+ "dev": "tsdown --watch",
50
50
  "start": "node dist/index.js",
51
51
  "test": "vitest run",
52
52
  "test:watch": "vitest",
@@ -54,12 +54,14 @@
54
54
  "prepack": "bun run ../../scripts/populate-readme.ts"
55
55
  },
56
56
  "devDependencies": {
57
- "arktype": "catalog:",
58
- "tsup": "catalog:",
59
- "typescript": "catalog:",
60
- "valibot": "catalog:",
57
+ "@types/bun": "^1.3.5",
58
+ "arktype": "2.1.20",
59
+ "expect-type": "^1.3.0",
60
+ "tsdown": "0.19.0",
61
+ "typescript": "5.8.3",
62
+ "valibot": "1.1.0",
61
63
  "vitest": "3.2.3",
62
- "zod": "catalog:"
64
+ "zod": "4.1.13"
63
65
  },
64
66
  "peerDependencies": {
65
67
  "arktype": "^2.1.0",
@@ -78,4 +80,4 @@
78
80
  "optional": true
79
81
  }
80
82
  }
81
- }
83
+ }
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- function y(e,t){if(e instanceof Promise)throw new Error(t)}function O(e,t){let s={},c=[];for(let a in e){let o=e[a]?.["~standard"].validate(t[a]);if(y(o,`Validation must be synchronous, but ${a} returned a Promise.`),o?.issues){c.push(...o.issues.map(d=>({...d,path:[a,...d.path??[]]})));continue}s[a]=o?.value}return c.length?{issues:c}:{value:s}}var h=e=>["function","object"].includes(typeof e)&&!!e&&"~standard"in e&&typeof e["~standard"]=="object"&&!!e["~standard"]&&"validate"in e["~standard"],v=e=>{if(!(typeof e!="object"||e===null)){if("default"in e&&!["object","function"].includes(typeof e.default))return e.default;if("_def"in e&&typeof e._def=="object"&&e._def!==null&&"defaultValue"in e._def)return typeof e._def.defaultValue=="function"?e._def.defaultValue?.():e._def.defaultValue}},D=e=>Object.fromEntries(Object.entries(e).map(([t,s])=>[t,v(s)]));var V=e=>["__esModule","$$typeof"].includes(e),I=(e,t)=>({...e.shared&&e.shared,...e.server&&t&&e.server,...e.client&&e.client}),k=(e,t)=>{let s=a=>({...a.extends?.reduce((d,u)=>({...d,...s(u)}),{})??{},...I(a,t)});return{...e.extends?.reduce((a,o)=>({...a,...s(o)}),{})??{},...I(e,t)}},f=class extends Error{constructor(t){super(t),this.name="EnvError"}};function j(e){let t=e.envStrict??e.env??process.env;for(let[n,r]of Object.entries(t))r===""&&delete t[n];let s=e.isServer??(typeof window>"u"||"Deno"in window),c=e.onError??(n=>{throw console.error("\u274C Invalid environment variables:",n),new f("Invalid environment variables")}),a=e.onInvalidAccess??(n=>{throw new f(`\u274C Attempted to access a server-side environment variable on the client: ${n}`)}),o=!!e.skip,d=k(e,s),u=e.transform?.(d,s)??d,S=h(u)?v(u):D(u),P=Object.fromEntries(Object.entries(t).map(([n,r])=>r!==void 0?[n,r]:[n,S&&n in S?S[n]:void 0]));if(o)return{...S,...P,_schema:d};let l=h(u)?u["~standard"].validate(t):O(d,t);if(y(l,"Validation must be synchronous!"),l.issues)return c(l.issues);let g=n=>{let r=i=>{let p={keys:Object.keys(i.client??{}),prefix:i.clientPrefix},x=(i.extends??[]).flatMap(m=>r(m));return[p,...x]},F=i=>{let p=Object.keys(i.shared??{}),x=(i.extends??[]).flatMap(m=>F(m));return[...p,...x]},E=r(e).some(i=>i.keys.includes(n)&&(!i.prefix||n.startsWith(i.prefix)));return!F(e).includes(n)&&!E},b=n=>s||!g(n);return new Proxy("value"in l?l.value:{},{get(n,r){if(typeof r=="string"&&!V(r))return r==="_schema"?d:b(r)?Reflect.get(n,r):a(r)}})}export{j as defineEnv};