feat: (v1) Make env/internal/shared.ts optional in strict layout#1505
Conversation
🦋 Changeset detectedLatest commit: 5033c4f The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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: |
Align assertFlatSchemaFile prefixes with host missing-schema errors and restore a typed guard for registerStrictLayoutHooks. Co-authored-by: Yam Borodetsky <hi@yam.codes>
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>
Co-authored-by: Yam Borodetsky <hi@yam.codes>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — makes env/internal/shared.ts optional in strict layout across all integrations, forward-porting the same change from dev (#1503). Auto-detection and explicit layout: "strict" now require only client.ts + server.ts; shared keys are treated as empty when the file is absent.
- Relax strict-layout
isStrictLayoutDirandfindSchemaPath— core auto-detection now treatsclient.ts+server.tsas sufficient;internal/shared.tsis optional. - New
assertFlatSchemaFileshared guard — Vite and Bun plugins reject discovered strict directories with a clear host-specific diagnostic instead of reading a directory as a module. - Nuxt missing-shared fallback — absent
env/internal/shared.tsaliases to the existingempty-shared-schemastub; present file withoutSharedSchemastill fails with a clear diagnostic. - Next.js JSDoc only — codegen already handled missing shared with an empty-string fallback.
- Docs and changeset — strict layout pages for Next.js and Nuxt updated; patch bump for all 5 affected packages.
DeepSeek Pro (free via Pullfrog for OSS) (GPT Sol not used — the program covers this model; add its provider key to run your pick) | 𝕏

Fixes #1449
Forward-port of #1503 / #1448
Summary
@arkenv/build: strict auto-detect /findSchemaPathtreatclient.ts+server.tsas enough;internal/shared.tsoptional (empty when absent). Explicitlayout: "strict"only requiresclient.ts. SharedisStrictLayoutDir+assertFlatSchemaFilekeep host integrations DRY.@arkenv/nuxt: missing shared aliases#arkenv/shared-schematoempty-shared-schema(same stub as non-strict); present file without usableSharedSchemastill fails.@arkenv/nextjs: codegen already treated missing shared as empty; JSDoc + docs updated.@arkenv/vite-plugin/@arkenv/bun-plugin: flat-only; reject a discovered strictenv/directory viaassertFlatSchemaFileinstead of reading a directory as a module.shared.tsby default.Test plan
@arkenv/build,nextjs,nuxt,vite-plugin,bun-plugin)env/with onlyclient.ts+server.tsauto-detects as strictinternal/shared.ts(empty auto-extend)SharedSchemaexport still failsinit --strictstill scaffoldsshared.ts