Skip to content

fix(deps): show installed copies in peer permutations diagnosis#10228

Open
davidfirst wants to merge 4 commits intomasterfrom
fix/deps-diagnose-peer-permutations-installed-copies
Open

fix(deps): show installed copies in peer permutations diagnosis#10228
davidfirst wants to merge 4 commits intomasterfrom
fix/deps-diagnose-peer-permutations-installed-copies

Conversation

@davidfirst
Copy link
Member

bit deps diagnose showed peer dependencies in the "permutations" section based on declared component dependency metadata, but --package drill-down checks actual .pnpm entries on disk. This caused confusion when a package appeared in permutations but showed "0 installed copies" in the drill-down (e.g. @teambit/legacy declared as peer with 4 version ranges but not present in .pnpm at all).

Now the permutations table cross-references with .pnpm copy counts and adds an "Installed copies" column. Packages that are declared but not installed show 0 (not installed), and results are sorted by actual installed copies first so real bloat surfaces at the top.

Cross-reference peer permutation entries with actual .pnpm directory
counts so users can distinguish declared-but-not-installed peers from
those actually causing bloat on disk.
Copilot AI review requested due to automatic review settings March 16, 2026 16:16
Copy link
Contributor

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

Updates bit deps diagnose to better align the “peer permutations” output with what’s actually installed on disk, reducing confusion when peers are declared but not present in .pnpm.

Changes:

  • Extends DiagnosisReport.peerPermutations entries with an installedCopies field sourced from node_modules/.pnpm.
  • Sorts peer permutation results primarily by actual installed copy count.
  • Updates CLI output to display an “Installed copies” column and label missing packages as 0 (not installed).

Reviewed changes

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

File Description
scopes/dependencies/dependencies/dependencies.main.runtime.ts Adds installedCopies to peerPermutations and sorts peer permutation results by .pnpm copy count.
scopes/dependencies/dependencies/dependencies-cmd.ts Updates the diagnose CLI table to show declared versions alongside installed copy counts.

You can also share your feedback on Copilot code review. Take the survey.

…mutations-installed-copies

# Conflicts:
#	scopes/dependencies/dependencies/dependencies.main.runtime.ts
Copilot AI review requested due to automatic review settings March 18, 2026 23:02
Copy link
Contributor

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

Updates bit deps diagnose to reduce confusion by surfacing actual installed .pnpm copy counts alongside peer permutation data, so declared-but-not-installed peers are clearly distinguished from real on-disk bloat.

Changes:

  • Add installedCopies to the peerPermutations section of DiagnosisReport and sort peer permutations primarily by installed copy count.
  • Update CLI output to include an “Installed copies” column and display 0 (not installed) when appropriate.

Reviewed changes

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

File Description
scopes/dependencies/dependencies/dependencies.main.runtime.ts Enriches peer permutation entries with .pnpm-derived installed copy counts and adjusts sorting.
scopes/dependencies/dependencies/dependencies-cmd.ts Extends the peer permutations table output to show installed copy counts and a “not installed” indicator.

You can also share your feedback on Copilot code review. Take the survey.

}>;
peerPermutations: Array<{
packageName: string;
/** declared peer-dep version ranges across components */
Comment on lines +384 to +391
const peerTable = borderlessTable({
head: ['Package', 'Declared versions', 'Installed copies'],
paddingLeft: 2,
paddingRight: 1,
});
report.peerPermutations.forEach((entry) => {
peerTable.push([entry.packageName, `${entry.versions.length} (${entry.versions.join(', ')})`]);
const copies = entry.installedCopies > 0 ? String(entry.installedCopies) : chalk.dim('0 (not installed)');
peerTable.push([entry.packageName, `${entry.versions.length} (${entry.versions.join(', ')})`, copies]);
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.

2 participants