Skip to content

chore: update versions#7

Merged
rqbazan merged 1 commit into
mainfrom
changeset-release/main
May 16, 2026
Merged

chore: update versions#7
rqbazan merged 1 commit into
mainfrom
changeset-release/main

Conversation

@vland-bot

@vland-bot vland-bot Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@vlandoss/env@0.2.0

Minor Changes

  • #6 d150a70 Thanks @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 DOM id="env" and window.__env global stay identical, so HTML served by an older build continues to hydrate correctly.

    Renames included:

    • Component: ClientEnvEnvScript
    • Props: ClientEnvPropsEnvScriptProps
    • Constants: CLIENT_ENV_SCRIPT_IDENV_SCRIPT_ID, CLIENT_ENV_GLOBAL_IDENV_GLOBAL_ID

    Migration: replace <ClientEnv …> with <EnvScript …>. If you imported the constants from the core entrypoint, update those imports too.

  • #6 d150a70 Thanks @rqbazan! - BREAKING Rename @vlandoss/env/node to @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 uses pathToFileURL so Deno can load absolute paths correctly.

    Migration: replace from "@vlandoss/env/node" with from "@vlandoss/env/fs".

Patch Changes

  • #6 d150a70 Thanks @rqbazan! - Replace lodash.merge with defu for the internal merge that combines defaults + 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.merge relies on isPlainObject, which returns false when 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 in config (e.g. db.LOGGING: true) to be dropped whenever envOverride touched the same parent branch.

    defu is realm-agnostic and reliably deep-merges in all the runtimes supported by the core.

  • #6 d150a70 Thanks @rqbazan! - Polish the package README to match the new docs site language — soften technical references to process.env, separate the optional zod install, and align the tagline with the rest of the documentation.

  • #6 d150a70 Thanks @rqbazan! - readEnv() no longer throws ReferenceError on runtimes where process is not defined (e.g. Cloudflare Workers without nodejs_compat). It now returns {} so callers can supply the environment explicitly via defineEnv({ runtimeEnv }) — the idiomatic pattern in Worker fetch(req, env, ctx) handlers. Behavior on Node, Bun, Deno, browsers, and Edge runtimes that polyfill process.env is unchanged.

Releases:
  @vlandoss/env@0.2.0

[skip ci]
@rqbazan
rqbazan merged commit 1c9736f into main May 16, 2026
@rqbazan
rqbazan deleted the changeset-release/main branch May 16, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant