Skip to content

Commit

Permalink
only provide critical duplicated dependency warning on major version …
Browse files Browse the repository at this point in the history
…difference
  • Loading branch information
yannbf committed Mar 30, 2023
1 parent acace30 commit b421d95
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 b421d95

Please sign in to comment.