diff --git a/.changeset/silly-taxis-suffer.md b/.changeset/silly-taxis-suffer.md new file mode 100644 index 0000000000..7763a70f39 --- /dev/null +++ b/.changeset/silly-taxis-suffer.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Fix issue where generate-patch incorrectly encodes the locator not aligning with result of yarn patch diff --git a/packages/repo-tools/src/commands/generate-patch/generate-patch.ts b/packages/repo-tools/src/commands/generate-patch/generate-patch.ts index 224b7ae4e6..10b31e0584 100644 --- a/packages/repo-tools/src/commands/generate-patch/generate-patch.ts +++ b/packages/repo-tools/src/commands/generate-patch/generate-patch.ts @@ -254,12 +254,7 @@ async function generatePatch( await fs.writeFile(joinPath(patchDir, name), patch, 'utf8'); const locator = `${ctx.sourcePkg.packageJson.name}@npm:${version}`; - return `patch:${encodeURIComponent(locator)}#${posix.join( - '.', - '.yarn', - 'patches', - name, - )}`; + return `patch:${locator}#${posix.join('.', '.yarn', 'patches', name)}`; } // Check if an existing resolution entry is a patch, and in that case return the