Skip to content

Commit

Permalink
Merge pull request #21850 from storybookjs/fix/tone-down-dependency-a…
Browse files Browse the repository at this point in the history
…lerts

CLI: Fix duplicated dependency warning for major version differences
  • Loading branch information
yannbf authored Mar 31, 2023
2 parents 941103b + b421d95 commit 2cc1d36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('getMigrationSummary', () => {
const installationMetadata: InstallationMetadata = {
duplicatedDependencies: {
'@storybook/core-client': ['7.0.0', '7.1.0'],
'@storybook/instrumenter': ['7.0.0', '7.1.0'],
'@storybook/instrumenter': ['6.0.0', '7.1.0'],
'@storybook/core-common': ['6.0.0', '7.1.0'],
'@storybook/addon-essentials': ['7.0.0', '7.1.0'],
},
Expand Down Expand Up @@ -136,13 +136,13 @@ describe('getMigrationSummary', () => {
Critical: The following dependencies are duplicated and WILL cause unexpected behavior:
@storybook/instrumenter:
7.0.0, 7.1.0
@storybook/core-common:
6.0.0, 7.1.0
Attention: The following dependencies are duplicated which might cause unexpected behavior:
@storybook/core-common:
6.0.0, 7.1.0
@storybook/addon-essentials:
7.0.0, 7.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function getWarnings(installationMetadata: InstallationMetadata) {

const hasMultipleMajorVersions = hasMultipleVersions(versions);

if (hasMultipleMajorVersions || disallowList.includes(dep)) {
if (disallowList.includes(dep) && hasMultipleMajorVersions) {
acc.critical.push(`${chalk.redBright(dep)}:\n${versions.join(', ')}`);
} else {
acc.trivial.push(`${chalk.hex('#ff9800')(dep)}:\n${versions.join(', ')}`);
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export async function runFixes({
const sbVersionCoerced = storybookVersion && semver.coerce(storybookVersion)?.version;
if (!sbVersionCoerced) {
logger.info(dedent`
[Storybook automigrate] ❌ Unable to determine storybook version so the automigrations will be skipped.
[Storybook automigrate] ❌ Unable to determine storybook version so the automigrations will be skipped.
🤔 Are you running automigrate from your project directory? Please specify your Storybook config directory with the --config-dir flag.
`);
return {
Expand Down

0 comments on commit 2cc1d36

Please sign in to comment.