Skip to content

feat: Make env/internal/shared.ts optional in strict layout (dev/v0)#1503

Merged
yamcodes merged 1 commit into
devfrom
1448-make-envinternalsharedts-optional-in-strict-layout-devv0
Jul 25, 2026
Merged

feat: Make env/internal/shared.ts optional in strict layout (dev/v0)#1503
yamcodes merged 1 commit into
devfrom
1448-make-envinternalsharedts-optional-in-strict-layout-devv0

Conversation

@yamcodes

Copy link
Copy Markdown
Owner

Fixes #1448

Summary

  • Strict layout auto-detect and findSchemaPath now treat client.ts + server.ts as enough; internal/shared.ts is optional (empty when absent)
  • Explicit layout: "strict" only requires client.ts
  • Docs updated to describe shared as optional; CLI still scaffolds it by default

Test plan

  • Confirm pnpm run typecheck / pnpm run test -- --run / pnpm run fix pass
  • Strict env/ with only client.ts + server.ts auto-detects as strict
  • layout: "strict" succeeds without internal/shared.ts
  • CLI init --strict still scaffolds shared.ts

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@yamcodes yamcodes linked an issue Jul 25, 2026 that may be closed by this pull request
4 tasks
@yamcodes yamcodes added docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement www Improvements or additions to arkenv.js.org @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI @arkenv/nextjs Issues or Pull Requests involving the Next.js integration for ArkEnv @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv labels Jul 25, 2026
@changeset-bot

changeset-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8884fae

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

This PR includes changesets to release 4 packages
Name Type
@arkenv/build Patch
@arkenv/nextjs Patch
@arkenv/nuxt Patch
@arkenv/bun-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 tests This issue or PR is about adding, removing or changing tests and removed @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI labels Jul 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

arkenv

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

@arkenv/build

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

@arkenv/bun-plugin

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

@arkenv/cli

npm i https://pkg.pr.new/@arkenv/cli@1503

@arkenv/fumadocs-ui

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

@arkenv/nextjs

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

@arkenv/nuxt

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

@arkenv/vite-plugin

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

commit: 8884fae

@arkenv-bot

arkenv-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Limit Diff Status
@arkenv/nextjs 1.32 kB 2.93 kB 0.0%
@arkenv/nextjs/shared 1.15 kB 1.46 kB 0.0%
@arkenv/nextjs/server 1.21 kB 1.95 kB 0.0%
@arkenv/nextjs/client 1.21 kB 1.95 kB 0.0%
@arkenv/nextjs/config 3.55 kB 3.91 kB -0.3%

All size limits passed!

@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.

✅ No new issues found.

Reviewed changes — makes env/internal/shared.ts optional in strict layout by extracting a shared isStrictLayoutDir() helper and relaxing the auto-detection and explicit-validation checks to require only client.ts + server.ts.

  • Extract isStrictLayoutDir() — new exported function in packages/build/src/index.ts that checks for client.ts + server.ts without touching shared.ts. Replaces the old inline checkStrict closure at all 4 call sites.
  • Relax resolveLayout explicit validationlayout: "strict" now only requires client.ts to exist; the sharedPath check is removed. Error message updated accordingly.
  • Update findSchemaPath — uses isStrictLayoutDir() so directories without shared.ts are discovered as strict layouts.
  • Documentation updates — Next.js and Nuxt strict-layout docs, plus JSDoc on both ArkEnvConfigOptions.layout types now describe shared.ts as optional.
  • Tests — 4 new tests in packages/build/src/index.test.ts covering auto-detection, findSchemaPath, and explicit-strict-without-client error path.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (GPT Sol not used — the program covers this model; add its provider key to run your pick) | 𝕏

@yamcodes
yamcodes merged commit 0b17e32 into dev Jul 25, 2026
24 checks passed
@yamcodes
yamcodes deleted the 1448-make-envinternalsharedts-optional-in-strict-layout-devv0 branch July 25, 2026 14:35
@arkenv-bot arkenv-bot Bot mentioned this pull request Jul 25, 2026
cursor Bot pushed a commit that referenced this pull request Jul 25, 2026
Drop internal aliases/stub wording; keep the usage-first tone from the
changeset skill and the original #1503 notes.

Co-authored-by: Yam Borodetsky <hi@yam.codes>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@arkenv/nextjs Issues or Pull Requests involving the Next.js integration for ArkEnv @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 enhancement New feature or improvement tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make env/internal/shared.ts optional in strict layout (dev/v0)

1 participant