mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
Merge pull request #26049 from storybookjs/norbert/fix-caret-in-upgrade
CLI: Fix logic to add `^` packages in upgrade
This commit is contained in:
commit
22f7db6c6d
@ -223,10 +223,16 @@ export const doUpgrade = async ({
|
||||
return dependency in versions;
|
||||
}) as Array<keyof typeof versions>;
|
||||
return monorepoDependencies.map((dependency) => {
|
||||
let char = '^';
|
||||
if (isOutdated) {
|
||||
char = '';
|
||||
}
|
||||
if (isCanary) {
|
||||
char = '';
|
||||
}
|
||||
/* add ^ modifier to the version if this is the latest stable or prerelease version
|
||||
example outputs: @storybook/react@^8.0.0 */
|
||||
const maybeCaret = (!isOutdated || isPrerelease) && !isCanary ? '^' : '';
|
||||
return `${dependency}@${maybeCaret}${versions[dependency]}`;
|
||||
return `${dependency}@${char}${versions[dependency]}`;
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user