refactor(layering): R11 lets test support resolve private siblings through devDependencies
Merged
TH
2h ago+149+149+012345678901234567890123456789-20-20-01234567890123456789
Stacked on #3645 (R83).
What
R11 reads a private package's devDependencies as test-only siblings:
- A test file,
*.spec.*,*.fixtures.*file or test tree (anythingisProductionSourceFilerejects) may import a sibling the package declares only indevDependencies. - Production source still needs the production field (
dependencies, ordevDependenciesfor a published package, which bundles its siblings). A production import of a dev-only sibling gets its own message: declare it independenciesor import it from test support only. - A package's tsconfig
referencesmust name both fields (project-references.test.tsunions them), so a dev-only sibling still builds in order. @agent-device/daemonmoves@agent-device/test-kitfromdependenciestodevDependencies. It declared test-kit as a runtime dependency; nothing in production source imports it (R83 refuses that). The lockfile changes by that one importer move.
Why now: the test-kit single-entry layer needs every test-kit consumer to declare it as a devDependency, and #3638's @agent-device/proxy flip to devDependencies (declared at runtime only because a test imports it) needs this to land first.
Evidence
package-boundaries-dev-dependencies.test.ts: dev-only sibling accepted for.test,.spec,__tests__,.fixturesandtest/files; refused with the dev-only message in production source; refused when undeclared for both; a production declaration serves both; a published package is unchanged.- Gates:
pnpm check:quick,check:layering(367 node tests),check:fallow,check:gate-manifest,check:affected --run(the manifest change fails open to the full gate set, which passed), repo-widepnpm format.
🤖 Generated with Claude Code