Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .changeset/famous-animals-thank.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/tidy-worlds-fetch.md

This file was deleted.

43 changes: 43 additions & 0 deletions packages/vite-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# @arkenv/vite-plugin

## 0.0.14

### Patch Changes

- #### Support array defaults using `type().default()` syntax _[`#224`](https://github.com/yamcodes/arkenv/pull/224) [`ecf9b64`](https://github.com/yamcodes/arkenv/commit/ecf9b64a680d3af5c5786b288fda35608590f7a9) [@yamcodes](https://github.com/yamcodes)_

Fix to an issue where `type("array[]").default(() => [...])` syntax was not accepted by the plugin due to overly restrictive type constraints. The plugin now accepts any string-keyed record while still maintaining type safety through ArkType's validation system.

##### New Features

- Array defaults to empty using `type("string[]").default(() => [])` syntax
- Support for complex array types with defaults
- Mixed schemas combining string-based and type-based defaults

##### Example

```typescript
// vite.config.ts
import arkenv from "@arkenv/vite-plugin";
import { type } from "arkenv";

export default defineConfig({
plugins: [
arkenv({
ALLOWED_ORIGINS: type("string[]").default(() => ["localhost"]),
FEATURE_FLAGS: type("string[]").default(() => []),
PORT: "number.port",
}),
],
});
```

> [!NOTE]
> This is the same fix as in [`arkenv@0.7.2` (the core library)](https://github.com/yamcodes/arkenv/releases/tag/arkenv%400.7.2), but for the Vite plugin.

- #### Fix `import.meta.env` not respecting morphed environment variables _[`#227`](https://github.com/yamcodes/arkenv/pull/227) [`d41878f`](https://github.com/yamcodes/arkenv/commit/d41878fe9cc2524f06ac2f0ef35f2f5ba58ee06b) [@yamcodes](https://github.com/yamcodes)_

The Vite plugin now properly exposes transformed environment variables through `import.meta.env`.

Previously, type transformations (`string → number`, `string → boolean`) and default values were lost because the plugin only called `createEnv()` without integrating the results with Vite's environment system.

Now the plugin uses Vite's `define` option to expose the morphed values, ensuring all schema transformations are respected.

## 0.0.13

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@arkenv/vite-plugin",
"version": "0.0.13",
"version": "0.0.14",
"author": "Yam Borodetsky <yam@yam.codes>",
"repository": {
"type": "git",
Expand Down