feat(plugin-patch): Expose Temp Patch Path #4831
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
This PR aims to improve the ability to write plugins that pertain to "patching" with Yarn.
In the Clipanion docs there is a section about how to
add options to an existing command
. In order to do this, as you may know, you need access to the original Command and then you can extend from that.Yarn berry does not expose either command in its
plugin-patch
package - which forced me to have to copy/paste them into my codebase (after a few failed attempts to work around it).Since the expected practice is to extend the command you're plugging - then I think its reasonable to export these command so they may be extended.
This PR also includes another change - related to
patch
plug-ability. Thetemp
folder path is not stored anywhere accessible from within the command. This makes sense - as it was never exposed and if it was needed it could be quickly modified within the existing file.With the exposure of these classes - its also helpful to have to path to which the patch was written to. An example that may help is - the plugin I'm writing will automatically open your "preferred editor" if set (much like
git
does - seecore.editor
)....
How did you fix it?
...
export
both commands in this packagepatch
class to expose to extended commandsChecklist