Skip to content

Remove ArkEnvError export from main entry#815

Merged
yamcodes merged 6 commits into
mainfrom
remove-ark-env-error-export
Feb 24, 2026
Merged

Remove ArkEnvError export from main entry#815
yamcodes merged 6 commits into
mainfrom
remove-ark-env-error-export

Conversation

@yamcodes

@yamcodes yamcodes commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Breaking Changes
    • ArkEnvError is now exclusively available via "arkenv/core"; previously importable from the main "arkenv" package

@changeset-bot

changeset-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5d4fa3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
arkenv Minor
@arkenv/bun-plugin Patch
@arkenv/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added docs Adds or changes documentation, or acts as documentation in and of itself arkenv Changes to the `arkenv` npm package. @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv labels Feb 24, 2026
@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41b2908 and 5d4fa3f.

📒 Files selected for processing (6)
  • .changeset/shiny-brooms-thank.md
  • packages/arkenv/package.json
  • packages/arkenv/src/core.ts
  • packages/arkenv/src/index.ts
  • packages/bun-plugin/package.json
  • packages/vite-plugin/package.json
💤 Files with no reviewable changes (1)
  • packages/arkenv/src/index.ts

Walkthrough

This PR relocates the ArkEnvError export from the arkenv package root to the arkenv/core submodule. The changeset documents this breaking API change. Package.json files are updated with granular size-limit configurations for individual entry points and refined size limits.

Changes

Cohort / File(s) Summary
ArkEnvError Export Relocation
.changeset/shiny-brooms-thank.md, packages/arkenv/src/index.ts, packages/arkenv/src/core.ts
Removes ArkEnvError re-export from package root index, updates documentation examples to reflect new import path from "arkenv/core", and documents the breaking change via changeset.
Size Limit Configuration Updates
packages/arkenv/package.json, packages/bun-plugin/package.json, packages/vite-plugin/package.json
Replaces aggregated size-limit entry with three granular per-bundle entries; updates size script; removes node:module from ignore lists across packages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

arkenv, docs

Poem

A rabbit hops through exports bright,
Moving errors left and right,
From root to core, they find their place,
Size limits neat—a cleaner space! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove ArkEnvError export from main entry' accurately and specifically describes the main change in the pull request: removing the ArkEnvError re-export from the index barrel file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-ark-env-error-export

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Feb 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/arkenv@815
npm i https://pkg.pr.new/@arkenv/bun-plugin@815
npm i https://pkg.pr.new/@arkenv/fumadocs-ui@815
npm i https://pkg.pr.new/@arkenv/vite-plugin@815

commit: 5d4fa3f

@arkenv-bot

arkenv-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Limit Diff Status
@arkenv/vite-plugin 1.91 kB 2.93 kB 0.0%
arkenv 441 B 2.93 kB 0.0%
@arkenv/bun-plugin 2.4 kB 2.44 kB 0.0%

All size limits passed!

1 similar comment
@arkenv-bot

arkenv-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Limit Diff Status
@arkenv/vite-plugin 1.91 kB 2.93 kB 0.0%
arkenv 441 B 2.93 kB 0.0%
@arkenv/bun-plugin 2.4 kB 2.44 kB 0.0%

All size limits passed!

@arkenv-bot

arkenv-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (Asia/Almaty)
arkenv Ready Ready Preview, Comment Feb 25 2026, 12:22 AM (Asia/Almaty)

@yamcodes
yamcodes merged commit 5e8025f into main Feb 24, 2026
18 checks passed
@yamcodes
yamcodes deleted the remove-ark-env-error-export branch February 24, 2026 20:13
@arkenv-bot arkenv-bot Bot mentioned this pull request Feb 24, 2026
yamcodes pushed a commit that referenced this pull request Feb 24, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) 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
## arkenv@0.11.0

### Minor Changes

