-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(plugin-pack): reload manifest after prepack script #3146
Conversation
8abe25a
to
ce14a28
Compare
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.
That won't work. We special-case package.json
precisely because we want to use the manifest from memory, because beforeWorkspacePacking
is meant to allow in-memory package mutations (which we use to implement publishConfig
).
Generally, prepack
is intended to be idempotent, so mutating the package.json
isn't a practice we'd recommend. Instead, you should use beforeWorkspacePacking
(which is more verbose). It's a bit unclear by your issue what you mean by "I want to Yarn to still perform the processing it normally does", so I'm not sure why it wouldn't work.
Just to be clear, this isn't at odds with what
I want Yarn and its plugins to still run their |
Any further thoughts on this? I really can't see how supporting this would disrupt anything. I've been using this patch in my CI/CD pipeline for the past few weeks, and I actually already do use |
ce14a28
to
ee89a7c
Compare
Yep, that looks good to me - I've updated the versions since I think it qualifies as a bugfix more than a breaking change. |
What's the problem this PR addresses?
Resolves #3145 - see issue for rationale.
How did you fix it?
This unconditionally reloads the active workspace's manifest during
prepareForPack
after the prepack lifecycle script exits.Checklist