Repository navigation
Conversation
Flat arkenv(schema, { exposeToClient }) is the only supported shape.
Nested bags and option aliases now fail with a migration error.
Co-authored-by: Yam Borodetsky <[email protected]>
🦋 Changeset detectedLatest commit: fb6663b The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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/agent-plugin
arkenv
@arkenv/build
@arkenv/bun-plugin
@arkenv/core
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/nuxt
@arkenv/rsbuild-plugin
@arkenv/standard
@arkenv/tanstack-addon
@arkenv/vite-plugin
commit: |
Align @ts-expect-error placement with flat-only signatures and apply formatter fixes from biome. Co-authored-by: Yam Borodetsky <[email protected]>
Deduplicate the Next/Nuxt/build helpers into @repo/utils/nested-bag-migration-error (from PR #1928), keeping value-aware detection so flat keys named server are not misclassified. Co-authored-by: Yam Borodetsky <[email protected]>
|
Closing as a duplicate of #1929 (same nested-bag / #1929 absorbed the useful bit from this PR — the shared |
There was a problem hiding this comment.
ℹ️ No critical issues — the removal is complete and internally consistent. A couple of stale references and small rough edges below.
Reviewed changes
- Nested bag overloads removed —
@arkenv/nextjsand@arkenv/nuxt(ArkType + Standard) accept onlyarkenv(schema, options); legacy bags and boolean second args throw the shared migration error from the new@repo/utils/nested-bag-migration-errorhelper. expose/sharedaliases dropped — flat options and Next.js codegen readexposeToClientonly; type-level tests assert the aliases are rejected.@arkenv/buildflattened —extractKeysdropsisLegacyand throws on nested bags,generateFactoryCodeis deleted, and codegen always emits the flat factory.- Tests and migration guide updated — nested success tests become flat success + legacy-rejection coverage;
migrating-to-v1.mdxmoves these APIs from Deprecated to Removed; breaking changeset for@arkenv/nextjs,@arkenv/nuxt,@arkenv/build.
ℹ️ Example and playground READMEs still document the removed nested schema
examples/with-nextjs/README.md and apps/playgrounds/nextjs/README.md both present arkenv({ server, client, shared }) as the setup, even though their own env.ts files are already flat. Anyone copying the README now hits the migration throw.
Technical details
# Stale nested-API references
## Affected sites
- `examples/with-nextjs/README.md:16` — `env.ts` snippet uses `server` / `client` / `shared` buckets
- `apps/playgrounds/nextjs/README.md:16` — identical snippet
- `docs/design/v0-parity-audit.md:52` — table row still says nested "Still works on Next/Nuxt; migrate to flat + `exposeToClient`"
## Required outcome
- Both README snippets match the flat `env.ts` (drop the buckets; note `NEXT_PUBLIC_` auto-exposure).
- The parity-audit row reflects removal.ℹ️ Nitpicks
packages/internal/utils/src/utils/nested-bag-migration-error.ts:31— a boolean second argument yields the nested-bag message even when no bag was passed; the wording could mention the removed booleanisServerflag.packages/nextjs/src/index.ts:65,packages/nextjs/src/react-server.ts:37, andpackages/nextjs/src/standard/index.ts:47callassertNotNestedBagimmediately beforearkenvInternal, which asserts again — harmless but redundant.- The removed
expose/sharedoption aliases are silently ignored at runtime (tests pin this) while the nested bag throws; untyped callers get no migration signal.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (incremental)
fb6663b6—[autofix.ci] apply automated fixes— only whitespace/formatting inapps/www/content/docs/guides/migrating-to-v1.mdx(a blank line before the changelog note and spacing in the Removed APIs list). The sentence reads correctly in full; no behavioral change.
Prior feedback still stands: examples/with-nextjs/README.md, apps/playgrounds/nextjs/README.md, and docs/design/v0-parity-audit.md still document the removed nested schema.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Fixes #1915
Removes the legacy nested
arkenv({ server, client, shared, runtimeEnv })overload and theexpose/sharedoption aliases from@arkenv/nextjsand@arkenv/nuxt. Flatarkenv(schema, { exposeToClient })is the only supported path.Changes
@arkenv/buildextractKeysand Next codegen to flat-only (exposeToClientonly)@arkenv/nextjs,@arkenv/nuxt, and@arkenv/buildMigration
Validation
@repo/utils,@arkenv/build,@arkenv/nextjs,@arkenv/nuxt, and deps)issue-1915-validation.log
To show artifacts inline, enable in settings.