Skip to content

[Feature] Please improve the yarn patch DX like pnpm patch or patch-package #6772

Open
@JounQin

Description

@JounQin
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

Now when using yarn patch, a temp dir is created and requires the use to run code <temp dir> to apply the patch and then yarn patch commit <temp dir>, the workflow is really painful, and unexpected files like .DS_Store could be included if the user open the <temp dir> in macOS Finder, for example.

patch-package has much better DX that it allows to modify directly in node_modules and then the user can test before save the .patch, but it doesn't support yarn v2+ well, I raised ds300/patch-package#507 to fix it and published at @unts/patch-package, but it would be awesome to have the best DX in yarn berry itself!

pnpm patch used the same approach as yarn patch previously, but now it has better DX after pnpm/pnpm#9251

Describe the solution you'd like

For projects using nodeLinker: node_modules, the approach of patch-package is best.

For projects using other nodeLinker options, the approach of the new pnpm patch would also be good enough.

Describe the drawbacks of your solution

I cann't see any drawbacks

Describe alternatives you've considered

Keep it as-is and let the 3rd-party package @unts/patch-package do the dirty.

cc @arcanis @clemyan

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions