feat: remove CLI package.json "arkenv" schema pointer - #1909
Conversation
Stop writing and reading package.json "arkenv" for schema discovery. CLI location is --schema then convention paths only (fixes #1906). Co-authored-by: Yam Borodetsky <hi@yam.codes>
🦋 Changeset detectedLatest commit: f230bdc 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: |
Tighten the scaffold assertion so pnpm-only package.json writes still pass, and apply biome formatting from validation. Co-authored-by: Yam Borodetsky <hi@yam.codes>
There was a problem hiding this comment.
Important
The new executor.test.ts case fails on this branch (expected [ [ 'package.json', … ] ] to have a length of +0 but got 1), so the unit-test check will be red until it is fixed.
Reviewed changes
- CLI schema discovery:
resolveSchemaPathnow resolves only--schema/-s→ convention candidates; thepackage.json"arkenv"read and theProjectScannerPort.readArkenvConfigport/adapter method are removed. - Scaffold cleanup:
Executor.configurePackageJsonArkenvand its call site are gone, soarkenv initno longer writes the pointer (configurePnpmBuildsstill rewritespackage.jsonfor pnpm whitelisting). - Docs & glossary:
checkreference, migrating-to-v1, new ADR 0033,docs/CONTEXT.md"Schema location", the ADR index row, andskills/arkenv/SKILL.mdall describe--schema+ convention only. - Tests: new coverage for convention discovery,
--schema, ignored leftover pointer, and no pointer write on init — but one case cannot pass as written (inline). - Changeset: major for
arkenvwith a--schemamigration snippet.
ℹ️ Nitpicks
ProjectScannerPort.findPackageJson(packages/arkenv/src/shared/ports/project-scanner.port.ts:109) and itsNodeProjectScannerAdapterimplementation lost their only caller withreadArkenvConfig; they are now unused and could be removed in the same cleanup.- The new row in
docs/adr/README.md:39is padded to the old column width, so the "CLI / scaffold IR" row no longer aligns with the rest of the table.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Use an npm scaffold plan so the no-pointer assertion is exact, drop the vacuous scanner mock check, and remove unused findPackageJson. Co-authored-by: Yam Borodetsky <hi@yam.codes>
There was a problem hiding this comment.
ℹ️ No new issues from the follow-up commits. The prior blocking test failure is fixed and verified; one minor prior test-quality note remains open.
Reviewed changes (since a01634a)
- Prior blocking finding fixed:
executor.test.tsnow parses eachpackage.jsonwrite and asserts the parsed object has noarkenvproperty, instead of requiring zero writes — so the legitimate pnpm whitelisting rewrite no longer trips the test.executor.test.tsandresolve-schema-path.test.tspass locally (21 tests). - ADR index alignment: the "CLI / scaffold IR" row in
docs/adr/README.mdis re-padded to the table width. - Formatting: Biome autofix on
help.tsandresolve-schema-path.test.ts(line wrapping only).
The unaddressed thread at packages/arkenv/src/features/schema-loader/resolve-schema-path.test.ts:54-57 (tautological assertion) remains open and is non-blocking.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. All prior feedback is addressed.
Reviewed changes (since 8f4a79c)
- Executor no-write test: now runs an
npminstall plan soconfigurePnpmBuildscannot rewritepackage.json, and asserts zeropackage.jsonwrites — restoring the exact assertion. Verified passing. resolveSchemaPathtest: the vacuous"readArkenvConfig" in scannercheck is replaced by a real convention-preference assertion (env.tsover an off-convention sibling). Verified passing.- Dead code removed:
ProjectScannerPort.findPackageJsonand itsNodeProjectScannerAdapterimplementation are deleted (the port now ends atcheckGitStatus); a repo-wide grep forreadArkenvConfig|findPackageJsonreturns nothing, andtsc --noEmitforpackages/arkenvis clean.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Fixes #1906
Summary
Removes the CLI
package.json"arkenv"schema pointer (Option B, locked on the issue). Schema discovery is now--schema/-s→ convention paths only. Leftover"arkenv"keys are ignored.Changes
init; stop reading it inresolveSchemaPath; dropreadArkenvConfigand unusedfindPackageJsonfrom the project scanner port/adaptercheckreference and migrating-to-v1; add ADR 0033; glossary + ArkEnv skill alignment--schema/ ignored leftover field / no write-on-init (npm plan so pnpm whitelisting does not rewritepackage.json)arkenvwith migration to--schemaMigration
{ "scripts": { "check": "arkenv check --schema config/env.ts" } }Review follow-ups
npminstall plan so the no-pointer assertion is exactresolveSchemaPathunit test asserts convention preference instead of a vacuous mock checkfindPackageJsonafterreadArkenvConfigremoval