Skip to content

chore: update versions#23

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

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

Conversation

@vland-bot
Copy link
Copy Markdown
Contributor

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

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.3.0

Minor Changes

  • #22 fd1f5f8 Thanks @rqbazan! - loadConfig (@vlandoss/env/fs) is now synchronous. It loads the config with require() and returns Config<S> directly instead of a Promise, so it works in app code and in config files that tooling loads via require() or bundles to CJS (where a top-level await is rejected).

    Migration — drop the await:

    - const config = await loadConfig(Env);
    + const config = loadConfig(Env);

    await loadConfig(...) still returns the right value at runtime (awaiting a non-promise yields the value), but the await keeps the module asynchronous — so a config file that keeps it still can't be require()d. Remove it.

    Auto-discovery now also covers .cjs / .cts (was: .ts .mts .js .mjs .json). The options form gains an optional cwd so callers can override process.cwd() when the working directory isn't the project root.

    Files are loaded with require(). Runtime requirements by extension:

    • .ts / .mts / .cts — needs native TS stripping (native in Bun/Deno, Node ≥22.18).
    • .mjs / .js / .cjs — needs require(esm) (native in Bun/Deno, Node ≥22.12).
    • .json — works on any supported Node.

    The package's engines is Node ≥22.12 (the require(esm) baseline). The .ts strip requirement is documented per-extension; consumers using only .json/.mjs/.cjs configs aren't blocked by an over-broad floor.

    CJS configs (module.exports = {...}): a CJS exports object that owns a default property name is no longer silently stripped — loadConfig discriminates ESM namespaces by Symbol.toStringTag === "Module" and returns CJS exports as-is, so sibling keys survive.

Releases:
  @vlandoss/env@0.3.0

[skip ci]
@rqbazan rqbazan merged commit 04c99d2 into main May 28, 2026
@rqbazan rqbazan deleted the changeset-release/main branch May 28, 2026 03:58
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