Skip to content

fix: always use package key when reading from dependency list instead of package name#9583

Merged
mmaietta merged 4 commits intomasterfrom
fix/use-pkg-key
Feb 13, 2026
Merged

fix: always use package key when reading from dependency list instead of package name#9583
mmaietta merged 4 commits intomasterfrom
fix/use-pkg-key

Conversation

@mmaietta
Copy link
Collaborator

@mmaietta mmaietta commented Feb 12, 2026

Fixes: #9580
Fixes: #9560

…kage `from` to not mislabel package-version strings
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 5174d68

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes dependency resolution for aliased/renamed dependencies by ensuring dependency graph IDs and stored dependency entries consistently use the dependency list key (the package.json key) rather than the package’s reported from/resolved name, preventing lookup mismatches during node_modules collection and hoisting.

Changes:

  • Introduces a shared normalizePackageVersion() helper to generate consistent dependency IDs (${packageKey}@${version}) and override pkg.name to the dependency key.
  • Updates npm/pnpm/manual-traversal collectors to use the normalized IDs when building allDependencies and the production dependency graph.
  • Adds a changeset for a patch release of app-builder-lib.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/app-builder-lib/src/node-module-collector/traversalNodeModulesCollector.ts Normalizes dependency IDs using the dependency entry key when collecting and building the production graph.
packages/app-builder-lib/src/node-module-collector/pnpmNodeModulesCollector.ts Switches production graph traversal to use normalized dependency IDs based on dependency keys; removes packageVersionString() override that used from.
packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts Uses normalized dependency IDs/overrides to correctly handle npm aliased dependencies.
packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts Replaces packageVersionString() with normalizePackageVersion() as the shared normalization point.
.changeset/thick-cases-refuse.md Declares a patch-level changeset for the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmaietta mmaietta changed the title fix: always use package key when reading from dependency list instead of package from fix: always use package key when reading from dependency list instead of package name Feb 12, 2026
@mmaietta mmaietta requested a review from Copilot February 12, 2026 22:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm hoisted mode: aliased (renamed) dependencies not resolved after v26.3.1 Wrong And Duplicated dependencies tree generated when building

2 participants