From 8530fdda53e803ead2fb1d0e3a9e0686cb29101e Mon Sep 17 00:00:00 2001 From: Theryn Groetken Date: Wed, 7 Sep 2022 14:39:03 -0500 Subject: [PATCH 1/3] feat: Expose Commands and Add Temp Path --- packages/plugin-patch/sources/commands/patch.ts | 9 +++++++-- packages/plugin-patch/sources/index.ts | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/plugin-patch/sources/commands/patch.ts b/packages/plugin-patch/sources/commands/patch.ts index 5f980c5f0235..d4457b70b87f 100644 --- a/packages/plugin-patch/sources/commands/patch.ts +++ b/packages/plugin-patch/sources/commands/patch.ts @@ -32,6 +32,8 @@ export default class PatchCommand extends BaseCommand { package = Option.String(); + tempPatchPath: string = ``; + async execute() { const configuration = await Configuration.find(this.context.cwd, this.context.plugins); const {project, workspace} = await Project.find(configuration, this.context.cwd); @@ -76,10 +78,13 @@ export default class PatchCommand extends BaseCommand { }, async report => { const unpatchedLocator = patchUtils.ensureUnpatchedLocator(locator); const temp = await patchUtils.extractPackageToDisk(locator, {cache, project}); + const tempPath = npath.fromPortablePath(temp); + + this.tempPatchPath = tempPath; report.reportJson({ locator: structUtils.stringifyLocator(unpatchedLocator), - path: npath.fromPortablePath(temp), + path: tempPath, }); const updateString = this.update @@ -88,7 +93,7 @@ export default class PatchCommand extends BaseCommand { report.reportInfo(MessageName.UNNAMED, `Package ${structUtils.prettyLocator(configuration, unpatchedLocator)} got extracted with success${updateString}!`); report.reportInfo(MessageName.UNNAMED, `You can now edit the following folder: ${formatUtils.pretty(configuration, npath.fromPortablePath(temp), `magenta`)}`); - report.reportInfo(MessageName.UNNAMED, `Once you are done run ${formatUtils.pretty(configuration, `yarn patch-commit -s ${process.platform === `win32` ? `"` : ``}${npath.fromPortablePath(temp)}${process.platform === `win32` ? `"` : ``}`, `cyan`)} and Yarn will store a patchfile based on your changes.`); + report.reportInfo(MessageName.UNNAMED, `Once you are done run ${formatUtils.pretty(configuration, `yarn patch-commit -s ${process.platform === `win32` ? `"` : ``}${tempPath}${process.platform === `win32` ? `"` : ``}`, `cyan`)} and Yarn will store a patchfile based on your changes.`); }); } } diff --git a/packages/plugin-patch/sources/index.ts b/packages/plugin-patch/sources/index.ts index 816826ba03f8..5f97c1e8f9cb 100644 --- a/packages/plugin-patch/sources/index.ts +++ b/packages/plugin-patch/sources/index.ts @@ -9,6 +9,8 @@ import * as patchUtils from './patchUtils'; export {patchUtils}; +export {PatchCommit, Patch}; + export interface Hooks { /** * Registers a builtin patch that can be referenced using the dedicated From 6730b18c53a1ab89c14dce5dd016db32c3a4e9e6 Mon Sep 17 00:00:00 2001 From: Theryn Groetken Date: Wed, 7 Sep 2022 14:50:41 -0500 Subject: [PATCH 2/3] check version --- .yarn/versions/e834d604.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .yarn/versions/e834d604.yml diff --git a/.yarn/versions/e834d604.yml b/.yarn/versions/e834d604.yml new file mode 100644 index 000000000000..2b30485de49b --- /dev/null +++ b/.yarn/versions/e834d604.yml @@ -0,0 +1,2 @@ +releases: + "@yarnpkg/plugin-patch": patch From 43197102247f2dc6f50c94514cf13832a44a0a91 Mon Sep 17 00:00:00 2001 From: Theryn Groetken Date: Wed, 7 Sep 2022 14:58:45 -0500 Subject: [PATCH 3/3] check version --- .yarn/versions/e834d604.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.yarn/versions/e834d604.yml b/.yarn/versions/e834d604.yml index 2b30485de49b..d82515483053 100644 --- a/.yarn/versions/e834d604.yml +++ b/.yarn/versions/e834d604.yml @@ -1,2 +1,6 @@ releases: "@yarnpkg/plugin-patch": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/cli"