{"version":3,"file":"plugin.cjs","names":["formatGuardLogEntry","path","fs","process","isStandardEnvDefinition","validateStandardEnv","formatStandardSchemaError","path","loadEnvConfig","generateStandardDts","formatHardError","formatGuardWarning","detectServerLeak"],"sources":["../src/guard.ts","../src/log.ts","../src/sources.ts","../src/virtual.ts","../src/plugin.ts"],"sourcesContent":["export type GuardMode = \"error\" | \"stub\" | \"warn\";\n\nexport type GuardResult =\n  | { allowed: true }\n  | { allowed: false; mode: GuardMode; envName: string; importer: string | undefined };\n\nexport type GuardFail = Extract<GuardResult, { allowed: false }>;\n\n/**\n * Determines whether the given Vite environment is allowed to import virtual:env/server.\n * Returns a GuardResult discriminated union — allowed or fail with context.\n * When this.environment is undefined (should not occur with Vite ≥ 8), callers default\n * envName to 'client' — failing closed (restrictive) is safer than failing open.\n */\nexport function checkServerModuleAccess(\n  envName: string,\n  serverEnvironments: string[],\n  mode: GuardMode,\n  importer: string | undefined,\n): GuardResult {\n  if (serverEnvironments.includes(envName)) return { allowed: true };\n  return { allowed: false, mode, envName, importer };\n}\n\n/**\n * Generates the stub virtual module returned when onClientAccessOfServerModule is 'stub'.\n * The stub throws at runtime if executed — its message reflects that this import was\n * expected to be unreachable and the assumption was wrong.\n */\nexport function buildServerStubModule(envName: string): { code: string; moduleType: \"js\" } {\n  return {\n    moduleType: \"js\",\n    code: `// Auto-generated by @vite-env/core — server-only module stub\nthrow new Error(\n  '[vite-env] virtual:env/server was imported in the \"${envName}\" environment. ' +\n  'This module is server-only and was replaced with a stub. ' +\n  'To allow this environment: add it to serverEnvironments. ' +\n  'To suppress this stub: ensure this import never executes in the \"${envName}\" environment.'\n);`,\n  };\n}\n","// @env node\nimport type { GuardFail } from \"./guard\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { formatGuardLogEntry } from \"./format\";\n\nconst LOG_HEADER = `# vite-env warnings — generated by @vite-env/core\n# These warnings will become hard errors in 1.0.0.\n# To enforce immediately: ViteEnv({ onClientAccessOfServerModule: 'error' })\n# To acknowledge and suppress: ViteEnv({ onClientAccessOfServerModule: 'stub' })\n# To allow specific environments: ViteEnv({ serverEnvironments: ['ssr', 'workerd'] })`;\n\n/**\n * Writes accumulated GuardFail entries to vite-env-warnings.log in the project root.\n * Overwrites on each build — stale entries from previous builds must not persist.\n * Called only in 'warn' mode from buildEnd, after verifying the build succeeded.\n */\nexport async function writeWarningsLog(fails: GuardFail[], root: string): Promise<void> {\n  const seen = new Set<string>();\n  const unique = fails.filter((fail) => {\n    const key = `${fail.envName}::${fail.importer ?? \"\"}`;\n    if (seen.has(key)) return false;\n    seen.add(key);\n    return true;\n  });\n  const timestamp = new Date().toISOString();\n  const entries = unique.map((fail) => formatGuardLogEntry(fail, timestamp)).join(\"\\n\\n\");\n  const content = `${LOG_HEADER}\\n\\n${entries}\\n`;\n  const filePath = path.join(root, \"vite-env-warnings.log\");\n  try {\n    await fs.writeFile(filePath, content, \"utf-8\");\n  } catch (e) {\n    throw new Error(\n      `[vite-env] Failed to write vite-env-warnings.log to ${root}. Check file permissions.`,\n      { cause: e },\n    );\n  }\n}\n","// @env node\nimport type { ResolvedConfig } from \"vite\";\nimport process from \"node:process\";\nimport { loadEnv } from \"vite\";\n\n/**\n * Merge priority (highest → lowest):\n *   1. process.env        (CI pipeline secrets win)\n *   2. .env.[mode].local\n *   3. .env.[mode]\n *   4. .env.local\n *   5. .env\n *\n * Prefix '' = load everything, schema decides what's valid.\n */\nexport async function loadEnvSources(config: ResolvedConfig): Promise<Record<string, string>> {\n  const fileEnv = loadEnv(\n    config.mode,\n    config.envDir || config.root,\n    \"\", // no prefix filter — schema is the filter\n  );\n\n  return {\n    ...fileEnv,\n    ...filterStrings(process.env),\n  };\n}\n\nfunction filterStrings(env: NodeJS.ProcessEnv): Record<string, string> {\n  return Object.fromEntries(\n    Object.entries(env).filter((entry): entry is [string, string] => typeof entry[1] === \"string\"),\n  );\n}\n","import type { AnyEnvDefinition } from \"./types\";\n\nexport function buildClientModule(\n  def: AnyEnvDefinition,\n  data: Record<string, unknown>,\n): { code: string; moduleType: \"js\" } {\n  const clientKeys = new Set(Object.keys(def.client ?? {}));\n\n  const clientData = Object.fromEntries(Object.entries(data).filter(([k]) => clientKeys.has(k)));\n\n  return {\n    moduleType: \"js\", // Required: Vite 8 / Rolldown explicit moduleType\n    code: `// Auto-generated by @vite-env/core — do not edit\nexport const env = Object.freeze(${JSON.stringify(clientData, null, 2)});\nexport default env;`,\n  };\n}\n\nexport function buildServerModule(\n  _def: AnyEnvDefinition,\n  data: Record<string, unknown>,\n): { code: string; moduleType: \"js\" } {\n  return {\n    moduleType: \"js\",\n    code: `// Auto-generated by @vite-env/core — do not edit\nexport const env = Object.freeze(${JSON.stringify(data, null, 2)});\nexport default env;`,\n  };\n}\n","// @env node\nimport type { Plugin, ResolvedConfig, Rollup } from \"vite\";\nimport type { GuardFail } from \"./guard\";\nimport type { AnyEnvDefinition } from \"./types\";\nimport path from \"node:path\";\nimport process from \"node:process\";\nimport { loadEnvConfig } from \"./config\";\nimport { generateStandardDts } from \"./dts\";\nimport { formatGuardWarning, formatHardError, formatStandardSchemaError } from \"./format\";\nimport { buildServerStubModule, checkServerModuleAccess } from \"./guard\";\nimport { detectServerLeak } from \"./leak\";\nimport { writeWarningsLog } from \"./log\";\nimport { loadEnvSources } from \"./sources\";\nimport { isStandardEnvDefinition, validateStandardEnv } from \"./standard\";\nimport { buildClientModule, buildServerModule } from \"./virtual\";\n\nexport type ViteEnvOptions = {\n  /**\n   * Path to env definition file.\n   * @default './env.ts' (resolved from project root)\n   */\n  configFile?: string;\n\n  /**\n   * Vite 8 environment names that are allowed to import virtual:env/server.\n   * Use this to allow edge runtimes (Cloudflare Workers → 'workerd', Deno Deploy → 'ssr').\n   * @default ['ssr']\n   */\n  serverEnvironments?: string[];\n\n  /**\n   * Behavior when virtual:env/server is imported from a disallowed environment.\n   *\n   * - 'warn'  — Deprecation warning printed to terminal + vite-env-warnings.log written.\n   *             Build succeeds but exits with code 1. Default in 0.x releases.\n   *             The default will change to 'error' in 1.0.0.\n   *\n   * - 'error' — Hard build error. No artifacts emitted.\n   *\n   * - 'stub'  — Returns a module that throws at runtime if the import executes.\n   *             Use for testing environments (Vitest jsdom) or framework isomorphic files\n   *             where the import exists but the code path is never reached in a server context.\n   *\n   * @default 'warn'\n   */\n  onClientAccessOfServerModule?: \"error\" | \"stub\" | \"warn\";\n};\n\n/**\n * Validates environment variables against the definition.\n * Routes to Zod or Standard Schema path based on definition type.\n * Zod modules are loaded dynamically to avoid requiring zod for Standard Schema users.\n */\nasync function validateAndFormat(\n  def: AnyEnvDefinition,\n  rawEnv: Record<string, string>,\n): Promise<{ data: Record<string, unknown> } | { error: string }> {\n  if (isStandardEnvDefinition(def)) {\n    const result = await validateStandardEnv(def, rawEnv);\n    if (!result.success) {\n      return { error: formatStandardSchemaError(result.errors) };\n    }\n    return { data: result.data };\n  }\n\n  const { validateEnv } = await import(\"./schema\");\n  const { formatZodError } = await import(\"./format\");\n  const result = validateEnv(def, rawEnv);\n  if (!result.success) {\n    return { error: formatZodError(result.errors) };\n  }\n  return { data: result.data };\n}\n\nfunction getEnvConsumer(ctx: Rollup.PluginContext): string | undefined {\n  return (ctx.environment as unknown as { config?: { consumer?: string } })?.config?.consumer;\n}\n\nexport default function ViteEnv(options: ViteEnvOptions = {}): Plugin {\n  let resolvedConfig: ResolvedConfig;\n  let envDefinition: AnyEnvDefinition;\n  let lastValidated: Record<string, unknown> = {};\n  let serverModuleGuardFails: GuardFail[] = [];\n  let didSetExitCode = false;\n\n  const serverEnvs = options.serverEnvironments ?? [\"ssr\"];\n  const guardMode = options.onClientAccessOfServerModule ?? \"warn\";\n\n  return {\n    name: \"vite-env\",\n    enforce: \"pre\",\n\n    async configResolved(config) {\n      resolvedConfig = config;\n\n      const configPath = path.resolve(config.root, options.configFile ?? \"env.ts\");\n\n      try {\n        envDefinition = await loadEnvConfig(configPath);\n      } catch (e) {\n        throw new Error(\n          `[vite-env] Could not load env definition file at: ${configPath}\\n` +\n            `  Create an env.ts file and export default defineEnv({ ... })`,\n          { cause: e },\n        );\n      }\n    },\n\n    async buildStart() {\n      serverModuleGuardFails = [];\n      if (didSetExitCode) {\n        process.exitCode = 0;\n        didSetExitCode = false;\n      }\n\n      const rawEnv = await loadEnvSources(resolvedConfig);\n      const result = await validateAndFormat(envDefinition, rawEnv);\n\n      if (\"error\" in result) {\n        throw new Error(`[vite-env] Environment validation failed:\\n\\n${result.error}`);\n      }\n\n      lastValidated = result.data;\n\n      if (isStandardEnvDefinition(envDefinition)) {\n        await generateStandardDts(envDefinition, resolvedConfig.root);\n      } else {\n        const { generateDts } = await import(\"./dts\");\n        await generateDts(envDefinition, resolvedConfig.root);\n      }\n\n      const count = Object.keys(lastValidated).length;\n      resolvedConfig.logger.info(\n        `  \\x1B[32m✓\\x1B[0m \\x1B[36m[vite-env]\\x1B[0m ${count} variables validated`,\n      );\n    },\n\n    resolveId(this: Rollup.PluginContext, source, importer) {\n      if (source === \"virtual:env/client\") return \"\\0virtual:env/client\";\n      if (source === \"virtual:env/server\") {\n        const envName = this.environment?.name ?? \"client\";\n        if (getEnvConsumer(this) !== \"server\") {\n          const result = checkServerModuleAccess(envName, serverEnvs, guardMode, importer);\n          if (!result.allowed) serverModuleGuardFails.push(result);\n        }\n        return \"\\0virtual:env/server\";\n      }\n    },\n\n    load(this: Rollup.PluginContext, id) {\n      if (id === \"\\0virtual:env/client\") return buildClientModule(envDefinition, lastValidated);\n      if (id === \"\\0virtual:env/server\") {\n        const envName = this.environment?.name ?? \"client\";\n        const envFails = serverModuleGuardFails.filter((f) => f.envName === envName);\n        if (envFails.length > 0) {\n          const latest = envFails.at(-1)!;\n          if (latest.mode === \"error\") throw new Error(formatHardError(latest));\n          if (latest.mode === \"stub\") return buildServerStubModule(envName);\n          resolvedConfig.logger.warn(`\\n${formatGuardWarning(latest)}`);\n        }\n        return buildServerModule(envDefinition, lastValidated);\n      }\n    },\n\n    async buildEnd(error) {\n      if (error) return;\n      if (serverModuleGuardFails.length === 0) return;\n      if (guardMode !== \"warn\") return;\n      await writeWarningsLog(serverModuleGuardFails, resolvedConfig.root);\n      process.exitCode = 1;\n      didSetExitCode = true;\n    },\n\n    generateBundle(this: Rollup.PluginContext, _options, bundle) {\n      const envName = this.environment?.name ?? \"client\";\n      if (resolvedConfig.build.ssr || serverEnvs.includes(envName) || getEnvConsumer(this) === \"server\") return;\n\n      const leaks = detectServerLeak(envDefinition, lastValidated, bundle, (keys) => {\n        resolvedConfig.logger.warn(\n          `  \\x1B[33m⚠\\x1B[0m \\x1B[36m[vite-env]\\x1B[0m Leak detection skipped ${keys.length} server variable(s) with values shorter than 8 chars: ${keys.join(\", \")}`,\n        );\n      });\n\n      if (leaks.length > 0) {\n        const details = leaks.map((l) => `  ✗ ${l.key} found in ${l.chunk}`).join(\"\\n\");\n        throw new Error(\n          `[vite-env] Server environment variables detected in client bundle!\\n\\n${details}\\n\\n  These variables are marked as server-only and must never reach the browser.`,\n        );\n      }\n    },\n\n    configureServer(server) {\n      const envDir = resolvedConfig.envDir || resolvedConfig.root;\n      server.watcher.add(path.join(envDir, \".env*\"));\n\n      let debounceTimer: ReturnType<typeof setTimeout>;\n\n      server.watcher.on(\"change\", async (file) => {\n        if (!path.basename(file).startsWith(\".env\")) return;\n\n        clearTimeout(debounceTimer);\n        debounceTimer = setTimeout(async () => {\n          try {\n            const rawEnv = await loadEnvSources(resolvedConfig);\n            const result = await validateAndFormat(envDefinition, rawEnv);\n\n            if (\"error\" in result) {\n              resolvedConfig.logger.warn(\n                `\\n  \\x1B[33m⚠\\x1B[0m \\x1B[36m[vite-env]\\x1B[0m Env revalidation failed:\\n${result.error}`,\n              );\n              return;\n            }\n\n            lastValidated = result.data;\n\n            const clientMod = server.moduleGraph.getModuleById(\"\\0virtual:env/client\");\n            const serverMod = server.moduleGraph.getModuleById(\"\\0virtual:env/server\");\n            if (clientMod) server.moduleGraph.invalidateModule(clientMod);\n            if (serverMod) server.moduleGraph.invalidateModule(serverMod);\n            if (clientMod || serverMod) {\n              serverModuleGuardFails = [];\n              server.hot.send({ type: \"full-reload\" });\n              resolvedConfig.logger.info(\n                `  \\x1B[32m✓\\x1B[0m \\x1B[36m[vite-env]\\x1B[0m Env revalidated`,\n              );\n            }\n          } catch (e) {\n            resolvedConfig.logger.error(\n              `\\n  \\x1B[31m✗\\x1B[0m \\x1B[36m[vite-env]\\x1B[0m Failed to reload env files: ${e instanceof Error ? e.message : String(e)}`,\n            );\n          }\n        }, 150);\n      });\n    },\n  };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,SAAgB,wBACd,SACA,oBACA,MACA,UACa;AACb,KAAI,mBAAmB,SAAS,QAAQ,CAAE,QAAO,EAAE,SAAS,MAAM;AAClE,QAAO;EAAE,SAAS;EAAO;EAAM;EAAS;EAAU;;;;;;;AAQpD,SAAgB,sBAAsB,SAAqD;AACzF,QAAO;EACL,YAAY;EACZ,MAAM;;wDAE8C,QAAQ;;;sEAGM,QAAQ;;EAE3E;;;;ACjCH,MAAM,aAAa;;;;;;;;;;AAWnB,eAAsB,iBAAiB,OAAoB,MAA6B;CACtF,MAAM,uBAAO,IAAI,KAAa;CAC9B,MAAM,SAAS,MAAM,QAAQ,SAAS;EACpC,MAAM,MAAM,GAAG,KAAK,QAAQ,IAAI,KAAK,YAAY;AACjD,MAAI,KAAK,IAAI,IAAI,CAAE,QAAO;AAC1B,OAAK,IAAI,IAAI;AACb,SAAO;GACP;CACF,MAAM,6BAAY,IAAI,MAAM,EAAC,aAAa;CAE1C,MAAM,UAAU,GAAG,WAAW,MADd,OAAO,KAAK,SAASA,eAAAA,oBAAoB,MAAM,UAAU,CAAC,CAAC,KAAK,OACrC,CAAC;CAC5C,MAAM,WAAWC,UAAAA,QAAK,KAAK,MAAM,wBAAwB;AACzD,KAAI;AACF,QAAMC,iBAAAA,QAAG,UAAU,UAAU,SAAS,QAAQ;UACvC,GAAG;AACV,QAAM,IAAI,MACR,uDAAuD,KAAK,4BAC5D,EAAE,OAAO,G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