Skip to content

Support Vite 2.x and up#212

Merged
yamcodes merged 7 commits intomainfrom
211-support-vite-2x-and-up
Oct 12, 2025
Merged

Support Vite 2.x and up#212
yamcodes merged 7 commits intomainfrom
211-support-vite-2x-and-up

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Oct 11, 2025

Closes #211

Summary by CodeRabbit

  • Documentation

    • Clarified supported Vite versions (2.9.18–7.x) and updated “Tested on” notes.
    • Added FAQ explaining why the plugin is Vite-only (not a Rollup plugin).
  • Chores

    • Expanded compatibility to Vite 2.9.18–7.x via updated peer range.
    • Removed unused React-related dev dependencies.
    • Added “vite-plugin” keyword for improved discoverability.
    • Added a changeset entry for a patch release.

- Downgraded vite version
- Removed unused dev dependencies
- Updated peerDependencies
- Clarify tested Vite versions
- Allow any vite v2.9.18+ version
- Added FAQ section
- Explained Vite config hook usage
@vercel
Copy link

vercel bot commented Oct 11, 2025

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

Project Deployment Preview Comments Updated (UTC)
arkenv Ready Ready Preview Comment Oct 12, 2025 2:44pm

@yamcodes yamcodes linked an issue Oct 11, 2025 that may be closed by this pull request
@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2025

🦋 Changeset detected

Latest commit: 27a869b

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

This PR includes changesets to release 1 package
Name Type
@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 Improvements or additions to documentation arkenv Changes to the `arkenv` npm package. @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv labels Oct 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Updates documentation and package metadata to declare Vite support from 2.9.18 through 7.x, adds a changeset entry for a patch release, widens peerDependencies for Vite, adds a vite-plugin export/keyword, and explains Vite-only scope in the plugin README.

Changes

