-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(turborepo): add berry support for built meta when pruning #8550
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Skipped Deployments
|
@vinnymac is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for the PR! I think this looks good to me, but I'll be doing some additional testing just because |
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.
Thank you for the PR!
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
@@ -163,6 +163,9 @@ where | |||
|
|||
for (dependency, meta) in metadata { | |||
let dependency = dependency.as_ref(); | |||
if meta.built.unwrap_or_default() { |
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.
Sorry I missed this, I believe this logic needs to be changed so we only include built
if it is present. add_line
will also need to be updated to be able to write both true and false.
if meta.built.unwrap_or_default() { | |
if meta.built.unwrap_or_default() { |
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.
I updated it so all three dependencyMeta settings support true and false. And check if they are present before adding the lines.
Let me know if you find any more 🐛 s. 🙇🏼♂️
if let Some(optional) = meta.optional { | ||
add_line(dependency, "optional", optional); | ||
} | ||
if let Some(unplugged) = meta.unplugged { |
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.
After updating this for built
, I assumed someone may set optional or unplugged to false, and then that too would become an issue.
@chris-olszewski fixed an issue with this change where I somehow forgot to support more than one dependency meta setting for a single dependency 😅. This should do the job now, let me know what you think. |
@vinnymac @chris-olszewski Just want to check in with you both to see if we want to finish up this PR? I'm doing some housekeeping to close out stale items in the repo (but would love to see this get merged!) |
This is in a good place, just needs a review first so it can move forward. @chris-olszewski did you want any changes here? |
…runing (#9605) ### Description A rebase of #8550 as rebasing those commits past #8813. I do not know exactly what about that change resulted in my repo getting into such a bad state, but I needed to do a fresh clone after trying to rebase past it. From the original PR: Add support for [yarn berry built option](https://yarnpkg.com/configuration/manifest#dependenciesMeta.built) for dependencies meta to turbo prune. Without this change, yarn install --immutable fails because built is added after turbo accidentally removes it, triggering the following error. > The lockfile would have been modified by this install, which is explicitly forbidden. All credit to @vinnymac for the original PR #### Additional Changes I added some additional unit tests and reworked the `dependenciesMeta` serialization logic so it support multiple fields per dependency. ### Testing Instructions Added unit test along with updating the roundtrip text fixture to include a dependency with `built: false`
Description
Add support for yarn berry built option for dependencies meta to
turbo prune
.Without this change,
yarn install --immutable
fails becausebuilt
is added after turbo accidentally removes it, triggering the following error.Testing Instructions
built: false
.yarn install --immutable
on that small lockfile