// Generated by scripts/generate-manifest.mjs. Do not edit by hand. import type { AddOnCompiled } from '../../../../../types.js' type TemplateRecord = Record type TemplateAddOn = TemplateRecord & { integrations?: Array routes?: Array } type TemplateRenderContext = { [key: string]: any packageManager: any projectName: any typescript: any tailwind: any blank: any js: any jsx: any fileRouter: any codeRouter: any routerOnly: any includeExamples: any addOnEnabled: Record addOnOption: Record addOns: Array integrations: Array routes: Array getPackageManagerAddScript: (...args: Array) => string getPackageManagerRunScript: (...args: Array) => string getPackageManagerExecuteScript: (...args: Array) => string relativePath: (...args: Array) => string integrationImportContent: (...args: Array) => string integrationImportCode: (...args: Array) => string | undefined renderTemplate: (content: string) => string ignoreFile: () => never } type TemplateRenderer = (context: TemplateRenderContext) => string | undefined function __escapeXML(value: unknown) { if (value === undefined || value === null) { return '' } return String(value).replace(/[&<>'"]/g, (character) => { switch (character) { case '&': return '&' case '<': return '<' case '>': return '>' case '"': return '"' case "'": return ''' default: return character } }) } export function getManifestTemplateKey(template: string) { let hash = 0x811c9dc5 for (let i = 0; i < template.length; i++) { hash ^= template.charCodeAt(i) hash = Math.imul(hash, 0x01000193) >>> 0 } return `${hash.toString(16).padStart(8, '0')}:${template.length}` } const templateRenderers: Record = { } export function hasManifestTemplate(template: string) { return getManifestTemplateKey(template) in templateRenderers } export function renderManifestTemplate( template: string, context: TemplateRenderContext, ) { const key = getManifestTemplateKey(template) const renderer = templateRenderers[key] if (!renderer) { throw new Error(`Template ${key} was not precompiled into the manifest`) } return renderer(context) ?? '' } export const addOn = { "name": "T3Env", "description": "Validate process.env at build time (catch missing/wrong env vars before runtime).", "phase": "add-on", "link": "https://github.com/t3-oss/t3-env", "type": "add-on", "category": "tooling", "color": "#6366F1", "modes": [ "file-router", "code-router" ], "id": "t3env", "version": "0.0.0", "packageAdditions": { "dependencies": { "@t3-oss/env-core": "^0.13.10", "zod": "^4.3.6" } }, "readme": "## T3Env\n\n- You can use T3Env to add type safety to your environment variables.\n- Add Environment variables to the `src/env.mjs` file.\n- Use the environment variables in your code.\n\n### Usage\n\n```ts\nimport { env } from \"@/env\";\n\nconsole.log(env.VITE_APP_TITLE);\n```\n\n\n\n", "readmeIsEjs": false, "files": { "src/env.ts": "import { createEnv } from \"@t3-oss/env-core\";\nimport { z } from \"zod\";\n \nexport const env = createEnv({\n server: {\n SERVER_URL: z.url().optional(),\n },\n \n /**\n * The prefix that client-side variables must have. This is enforced both at\n * a type-level and at runtime.\n */\n clientPrefix: \"VITE_\",\n \n client: {\n VITE_APP_TITLE: z.string().min(1).optional(),\n },\n \n /**\n * What object holds the environment variables at runtime. This is usually\n * `process.env` or `import.meta.env`.\n */\n runtimeEnv: import.meta.env,\n \n /**\n * By default, this library will feed the environment variables directly to\n * the Zod validator.\n *\n * This means that if you have an empty string for a value that is supposed\n * to be a number (e.g. `PORT=` in a \".env\" file), Zod will incorrectly flag\n * it as a type mismatch violation. Additionally, if you have an empty string\n * for a value that is supposed to be a string with a default value (e.g.\n * `DOMAIN=` in an \".env\" file), the default value will never be applied.\n *\n * In order to solve these issues, we recommend that all new projects\n * explicitly specify this option as true.\n */\n emptyStringAsUndefined: true,\n});\n" }, "deletedFiles": [], "smallLogo": "\n\n\n\n\n\n" } satisfies AddOnCompiled