Repository navigation
fix(deps): declare typebox as a host-provided peer dependency - #472
Open
nelo-onyiah wants to merge 1 commit into
Open
nelo-onyiah wants to merge 1 commit into
nelo-onyiah wants to merge 1 commit into
Conversation
Pi supplies `typebox` to extensions and maps the specifier to its own copy. Listing it in `dependencies` installed a second physical copy at node_modules/agent-comms/node_modules/typebox, which shadows that mapping and makes Pi warn on every start that host-provided packages must be declared in peerDependencies (ExaDev#455). Move it to `peerDependencies` with a `"*"` range so Pi's own copy satisfies it, and keep the pinned version in `devDependencies` so local builds and typechecks still resolve it. The pi bridge source ships in the tarball and imports `typebox` only through Pi's mapping, so no runtime dependency is lost. Extend the packed-manifest test to fail if a host-provided package reappears in `dependencies`. Fixes ExaDev#455
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #455.
src/bridges/pi/extension.tsimportstypeboxdirectly, and Pi supplies that package to extensions: the loader maps thetypeboxspecifier to Pi's own copy (VIRTUAL_MODULESin@earendil-works/pi-coding-agent). Becausepackage.jsonlisted it independencies, pnpm/npm installed a second physical copy atnode_modules/agent-comms/node_modules/typebox, which shadows that mapping and makes Pi print this on every start:Changes
typeboxmoved fromdependenciestopeerDependencieswith a"*"range, so Pi's own copy satisfies it. Pi's package docs listtypeboxas host-provided and require exactly this.typeboxpinned at1.3.6indevDependenciesso the repo's own typecheck/build still resolve it.devDependenciesare not installed for consumers, so no physical copy ships.pnpm-lock.yamlregenerated.src/test/pi-manifest-packed.integration.test.tsextended: fails if a host-provided package (the Pi docs' list) reappears independencies, and requirestypeboxto be a"*"peer.Verification
pnpm exec vitest run src/test/pi-manifest-packed.integration.test.ts— 4 passed; reverting the manifest to the old shape fails the new test.pnpm lint,pnpm typecheck— pass.pnpm testafterpnpm run build— the only two failures were web-console tests that needdist(they pass once built, as CI's Test job does).npm install ... --omit=dev --legacy-peer-deps): manifest showspeerDependencies.typebox: "*",dependencies.typeboxabsent, and notypeboxdirectory anywhere undernode_modules.No runtime behaviour changes: the pi bridge only ever resolved
typeboxthrough Pi's module mapping.