Bug fix: [repo-tools] generate-patch adds incompatible locator (#29046)
* fix: Only encode the version for yarn patches Signed-off-by: Jack Palmer <jackpalmer@spotify.com> * chore: changeset Signed-off-by: Jack Palmer <jackpalmer@spotify.com> --------- Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/repo-tools': patch
|
||||
---
|
||||
|
||||
Fix issue where generate-patch incorrectly encodes the locator not aligning with result of yarn patch
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user