diff --git a/.yarn/plugins/linker.cjs b/.yarn/plugins/linker.cjs index 9172a206..cf7181f9 100644 --- a/.yarn/plugins/linker.cjs +++ b/.yarn/plugins/linker.cjs @@ -9,6 +9,9 @@ module.exports = { name: "linker", factory: (require) => ({ hooks: { + // Yarn's plugin system is very light on documentation. The best we have + // for this hook is simply the type definition in + // https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-core/sources/Plugin.ts registerPackageExtensions: async (config, registerPackageExtension) => { const { structUtils } = require("@yarnpkg/core"); const { parseSyml } = require("@yarnpkg/parsers"); @@ -56,10 +59,11 @@ module.exports = { structUtils.parseDescriptor(`${name}@*`, true).identHash, ); + // Extend our own package's dependencies with these local overrides registerPackageExtension(selfDescriptor, { dependencies: overrides }); // Filter out the original dependencies from the package spec so Yarn - // knows to override them + // actually respects the overrides const filterDependencies = (original) => { const pkg = structUtils.copyPackage(original); pkg.dependencies = new Map( @@ -70,7 +74,7 @@ module.exports = { return pkg; }; - // Patch Yarn's own normalizePackage method with the above filter + // Patch Yarn's own normalizePackage method to use the above filter const originalNormalizePackage = config.normalizePackage; config.normalizePackage = function (pkg, extensions) { return originalNormalizePackage.call(