CLI: Fix versions map to include sb/storybook packages

This commit is contained in:
Michael Shilman 2022-06-07 01:19:08 +08:00
parent 1a73ad38cc
commit 31da7f79b1

View File

@ -35,8 +35,7 @@ const run = async () => {
})
)
)
// Remove non-`@storybook/XXX` package (like: `cli-sb`, `cli-storybook`)
.filter(({ name }) => /@storybook/.test(name))
.filter(({ name }) => /(@storybook|^sb$|^storybook$)/.test(name))
// As some previous steps are asynchronous order is not always the same so sort them to avoid that
.sort((package1, package2) => package1.name.localeCompare(package2.name))
.reduce((acc, { name }) => ({ ...acc, [name]: updatedVersion }), {});