diff --git a/code/lib/cli/src/automigrate/fixes/addon-postcss.ts b/code/lib/cli/src/automigrate/fixes/addon-postcss.ts index f8d134183c0b..0b9e9095d336 100644 --- a/code/lib/cli/src/automigrate/fixes/addon-postcss.ts +++ b/code/lib/cli/src/automigrate/fixes/addon-postcss.ts @@ -10,7 +10,7 @@ interface AddonPostcssRunOptions { export const addonPostCSS: Fix = { id: 'addon-postcss', - versionRange: ['<7', '>=7'], + versionRange: ['*', '*'], promptType: 'notification', diff --git a/code/lib/cli/src/automigrate/fixes/addons-api.ts b/code/lib/cli/src/automigrate/fixes/addons-api.ts index f193898aa82f..69d0f3284b03 100644 --- a/code/lib/cli/src/automigrate/fixes/addons-api.ts +++ b/code/lib/cli/src/automigrate/fixes/addons-api.ts @@ -9,7 +9,7 @@ interface AddonsAPIRunOptions { export const addonsAPI: Fix = { id: 'addons-api', - versionRange: ['<8', '>=8'], + versionRange: ['*', '*'], promptType: 'notification', diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts index e51e919eb88a..34df12d717b6 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts @@ -18,32 +18,12 @@ const checkStorybookBinary = async ({ describe('storybook-binary fix', () => { describe('sb >= 7.0', () => { - it('should no-op in NX projects', async () => { + it('should add storybook dependency if not present', async () => { const packageManager = { getPackageVersion: (packageName) => { switch (packageName) { - case '@storybook/react': - return Promise.resolve('7.0.0'); case '@nrwl/storybook': return Promise.resolve('15.7.1'); - default: - return null; - } - }, - retrievePackageJson: () => Promise.resolve({}), - } as Partial; - - await expect( - checkStorybookBinary({ - packageManager, - }) - ).resolves.toBeFalsy(); - }); - - it('should add storybook dependency if not present', async () => { - const packageManager = { - getPackageVersion: (packageName) => { - switch (packageName) { case '@storybook/react': return Promise.resolve('7.0.0-alpha.0'); default: diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.ts index 09ee16bd5d84..798655f1e28a 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-binary.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.ts @@ -23,20 +23,14 @@ const logger = console; export const sbBinary: Fix = { id: 'storybook-binary', - versionRange: ['<7', '>=7'], + versionRange: ['*', '*'], async check({ packageManager, storybookVersion }) { const packageJson = await packageManager.retrievePackageJson(); - const nrwlStorybookVersion = await packageManager.getPackageVersion('@nrwl/storybook'); const sbBinaryVersion = await packageManager.getPackageVersion('sb'); const storybookBinaryVersion = await packageManager.getPackageVersion('storybook'); - // Nx provides their own binary, so we don't need to do anything - if (nrwlStorybookVersion) { - return null; - } - const hasSbBinary = !!sbBinaryVersion; const hasStorybookBinary = !!storybookBinaryVersion; diff --git a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts index ec0fcbc158e4..c9a941de206f 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts @@ -78,7 +78,7 @@ export const getStorybookScripts = (allScripts: NonNullable = { id: 'sb-scripts', - versionRange: ['<7', '>=7'], + versionRange: ['*', '*'], async check({ packageManager, storybookVersion }) { const packageJson = await packageManager.retrievePackageJson(); diff --git a/code/lib/cli/src/automigrate/fixes/wrap-require.ts b/code/lib/cli/src/automigrate/fixes/wrap-require.ts index 829d42ee352f..0334d4b82f33 100644 --- a/code/lib/cli/src/automigrate/fixes/wrap-require.ts +++ b/code/lib/cli/src/automigrate/fixes/wrap-require.ts @@ -22,7 +22,7 @@ interface WrapRequireRunOptions { export const wrapRequire: Fix = { id: 'wrap-require', - versionRange: ['<7.2.0-rc.0', '>=7.2.0-rc.0'], + versionRange: ['*', '*'], async check({ packageManager, storybookVersion, mainConfigPath }) { const isStorybookInMonorepo = await packageManager.isStorybookInMonorepo();