Releases: variableland/env
@vlandoss/env@0.2.1
@vlandoss/env@0.2.0
Minor Changes
-
#6
d150a70Thanks @rqbazan! - BREAKING Rename<ClientEnv />(in@vlandoss/env/react) to<EnvScript />. The new name stops suggesting client-side use and reflects what the component actually does: emit a<script>tag with the server-resolved env so the browser can read it during SSR or SSG hydration. The entrypoint path (@vlandoss/env/react) is unchanged. The wire format is also unchanged: the DOMid="env"andwindow.__envglobal stay identical, so HTML served by an older build continues to hydrate correctly.Renames included:
- Component:
ClientEnv→EnvScript - Props:
ClientEnvProps→EnvScriptProps - Constants:
CLIENT_ENV_SCRIPT_ID→ENV_SCRIPT_ID,CLIENT_ENV_GLOBAL_ID→ENV_GLOBAL_ID
Migration: replace
<ClientEnv …>with<EnvScript …>. If you imported the constants from the core entrypoint, update those imports too. - Component:
-
#6
d150a70Thanks @rqbazan! - BREAKING Rename@vlandoss/env/nodeto@vlandoss/env/fs. The entrypoint has always been about file-system access on a Node-compatible runtime — the new name reflects that it works on Node, Bun, and Deno (not just Node), and that it does not work on Workers/Edge. The dynamic-import path resolution now usespathToFileURLso Deno can load absolute paths correctly.Migration: replace
from "@vlandoss/env/node"withfrom "@vlandoss/env/fs".
Patch Changes
-
#6
d150a70Thanks @rqbazan! - Replacelodash.mergewithdefufor the internal merge that combinesdefaults + config + envOverride. The precedence (env > config > defaults) is unchanged.This fixes a silent shallow-merge regression on V8 isolate runtimes (Cloudflare Workers, Vercel Edge, Next.js Edge):
lodash.mergerelies onisPlainObject, which returnsfalsewhen the object originates from a different realm than the merger. The fallback path then assigns by reference instead of deep-merging, which caused leaf values present inconfig(e.g.db.LOGGING: true) to be dropped wheneverenvOverridetouched the same parent branch.defu is realm-agnostic and reliably deep-merges in all the runtimes supported by the core.
-
#6
d150a70Thanks @rqbazan! - Polish the package README to match the new docs site language — soften technical references toprocess.env, separate the optionalzodinstall, and align the tagline with the rest of the documentation. -
#6
d150a70Thanks @rqbazan! -readEnv()no longer throwsReferenceErroron runtimes whereprocessis not defined (e.g. Cloudflare Workers withoutnodejs_compat). It now returns{}so callers can supply the environment explicitly viadefineEnv({ runtimeEnv })— the idiomatic pattern in Workerfetch(req, env, ctx)handlers. Behavior on Node, Bun, Deno, browsers, and Edge runtimes that polyfillprocess.envis unchanged.
@vlandoss/env@0.1.2
@vlandoss/env@0.1.1
@vlandoss/env@0.1.0
Minor Changes
-
42c6eb7Thanks @rqbazan! - Initial public release of@vlandoss/envunder the@vlandossscope.Contract-first environment configuration with typed schemas and per-runtime entrypoints:
@vlandoss/env— runtime-agnostic core (schema,defineEnv,envName,readEnv).@vlandoss/env/node—loadConfigwith auto-discovery or{env}template.@vlandoss/env/vite—envConfigVite plugin (#configalias +__ENV_NAME__build-time inject).@vlandoss/env/react—<ClientEnv />for SSR/SSG.@vlandoss/env/zod— opt-in opinionated Zod primitives (port,host,bool,logLevel,secret).