Skip to content

Automigrate: Also upgrade E2E packages when upgrading #31661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ describe('upgrade-storybook-related-dependencies fix', () => {
availableUpgrade: '8.0.0',
hasIncompatibleDependencies: true,
},
{
packageName: '@chromatic-com/playwright',
packageVersion: '0.1.0',
availableUpgrade: '1.0.0',
hasIncompatibleDependencies: false,
},
];
vi.mocked(docsUtils.getIncompatibleStorybookPackages).mockResolvedValue(analyzedPackages);
await expect(
Expand Down Expand Up @@ -83,6 +89,11 @@ describe('upgrade-storybook-related-dependencies fix', () => {
"beforeVersion": "0.2.3",
"packageName": "@storybook/jest",
},
{
"afterVersion": "1.0.0",
"beforeVersion": "0.1.0",
"packageName": "@chromatic-com/playwright",
},
{
"afterVersion": "8.0.0",
"beforeVersion": "3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ async function getLatestVersions(
);
}

const RELATED_PACKAGES_TO_UPGRADE = ['@chromatic-com/playwright', '@chromatic-com/cypress'];

/**
* Is the user upgrading to the `latest` version of Storybook? Let's try to pull along some of the
* storybook related dependencies to `latest` as well!
Expand All @@ -55,7 +57,7 @@ export const upgradeStorybookRelatedDependencies = {

const allDependencies = (await packageManager.getAllDependencies()) as Record<string, string>;
const storybookDependencies = Object.keys(allDependencies)
.filter((dep) => dep.includes('storybook'))
.filter((dep) => dep.includes('storybook') || RELATED_PACKAGES_TO_UPGRADE.includes(dep))
.filter((dep) => !isCorePackage(dep) && !isSatelliteAddon(dep));
const incompatibleDependencies = analyzedPackages
.filter((pkg) => pkg.hasIncompatibleDependencies)
Expand Down
Loading