You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some patches that we share across multiple projects so we decided to move them to a shared 'infra' dependency which we then add as part of everyone of our projects.
We are now migrating from Yarn to pnpm and we used to use patch-package to apply our patches, and we could do this postinstall command:
That would then apply the local packages and the shared ones from the infra dependency but that isn't possible anymore with pnpm native patch mechanism due to the fact that it doesn't even let install dependencies before applying the patches )':
Describe the solution you'd like
Basically allow to install project dependencies before applying patches and allow to patch local dependencies from a patch folder from a dependency (or some other mechanism that allows for that without having to fork projects)
Describe the drawbacks of your solution
I'm not sure there are any without having to fork some projects and maintain said fork
Describe alternatives you've considered
Forking
The text was updated successfully, but these errors were encountered:
I don't think this is possible to implement unless we come up with a new dependency type that is installed before the rest.
You can create a package in a subdirectory. Add your package with patches as a dependency there. In your main package you can add a pnpm:devPreinstall script that will install the dependencies in the subpackage. Then reference the patches from the node_modules of the subpackage.
Contribution
Describe the user story
We have some patches that we share across multiple projects so we decided to move them to a shared 'infra' dependency which we then add as part of everyone of our projects.
We are now migrating from Yarn to pnpm and we used to use
patch-package
to apply our patches, and we could do this postinstall command:That would then apply the local packages and the shared ones from the infra dependency but that isn't possible anymore with pnpm native patch mechanism due to the fact that it doesn't even let install dependencies before applying the patches )':
Describe the solution you'd like
Basically allow to install project dependencies before applying patches and allow to patch local dependencies from a patch folder from a dependency (or some other mechanism that allows for that without having to fork projects)
Describe the drawbacks of your solution
I'm not sure there are any without having to fork some projects and maintain said fork
Describe alternatives you've considered
Forking
The text was updated successfully, but these errors were encountered: