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

fix(essentials): yarn add --peer and --dev do not work when used together #4800

Merged
merged 4 commits into from
Sep 3, 2022

Conversation

jj811208
Copy link
Contributor

@jj811208 jj811208 commented Aug 27, 2022

What's the problem this PR addresses?

Yarn add --peer and --dev do not work when used together

Resolves #4691
...

How did you fix it?

Let the return value of the suggestTarget function of the packages/plugin-essentials/sources/commands/add.ts file change from suggestUtils.Target to suggestUtils.Target[], It is possible to add different types of dependencies at once

...

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@jj811208 jj811208 changed the title fix(essentials): yarn add --peer, --dev not working fix(essentials): yarn add --peer and --dev do not work when used together Aug 27, 2022
@jj811208 jj811208 marked this pull request as ready for review August 27, 2022 15:00
Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, please add some tests to https://github.com/yarnpkg/berry/blob/15c481dce19f1a7e56b875b96f11c9ef67dc4c2d/packages/acceptance-tests/pkg-tests-specs/sources/commands/add.test.ts to verify that the new behaviour works and to prevent regression.

.yarn/versions/0d3ddb4d.yml Outdated Show resolved Hide resolved
@jj811208
Copy link
Contributor Author

Thanks for the PR, please add some tests to https://github.com/yarnpkg/berry/blob/15c481dce19f1a7e56b875b96f11c9ef67dc4c2d/packages/acceptance-tests/pkg-tests-specs/sources/commands/add.test.ts to verify that the new behaviour works and to prevent regression.

Thanks for the quick review! I added a new test to this commit de54cb6 .

@jj811208 jj811208 requested a review from merceyz August 28, 2022 02:43
@arcanis arcanis merged commit af7eb98 into yarnpkg:master Sep 3, 2022
@arcanis
Copy link
Member

arcanis commented Sep 3, 2022

Thanks!

merceyz pushed a commit that referenced this pull request Sep 28, 2022
…together (#4800)

* refactor(essentials): replace tuple arrays with object arrays, making flat arrays easy

* refactor(essentials): rename `suggestions` to `suggestedDescriptors` to prevent confusion

* fix(essentials): yarn add `--peer`, `--dev` not working at the same time

* test: add test for `yarn add --dev --peer` usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: add --dev --peer does not do what I mean
3 participants