chore(deps): interface deps as wide peer dependencies - #3
Conversation
|
|
||
| snapshots: | ||
|
|
||
| '@antelopejs/interface-api@0.0.3': | ||
| '@antelopejs/interface-api@0.0.4': |
There was a problem hiding this comment.
interface-core dual-install still occurs
The PR's stated goal is to prevent duplicate installs of interface singletons, but the lockfile shows @antelopejs/interface-api@0.0.4 still depends on @antelopejs/interface-core@0.0.3 as a bundled dependency. Meanwhile, this package now declares @antelopejs/interface-core@>=0.0.5 as a required peer — meaning both 0.0.3 (pulled in by interface-api) and 0.0.5 (the peer) will coexist in node_modules. The singleton guarantee breaks exactly where it was meant to be enforced. The fix requires interface-api@0.0.4 itself to declare interface-core as a peer dependency rather than a bundled one.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pnpm-lock.yaml
Line: 1373-1376
Comment:
**`interface-core` dual-install still occurs**
The PR's stated goal is to prevent duplicate installs of interface singletons, but the lockfile shows `@antelopejs/interface-api@0.0.4` still depends on `@antelopejs/interface-core@0.0.3` as a bundled dependency. Meanwhile, this package now declares `@antelopejs/interface-core@>=0.0.5` as a required peer — meaning both `0.0.3` (pulled in by `interface-api`) and `0.0.5` (the peer) will coexist in `node_modules`. The singleton guarantee breaks exactly where it was meant to be enforced. The fix requires `interface-api@0.0.4` itself to declare `interface-core` as a peer dependency rather than a bundled 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.
Unbounded
>= peer ranges claim unlimited forward compatibility
Using >=0.0.4 with no upper bound silently accepts any future major version of interface-api and interface-core, even if they introduce completely incompatible APIs. A ^ range (or >=x <next-major) is the idiomatic way to express "at least this version, but within a compatible major" for peer dependencies.
| "peerDependencies": { | |
| "@antelopejs/interface-api": ">=0.0.4", | |
| "@antelopejs/interface-core": ">=0.0.5" | |
| } | |
| "peerDependencies": { | |
| "@antelopejs/interface-api": ">=0.0.4 <1", | |
| "@antelopejs/interface-core": ">=0.0.5 <1" | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 57-60
Comment:
**Unbounded `>=` peer ranges claim unlimited forward compatibility**
Using `>=0.0.4` with no upper bound silently accepts any future major version of `interface-api` and `interface-core`, even if they introduce completely incompatible APIs. A `^` range (or `>=x <next-major`) is the idiomatic way to express "at least this version, but within a compatible major" for peer dependencies.
```suggestion
"peerDependencies": {
"@antelopejs/interface-api": ">=0.0.4 <1",
"@antelopejs/interface-core": ">=0.0.5 <1"
}
```
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!
4bd4d4e to
7d26e04
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.
7d26e04 to
67a560b
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-corefromdependenciestopeerDependencies(range>=0.0.3 <1.0.0), adding them asdevDependenciestoo so they are available locally — a standard pattern for ecosystem-singleton packages.>=0.0.3 <1.0.0) and asdevDependenciesfor local builds, replacing the previous^0.0.3regular dependency entries.pnpm-lock.yamlreflects the move todevDependencies; both packages still resolve to0.0.3, and the snapshot confirmsinterface-api@0.0.3continues to carryinterface-core@0.0.3as a bundled runtime dependency — meaning the singleton guarantee forinterface-coreis not yet fully achieved by this change alone.Confidence Score: 4/5
Safe to merge as a structural improvement, but the singleton guarantee for interface-core is not fully enforced until interface-api itself stops bundling it as a regular dependency.
The peer dependency restructure is directionally correct and the bounded range (>=0.0.3 <1.0.0) is reasonable. However, the lockfile snapshot confirms that interface-api@0.0.3 still carries interface-core as a bundled runtime dependency, so two copies of interface-core will coexist in node_modules of any consumer that installs this package — which is the exact dual-install the PR intends to prevent.
pnpm-lock.yaml snapshot at lines 1372–1374 confirms the interface-api → interface-core bundled dependency that undermines the singleton goal.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph Before A1["@antelopejs/interface-auth"] -->|dependencies ^0.0.3| B1["@antelopejs/interface-api"] A1 -->|dependencies ^0.0.3| C1["@antelopejs/interface-core"] B1 -->|bundled dep| C1 end subgraph After A2["@antelopejs/interface-auth"] -->|peerDependencies >=0.0.3 <1.0.0| B2["@antelopejs/interface-api"] A2 -->|peerDependencies >=0.0.3 <1.0.0| C2["@antelopejs/interface-core"] A2 -->|devDependencies >=0.0.3 <1.0.0| B2 A2 -->|devDependencies >=0.0.3 <1.0.0| C2 B2 -->|still a bundled dep| C2 style C2 fill:#ffcccc,stroke:#ff0000 end%%{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 subgraph Before A1["@antelopejs/interface-auth"] -->|dependencies ^0.0.3| B1["@antelopejs/interface-api"] A1 -->|dependencies ^0.0.3| C1["@antelopejs/interface-core"] B1 -->|bundled dep| C1 end subgraph After A2["@antelopejs/interface-auth"] -->|peerDependencies >=0.0.3 <1.0.0| B2["@antelopejs/interface-api"] A2 -->|peerDependencies >=0.0.3 <1.0.0| C2["@antelopejs/interface-core"] A2 -->|devDependencies >=0.0.3 <1.0.0| B2 A2 -->|devDependencies >=0.0.3 <1.0.0| C2 B2 -->|still a bundled dep| C2 style C2 fill:#ffcccc,stroke:#ff0000 endReviews (2): Last reviewed commit: "chore(deps): interface deps as bounded p..." | Re-trigger Greptile