Skip to content

Update dependency arkenv to ~0.12.0#363

Merged
inetol merged 1 commit into
devfrom
renovate/arkenv-0.x
Jun 19, 2026
Merged

Update dependency arkenv to ~0.12.0#363
inetol merged 1 commit into
devfrom
renovate/arkenv-0.x

Conversation

@renovate

@renovate renovate Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
arkenv (source) ~0.11.0 -> ~0.12.0 age confidence

Release Notes

yamcodes/arkenv (arkenv)

v0.12.2

Compare Source

Patch Changes
  • Expose getSchemaKeys helper #1191 a3e32db @​yamcodes

    Expose getSchemaKeys helper and widen RuntimeEnvironment type to support typed framework runtime configurations.

  • Handle pre-parsed primitives gracefully in coercion logic #1206 12ed4f3 @​yamcodes

    Updated the core coercion logic to defensively skip values that are not strings. This ensures ArkEnv won't crash or behave unpredictably when passed configuration objects that have already been parsed into numbers, booleans, or complex objects by other systems (such as Nuxt's runtimeConfig).

  • Fix coercion to prevent in-place mutation of environment config objects #1206 12ed4f3 @​yamcodes

    Refactor applyCoercion to perform non-mutating updates on environment configuration data. Clone objects and arrays along the validation path instead of modifying them in-place, preventing runtime crashes on frozen configuration objects (e.g., framework runtime configurations) and avoiding side-effects on reusable config objects.

    Usage:

    import { createEnv } from "arkenv";
    
    const env = createEnv(
      { DATABASE: { port: "number" } },
      { env: { DATABASE: Object.freeze({ port: "3000" }) } } // Frozen object is now safely parsed without crashes!
    );

v0.12.1

Compare Source

Patch Changes
  • Add emptyAsUndefined option to treat empty env values as missing #1188 3bfbcb7 @​yamcodes

    Add a new emptyAsUndefined configuration option to both createEnv (ArkType mode) and arkenv/standard (Standard Schema mode). When enabled, environment variables set to empty strings (e.g., PORT= in a .env file) are treated as if they were missing, allowing defaults to apply and preventing unnecessary validation errors for numeric, boolean, or array types.

    Usage:

    import arkenv from "arkenv";
    
    const env = arkenv(
      { PORT: "number = 3000", DEBUG: "boolean = false" },
      { emptyAsUndefined: true }
    );
    
    // Given PORT= and DEBUG= in the environment:
    // env.PORT  → 3000
    // env.DEBUG → false
    import arkenv from "arkenv/standard";
    import { z } from "zod";
    
    const env = arkenv(
      { PORT: z.coerce.number().default(3000) },
      { emptyAsUndefined: true }
    );
    • The default behavior remains unchanged (emptyAsUndefined: false).
    • Keys with empty values are removed from the input record before validation so that ArkType defaults and optional types work correctly.

v0.12.0

Compare Source

Minor Changes
  • Add Standard JSON Schema coercion to arkenv/standard #1154 88b0eee @​yamcodes

    Introduce opt-out type coercion for standard mode (arkenv/standard). This coercion only works if the validator is a standard JSON Schema compliant validator (e.g., Zod, Valibot, or custom schemas that implement the StandardJSONSchemaV1 interface). This automatically enables coercion for environment variables without relying on ArkType's runtime footprint.

    If you need to disable coercion, explicitly pass { coerce: false } in your configuration:

    import arkenv from "arkenv/standard";
    import { z } from "zod";
    
    const env = arkenv({ PORT: z.number() }, { coerce: false });

    BREAKING CHANGE: Coercion is now enabled by default in arkenv/standard. This will automatically coerce environment variables to their expected types (e.g., strings containing numbers, booleans, or dates will be converted to their respective types) based on the JSON Schema of your validators. It's unlikely to affect you unless you were relying on validation failing for uncoerced string inputs, or have custom schemas that expect raw strings instead of coerced values.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@inetol inetol added this pull request to the merge queue Jun 19, 2026
Merged via the queue into dev with commit c8128f7 Jun 19, 2026
1 check passed
@inetol inetol deleted the renovate/arkenv-0.x branch June 19, 2026 14: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