Skip to content

fix: Stop probing env/server.ts in CLI schema discovery - #1925

Merged
yamcodes merged 4 commits into
v1from
cursor/stop-probing-env-server-f30c
Sep 21, 2026
Merged

yamcodes merged 4 commits into
v1from
cursor/stop-probing-env-server-f30c

Conversation

@yamcodes

@yamcodes yamcodes commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1913

Summary

CLI schema discovery no longer auto-picks leftover strict-layout filenames (env/server.ts, src/env/server.ts). Discovery stays --schema → flat convention only (env.ts, src/env.ts, and related extensions), matching ADR 0020.

Split-recipe projects keep working by pointing --schema at a loadable module (typically the client schema or a flat env.ts). Server modules that import server-only cannot be evaluated by the CLI's plain-Node Jiti loader.

Changes

  • Remove env/server.ts / src/env/server.ts from resolveSchemaPath candidates
  • Unit + integration tests for ignored leftovers, flat convention (incl. .mjs), and --schema escape hatch
  • Clarify flat-only discovery in reference/check.mdx, ADR 0033, and the ArkEnv skill
  • Major changeset on arkenv with migration note (client/flat target; server-only caveat)

Duplicate handling

Absorbed ADR/skill/docs notes from parallel #1921 (closed as duplicate). Surviving PR for this cleanup.

Review follow-up

  • Migration/check docs no longer recommend --schema env/server.ts when that file imports server-only

Rebase

Rebased onto latest v1 (resolved skills/arkenv/SKILL.md conflict with collapsed --preset from #1927).

Validation

  • Focused resolve-schema-path tests pass after rebase
  • Full CI pending after conflict resolution

Test plan

  • Unit tests assert env/server.ts / src/env/server.ts alone are not discovered
  • Flat env.ts / src/env.mjs and explicit --schema still resolve
  • Integration: only env/server.ts present → exit 2 / CLI.SCHEMA_NOT_FOUND
Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 52c3bdd

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

This PR includes changesets to release 1 package
Name Type
arkenv Major

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/cli Issues or Pull Requests involving the ArkEnv CLI 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 tests This issue or PR is about adding, removing or changing tests labels Sep 21, 2026 — with Cursor
@github-actions github-actions Bot added www Improvements or additions to arkenv.js.org and removed @arkenv/cli Issues or Pull Requests involving the ArkEnv CLI 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@1925

arkenv

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

@arkenv/build

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

@arkenv/bun-plugin

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

@arkenv/core

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

@arkenv/fumadocs-ui

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

@arkenv/nextjs

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

@arkenv/nuxt

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

@arkenv/rsbuild-plugin

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

@arkenv/standard

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

@arkenv/tanstack-addon

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

@arkenv/vite-plugin

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

commit: 52c3bdd

@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 critical issues — one migration-guidance note inline.

Reviewed changes

  • Drop strict-layout leftovers — resolveSchemaPath no longer lists env/server.ts or src/env/server.ts, so discovery is --schema → flat convention only. The scanner suggestion path is untouched and never returns a /server filename, so the removal is sufficient.
  • Unit coverage — six new cases in resolve-schema-path.test.ts pin both leftovers to undefined, keep flat env.ts / src/env.ts, verify --schema ./env/server.ts still resolves (and skips the scanner), and confirm flat wins over a leftover sibling. These fail with the bug present, so they are real coverage.
  • Integration coverage — check.test.ts asserts exit 2 + CLI.SCHEMA_NOT_FOUND when only env/server.ts exists; with the candidates still in place that path would load and return 0/4, so the assertion is meaningful.
  • Docs + changeset — reference/check.mdx now states flat-only discovery and that env/server.ts needs --schema; the arkenv major changeset matches the sibling #1906 changeset convention.

Note on verification: resolve-schema-path.test.ts passes here (9/9). check.test.ts cannot load in this environment (pre-existing @arkenv/core resolution failure under Jiti, unrelated to this diff), so I read the assertions rather than relying on the run.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread .changeset/stop-probing-env-server.md Resolved

@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

Docs-only delta since the prior pullfrog review (86d9bb0 → 6bd0cb0); no product code or tests changed.

  • Migration guidance retargeted — the changeset now points --schema at a loadable module (env/client.ts) and warns that a server module importing server-only throws under the CLI's plain-Node Jiti loader. This resolves the prior inline concern.
  • Flat-only discovery wording propagated — reference/check.mdx, ADR 0033, and the resolveSchemaPath JSDoc now state discovery is --schema → flat convention only, and name the loadable-module escape hatch for split recipes.
  • Skill alignment — skills/arkenv/SKILL.md describes discovery as --schema plus flat convention paths, excluding leftover split-layout filenames such as env/server.ts.
  • Test housekeeping — check.test.ts builds the leftover path with path.join (cross-platform), and resolve-schema-path.test.ts covers flat src/env.mjs alongside the leftover and explicit --schema cases.

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

cursoragent and others added 4 commits September 21, 2026 10:24
Remove leftover strict-layout convention candidates so discovery is
flat-only. Split recipes keep working via --schema. Fixes #1913.

Co-authored-by: Yam Borodetsky <[email protected]>
Port flat-only discovery language into ADR 0033 and the ArkEnv skill,
and align docs/changeset/tests with the parallel implementation.

Co-authored-by: Yam Borodetsky <[email protected]>
Migration and docs no longer recommend checking env/server.ts when it
imports server-only; the CLI loads schemas in plain Node via Jiti.

Co-authored-by: Yam Borodetsky <[email protected]>
Rebase onto v1 left unresolved markers in skills/arkenv/SKILL.md;
keep collapsed --preset wording and flat-only discovery note.

Co-authored-by: Yam Borodetsky <[email protected]>
@cursor
cursor Bot force-pushed the cursor/stop-probing-env-server-f30c branch from 6bd0cb0 to 52c3bdd Compare September 21, 2026 10:25
@yamcodes
yamcodes merged commit 53098ef into v1 Sep 21, 2026
19 checks passed
@yamcodes
yamcodes deleted the cursor/stop-probing-env-server-f30c branch September 21, 2026 10:37
@arkenv-bot arkenv-bot Bot mentioned this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Stop probing env/server.ts in CLI schema discovery

2 participants