Skip to content

chore: add constraint for duplicate dependency declarations#13744

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
merceyz:merceyz/chore/duplicate-dependency
Sep 10, 2021
Merged

chore: add constraint for duplicate dependency declarations#13744
nicolo-ribaudo merged 1 commit intobabel:mainfrom
merceyz:merceyz/chore/duplicate-dependency

Conversation

@merceyz
Copy link
Copy Markdown
Contributor

@merceyz merceyz commented Sep 9, 2021

Q                       A
Tests Added + Pass? Yes
License MIT

Added a constraint to enforce the change in #13737, while it doesn't cause issues in published packages since devDependencies are ignored, it can cause an issue in the monorepo since devDependencies wins when a dependency is declared in both dependencies and devDependencies.

@babel-bot
Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/48615/

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Sep 9, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 251abb8:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

We can apply the constraints to (peerDependencies, dependencies) too.

@JLHwung JLHwung added the PR: Internal 🏠 A type of pull request used for our changelog categories label Sep 10, 2021
@merceyz
Copy link
Copy Markdown
Contributor Author

merceyz commented Sep 10, 2021

@JLHwung That's actually a valid pattern, Yarn will use the peerDependencies if provided by the parent and dependencies if not, "peer dependencies with a default" if you will.
https://yarnpkg.com/configuration/manifest/#peerDependencies

@nicolo-ribaudo nicolo-ribaudo merged commit 0ca601a into babel:main Sep 10, 2021
@merceyz merceyz deleted the merceyz/chore/duplicate-dependency branch September 10, 2021 07:09
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants