fix(bump:deps): Use 'dev' dist-tag instead of 'next' (#22266)

This commit is contained in:
Tyler Butler 2024-08-22 11:30:23 -07:00 коммит произвёл GitHub
Родитель c8e16500ff
Коммит 1bc4134643
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -735,16 +735,16 @@ async function findDepUpdates(
// Get the new version for each package based on the update type
for (const pkgName of dependencies) {
let latest: string;
let next: string;
let dev: string;
try {
// eslint-disable-next-line no-await-in-loop
[latest, next] = await Promise.all([
[latest, dev] = await Promise.all([
latestVersion(pkgName, {
version: "latest",
}),
latestVersion(pkgName, {
version: "next",
version: "dev",
}),
]);
} catch (error: unknown) {
@ -752,12 +752,12 @@ async function findDepUpdates(
continue;
}
// If we're allowing pre-release, use the next tagged version. Warn if it is lower than the latest.
// If we're allowing pre-release, use the version that has the 'dev' dist-tag in npm. Warn if it is lower than the 'latest'.
if (prerelease) {
dependencyVersionMap[pkgName] = next;
if (semver.gt(latest, next)) {
dependencyVersionMap[pkgName] = dev;
if (semver.gt(latest, dev)) {
log?.warning(
`The latest dist-tag is version ${latest}, which is greater than the next dist-tag version, ${next}. Is this expected?`,
`The 'latest' dist-tag is version ${latest}, which is greater than the 'dev' dist-tag version, ${dev}. Is this expected?`,
);
}
} else {