- #### Remove `ArkEnvError` import from "arkenv"
_[`#815`](#815)
[`5e8025f`](5e8025f)
[@yamcodes](https://github.com/yamcodes)_

    The `ArkEnvError` class is now only available via:

    ```ts
    import { ArkEnvError } from "arkenv/core";
    ```

## @arkenv/bun-plugin@0.1.6

### Patch Changes

<details><summary>Updated 1 dependency</summary>

<small>


[`5e8025f`](5e8025f)

</small>

-   `arkenv@0.11.0`

</details>

## @arkenv/vite-plugin@0.0.32

### Patch Changes

<details><summary>Updated 1 dependency</summary>

<small>


[`5e8025f`](5e8025f)

</small>

-   `arkenv@0.11.0`

</details>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
renovate Bot added a commit that referenced this pull request Mar 20, 2026
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [arkenv](https://arkenv.js.org)
([source](https://redirect.github.com/yamcodes/arkenv)) | [`^0.9.0` →
`^0.11.0`](https://renovatebot.com/diffs/npm/arkenv/0.9.3/0.11.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/arkenv/0.11.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/arkenv/0.9.3/0.11.0?slim=true)
|

---

### Release Notes

<details>
<summary>yamcodes/arkenv (arkenv)</summary>

###
[`v0.11.0`](https://redirect.github.com/yamcodes/arkenv/releases/tag/arkenv%400.11.0)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/arkenv@0.10.0...arkenv@0.11.0)

##### Minor Changes

- #### Remove `ArkEnvError` import from "arkenv"
*[`#815`](https://redirect.github.com/yamcodes/arkenv/pull/815)
[`5e8025f`](https://redirect.github.com/yamcodes/arkenv/commit/5e8025fd53e5637cd326848f6e0e0d3a20fc1a8b)
[@&#8203;yamcodes](https://redirect.github.com/yamcodes)*

  The `ArkEnvError` class is now only available via:

  ```ts
  import { ArkEnvError } from "arkenv/core";
  ```

###
[`v0.10.0`](https://redirect.github.com/yamcodes/arkenv/releases/tag/arkenv%400.10.0)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/arkenv@0.9.3...arkenv@0.10.0)

##### Minor Changes

- #### `arkenv/standard` import
*[`#806`](https://redirect.github.com/yamcodes/arkenv/pull/806)
[`f9010d0`](https://redirect.github.com/yamcodes/arkenv/commit/f9010d00c3f05dbd9862e4aeafab099a9dea4d25)
[@&#8203;yamcodes](https://redirect.github.com/yamcodes)*

  `arkenv` now ships three separate entry points:

- **`arkenv`** (main): ArkType-first. Includes `createEnv` (aliased to
`arkenv` default import), `type`, and `ArkEnvError`. Importing from this
entry requires you to have ArkType installed.
- **`arkenv/standard`**: ArkType-free. A standalone `createEnv` (aliased
to `arkenv` default import) for Standard Schema validators (Zod,
Valibot, etc.), not requiring ArkType.
- **`arkenv/core`**: Mode-agnostic primitives - `ArkEnvError` and
`ValidationIssue`.

##### Breaking changes

````
**1. `validator: "standard"` option removed; `arkenv` now statically requires ArkType.**
The `validator` config option has been removed - ArkType is now always required when importing from `arkenv`. For a zero-ArkType bundle, use `arkenv/standard`:

```ts
// ❌ Before
import arkenv from "arkenv";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() }, { validator: "standard"
});

// ✅ After
import arkenv from "arkenv/standard";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() });
```

**2. `type` moved from `arkenv/arktype` to `arkenv`.**
The `type` helper is now exported from the main entry. The `arkenv/arktype` sub-path is no longer public:

```ts
// ❌ Before
import { type } from "arkenv/arktype";

// ✅ After
import { type } from "arkenv"; // 'type' is the ArkEnv helper, not a TS
type modifier
```
````

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on friday" in timezone Asia/Almaty,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

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

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/yamcodes/arkenv).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate Bot added a commit to gwennlbh/pleye that referenced this pull request Jul 20, 2026
##### [v0.12.2](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.2)

##### Patch Changes

- #### Expose `getSchemaKeys` helper *[`#1191`](yamcodes/arkenv#1191) [`a3e32db`](yamcodes/arkenv@a3e32db) [@yamcodes](https://github.com/yamcodes)*

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

- #### Handle pre-parsed primitives gracefully in coercion logic *[`#1206`](yamcodes/arkenv#1206) [`12ed4f3`](yamcodes/arkenv@12ed4f3) [@yamcodes](https://github.com/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`](yamcodes/arkenv#1206) [`12ed4f3`](yamcodes/arkenv@12ed4f3) [@yamcodes](https://github.com/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:

  ```ts
  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](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.1)

##### Patch Changes

- #### Add `emptyAsUndefined` option to treat empty env values as missing *[`#1188`](yamcodes/arkenv#1188) [`3bfbcb7`](yamcodes/arkenv@3bfbcb7) [@yamcodes](https://github.com/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:**

  ```ts
  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
  ```

  ```ts
  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](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.0)

##### Minor Changes

- #### Add Standard JSON Schema coercion to `arkenv/standard` *[`#1154`](yamcodes/arkenv#1154) [`88b0eee`](yamcodes/arkenv@88b0eee) [@yamcodes](https://github.com/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:

  ```ts
  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.
##### [v0.11.1](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.11.1)

##### Patch Changes

- #### Add `Infer<T>` helper to resolve environment variable types *[`#1092`](yamcodes/arkenv#1092) [`c6c30ab`](yamcodes/arkenv@c6c30ab) [@yamcodes](https://github.com/yamcodes)*

  Introduce the `Infer<T>` type helper, allowing developers to extract the inferred output types of their environment schemas. It supports both declarative schema shapes and compiled schemas (like Zod or ArkType types).

  Usage:

  ```ts
  import { createEnv, type Infer } from "arkenv";
  import { type } from "arktype";

  const schema = {
    PORT: type.number,
  };

  export type Env = Infer<typeof schema>;
  ```
##### [v0.11.0](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.11.0)

##### Minor Changes

- #### Remove `ArkEnvError` import from "arkenv" *[`#815`](yamcodes/arkenv#815) [`5e8025f`](yamcodes/arkenv@5e8025f) [@yamcodes](https://github.com/yamcodes)*

  The `ArkEnvError` class is now only available via:

  ```ts
  import { ArkEnvError } from "arkenv/core";
  ```
##### [v0.10.0](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.10.0)

##### Minor Changes

- #### `arkenv/standard` import *[`#806`](yamcodes/arkenv#806) [`f9010d0`](yamcodes/arkenv@f9010d0) [@yamcodes](https://github.com/yamcodes)*

  `arkenv` now ships three separate entry points:

  - **`arkenv`** (main): ArkType-first. Includes `createEnv` (aliased to `arkenv` default import), `type`, and `ArkEnvError`. Importing from this entry requires you to have ArkType installed.
  - **`arkenv/standard`**: ArkType-free. A standalone `createEnv` (aliased to `arkenv` default import) for Standard Schema validators (Zod, Valibot, etc.), not requiring ArkType.
  - **`arkenv/core`**: Mode-agnostic primitives - `ArkEnvError` and `ValidationIssue`.

##### Breaking changes

````
**1. `validator: "standard"` option removed; `arkenv` now statically requires ArkType.**
The `validator` config option has been removed - ArkType is now always required when importing from `arkenv`. For a zero-ArkType bundle, use `arkenv/standard`:

```ts
// ❌ Before
import arkenv from "arkenv";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() }, { validator: "standard" });

// ✅ After
import arkenv from "arkenv/standard";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() });
```

**2. `type` moved from `arkenv/arktype` to `arkenv`.**
The `type` helper is now exported from the main entry. The `arkenv/arktype` sub-path is no longer public:

```ts
// ❌ Before
import { type } from "arkenv/arktype";

// ✅ After
import { type } from "arkenv"; // 'type' is the ArkEnv helper, not a TS type modifier
```
````
renovate Bot added a commit to gwennlbh/pleye that referenced this pull request Jul 24, 2026
##### [v0.12.3](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.3)

##### Patch Changes

- #### Improve npm keywords across published packages for discoverability *[`#1383`](yamcodes/arkenv#1383) [`bf60ab2`](yamcodes/arkenv@bf60ab2) [@yamcodes](https://github.com/yamcodes)*

  Clean up and extend the `keywords` field of every published package so npm search, aggregators, and LLM-powered package discovery surface ArkEnv for the terms users actually search for.

  - Remove the misleading `pnpm` keyword from `arkenv` and add `env`, `environment-variables`, `dotenv`, `config`, `standard-schema`, and the supported validators `zod` and `valibot`.
  - Deduplicate the repeated `arkenv` keyword in `@arkenv/vite-plugin`.
  - Give every env-related package a shared baseline (`env`, `environment-variables`, `dotenv`, `config`, `validation`, `typesafe`, `standard-schema`) alongside their integration-specific terms.
  - Add a keyword set to `@arkenv/fumadocs-ui`, which previously had none.
##### [v0.12.2](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.2)

##### Patch Changes

- #### Expose `getSchemaKeys` helper *[`#1191`](yamcodes/arkenv#1191) [`a3e32db`](yamcodes/arkenv@a3e32db) [@yamcodes](https://github.com/yamcodes)*

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

- #### Handle pre-parsed primitives gracefully in coercion logic *[`#1206`](yamcodes/arkenv#1206) [`12ed4f3`](yamcodes/arkenv@12ed4f3) [@yamcodes](https://github.com/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`](yamcodes/arkenv#1206) [`12ed4f3`](yamcodes/arkenv@12ed4f3) [@yamcodes](https://github.com/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:

  ```ts
  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](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.1)

##### Patch Changes

- #### Add `emptyAsUndefined` option to treat empty env values as missing *[`#1188`](yamcodes/arkenv#1188) [`3bfbcb7`](yamcodes/arkenv@3bfbcb7) [@yamcodes](https://github.com/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:**

  ```ts
  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
  ```

  ```ts
  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](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.12.0)

##### Minor Changes

- #### Add Standard JSON Schema coercion to `arkenv/standard` *[`#1154`](yamcodes/arkenv#1154) [`88b0eee`](yamcodes/arkenv@88b0eee) [@yamcodes](https://github.com/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:

  ```ts
  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.
##### [v0.11.1](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.11.1)

##### Patch Changes

- #### Add `Infer<T>` helper to resolve environment variable types *[`#1092`](yamcodes/arkenv#1092) [`c6c30ab`](yamcodes/arkenv@c6c30ab) [@yamcodes](https://github.com/yamcodes)*

  Introduce the `Infer<T>` type helper, allowing developers to extract the inferred output types of their environment schemas. It supports both declarative schema shapes and compiled schemas (like Zod or ArkType types).

  Usage:

  ```ts
  import { createEnv, type Infer } from "arkenv";
  import { type } from "arktype";

  const schema = {
    PORT: type.number,
  };

  export type Env = Infer<typeof schema>;
  ```
##### [v0.11.0](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.11.0)

##### Minor Changes

- #### Remove `ArkEnvError` import from "arkenv" *[`#815`](yamcodes/arkenv#815) [`5e8025f`](yamcodes/arkenv@5e8025f) [@yamcodes](https://github.com/yamcodes)*

  The `ArkEnvError` class is now only available via:

  ```ts
  import { ArkEnvError } from "arkenv/core";
  ```
##### [v0.10.0](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.10.0)

##### Minor Changes

- #### `arkenv/standard` import *[`#806`](yamcodes/arkenv#806) [`f9010d0`](yamcodes/arkenv@f9010d0) [@yamcodes](https://github.com/yamcodes)*

  `arkenv` now ships three separate entry points:

  - **`arkenv`** (main): ArkType-first. Includes `createEnv` (aliased to `arkenv` default import), `type`, and `ArkEnvError`. Importing from this entry requires you to have ArkType installed.
  - **`arkenv/standard`**: ArkType-free. A standalone `createEnv` (aliased to `arkenv` default import) for Standard Schema validators (Zod, Valibot, etc.), not requiring ArkType.
  - **`arkenv/core`**: Mode-agnostic primitives - `ArkEnvError` and `ValidationIssue`.

##### Breaking changes

````
**1. `validator: "standard"` option removed; `arkenv` now statically requires ArkType.**
The `validator` config option has been removed - ArkType is now always required when importing from `arkenv`. For a zero-ArkType bundle, use `arkenv/standard`:

```ts
// ❌ Before
import arkenv from "arkenv";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() }, { validator: "standard" });

// ✅ After
import arkenv from "arkenv/standard";
import { z } from "zod";

const env = arkenv({ PORT: z.coerce.number() });
```

**2. `type` moved from `arkenv/arktype` to `arkenv`.**
The `type` helper is now exported from the main entry. The `arkenv/arktype` sub-path is no longer public:

```ts
// ❌ Before
import { type } from "arkenv/arktype";

// ✅ After
import { type } from "arkenv"; // 'type' is the ArkEnv helper, not a TS type modifier
```
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant