Repository navigation
fix: declare @sinclair/typebox as a peer dependency - #14
Open
WangLuFeiUid wants to merge 1 commit into
Open
WangLuFeiUid wants to merge 1 commit into
WangLuFeiUid wants to merge 1 commit into
Conversation
`@sinclair/typebox` is provided by the Pi host at runtime and is listed in the
loader's host-provided package set. Keeping it in `dependencies` makes Pi emit
an extension warning at startup:
Host-provided extension packages must be declared in peerDependencies with a
"*" range, not dependencies: @sinclair/typebox. Installed copies can bypass
the extension loader and create duplicate runtime modules.
Move it to `peerDependencies` with a "*" range, following the guidance in Pi's
packages.md ("Declare the host-provided packages in peerDependencies with a "*"
range and do not bundle them") and the existing pattern already used here for
@earendil-works/pi-coding-agent: peerDependencies declares "*" while
devDependencies keeps the tested ^0.34.49 so local typecheck and tests still
have a real installation to resolve against.
package-lock.json regenerated with `npm install --package-lock-only`.
Author
CI note: the run needs a maintainer approval, not a code fixThe Since the workflow cannot start on its own, I reproduced the exact steps from
Re-checking the manifest against the loader's host-provided predicate ( This is the same root cause as #12 — the fix there was described as moving the package to |
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.
Problem
Starting Pi with this extension installed prints a warning:
@sinclair/typeboxis provided by the Pi host at runtime — it is part of theloader's host-provided package set. Declaring it in
dependenciestriggers thewarning on every startup and risks a physically separate copy of typebox being
installed next to the extension, which can bypass Pi's extension module mapping
and produce duplicate module instances.
Fix
peerDependencies: add"@sinclair/typebox": "*"dependencies: remove@sinclair/typeboxdevDependencies: keep"@sinclair/typebox": "^0.34.49"so local typecheck andthe test suite still resolve a real installation
package-lock.jsonThis follows Pi's own guidance in
packages.md("Declare the host-providedpackages listed above in
peerDependencieswith a"*"range and do not bundlethem" / "Do not list host-provided packages in
dependencies") and mirrors thepattern already used in this repository for
@earendil-works/pi-coding-agent,which is declared in both
peerDependencies("*") anddevDependencies.Verification
npm ci— installs cleanlynpm run typecheck— passesnpm test— 49 tests passed across 6 filesno matches in
dependencies, so the warning is goneNo
CHANGELOG.mdentry included, since releases here appear to be cut separately —happy to add one if you prefer.