Skip to content

feat: Remove reserved safe?: false from ArkEnvConfig - #1923

Closed
yamcodes wants to merge 2 commits into
v1from
cursor/remove-reserved-safe-false-c458
Closed

yamcodes wants to merge 2 commits into
v1from
cursor/remove-reserved-safe-false-c458

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1917

Removes the reserved phantom safe?: false field from public main-factory config types (ArkEnvConfig / StandardEnvConfig / ParseStandardConfig). Safe-mode remains available only via @arkenv/core/safe and @arkenv/standard/safe.

Changes

  • Drop safe?: false from core, standard, and shared parse-standard config types
  • Collapse now-noop Omit<..., "safe"> wrappers in /safe entry points and plugin factory configs
  • Update options / validators / plugin docs so reserved safe is no longer listed
  • Add type-regression coverage that safe is not a config property
  • Major changeset for the type break (migration: delete safe: false from call sites)

Out of scope

  • /safe behavior and return shape
  • Nested bag / ArkEnvScript / CLI discovery

Validation

  • pnpm run typecheck — pass
  • pnpm run check / pnpm run fix — pass
  • Core + standard unit/type-regression tests — pass
  • Full pnpm run test locally hit unrelated env-resolution flakes in vite-plugin temp fixtures and one CLI check exit-code assertion; relying on CI for the authoritative suite
Open in Web Open in Cursor 

Delete the phantom safe option from public config types so /safe
subpaths remain the only safe-mode entry points. Fixes #1917.

Co-authored-by: Yam Borodetsky <[email protected]>
@changeset-bot

changeset-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3fb5ca6

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

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@yamcodes yamcodes added @arkenv/standard Issues or Pull Requests involving @arkenv/standard arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement labels Sep 21, 2026 — with Cursor
@github-actions github-actions Bot added @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv www Improvements or additions to arkenv.js.org @arkenv/bun-plugin Issues or Pull Requests involving the Bun plugin for ArkEnv @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv and removed arkenv Changes to the `arkenv` npm package. labels Sep 21, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@arkenv/agent-plugin

npm i https://pkg.pr.new/@arkenv/agent-plugin@1923

arkenv

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

@arkenv/build

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

@arkenv/bun-plugin

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

@arkenv/core

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

@arkenv/fumadocs-ui

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

@arkenv/nextjs

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

@arkenv/nuxt

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

@arkenv/rsbuild-plugin

npm i https://pkg.pr.new/@arkenv/rsbuild-plugin@1923

@arkenv/standard

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

@arkenv/tanstack-addon

npm i https://pkg.pr.new/@arkenv/tanstack-addon@1923

@arkenv/vite-plugin

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

commit: 3fb5ca6

@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

This PR removes the reserved phantom safe?: false field from the public main-factory config types and updates docs, tests, and the changeset to match. Reviewed the full 18-file diff, plus linked issue #1917 and its plan comment.

  • Config types: dropped safe?: false from ArkEnvConfig (packages/core/src/arkenv.ts), ParseStandardConfig (packages/internal/utils/src/parse-standard.ts), and Nuxt's local CoreArkenv type; reworded the recordIfCapturing JSDoc that referenced migrating off { safe: true }.
  • No-op alias collapses: SafeArkenvConfig / SafeStandardEnvConfig and the Vite/Bun/Rsbuild *PluginFactoryConfig types drop their now-redundant Omit<..., "safe"> wrappers (structurally identical, so plugin public shapes are unchanged).
  • StandardEnvConfig: now a plain alias of ParseStandardConfig, with reworded JSDoc.
  • Docs: removed the ### safe section and shared-fields mention in reference/options, relocated the framework-plugins /safe Callout to the section intro, and dropped safe from the validators index, defining-your-schema, and the three plugin reference tables.
  • Tests: added not.toHaveProperty("safe") type-regression guards for ArkEnvConfig and a new packages/standard/src/type-regression.test-d.ts.
  • Changeset: new .changeset/pre/remove-reserved-safe-false.md with major bumps for @arkenv/core and @arkenv/standard and a migration diff.

Verification: turbo run typecheck --filter=@arkenv/core --filter=@arkenv/standard passes (including the new src/*.test-d.ts files). The negative assertion was confirmed to fail (TS2554) when safe is present, so it is a real regression guard rather than theatre. A grep sweep found zero remaining safe?: declarations, Omit<..., "safe"> wrappers, .safe runtime reads, or docs listing safe as a main-factory option. The { safe: true } mentions in docs/CONTEXT.md / ADR 0017 are pre-existing and were already stale before this PR, so they are out of scope here.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@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

Incremental review of the commit pushed after the prior review. Delta since dc5a639:

  • 3fb5ca6 — [autofix.ci] apply automated fixes: cosmetic only. Trimmed the Markdown table column widths in reference/bun-plugin, reference/rsbuild-plugin, and reference/vite-plugin (the Plus row still reads "All ArkEnvConfig fields", no safe), and re-sorted imports in packages/core/src/type-regression.test-d.ts and packages/standard/src/type-regression.test-d.ts.

No semantic or behavioral change in the delta. Re-ran turbo run typecheck --filter=@arkenv/core --filter=@arkenv/standard (pass) and mdxlint over the six changed MDX files (no issues found) at this head.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

cursor Bot pushed a commit that referenced this pull request Sep 21, 2026
Use expectTypeOf.not.toHaveProperty for safe regressions, restore
/safe pointer on StandardEnvConfig JSDoc, and tighten the changeset.

Co-authored-by: Yam Borodetsky <[email protected]>
@cursor

cursor Bot commented Sep 21, 2026

Copy link
Copy Markdown

Closing as a duplicate of #1924 (same change for #1912; #1917 was already closed as a duplicate of that issue).

Useful bits from this PR (cleaner expectTypeOf().not.toHaveProperty("safe") regressions, /safe JSDoc on StandardEnvConfig, tighter changeset prose, and the obsolete { safe: true } JSDoc cleanup) were folded into #1924.

@yamcodes yamcodes closed this Sep 21, 2026
@yamcodes
yamcodes deleted the cursor/remove-reserved-safe-false-c458 branch September 25, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@arkenv/bun-plugin Issues or Pull Requests involving the Bun plugin for ArkEnv @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv @arkenv/standard Issues or Pull Requests involving @arkenv/standard @arkenv/vite-plugin Issues or Pull Requests involving the Vite plugin for ArkEnv 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove reserved safe?: false from ArkEnvConfig

2 participants