-
Notifications
You must be signed in to change notification settings - Fork 198
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: add peer dep alignment to constraints #3541
Conversation
🦋 Changeset detectedLatest commit: 7dbe129 The changes in this PR will be included in the next version bump. This PR includes changesets to release 88 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
bb593b5
to
9cab2f6
Compare
File metricsSummaryTotal size: 2.24 MB* 🎉 No changes detected in any packages * Size is the sum of all main files for packages in the library.* An ASCII character in UTF-8 is 8 bits or 1 byte. |
59225b6
to
e22d58a
Compare
"@spectrum-css/tokens": { | ||
"optional": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"@spectrum-css/tokens": { | |
"optional": true | |
"@spectrum-css/tokens": { | |
"optional": true |
Tokens shouldn't be appearing as optional should it? (appearing on multiple components)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's not optional to appear in the DOM with the component but it is optional whether downstream consumers choose to install it as a dependency in the same package. It's problematic for us to list it as a required peerDep because SWC ships those styles from different packages. I definitely don't want to loose the peerDependency information but thought this would be a good way to reduce errors in the install that just end up ignored.
"@spectrum-css/icon": { | ||
"optional": true | ||
}, | ||
"@spectrum-css/menu": { | ||
"optional": true | ||
}, | ||
"@spectrum-css/popover": { | ||
"optional": true | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't optional for a functioning Picker. I'm seeing a lot of components with peer dependencies added as optional that aren't really optional, or is there some other criteria here for what is optional that I'm not aware of?
Edit: I see the PR description mentions "all local peerDependencies should be listed as optional in the peerDependenciesMeta", could you explain that change?
"@spectrum-css/icon": ">=7", | ||
"@spectrum-css/tokens": ">=14 || >=15" | ||
"@spectrum-css/icon": ">=9.0.0 <10.0.0", | ||
"@spectrum-css/tokens": ">=16.0.0 <17.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a lot of these semver range changes appearing with both >=
and <
, is there any reason not to use the caret range instead? For example, this line could just be "@spectrum-css/tokens": "^16.0.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are equivalent, that's true. I just like the readability of this syntax in peerDeps; it's subtly more readable. Any reason to use caret instead?
803cbdd
to
a8faf4a
Compare
🚀 Deployed on https://pr-3541--spectrum-css.netlify.app |
a8faf4a
to
7dbe129
Compare
Description
Updated the constraints
yarn.config.cjs
:How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
yarn constraints
, expect this to return warnings about misaligned shared dependencies, recommending update to the latest version required in the projectyarn constraints
, expect peerDependencies to match local major version, all local peerDependencies should be listed as optional in the peerDependenciesMetaTo-do list