|
1 |
| -import { z } from "zod"; |
2 |
| -import { createEnv } from "."; |
| 1 | +export interface VercelEnv { |
| 2 | + VERCEL?: string; |
| 3 | + CI?: string; |
| 4 | + VERCEL_ENV?: "development" | "preview" | "production"; |
| 5 | + VERCEL_URL?: string; |
| 6 | + VERCEL_PROJECT_PRODUCTION_URL?: string; |
| 7 | + VERCEL_BRANCH_URL?: string; |
| 8 | + VERCEL_REGION?: string; |
| 9 | + VERCEL_DEPLOYMENT_ID?: string; |
| 10 | + VERCEL_SKEW_PROTECTION_ENABLED?: string; |
| 11 | + VERCEL_AUTOMATION_BYPASS_SECRET?: string; |
| 12 | + VERCEL_GIT_PROVIDER?: string; |
| 13 | + VERCEL_GIT_REPO_SLUG?: string; |
| 14 | + VERCEL_GIT_REPO_OWNER?: string; |
| 15 | + VERCEL_GIT_REPO_ID?: string; |
| 16 | + VERCEL_GIT_COMMIT_REF?: string; |
| 17 | + VERCEL_GIT_COMMIT_SHA?: string; |
| 18 | + VERCEL_GIT_COMMIT_MESSAGE?: string; |
| 19 | + VERCEL_GIT_COMMIT_AUTHOR_LOGIN?: string; |
| 20 | + VERCEL_GIT_COMMIT_AUTHOR_NAME?: string; |
| 21 | + VERCEL_GIT_PREVIOUS_SHA?: string; |
| 22 | + VERCEL_GIT_PULL_REQUEST_ID?: string; |
| 23 | +} |
3 | 24 |
|
4 |
| -/** |
5 |
| - * Vercel System Environment Variables |
6 |
| - * @see https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables |
7 |
| - */ |
8 |
| -export const vercel = () => |
9 |
| - createEnv({ |
10 |
| - server: { |
11 |
| - VERCEL: z.string().optional(), |
12 |
| - CI: z.string().optional(), |
13 |
| - VERCEL_ENV: z.enum(["development", "preview", "production"]).optional(), |
14 |
| - VERCEL_URL: z.string().optional(), |
15 |
| - VERCEL_PROJECT_PRODUCTION_URL: z.string().optional(), |
16 |
| - VERCEL_BRANCH_URL: z.string().optional(), |
17 |
| - VERCEL_REGION: z.string().optional(), |
18 |
| - VERCEL_DEPLOYMENT_ID: z.string().optional(), |
19 |
| - VERCEL_SKEW_PROTECTION_ENABLED: z.string().optional(), |
20 |
| - VERCEL_AUTOMATION_BYPASS_SECRET: z.string().optional(), |
21 |
| - VERCEL_GIT_PROVIDER: z.string().optional(), |
22 |
| - VERCEL_GIT_REPO_SLUG: z.string().optional(), |
23 |
| - VERCEL_GIT_REPO_OWNER: z.string().optional(), |
24 |
| - VERCEL_GIT_REPO_ID: z.string().optional(), |
25 |
| - VERCEL_GIT_COMMIT_REF: z.string().optional(), |
26 |
| - VERCEL_GIT_COMMIT_SHA: z.string().optional(), |
27 |
| - VERCEL_GIT_COMMIT_MESSAGE: z.string().optional(), |
28 |
| - VERCEL_GIT_COMMIT_AUTHOR_LOGIN: z.string().optional(), |
29 |
| - VERCEL_GIT_COMMIT_AUTHOR_NAME: z.string().optional(), |
30 |
| - VERCEL_GIT_PREVIOUS_SHA: z.string().optional(), |
31 |
| - VERCEL_GIT_PULL_REQUEST_ID: z.string().optional(), |
32 |
| - }, |
33 |
| - runtimeEnv: process.env, |
34 |
| - }); |
| 25 | +export interface NeonVercelEnv { |
| 26 | + DATABASE_URL: string; |
| 27 | + DATABASE_URL_UNPOOLED?: string; |
| 28 | + PGHOST?: string; |
| 29 | + PGHOST_UNPOOLED?: string; |
| 30 | + PGUSER?: string; |
| 31 | + PGDATABASE?: string; |
| 32 | + PGPASSWORD?: string; |
| 33 | + POSTGRES_URL?: string; |
| 34 | + POSTGRES_URL_NON_POOLING?: string; |
| 35 | + POSTGRES_USER?: string; |
| 36 | + POSTGRES_HOST?: string; |
| 37 | + POSTGRES_PASSWORD?: string; |
| 38 | + POSTGRES_DATABASE?: string; |
| 39 | + POSTGRES_URL_NO_SSL?: string; |
| 40 | + POSTGRES_PRISMA_URL?: string; |
| 41 | +} |
35 | 42 |
|
36 |
| -/** |
37 |
| - * Neon for Vercel Environment Variables |
38 |
| - * @see https://neon.tech/docs/guides/vercel-native-integration#environment-variables-set-by-the-integration |
39 |
| - */ |
40 |
| -export const neonVercel = () => |
41 |
| - createEnv({ |
42 |
| - server: { |
43 |
| - DATABASE_URL: z.string(), |
44 |
| - DATABASE_URL_UNPOOLED: z.string().optional(), |
45 |
| - PGHOST: z.string().optional(), |
46 |
| - PGHOST_UNPOOLED: z.string().optional(), |
47 |
| - PGUSER: z.string().optional(), |
48 |
| - PGDATABASE: z.string().optional(), |
49 |
| - PGPASSWORD: z.string().optional(), |
50 |
| - POSTGRES_URL: z.string().url().optional(), |
51 |
| - POSTGRES_URL_NON_POOLING: z.string().url().optional(), |
52 |
| - POSTGRES_USER: z.string().optional(), |
53 |
| - POSTGRES_HOST: z.string().optional(), |
54 |
| - POSTGRES_PASSWORD: z.string().optional(), |
55 |
| - POSTGRES_DATABASE: z.string().optional(), |
56 |
| - POSTGRES_URL_NO_SSL: z.string().url().optional(), |
57 |
| - POSTGRES_PRISMA_URL: z.string().url().optional(), |
58 |
| - }, |
59 |
| - runtimeEnv: process.env, |
60 |
| - }); |
| 43 | +export interface UploadThingV6Env { |
| 44 | + UPLOADTHING_TOKEN: string; |
| 45 | +} |
61 | 46 |
|
62 |
| -/** |
63 |
| - * @see https://v6.docs.uploadthing.com/getting-started/nuxt#add-env-variables |
64 |
| - */ |
65 |
| -export const uploadthingV6 = () => |
66 |
| - createEnv({ |
67 |
| - server: { |
68 |
| - UPLOADTHING_TOKEN: z.string(), |
69 |
| - }, |
70 |
| - runtimeEnv: process.env, |
71 |
| - }); |
| 47 | +export interface UploadThingEnv { |
| 48 | + UPLOADTHING_TOKEN: string; |
| 49 | +} |
72 | 50 |
|
73 |
| -/** |
74 |
| - * @see https://docs.uploadthing.com/getting-started/appdir#add-env-variables |
75 |
| - */ |
76 |
| -export const uploadthing = () => |
77 |
| - createEnv({ |
78 |
| - server: { |
79 |
| - UPLOADTHING_TOKEN: z.string(), |
80 |
| - }, |
81 |
| - runtimeEnv: process.env, |
82 |
| - }); |
| 51 | +export interface RenderEnv { |
| 52 | + IS_PULL_REQUEST?: string; |
| 53 | + RENDER_DISCOVERY_SERVICE?: string; |
| 54 | + RENDER_EXTERNAL_HOSTNAME?: string; |
| 55 | + RENDER_EXTERNAL_URL?: string; |
| 56 | + RENDER_GIT_BRANCH?: string; |
| 57 | + RENDER_GIT_COMMIT?: string; |
| 58 | + RENDER_GIT_REPO_SLUG?: string; |
| 59 | + RENDER_INSTANCE_ID?: string; |
| 60 | + RENDER_SERVICE_ID?: string; |
| 61 | + RENDER_SERVICE_NAME?: string; |
| 62 | + RENDER_SERVICE_TYPE?: "web" | "pserv" | "cron" | "worker" | "static"; |
| 63 | + RENDER?: string; |
| 64 | +} |
83 | 65 |
|
84 |
| -/** |
85 |
| - * Render System Environment Variables |
86 |
| - * @see https://docs.render.com/environment-variables#all-runtimes |
87 |
| - */ |
88 |
| -export const render = () => |
89 |
| - createEnv({ |
90 |
| - server: { |
91 |
| - IS_PULL_REQUEST: z.string().optional(), |
92 |
| - RENDER_DISCOVERY_SERVICE: z.string().optional(), |
93 |
| - RENDER_EXTERNAL_HOSTNAME: z.string().optional(), |
94 |
| - RENDER_EXTERNAL_URL: z.string().url().optional(), |
95 |
| - RENDER_GIT_BRANCH: z.string().optional(), |
96 |
| - RENDER_GIT_COMMIT: z.string().optional(), |
97 |
| - RENDER_GIT_REPO_SLUG: z.string().optional(), |
98 |
| - RENDER_INSTANCE_ID: z.string().optional(), |
99 |
| - RENDER_SERVICE_ID: z.string().optional(), |
100 |
| - RENDER_SERVICE_NAME: z.string().optional(), |
101 |
| - RENDER_SERVICE_TYPE: z |
102 |
| - .enum(["web", "pserv", "cron", "worker", "static"]) |
103 |
| - .optional(), |
104 |
| - RENDER: z.string().optional(), |
105 |
| - }, |
106 |
| - runtimeEnv: process.env, |
107 |
| - }); |
| 66 | +export interface RailwayEnv { |
| 67 | + RAILWAY_PUBLIC_DOMAIN?: string; |
| 68 | + RAILWAY_PRIVATE_DOMAIN?: string; |
| 69 | + RAILWAY_TCP_PROXY_DOMAIN?: string; |
| 70 | + RAILWAY_TCP_PROXY_PORT?: string; |
| 71 | + RAILWAY_TCP_APPLICATION_PORT?: string; |
| 72 | + RAILWAY_PROJECT_NAME?: string; |
| 73 | + RAILWAY_PROJECT_ID?: string; |
| 74 | + RAILWAY_ENVIRONMENT_NAME?: string; |
| 75 | + RAILWAY_ENVIRONMENT_ID?: string; |
| 76 | + RAILWAY_SERVICE_NAME?: string; |
| 77 | + RAILWAY_SERVICE_ID?: string; |
| 78 | + RAILWAY_REPLICA_ID?: string; |
| 79 | + RAILWAY_DEPLOYMENT_ID?: string; |
| 80 | + RAILWAY_SNAPSHOT_ID?: string; |
| 81 | + RAILWAY_VOLUME_NAME?: string; |
| 82 | + RAILWAY_VOLUME_MOUNT_PATH?: string; |
| 83 | + RAILWAY_RUN_UID?: string; |
| 84 | + RAILWAY_GIT_COMMIT_SHA?: string; |
| 85 | + RAILWAY_GIT_AUTHOR_EMAIL?: string; |
| 86 | + RAILWAY_GIT_BRANCH?: string; |
| 87 | + RAILWAY_GIT_REPO_NAME?: string; |
| 88 | + RAILWAY_GIT_REPO_OWNER?: string; |
| 89 | + RAILWAY_GIT_COMMIT_MESSAGE?: string; |
| 90 | +} |
108 | 91 |
|
109 |
| -/** |
110 |
| - * Railway Environment Variables |
111 |
| - * @see https://docs.railway.app/reference/variables#railway-provided-variables |
112 |
| - */ |
113 |
| -export const railway = () => |
114 |
| - createEnv({ |
115 |
| - server: { |
116 |
| - RAILWAY_PUBLIC_DOMAIN: z.string().optional(), |
117 |
| - RAILWAY_PRIVATE_DOMAIN: z.string().optional(), |
118 |
| - RAILWAY_TCP_PROXY_DOMAIN: z.string().optional(), |
119 |
| - RAILWAY_TCP_PROXY_PORT: z.string().optional(), |
120 |
| - RAILWAY_TCP_APPLICATION_PORT: z.string().optional(), |
121 |
| - RAILWAY_PROJECT_NAME: z.string().optional(), |
122 |
| - RAILWAY_PROJECT_ID: z.string().optional(), |
123 |
| - RAILWAY_ENVIRONMENT_NAME: z.string().optional(), |
124 |
| - RAILWAY_ENVIRONMENT_ID: z.string().optional(), |
125 |
| - RAILWAY_SERVICE_NAME: z.string().optional(), |
126 |
| - RAILWAY_SERVICE_ID: z.string().optional(), |
127 |
| - RAILWAY_REPLICA_ID: z.string().optional(), |
128 |
| - RAILWAY_DEPLOYMENT_ID: z.string().optional(), |
129 |
| - RAILWAY_SNAPSHOT_ID: z.string().optional(), |
130 |
| - RAILWAY_VOLUME_NAME: z.string().optional(), |
131 |
| - RAILWAY_VOLUME_MOUNT_PATH: z.string().optional(), |
132 |
| - RAILWAY_RUN_UID: z.string().optional(), |
133 |
| - RAILWAY_GIT_COMMIT_SHA: z.string().optional(), |
134 |
| - RAILWAY_GIT_AUTHOR_EMAIL: z.string().optional(), |
135 |
| - RAILWAY_GIT_BRANCH: z.string().optional(), |
136 |
| - RAILWAY_GIT_REPO_NAME: z.string().optional(), |
137 |
| - RAILWAY_GIT_REPO_OWNER: z.string().optional(), |
138 |
| - RAILWAY_GIT_COMMIT_MESSAGE: z.string().optional(), |
139 |
| - }, |
140 |
| - runtimeEnv: process.env, |
141 |
| - }); |
| 92 | +export interface FlyEnv { |
| 93 | + FLY_APP_NAME?: string; |
| 94 | + FLY_MACHINE_ID?: string; |
| 95 | + FLY_ALLOC_ID?: string; |
| 96 | + FLY_REGION?: string; |
| 97 | + FLY_PUBLIC_IP?: string; |
| 98 | + FLY_IMAGE_REF?: string; |
| 99 | + FLY_MACHINE_VERSION?: string; |
| 100 | + FLY_PRIVATE_IP?: string; |
| 101 | + FLY_PROCESS_GROUP?: string; |
| 102 | + FLY_VM_MEMORY_MB?: string; |
| 103 | + PRIMARY_REGION?: string; |
| 104 | +} |
142 | 105 |
|
143 |
| -/** |
144 |
| - * Fly.io Environment Variables |
145 |
| - * @see https://fly.io/docs/machines/runtime-environment/#environment-variables |
146 |
| - */ |
147 |
| -export const fly = () => |
148 |
| - createEnv({ |
149 |
| - server: { |
150 |
| - FLY_APP_NAME: z.string().optional(), |
151 |
| - FLY_MACHINE_ID: z.string().optional(), |
152 |
| - FLY_ALLOC_ID: z.string().optional(), |
153 |
| - FLY_REGION: z.string().optional(), |
154 |
| - FLY_PUBLIC_IP: z.string().optional(), |
155 |
| - FLY_IMAGE_REF: z.string().optional(), |
156 |
| - FLY_MACHINE_VERSION: z.string().optional(), |
157 |
| - FLY_PRIVATE_IP: z.string().optional(), |
158 |
| - FLY_PROCESS_GROUP: z.string().optional(), |
159 |
| - FLY_VM_MEMORY_MB: z.string().optional(), |
160 |
| - PRIMARY_REGION: z.string().optional(), |
161 |
| - }, |
162 |
| - runtimeEnv: process.env, |
163 |
| - }); |
164 |
| - |
165 |
| -/** |
166 |
| - * Netlify Environment Variables |
167 |
| - * @see https://docs.netlify.com/configure-builds/environment-variables |
168 |
| - */ |
169 |
| -export const netlify = () => |
170 |
| - createEnv({ |
171 |
| - server: { |
172 |
| - NETLIFY: z.string().optional(), |
173 |
| - BUILD_ID: z.string().optional(), |
174 |
| - CONTEXT: z |
175 |
| - .enum(["production", "deploy-preview", "branch-deploy", "dev"]) |
176 |
| - .optional(), |
177 |
| - REPOSITORY_URL: z.string().optional(), |
178 |
| - BRANCH: z.string().optional(), |
179 |
| - URL: z.string().optional(), |
180 |
| - DEPLOY_URL: z.string().optional(), |
181 |
| - DEPLOY_PRIME_URL: z.string().optional(), |
182 |
| - DEPLOY_ID: z.string().optional(), |
183 |
| - SITE_NAME: z.string().optional(), |
184 |
| - SITE_ID: z.string().optional(), |
185 |
| - }, |
186 |
| - runtimeEnv: process.env, |
187 |
| - }); |
| 106 | +export interface NetlifyEnv { |
| 107 | + NETLIFY?: string; |
| 108 | + BUILD_ID?: string; |
| 109 | + CONTEXT?: "production" | "deploy-preview" | "branch-deploy" | "dev"; |
| 110 | + REPOSITORY_URL?: string; |
| 111 | + BRANCH?: string; |
| 112 | + URL?: string; |
| 113 | + DEPLOY_URL?: string; |
| 114 | + DEPLOY_PRIME_URL?: string; |
| 115 | + DEPLOY_ID?: string; |
| 116 | + SITE_NAME?: string; |
| 117 | + SITE_ID?: string; |
| 118 | +} |
0 commit comments