Repository navigation
fix: Stop probing env/server.ts in CLI schema discovery - #1925
Conversation
🦋 Changeset detectedLatest commit: 52c3bdd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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: |
There was a problem hiding this comment.
ℹ️ No critical issues — one migration-guidance note inline.
Reviewed changes
- Drop strict-layout leftovers —
resolveSchemaPathno longer listsenv/server.tsorsrc/env/server.ts, so discovery is--schema→ flat convention only. The scanner suggestion path is untouched and never returns a/serverfilename, so the removal is sufficient. - Unit coverage — six new cases in
resolve-schema-path.test.tspin both leftovers toundefined, keep flatenv.ts/src/env.ts, verify--schema ./env/server.tsstill 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.tsasserts exit2+CLI.SCHEMA_NOT_FOUNDwhen onlyenv/server.tsexists; with the candidates still in place that path would load and return0/4, so the assertion is meaningful. - Docs + changeset —
reference/check.mdxnow states flat-only discovery and thatenv/server.tsneeds--schema; thearkenvmajor 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.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ 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
--schemaat a loadable module (env/client.ts) and warns that a server module importingserver-onlythrows 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 theresolveSchemaPathJSDoc now state discovery is--schema→ flat convention only, and name the loadable-module escape hatch for split recipes. - Skill alignment —
skills/arkenv/SKILL.mddescribes discovery as--schemaplus flat convention paths, excluding leftover split-layout filenames such asenv/server.ts. - Test housekeeping —
check.test.tsbuilds the leftover path withpath.join(cross-platform), andresolve-schema-path.test.tscovers flatsrc/env.mjsalongside the leftover and explicit--schemacases.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
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]>
6bd0cb0 to
52c3bdd
Compare

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
--schemaat a loadable module (typically the client schema or a flatenv.ts). Server modules that importserver-onlycannot be evaluated by the CLI's plain-Node Jiti loader.Changes
env/server.ts/src/env/server.tsfromresolveSchemaPathcandidates.mjs), and--schemaescape hatchreference/check.mdx, ADR 0033, and the ArkEnv skillarkenvwith migration note (client/flat target;server-onlycaveat)Duplicate handling
Absorbed ADR/skill/docs notes from parallel #1921 (closed as duplicate). Surviving PR for this cleanup.
Review follow-up
checkdocs no longer recommend--schema env/server.tswhen that file importsserver-onlyRebase
Rebased onto latest
v1(resolvedskills/arkenv/SKILL.mdconflict with collapsed--presetfrom #1927).Validation
resolve-schema-pathtests pass after rebaseTest plan
env/server.ts/src/env/server.tsalone are not discoveredenv.ts/src/env.mjsand explicit--schemastill resolveenv/server.tspresent → exit2/CLI.SCHEMA_NOT_FOUND