Skip to content

fix(deps): move loopback and core packages from peer to direct deps - #174

Merged
a-ganguly merged 2 commits into
masterfrom
GH-173
Aug 16, 2026
Merged

fix(deps): move loopback and core packages from peer to direct deps#174
a-ganguly merged 2 commits into
masterfrom
GH-173

Conversation

@piyushsinghgaur1

Copy link
Copy Markdown
Contributor

Description

Moves @loopback/*, @sourceloop/core, jsdom, lodash, and tslib from peerDependencies to dependencies in package.json, and bumps the pinned versions for these packages:

  • @loopback/boot: ^8.0.4 -> ^8.0.11
  • @loopback/core: ^7.0.3 -> ^7.0.10
  • @loopback/repository: ^8.0.3 -> ^8.0.10
  • @loopback/rest: ^15.0.4 -> ^15.0.11
  • lodash: ^4.17.21 -> ^4.18.1
  • tslib: ^2.6.2 -> ^2.8.1

@loopback/sequelize and jsdom are also added as direct dependencies rather than peer dependencies.

Corresponding devDependencies versions were aligned/bumped as well (@commitlint/cli, @commitlint/config-conventional, @loopback/core, @loopback/repository, @loopback/rest, @loopback/sequelize, @loopback/testlab), and package-lock.json was regenerated to match.

Why

@sourceloop/audit-log declared @sourceloop/core (and other @loopback/* packages) as peerDependencies. In consumer monorepos where @sourceloop/core is a local workspace package (e.g. loopback4-microservice-catalog, where node_modules/@sourceloop/core is a symlink to packages/core), npm cannot reconcile that peer during dependency-tree re-resolution and fails with ERESOLVE. As a result, npm audit fix could not run at all in those consumers — it aborted before applying any remediation, blocking the normal security-fix workflow.

Diagnosis in the issue confirmed the peer version range itself was correct (the workspace @sourceloop/core at 21.0.0 satisfies ^21.0.0); the failure was specifically npm's resolution of a registry package's peer against a workspace-linked package, not a version mismatch. Moving these packages from peerDependencies to direct dependencies removes the peer relationship entirely, so there is nothing for npm to conflict on during re-resolution, and npm audit fix can run to completion without --legacy-peer-deps.

Changes

  • package.json: moved @loopback/boot, @loopback/core, @loopback/repository, @loopback/rest, @loopback/sequelize, @sourceloop/core, jsdom, lodash, and tslib from peerDependencies to dependencies
  • Bumped versions of the above packages and related devDependencies
  • package-lock.json regenerated to reflect the dependency changes

Related issue

Fixes GH-173

- remove the peerDependencies block and declare @loopback/boot,
  @loopback/core, @loopback/repository, @loopback/rest and
  @sourceloop/core as direct dependencies instead
- the peer on @sourceloop/core could not be resolved in consumer
  monorepos where @sourceloop/core is a local workspace package, which
  made npm error with ERESOLVE and blocked npm audit fix from running
- the peer was introduced in 9.1.0; releases up to 9.0.0 declared no
  peerDependencies at all, which is why the failure appeared only after
  consumers moved to ^9.1.0

GH-173
- add an undici ^6.27.0 override so the transitive copy resolves to a
  patched release instead of the vulnerable one trivy flagged
- regenerate package-lock.json to apply the override
- verified locally with the same command and config ci uses,
  trivy fs . --config trivy.yml, which now reports no fixable
  high or critical findings

GH-173
@sonarqubecloud

Copy link
Copy Markdown

@piyushsinghgaur1 piyushsinghgaur1 added the bug Something isn't working label Aug 16, 2026
@a-ganguly
a-ganguly merged commit e47b0f8 into master Aug 16, 2026
7 checks passed
@a-ganguly
a-ganguly deleted the GH-173 branch August 16, 2026 14:35
@a-ganguly

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 10.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

peerDependency on @sourceloop/core breaks npm audit fix in workspace consumers

3 participants