Skip to content

chore(deps): interface deps as wide peer dependencies - #3

Merged
Upd4ting merged 2 commits into
mainfrom
chore/peer-interface-deps
Jun 16, 2026
Merged

Upd4ting merged 2 commits into
mainfrom
chore/peer-interface-deps

Conversation

@Upd4ting

@Upd4ting Upd4ting commented Jun 15, 2026

Copy link
Copy Markdown
Member

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-api and @antelopejs/interface-core from dependencies to peerDependencies with wide >=0.0.3 <1.0.0 ranges, and mirrors them in devDependencies for local development. This is the correct pattern for runtime-singleton interface packages that are provided by the host application.

  • package.json: Removes the dependencies block for both interface packages, adds them to peerDependencies with a wide >=0.0.3 <1.0.0 range, and mirrors them in devDependencies so the local build/test environment can still resolve them.
  • pnpm-lock.yaml: Entries move from the dependencies section to devDependencies; both packages remain locked at 0.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

Filename Overview
package.json Moves @antelopejs/interface-api and @antelopejs/interface-core from dependencies to peerDependencies (with wide >=0.0.3 <1.0.0 ranges) and adds them to devDependencies for local development — a correct pattern for runtime-singleton interface packages.
pnpm-lock.yaml Reflects the package.json restructuring — entries moved from dependencies to devDependencies section; both packages locked to 0.0.3 (unchanged), consistent with the new peer range floor.

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
Loading
%%{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"| D
Loading

Reviews (2): Last reviewed commit: "chore(deps): interface deps as bounded p..." | Re-trigger Greptile

Comment thread pnpm-lock.yaml Outdated
Comment on lines +45 to +49
'@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==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment thread package.json Outdated
Comment on lines 53 to 56
"peerDependencies": {
"@antelopejs/interface-api": ">=0.0.4",
"@antelopejs/interface-core": ">=0.0.5"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
"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!

@Upd4ting
Upd4ting force-pushed the chore/peer-interface-deps branch from 63a8f7e to 2525821 Compare June 15, 2026 21:16
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.
@Upd4ting
Upd4ting force-pushed the chore/peer-interface-deps branch from 2525821 to 6979169 Compare June 15, 2026 21:51
@Upd4ting

Copy link
Copy Markdown
Member Author

@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.
@Upd4ting
Upd4ting merged commit 9537698 into main Jun 16, 2026
2 checks passed
@Upd4ting
Upd4ting deleted the chore/peer-interface-deps branch June 16, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant