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

chore(constraints): allow exceptions for dependency-range consistency #4772

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Oct 9, 2024

Explanation

This allows adding explicit exceptions for the Yarn constraint expectConsistentDependenciesAndDevDependencies.

An exception entry consists of a package name and a set of exact version ranges to be ignored in checking.

This is useful when we have "repo-circular" dependencies, where package A (in this repo) depends on package B (in another repo), which in its turn depends on package C (back again in this repo), finally depending on some package D.

In some cases, bumping D atomically in the monorepo makes things very heavy-handed. This change allows to slice it up in such situations.

References

Changelog

None

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@legobeat legobeat force-pushed the constraints-allow-consistent-dependency-ranges-exception branch from 8be8f73 to d7c7bd1 Compare October 9, 2024 05:13
@legobeat legobeat changed the title chore(constraints): allow execeptions for dependency-range consistency chore(constraints): allow exceptions for dependency-range consistency Oct 9, 2024
@legobeat legobeat marked this pull request as ready for review October 9, 2024 05:21
@legobeat legobeat requested a review from a team as a code owner October 9, 2024 05:21
@legobeat legobeat force-pushed the constraints-allow-consistent-dependency-ranges-exception branch from d7c7bd1 to 4502883 Compare October 9, 2024 05:22
@legobeat legobeat force-pushed the constraints-allow-consistent-dependency-ranges-exception branch from ae521de to f23be0c Compare October 9, 2024 20:39
Comment on lines +728 to +730
const ALLOWED_INCONSISTENT_DEPENDENCIES = Object.entries({
// '@metamask/foo': ['^1.0.0'],
});
Copy link
Member

Choose a reason for hiding this comment

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

Should this be near the top of the file?

Copy link
Contributor Author

@legobeat legobeat Oct 9, 2024

Choose a reason for hiding this comment

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

I'm thinking co-locating is clearer (esp since other exceptions are also currently inlined) but I will move it out of the function body in a follow-up!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Looks good to me. Based on the conversation on Slack, it seems like the wallet framework team agrees with this change as well.

@legobeat legobeat merged commit b00c6be into MetaMask:main Oct 9, 2024
116 checks passed
@legobeat legobeat deleted the constraints-allow-consistent-dependency-ranges-exception branch October 9, 2024 21:08
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.

2 participants