Cohort / File(s) Summary
Release note (changeset)
/.changeset/slick-banks-win.md
Adds patch changeset for @arkenv/vite-plugin; documents supported Vite range (2.9.18–7.x); mentions vite-plugin keyword and Vite-only rationale.
Docs updates
/packages/arkenv/README.md, /packages/vite-plugin/README.md
Clarifies supported Vite range in requirements; adds FAQ explaining why the plugin is Vite-only (relies on a Vite-specific config hook). Primarily wording/documentation changes.
Vite plugin package metadata
/packages/vite-plugin/package.json
Removes React-related devDependencies; updates devDependency vite to 7.1.9; expands peerDependencies.vite to `^2.9.18

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws in tidy delight,
From Vite 2.9 to seven's bright light.
Keywords tucked and exports aligned,
A patch hops in — small, well-timed.
I nibble docs and leave a byte. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR removes React-related devDependencies and adds an FAQ section explaining why the plugin is Vite-only, both of which are unrelated to the core objective of supporting Vite 2.x and up as outlined in issue #211. These changes go beyond the stated compatibility updates and could be separated into a distinct cleanup or documentation PR. Consider splitting the removal of React-related dependencies and the FAQ addition into a separate pull request or provide justification for why these changes are necessary within this compatibility update.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “Support Vite 2.x and up” succinctly captures the primary objective of widening compatibility for the Vite plugin and directly reflects the linked issue. It is concise, specific, and clearly indicates the main change without extraneous detail.
Linked Issues Check ✅ Passed The pull request updates the peer dependency range for Vite to include versions 2.x and later, adjusts documentation to reflect the supported versions, and ensures the plugin is compatible across the specified range, thereby fulfilling the primary requirement of issue #211. The code changes directly address the linked issue by expanding compatibility and documenting it.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 211-support-vite-2x-and-up

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfa9076 and 27a869b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/vite-plugin/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vite-plugin/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: pkg-pr-new

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
Copy link

pkg-pr-new bot commented Oct 11, 2025

Open in StackBlitz

npm i https://pkg.pr.new/arkenv@212
npm i https://pkg.pr.new/@arkenv/vite-plugin@212

commit: 27a869b

- Added vite-plugin keyword
- Explained Vite-only plugin
- Supported Vite 2.9.18 - 7.x
@yamcodes yamcodes changed the title 211 support vite 2x and up Support Vite 2.x Oct 11, 2025
@yamcodes yamcodes changed the title Support Vite 2.x Support Vite 2.x and up Oct 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/vite-plugin/README.md (1)

66-71: Add a “Requirements” section (Vite range, Node note).

Per docs guidelines, please document env requirements here too. Suggest:

  • Supported Vite: 2.9.18–7.x (align with peerDependencies and root README)
  • Note Node version guidance (varies by Vite major; defer to user’s Vite version), and that this plugin is Vite‑only.
packages/vite-plugin/package.json (2)

21-24: Peer range looks good; consider simplifying semver.

The disjunction is correct. Optionally, you can express as ">=2.9.18 <8" for readability (same effect).


36-45: Keywords ok; remove duplicate “arkenv”.

There’s a duplicate keyword ("arkenv"). Trim it.

Apply:

   "keywords": [
     "arktype",
     "arkenv",
-    "arkenv",
     "environment",
     "variables",
     "vite",
     "plugin",
     "vite-plugin"
   ],
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56f4b6f and 234834c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/arkenv/README.md (1 hunks)
  • packages/vite-plugin/README.md (1 hunks)
  • packages/vite-plugin/package.json (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/README.md

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Document environment requirements in README files

Files:

  • packages/vite-plugin/README.md
  • packages/arkenv/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test-build (22)
  • GitHub Check: pkg-pr-new
  • GitHub Check: test-build (lts/*)
🔇 Additional comments (1)
packages/arkenv/README.md (1)

113-113: LGTM; aligns with plugin’s peer range.

Vite “2.9.18 to 7.x” matches the plugin’s peerDependencies. Keep this in sync on future bumps.

- Updated vite dependency
- Updated vite-tsconfig-paths
@yamcodes yamcodes merged commit bfe08f6 into main Oct 12, 2025
17 checks passed
@yamcodes yamcodes deleted the 211-support-vite-2x-and-up branch October 12, 2025 16:24
@github-actions github-actions bot mentioned this pull request Oct 12, 2025
yamcodes pushed a commit that referenced this pull request Oct 12, 2025
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.7.3

### Patch Changes

- #### Automatic boolean string conversion
_[`#218`](#218)
[`e554e2b`](e554e2b)
[@yamcodes](https://github.com/yamcodes)_

The `boolean` type now accepts `"true"`/`"false"` strings from
environment variables and converts them to actual boolean values. This
also works with boolean defaults.

    Example:

    ```ts
    import arkenv from "arkenv";

    const env = arkenv({
      DEBUG: "boolean",
      ENABLE_FEATURE: "boolean = true",
    });

    console.log(env.DEBUG);
    console.log(env.ENABLE_FEATURE);
    ```

    Result:

    ```sh
    ❯ DEBUG=true npx tsx index.ts
    true
    true
    ```

## @arkenv/vite-plugin@0.0.13

### Patch Changes

- #### Support Vite 2.x
_[`#212`](#212)
[`bfe08f6`](bfe08f6)
[@yamcodes](https://github.com/yamcodes)_

Extended the supported Vite versions to include **2.9.18** through
**7.x** (inclusive).

Also, we've added the `vite-plugin` keyword to the `package.json`, and a
section in the `README.md` explaining why this plugin is a Vite only
plugin (and not a Rollup plugin).

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

<small>


[`e554e2b`](e554e2b)

</small>

-   `arkenv@0.7.3`

</details>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
yamcodes pushed a commit that referenced this pull request Nov 10, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [@arkenv/vite-plugin](https://arkenv.js.org)
([source](https://redirect.github.com/yamcodes/arkenv)) | [`^0.0.10` ->
`^0.0.14`](https://renovatebot.com/diffs/npm/@arkenv%2fvite-plugin/0.0.10/0.0.14)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@arkenv%2fvite-plugin/0.0.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@arkenv%2fvite-plugin/0.0.10/0.0.14?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>yamcodes/arkenv (@&#8203;arkenv/vite-plugin)</summary>

###
[`v0.0.14`](https://redirect.github.com/yamcodes/arkenv/releases/tag/%40arkenv/vite-plugin%400.0.14)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/@arkenv/vite-plugin@0.0.13...@arkenv/vite-plugin@0.0.14)

##### Patch Changes

- #### Support array defaults using `type().default()` syntax
*[`#224`](https://redirect.github.com/yamcodes/arkenv/pull/224)
[`ecf9b64`](https://redirect.github.com/yamcodes/arkenv/commit/ecf9b64a680d3af5c5786b288fda35608590f7a9)
[@&#8203;yamcodes](https://redirect.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 "@&#8203;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://redirect.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://redirect.github.com/yamcodes/arkenv/pull/227)
[`d41878f`](https://redirect.github.com/yamcodes/arkenv/commit/d41878fe9cc2524f06ac2f0ef35f2f5ba58ee06b)
[@&#8203;yamcodes](https://redirect.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.

###
[`v0.0.13`](https://redirect.github.com/yamcodes/arkenv/releases/tag/%40arkenv/vite-plugin%400.0.13)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/@arkenv/vite-plugin@0.0.12...@arkenv/vite-plugin@0.0.13)

##### Patch Changes

- #### Support Vite 2.x
*[`#212`](https://redirect.github.com/yamcodes/arkenv/pull/212)
[`bfe08f6`](https://redirect.github.com/yamcodes/arkenv/commit/bfe08f6d9f21352186420f0f68611840e164da52)
[@&#8203;yamcodes](https://redirect.github.com/yamcodes)*

Extended the supported Vite versions to include **2.9.18** through
**7.x** (inclusive).

Also, we've added the `vite-plugin` keyword to the `package.json`, and a
section in the `README.md` explaining why this plugin is a Vite only
plugin (and not a Rollup plugin).

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

<small>


[`e554e2b`](https://redirect.github.com/yamcodes/arkenv/commit/e554e2b41aab1b8e29d873982ea587c069f4732d)

</small>

- `arkenv@0.7.3`

</details>

###
[`v0.0.12`](https://redirect.github.com/yamcodes/arkenv/releases/tag/%40arkenv/vite-plugin%400.0.12)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/@arkenv/vite-plugin@0.0.11...@arkenv/vite-plugin@0.0.12)

##### Patch Changes

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

<small>


[`e50dba1`](https://redirect.github.com/yamcodes/arkenv/commit/e50dba1f19418f8fc007dc786df1172067e3d07c)

</small>

- `arkenv@0.7.2`

</details>

###
[`v0.0.11`](https://redirect.github.com/yamcodes/arkenv/releases/tag/%40arkenv/vite-plugin%400.0.11)

[Compare
Source](https://redirect.github.com/yamcodes/arkenv/compare/@arkenv/vite-plugin@0.0.10...@arkenv/vite-plugin@0.0.11)

##### Patch Changes

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

<small>


[`221f9ef`](https://redirect.github.com/yamcodes/arkenv/commit/221f9efdef65691b0c5155b12ec460404dddbe82)
[`221f9ef`](https://redirect.github.com/yamcodes/arkenv/commit/221f9efdef65691b0c5155b12ec460404dddbe82)

</small>

- `arkenv@0.7.1`

</details>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on friday" (UTC), 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.

---

- [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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 Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Vite 2.x and up

1 participant