Skip to content

Commit d633b47

Browse files
committed
fix: deduplicate ecosystems in resolver and use pkg.version in display
- resolve.ts: check includes() before push to prevent false ambiguity - display.ts: use pkg.version directly instead of path-keyed map lookup
1 parent f6d3b86 commit d633b47

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/src/changeset/resolve.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export function createKeyResolver(
99
const nameEcosystems = new Map<string, EcosystemKey[]>();
1010
for (const p of packages) {
1111
const existingPath = pathEcosystems.get(p.path) ?? [];
12-
existingPath.push(p.ecosystem);
12+
if (!existingPath.includes(p.ecosystem)) existingPath.push(p.ecosystem);
1313
pathEcosystems.set(p.path, existingPath);
1414

1515
const existingName = nameEcosystems.get(p.name) ?? [];
16-
existingName.push(p.ecosystem);
16+
if (!existingName.includes(p.ecosystem)) existingName.push(p.ecosystem);
1717
nameEcosystems.set(p.name, existingName);
1818
}
1919

packages/core/src/tasks/prompts/display.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function buildDependencyBumpNote(
7878

7979
export function renderPackageVersionSummary(
8080
packageInfos: ResolvedPackageConfig[],
81-
currentVersions: Map<string, string>,
81+
_currentVersions: Map<string, string>,
8282
selectedVersions: Map<string, string>,
8383
options: {
8484
activePackage?: string;
@@ -88,7 +88,7 @@ export function renderPackageVersionSummary(
8888
const lines = [t("output.packages")];
8989

9090
for (const pkg of packageInfos) {
91-
const currentVersion = currentVersions.get(pkg.path) ?? pkg.version;
91+
const currentVersion = pkg.version;
9292
const selectedVersion = selectedVersions.get(packageKey(pkg));
9393
const prefix = options.activePackage === pkg.path ? "> " : " ";
9494

0 commit comments

Comments
 (0)