Skip to content

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

Merged
legobeat merged 2 commits into
MetaMask:mainfrom
legobeat:constraints-allow-consistent-dependency-ranges-exception
Oct 9, 2024
Merged

chore(constraints): allow exceptions for dependency-range consistency#4772
legobeat merged 2 commits into
MetaMask:mainfrom
legobeat:constraints-allow-consistent-dependency-ranges-exception

Conversation

@legobeat

@legobeatlegobeat commented Oct 9, 2024

Copy link
Copy Markdown
Contributor

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
legobeatforce-pushed the constraints-allow-consistent-dependency-ranges-exception branch from 8be8f73 to d7c7bd1CompareOctober 9, 2024 05:13
@legobeatlegobeat changed the title chore(constraints): allow execeptions for dependency-range consistencychore(constraints): allow exceptions for dependency-range consistencyOct 9, 2024
@legobeat
legobeat marked this pull request as ready for review October 9, 2024 05:21
@legobeat
legobeat requested a review from a teamOctober 9, 2024 05:21
@legobeat
legobeatforce-pushed the constraints-allow-consistent-dependency-ranges-exception branch from d7c7bd1 to 4502883CompareOctober 9, 2024 05:22
@legobeat
legobeatforce-pushed the constraints-allow-consistent-dependency-ranges-exception branch from ae521de to f23be0cCompareOctober 9, 2024 20:39
Comment threadyarn.config.cjs
Comment on lines +728 to +730
const ALLOWED_INCONSISTENT_DEPENDENCIES = Object.entries({
// '@metamask/foo': ['^1.0.0'],
});

Copy link
Copy Markdown
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?

@legobeatlegobeatOct 9, 2024

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@MrtenzMrtenz left a comment

Copy link
Copy Markdown
Member

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:mainOct 9, 2024
@legobeat
legobeat deleted the constraints-allow-consistent-dependency-ranges-exception branch October 9, 2024 21:08
Sign up for freeto 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

@legobeat@Mrtenz