Skip to content

fix: Forward-port Nuxt proxy coercion lock from #1420 - #1429

Merged
yamcodes merged 3 commits into
v1from
cursor/forward-port-nuxt-proxy-coercion-61e0
Jul 20, 2026
Merged

fix: Forward-port Nuxt proxy coercion lock from #1420#1429
yamcodes merged 3 commits into
v1from
cursor/forward-port-nuxt-proxy-coercion-61e0

Conversation

@yamcodes

Copy link
Copy Markdown
Owner

Summary

  • Forward-ports #1420 / #1327 from dev onto v1
  • On v1, createSecurityProxy in arkenv-internal.ts already preferred the coerced validation target (the get-time runtimeConfig / process.env / __NUXT__ preference bug never landed here). This port locks that invariant with ADR 0015 docs comments and coercion regression tests.
  • Adds a patch changeset for @arkenv/nuxt (v1+ bump rules)

Notes

Test plan

  • pnpm --filter @arkenv/nuxt exec vitest run src/index.test.ts (7 passed)
  • pnpm --filter @arkenv/nuxt typecheck
Open in Web Open in Cursor 

Document that the security proxy serves the coerced validation target,
and add regression tests for process.env / __NUXT__ number|boolean reads.

Co-authored-by: Yam Borodetsky <hi@yam.codes>
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4028851

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

This PR includes changesets to release 1 package
Name Type
@arkenv/nuxt 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 tests This issue or PR is about adding, removing or changing tests @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv labels Jul 20, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

arkenv

npm i https://pkg.pr.new/arkenv@1429

@arkenv/build

npm i https://pkg.pr.new/@arkenv/build@1429

@arkenv/bun-plugin

npm i https://pkg.pr.new/@arkenv/bun-plugin@1429

@arkenv/core

npm i https://pkg.pr.new/@arkenv/core@1429

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/@arkenv/fumadocs-ui@1429

@arkenv/nextjs

npm i https://pkg.pr.new/@arkenv/nextjs@1429

@arkenv/nuxt

npm i https://pkg.pr.new/@arkenv/nuxt@1429

@arkenv/standard

npm i https://pkg.pr.new/@arkenv/standard@1429

@arkenv/vite-plugin

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

commit: 4028851

@yamcodes
yamcodes marked this pull request as ready for review July 20, 2026 20:23

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

One stale ADR reference in the new comments points to the wrong architectural record on v1. Details inline.

Reviewed changes — Forward-port of the Nuxt proxy coercion-lock from #1420 to v1: adds a patch changeset for @arkenv/nuxt, documents in arkenv-internal.ts that the security proxy must serve the coerced validation target, and adds regression tests for server and client coercion paths.

  • Add changeset describing the coercion-through-proxy guarantee for @arkenv/nuxt.
  • Document the proxy contract in arkenv-internal.ts with inline comments and JSDoc parameters for createSecurityProxy.
  • Add regression tests asserting that number/boolean values stay coerced when sourced from process.env (server) and __NUXT__.config.public (client).

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread packages/nuxt/src/arkenv-internal.ts Outdated
cursoragent and others added 2 commits July 20, 2026 20:33
On v1, ADR 0015 is nextjs-conditional-exports-boundary, not the
env-object-canonical-surface decision from dev.

Co-authored-by: Yam Borodetsky <hi@yam.codes>
@yamcodes
yamcodes merged commit 6be63f7 into v1 Jul 20, 2026
19 checks passed
@yamcodes
yamcodes deleted the cursor/forward-port-nuxt-proxy-coercion-61e0 branch July 20, 2026 21:03
@arkenv-bot arkenv-bot Bot mentioned this pull request Jul 20, 2026
yamcodes pushed a commit that referenced this pull request Jul 20, 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 v1, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`v1` is currently in **pre mode** so this branch has prereleases rather
than normal releases. If you want to exit prereleases, run `changeset
pre exit` on `v1`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## arkenv@1.0.0-alpha.9

### Minor Changes

- #### Add `add host` command to CLI for adding hosting presets to
existing schemas
_[`#1419`](#1419)
[`0a559ce`](0a559ce)
[@yamcodes](https://github.com/yamcodes)_

Support adding a hosting provider preset (Vercel or Netlify) to an
existing `env.ts` configuration file:

  ```bash
  npx arkenv@alpha add host [provider]
  ```

- Prompts interactively to select Vercel or Netlify if the provider is
omitted.
- Auto-detects the framework (Next.js, Nuxt, Vite, Bun) and the
validator engine (Zod, Valibot, or ArkType) to inject the preset fields
with the correct syntax.
- Fallback to logging the generated variable schemas to stdout with
manual configuration instructions if `env.ts` is missing or unparseable.
## @arkenv/nuxt@1.0.0-alpha.9

### Patch Changes

- #### Keep coerced number and boolean env values through the security
proxy _[`#1429`](#1429)
[`6be63f7`](6be63f7)
[@yamcodes](https://github.com/yamcodes)_

Lock the Nuxt security proxy so schema-key reads return the coerced
validation target. A key declared as `"number"` or `"boolean"` returns a
number or boolean at runtime, not a raw string from Nuxt runtime config
/ `__NUXT__`.

  ```ts
  import { arkenv } from "@arkenv/nuxt";

  export const env = arkenv({
    NUXT_PUBLIC_PORT: "number",
    PORT: "number",
  });

  // 3000 (number), not "3000" (string)
  env.NUXT_PUBLIC_PORT;
  env.PORT;
  ```

Co-authored-by: github-actions[bot] <41898282+github-actions[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/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv docs Adds or changes documentation, or acts as documentation in and of itself tests This issue or PR is about adding, removing or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants