Skip to content

Commit 66ec965

Browse files
committed
fix
1 parent 2194f2e commit 66ec965

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

scripts/check_changeset.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,23 @@ const bumpRank: Record<string, number> = {
3434

3535
/**
3636
* Get highest bump that isn't the main firebase package, return
37-
// numerical rank and bump text.
37+
// numerical rank, bump text, package name.
3838
*/
3939
function getHighestBump(changesetPackages: Record<string, string>) {
4040
let highestBump = bumpRank.patch;
4141
let highestBumpText = 'patch';
42+
let bumpPackage = '';
4243
for (const pkgName in changesetPackages) {
4344
if (
4445
pkgName !== 'firebase' &&
4546
bumpRank[changesetPackages[pkgName]] > highestBump
4647
) {
4748
highestBump = bumpRank[changesetPackages[pkgName]];
4849
highestBumpText = changesetPackages[pkgName];
50+
bumpPackage = pkgName;
4951
}
5052
}
51-
return { highestBump, bumpText: highestBumpText };
53+
return { highestBump, bumpText: highestBumpText, bumpPackage };
5254
}
5355

5456
/**
@@ -167,17 +169,18 @@ async function main() {
167169

168170
// Check for packages with a minor or major bump where 'firebase' hasn't been
169171
// included.
170-
const { highestBump, bumpText } = getHighestBump(changesetPackages);
171-
console.log(highestBump, bumpText);
172+
const { highestBump, bumpText, bumpPackage } = getHighestBump(
173+
changesetPackages
174+
);
172175
if (highestBump > bumpRank.patch) {
173176
if (changesetPackages['firebase'] == null) {
174177
errors.push(
175-
`- There is a package with a ${bumpText} bump which requires an ` +
178+
`- Package ${bumpPackage} has a ${bumpText} bump which requires an ` +
176179
`additional line to bump the main "firebase" package to ${bumpText}.`
177180
);
178181
} else if (bumpRank[changesetPackages['firebase']] < highestBump) {
179182
errors.push(
180-
`- There is a package with a ${bumpText} bump. ` +
183+
`- Package ${bumpPackage} has a ${bumpText} bump. ` +
181184
`Increase the bump for the main "firebase" package to ${bumpText}.`
182185
);
183186
}

0 commit comments

Comments
 (0)