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

chore(deps): interface deps as wide peer dependencies#3
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 (range >=0.0.3 <1.0.0), adding them as devDependencies too so they are available locally — a standard pattern for ecosystem-singleton packages.

  • Dependency restructure: Both interface packages are now declared as bounded peer dependencies (>=0.0.3 <1.0.0) and as devDependencies for local builds, replacing the previous ^0.0.3 regular dependency entries.
  • Lockfile update: pnpm-lock.yaml reflects the move to devDependencies; both packages still resolve to 0.0.3, and the snapshot confirms interface-api@0.0.3 continues to carry interface-core@0.0.3 as a bundled runtime dependency — meaning the singleton guarantee for interface-core is 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

Filename Overview
package.json Moves interface-api and interface-core from dependencies to peerDependencies (range >=0.0.3 <1.0.0), also adds them as devDependencies for local resolution; structure is correct but interface-api@0.0.3 still bundles interface-core as a regular dependency.
pnpm-lock.yaml Lockfile updated to reflect both packages moving to devDependencies; interface-api@0.0.3 and interface-core@0.0.3 resolve correctly, but the snapshot at line 1372–1374 shows interface-api@0.0.3 still carries interface-core@0.0.3 as a bundled dependency.

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
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
    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
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 +1373 to +1376

snapshots:

'@antelopejs/interface-api@0.0.3':
'@antelopejs/interface-api@0.0.4':

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

Comment thread package.json Outdated
Comment on lines 57 to 60
"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 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.

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

@Upd4ting
Upd4ting force-pushed the chore/peer-interface-deps branch from 4bd4d4e to 7d26e04 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 7d26e04 to 67a560b 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 47b7fb1 into main Jun 16, 2026
2 checks passed
@Upd4ting
Upd4ting deleted the chore/peer-interface-deps branch June 16, 2026 12:23
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