Skip to content
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

CLI: Don't try to add packages that are already installed #13876

Merged
merged 1 commit into from
Feb 15, 2021

Conversation

gaetanmaisse
Copy link
Member

Applying #13559 step by step to not face gigantic conflicts or issues with the webpack 4/5 works.

What I did

Previously for some framework, the Storybook CLI was installing extra dependencies (listed in the generator of each framework, for instance for rax) but, in some case, some were already present in the user's project.

It doesn't cause any issue with NPM/Yarn, I guess they are just updating the version 🤷🏻 . But, reasonably from my point of view, Yarn 2 is throwing an error:

Usage Error: Package "XXXXXX" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first

To fix that I added a filter before adding the extra dependencies to remove all the already installed ones.

How to test

  • CI should be green (especially the e2e extended test suite)

@gaetanmaisse gaetanmaisse added maintenance User-facing maintenance tasks run e2e extended test suite Run the e2e extended test suite in CircleCI workflows labels Feb 11, 2021
@gaetanmaisse gaetanmaisse requested a review from a team February 11, 2021 20:21
It mimic the behavior of Yarn 1.x when trying to install a package as dev dep but it is already a regular dep.
Example:
> warning "react-scripts" is already in "dependencies". Please remove existing entry first before adding it to "devDependencies".
>  success Saved 0 new dependencies.
@github-actions
Copy link
Contributor

Fails
🚫 PR is marked with "in progress" label.

Generated by 🚫 dangerJS against b035493

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shilman shilman merged commit 37a6d3a into next Feb 15, 2021
@shilman shilman deleted the tech/improve-cli branch February 15, 2021 00:39
@gaetanmaisse gaetanmaisse mentioned this pull request Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks run e2e extended test suite Run the e2e extended test suite in CircleCI workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants