Update @woocommerce/components

This commit is contained in:
Jan Jakes
2023-07-18 16:55:57 +02:00
committed by Aschepikov
parent 77ff76f77f
commit d8cf0121bf
3 changed files with 863 additions and 237 deletions

22
.pnpmfile.cjs Normal file
View File

@@ -0,0 +1,22 @@
function readPackage(pkg) {
// Resolve @wordpress/* dependencies of @woocommerce packages to those used by MailPoet.
// This avoids their duplication and downgrading due to @woocommerce pinning them to wp-6.0.
// This should be removed once we adopt similar pinning strategy and use dependency extraction.
// See: https://github.com/woocommerce/woocommerce/pull/37034
if (pkg.name?.startsWith('@woocommerce/')) {
pkg.dependencies = Object.fromEntries(
Object.entries(pkg.dependencies).map(([name, version]) =>
name.startsWith('@wordpress/') || name.startsWith('@types/wordpress__')
? [name, '*']
: [name, version],
),
);
}
return pkg;
}
module.exports = {
hooks: {
readPackage,
},
};