-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
allow "patchedDependencies"
patch files to come from dependencies
#8023
Comments
The patch file ( |
yeah I removed it because it didn't work. try this one: |
Theoretically, it can be implemented. However, it would be a complicated change for something that isn't good practice IMO. I would suggest you just to fork the problematic dependencies and republish them with new names and the fixes applied. If the dependency is somewhere deep and you don't want to fork the whole chain of dependencies, then you can use an override to replace a subdep with your fork. E.g.: {
"pnpm": {
"overrides": {
"foo@1": "npm:@norman/foo@1"
}
}
} |
I don't really want to fork typescript. that sounds like a lot of work |
You don't need to fork TS source code, just download the tarball, edit the file you want to change, and publish it under new names. It's just like |
hmm, I'll think about the option, thank you |
Contribution
Describe the user story
I have a template. As with all templates, it has an issue where I update the template, but people's copies of the template do not and cannot be easily updated. The main 2 ways this template gets out of date is the
hackmud.d.ts
type declaration file and thepatches/typescript@5.4.2.patch
file. The declaration file is an easy fix, I can move it into the dependency that I control and add"types": [ "hackmud-script-manager/env" ]
to thetsconfig.json
. I thought I could maybe do the same thing with the patch file and add"pnpm": { "patchedDependencies": { "typescript@5.4.5": "node_modules/hackmud-script-manager/typescript.patch" } }
to thepackage.json
.I straight away hit
however which makes sense because before I install the dependencies, the patch file does not exist.
I tried adding
"allowNonAppliedPatches": true
but it had no affect.Describe the solution you'd like
Apply patches after dependencies are installed (might want to disallow a patch file from a dependency for itself).
Describe the drawbacks of your solution
I think
pnpm install
with patch files might be slower since it can't be as concurrent as before (but I've not looked at howpnpm install
works so it might have no affect).Describe alternatives you've considered
Or respect
"allowNonAppliedPatches": true
for when the patch file can't be found.Or add a CLI option to specify patches for dependencies so users can do a regular
pnpm install
followed by apnpm install --magic-options-to-apply-patches
.The text was updated successfully, but these errors were encountered: