chore(deps): interface deps as wide peer dependencies - #3
Conversation
| '@antelopejs/interface-core@0.0.3': | ||
| resolution: {integrity: sha512-Kw3ffGiQHKJ88AqdFfPuwzl+v0w6QqzqiqnLY7M0MYYw+YwdRNXh5WAJkep0ePudR9leLGXPU//FYizNaDG6yw==} | ||
|
|
||
| '@antelopejs/interface-core@0.0.5': | ||
| resolution: {integrity: sha512-4H6hpFfiK2+DE8vL2mEtPbq1WNch9lt40QNr9KjBrOAtnuq/zMfIlzhbEsda39m+FVkMWXfUYoVolRogVKCLIQ==} |
There was a problem hiding this comment.
Dual install of
interface-core persists despite stated goal
The PR description says this change avoids dual installs, but the lockfile still contains two copies of @antelopejs/interface-core: 0.0.3 pulled in transitively by @antelopejs/interface-api@0.0.4, and 0.0.5 resolved for the root peer dep. Because these packages act as runtime singletons, having two distinct module instances loaded at once can cause interface identity checks to silently fail (e.g., instanceof guards or symbol-keyed registries). The dual install will persist until @antelopejs/interface-api itself also declares @antelopejs/interface-core as a peer dependency rather than a regular one.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pnpm-lock.yaml
Line: 45-49
Comment:
**Dual install of `interface-core` persists despite stated goal**
The PR description says this change avoids dual installs, but the lockfile still contains two copies of `@antelopejs/interface-core`: `0.0.3` pulled in transitively by `@antelopejs/interface-api@0.0.4`, and `0.0.5` resolved for the root peer dep. Because these packages act as runtime singletons, having two distinct module instances loaded at once can cause interface identity checks to silently fail (e.g., `instanceof` guards or symbol-keyed registries). The dual install will persist until `@antelopejs/interface-api` itself also declares `@antelopejs/interface-core` as a peer dependency rather than a regular one.
How can I resolve this? If you propose a fix, please make it concise.| "peerDependencies": { | ||
| "@antelopejs/interface-api": ">=0.0.4", | ||
| "@antelopejs/interface-core": ">=0.0.5" | ||
| } |
There was a problem hiding this comment.
The peer range floor for
@antelopejs/interface-api is bumped from 0.0.3 (the previously declared minimum) to 0.0.4, and @antelopejs/interface-core is bumped from 0.0.3 to 0.0.5. If there is no API break between those versions that this package depends on, the narrower floor unnecessarily breaks consumers who are still on 0.0.3. The PR description frames this as a pure organizational change ("avoid dual installs"), so the rationale for the higher floor should be documented. If 0.0.3 is still compatible, consider lowering the floor back to >=0.0.3.
| "peerDependencies": { | |
| "@antelopejs/interface-api": ">=0.0.4", | |
| "@antelopejs/interface-core": ">=0.0.5" | |
| } | |
| "peerDependencies": { | |
| "@antelopejs/interface-api": ">=0.0.3", | |
| "@antelopejs/interface-core": ">=0.0.3" | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 53-56
Comment:
The peer range floor for `@antelopejs/interface-api` is bumped from `0.0.3` (the previously declared minimum) to `0.0.4`, and `@antelopejs/interface-core` is bumped from `0.0.3` to `0.0.5`. If there is no API break between those versions that this package depends on, the narrower floor unnecessarily breaks consumers who are still on `0.0.3`. The PR description frames this as a pure organizational change ("avoid dual installs"), so the rationale for the higher floor should be documented. If `0.0.3` is still compatible, consider lowering the floor back to `>=0.0.3`.
```suggestion
"peerDependencies": {
"@antelopejs/interface-api": ">=0.0.3",
"@antelopejs/interface-core": ">=0.0.3"
}
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
63a8f7e to
2525821
Compare
Interfaces are host-provided runtime singletons, so they move to peerDependencies. The range keeps the original lower bound (no forced upgrade) and is bounded to the current major (<1.0.0). devDependencies mirror the exact same range so local/CI builds exercise the full supported window, and the field is grouped with the other dependency sections.
2525821 to
6979169
Compare
|
@greptileai review |
pnpm resolves direct dependency ranges to their lowest satisfying version (lowest-direct), so a range devDependency would build against the floor (oldest) interface. Pin devDependencies to the current published versions so local/CI builds exercise the latest, while peerDependencies keep the wide compatibility range for consumers.
Move
@antelopejs/interface-*from dependencies to peerDependencies with wide>=ranges. They are runtime singletons provided by the host, so peer ranges avoid dual installs and pinning overrides downstream. Verified: install (peers auto-installed), build, lint.Greptile Summary
This PR moves
@antelopejs/interface-apiand@antelopejs/interface-corefromdependenciestopeerDependencieswith wide>=0.0.3 <1.0.0ranges, and mirrors them indevDependenciesfor local development. This is the correct pattern for runtime-singleton interface packages that are provided by the host application.package.json: Removes thedependenciesblock for both interface packages, adds them topeerDependencieswith a wide>=0.0.3 <1.0.0range, and mirrors them indevDependenciesso the local build/test environment can still resolve them.pnpm-lock.yaml: Entries move from thedependenciessection todevDependencies; both packages remain locked at0.0.3, consistent with the new peer range floor.Confidence Score: 5/5
Safe to merge — the restructuring correctly moves runtime-singleton interface packages to peer dependencies without altering any runtime logic.
The change is a pure dependency reorganization with no modifications to source code. Both packages are correctly declared in peerDependencies for consumers and mirrored in devDependencies for local development, which is the standard pattern. The lockfile resolves both packages to 0.0.3, matching the peer range floor.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Consumer project"] -->|"installs"| B["@antelopejs/interface-api-util"] A -->|"must provide (peerDep) >=0.0.3 <1.0.0"| C["@antelopejs/interface-api"] A -->|"must provide (peerDep) >=0.0.3 <1.0.0"| D["@antelopejs/interface-core"] B -->|"devDependency (local dev/test)"| C B -->|"devDependency (local dev/test)"| D C -->|"runtime singleton"| D%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["Consumer project"] -->|"installs"| B["@antelopejs/interface-api-util"] A -->|"must provide (peerDep) >=0.0.3 <1.0.0"| C["@antelopejs/interface-api"] A -->|"must provide (peerDep) >=0.0.3 <1.0.0"| D["@antelopejs/interface-core"] B -->|"devDependency (local dev/test)"| C B -->|"devDependency (local dev/test)"| D C -->|"runtime singleton"| DReviews (2): Last reviewed commit: "chore(deps): interface deps as bounded p..." | Re-trigger Greptile