fix: (v1) Remove framework /shared exports; keep /client and /server for strict layout#1297
Conversation
🦋 Changeset detectedLatest commit: fbfecc5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
arkenv
@arkenv/build
@arkenv/bun-plugin
@arkenv/core
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/nuxt
@arkenv/standard
@arkenv/vite-plugin
commit: |
📦 Bundle Size Report
✅ All size limits passed! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Caution
The new mock-server-only alias target is not emitted in the published build, which breaks strict-layout build-time validation. Details are inline on packages/nextjs/src/config.ts.
Reviewed changes — remove the ./shared subpath exports from @arkenv/nextjs and @arkenv/nuxt so strict-layout internal schema modules import type from core arkenv, while keeping /client and /server unchanged.
- Drop
./sharedexports frompackages/nextjs/package.jsonandpackages/nuxt/package.json(exports and size-limit entries). - Delete
packages/nextjs/src/shared.tsandpackages/nuxt/src/shared.tsand remove them from thetsdownentry arrays. - Update
packages/nextjs/src/config.tsto aliasserver-onlyand./script*to a newmock-server-only.tsstub. - Update docs, examples, playgrounds, CLI templates, and tests to import
typefromarkenvinstead of@arkenv/{nextjs,nuxt}/shared. - Add ADR 0014 documenting the flat versus strict layout import mental model and the export-surface decision.
- Add a major changeset for
@arkenv/nextjsand@arkenv/nuxt.
ℹ️ Dead isShared branch in create-env.ts
Both framework createEnvInternal implementations still branch on context?.isShared, but the only call sites that passed isShared: true were deleted with shared.ts. The branch is now unreachable and should be removed in a follow-up so the internal boundary routing (strictLayout only) stays aligned with the documented mental model.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ The incremental change resolves the missing
mock-server-onlybuild artifact.
Reviewed changes since 742edc0 — one commit that adds src/mock-server-only.ts to the @arkenv/nextjs build entries.
- Add
src/mock-server-only.tstopackages/nextjs/tsdown.config.tsso the jiti alias target is emitted intodist/for published builds.
I verified the build locally: dist/mock-server-only.js, .d.ts, and source maps are now produced alongside the other entry points.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
Reviewed changes — removed the dead
ℹ️ Nitpicks
|
|
Run failed. View the logs →
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop unreachable isShared context handling after removing the /shared subpath entry points, keeping strictLayout-only boundary routing. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove stale shared-entry-point wording from createEnvInternal after dropping the /shared subpath exports. Co-authored-by: Cursor <cursoragent@cursor.com>
v1 still publishes ./standard/shared entry points that rely on isShared context routing. Restore that path while the ArkType ./shared exports remain removed. Co-authored-by: Cursor <cursoragent@cursor.com>
Add vfsRoot, baseUrl, and framework env path mappings so twoslash tests and docs snippets resolve @/env/client and ~~/env/client correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
31977ae to
7071b3c
Compare
…lient-and-server-for-strict-layout
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since 404a44e — the author restored the isShared context routing in both framework arkenvInternal implementations so the ./standard/shared entry points continue to work, added twoslash path aliases for strict-layout documentation snippets, and fixed the test format for the shared schema import assertion.
- Restored
isSharedrouting inpackages/nextjs/src/arkenv-internal.tsandpackages/nuxt/src/arkenv-internal.tsafter temporarily removing it, preserving./standard/sharedbehavior while keeping the ArkType./sharedexports removed. - Added strict-layout path mappings to
apps/www/lib/twoslash-options.tsso documentation snippets resolve@/env/clientand~~/env/clientcorrectly. - Updated
apps/www/lib/twoslash-options.test.tsto pass the twoslash options into the strict-layout resolution cases. - Autofix formatting in
packages/arkenv/src/features/scaffold/planner.test.tsanddocs/adr/0014-framework-subpath-exports.md.
I verified the changes locally: @arkenv/nextjs (66 tests), @arkenv/nuxt (16 tests), and the www twoslash-options test (3 tests) all pass after a fresh pnpm run build:packages.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
Strict-layout fixtures now import type from @arkenv/core and drop the stale @arkenv/nuxt/shared jiti alias pointing at deleted shared.ts. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since 0ef55158 — one commit that updates the Nuxt validation tests after the /shared export removal.
- Update
packages/nuxt/src/validation.test.tsto remove the deleted@arkenv/nuxt/sharedalias and importtypefrom@arkenv/corein the strict-layout fixture snippets.
I verified the Nuxt test suite passes after a fresh pnpm run build:packages.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
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/nextjs@1.0.0-alpha.6 ### Major Changes - #### Remove framework `/shared` subpath exports _[`#1297`](#1297) [`68ed78e`](68ed78e) [@yamcodes](https://github.com/yamcodes)_ Drop the `./shared` export from `@arkenv/nextjs` and `@arkenv/nuxt`. Strict-layout internal schema modules should import `type` from `@arkenv/core` instead. `/client` and `/server` subpath exports are unchanged. **BREAKING CHANGE:** Remove `@arkenv/nextjs/shared` and `@arkenv/nuxt/shared` subpath exports. Migration: ```ts // Before import { type } from "@arkenv/nextjs/shared"; // After import { type } from "@arkenv/core"; ``` Import mental model: - **Flat layout:** `import arkenv from "@arkenv/nextjs"` (or `@arkenv/nuxt`) - **Strict layout:** `@arkenv/nextjs/client` and `@arkenv/nextjs/server` (or Nuxt equivalents) - **Internal schema modules:** `import { type } from "@arkenv/core"` ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`90ac1e1`](90ac1e1) </small> - `@arkenv/build@0.0.2-alpha.0` </details> ## @arkenv/nuxt@1.0.0-alpha.4 ### Major Changes - #### Remove framework `/shared` subpath exports _[`#1297`](#1297) [`68ed78e`](68ed78e) [@yamcodes](https://github.com/yamcodes)_ Drop the `./shared` export from `@arkenv/nextjs` and `@arkenv/nuxt`. Strict-layout internal schema modules should import `type` from `@arkenv/core` instead. `/client` and `/server` subpath exports are unchanged. **BREAKING CHANGE:** Remove `@arkenv/nextjs/shared` and `@arkenv/nuxt/shared` subpath exports. Migration: ```ts // Before import { type } from "@arkenv/nextjs/shared"; // After import { type } from "@arkenv/core"; ``` Import mental model: - **Flat layout:** `import arkenv from "@arkenv/nextjs"` (or `@arkenv/nuxt`) - **Strict layout:** `@arkenv/nextjs/client` and `@arkenv/nextjs/server` (or Nuxt equivalents) - **Internal schema modules:** `import { type } from "@arkenv/core"` ### Minor Changes - #### Align Nuxt flat layout across CLI, examples, and build resolution _[`#1299`](#1299) [`90ac1e1`](90ac1e1) [@yamcodes](https://github.com/yamcodes)_ Forward-port flat layout support for Nuxt on v1 by aligning CLI scaffolding, build-time validation, runtime proxy behavior, and `@arkenv/build` layout resolution. Usage: ```ts // nuxt.config.ts export default defineNuxtConfig({ modules: ["@arkenv/nuxt/module"], arkenv: { layout: "flat" }, }); ``` ```ts // env.ts import arkenv from "@arkenv/nuxt"; export const env = arkenv({ DATABASE_URL: "string", NUXT_PUBLIC_API_URL: "string", NODE_ENV: "'development' | 'production' | 'test' = 'development'", }); ``` - `arkenv` init wizard presents "Flat (Recommended)" for Nuxt and scaffolds a flat `env.ts` - `@arkenv/build` `resolveLayout()` accepts `"flat"` as an alias for the single-file layout mode - Nuxt examples and playgrounds use flat layout conventions ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`90ac1e1`](90ac1e1) </small> - `@arkenv/build@0.0.2-alpha.0` </details> ## arkenv@1.0.0-alpha.4 ### Minor Changes - #### Align Nuxt flat layout across CLI, examples, and build resolution _[`#1299`](#1299) [`90ac1e1`](90ac1e1) [@yamcodes](https://github.com/yamcodes)_ Forward-port flat layout support for Nuxt on v1 by aligning CLI scaffolding, build-time validation, runtime proxy behavior, and `@arkenv/build` layout resolution. Usage: ```ts // nuxt.config.ts export default defineNuxtConfig({ modules: ["@arkenv/nuxt/module"], arkenv: { layout: "flat" }, }); ``` ```ts // env.ts import arkenv from "@arkenv/nuxt"; export const env = arkenv({ DATABASE_URL: "string", NUXT_PUBLIC_API_URL: "string", NODE_ENV: "'development' | 'production' | 'test' = 'development'", }); ``` - `arkenv` init wizard presents "Flat (Recommended)" for Nuxt and scaffolds a flat `env.ts` - `@arkenv/build` `resolveLayout()` accepts `"flat"` as an alias for the single-file layout mode - Nuxt examples and playgrounds use flat layout conventions ### Patch Changes - #### Generate `.env` and `.env.example` files and configure pnpm approved builds whitelisting during initialization _[`#1292`](#1292) [`3cdbac9`](3cdbac9) [@yamcodes](https://github.com/yamcodes)_ - Generate default `.env` and `.env.example` files during initialization if they do not exist to prevent Node/tsx `--env-file` boot crashes. - Parse existing `.env` file and securely strip all values to generate `.env.example` when `.env.example` is missing to avoid leaking user credentials to source control. - Automatically check and update `.gitignore` in existing projects to ignore `.env` and `.env.local` files. - Skip overwriting pre-existing files when their scaffolding action is set to `"create"`. - Configure pnpm build whitelisting for `esbuild` during project scaffolding if `pnpm` is the detected package manager. This writes the `onlyBuiltDependencies` field to `package.json` and creates or updates a `pnpm-workspace.yaml` file with the `allowBuilds` configuration before running the installation phase. - Add a runtime guardrail to throw a friendly error when the CLI is imported as a library to guide upgrading library users to `@arkenv/core`. ## @arkenv/build@0.0.2-alpha.0 ### Patch Changes - #### Align Nuxt flat layout across CLI, examples, and build resolution _[`#1299`](#1299) [`90ac1e1`](90ac1e1) [@yamcodes](https://github.com/yamcodes)_ Forward-port flat layout support for Nuxt on v1 by aligning CLI scaffolding, build-time validation, runtime proxy behavior, and `@arkenv/build` layout resolution. Usage: ```ts // nuxt.config.ts export default defineNuxtConfig({ modules: ["@arkenv/nuxt/module"], arkenv: { layout: "flat" }, }); ``` ```ts // env.ts import arkenv from "@arkenv/nuxt"; export const env = arkenv({ DATABASE_URL: "string", NUXT_PUBLIC_API_URL: "string", NODE_ENV: "'development' | 'production' | 'test' = 'development'", }); ``` - `arkenv` init wizard presents "Flat (Recommended)" for Nuxt and scaffolds a flat `env.ts` - `@arkenv/build` `resolveLayout()` accepts `"flat"` as an alias for the single-file layout mode - Nuxt examples and playgrounds use flat layout conventions --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

Fixes #1296
Remove the
./sharedsubpath export from@arkenv/nextjsand@arkenv/nuxt. Strict-layout internal schema modules now importtypefrom corearkenv./clientand/serversubpath exports are unchanged.Changes
packages/nextjs/src/shared.tsandpackages/nuxt/src/shared.ts./sharedfrom package exports and size-limit configsTest plan
pnpm run typecheckpnpm run test(758 tests passed)pnpm run fixMade with Cursor