fix(deps): show installed copies in peer permutations diagnosis#10228
fix(deps): show installed copies in peer permutations diagnosis#10228davidfirst wants to merge 4 commits intomasterfrom
Conversation
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.
There was a problem hiding this comment.
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.peerPermutationsentries with aninstalledCopiesfield sourced fromnode_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
There was a problem hiding this comment.
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
installedCopiesto thepeerPermutationssection ofDiagnosisReportand 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 */ |
| 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]); |
bit deps diagnoseshowed peer dependencies in the "permutations" section based on declared component dependency metadata, but--packagedrill-down checks actual.pnpmentries on disk. This caused confusion when a package appeared in permutations but showed "0 installed copies" in the drill-down (e.g.@teambit/legacydeclared as peer with 4 version ranges but not present in.pnpmat all).Now the permutations table cross-references with
.pnpmcopy counts and adds an "Installed copies" column. Packages that are declared but not installed show0 (not installed), and results are sorted by actual installed copies first so real bloat surfaces at the top.