diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 5c5bcf32a8ed9..26499461dc971 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -26,6 +26,13 @@ // Monorepo packages are excluded in renovate-config.js, where we can read // the list of them in code. + // Disable the packagist 'wordpress/classic-editor-plugin'. It's not in packagist, and we have a customManager for it below. + { + matchDatasources: [ 'packagist' ], + matchDepNames: [ 'wordpress/classic-editor-plugin' ], + enabled: false, + }, + // Widen PHP dev deps to maintain support for old PHP versions we still support. // When we drop an old PHP version we'll manually go through and narrow any ranges. // (non-dev deps are handled in renovate-config.js where we can read the correct value for `constraints.php`) @@ -106,7 +113,35 @@ depNameTemplate: 'renovate', packageNameTemplate: 'ghcr.io/renovatebot/renovate', }, + + // wpcomsh's wordpress/classic-editor-plugin fake-package. + { + customType: 'regex', + fileMatch: [ '^projects/plugins/wpcomsh/composer\\.json$' ], + matchStrings: [ + // Alas the only option is regexing to match against the JSON. Four patterns for the four different places the version number appears. + // .require: + '"wordpress/classic-editor-plugin": "(?[0-9.]+)",', + // .repositories[].package.version + '"name": "wordpress/classic-editor-plugin",\\s+"version": "(?[0-9.]+)",', + // .repositories[].package.dist.url + '"url": "https://downloads\\.wordpress\\.org/plugin/classic-editor\\.(?[0-9.]+)\\.zip",', + // .repositories[].package.source.reference + '"url": "https://plugins\\.svn\\.wordpress\\.org/classic-editor/",\\s+"type": "svn",\\s+"reference": "tags/(?[0-9.]+)/"', + ], + depNameTemplate: 'wordpress/classic-editor-plugin', + packageNameTemplate: 'classic-editor', + datasourceTemplate: 'custom.wordpress-plugin', + }, ], + customDatasources: { + 'wordpress-plugin': { + defaultRegistryUrlTemplate: 'https://api.wordpress.org/plugins/info/1.0/{{packageName}}.json', + transformTemplates: [ + '{ "releases": $each( versions, function($v, $k) { $match( $k, /^[0-9.]+$/ ) ? { "version": $k } } ) }', + ], + }, + }, lockFileMaintenance: { enabled: true, diff --git a/projects/plugins/wpcomsh/changelog/fix-renovate-and-wpcomsh-weird-deps b/projects/plugins/wpcomsh/changelog/fix-renovate-and-wpcomsh-weird-deps new file mode 100644 index 0000000000000..3a53fc09c7c1d --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/fix-renovate-and-wpcomsh-weird-deps @@ -0,0 +1,5 @@ +Significance: patch +Type: added +Comment: Add names in composer.json `repositories` to make Renovate happy. No change to functionality. + + diff --git a/projects/plugins/wpcomsh/composer.json b/projects/plugins/wpcomsh/composer.json index 13cbd02b642c8..3a49897425ed9 100644 --- a/projects/plugins/wpcomsh/composer.json +++ b/projects/plugins/wpcomsh/composer.json @@ -73,26 +73,31 @@ } }, { + "name": "automattic/custom-fonts", "type": "vcs", "no-api": true, "url": "https://github.com/Automattic/custom-fonts.git" }, { + "name": "automattic/custom-fonts-typekit", "type": "vcs", "no-api": true, "url": "https://github.com/Automattic/custom-fonts-typekit.git" }, { + "name": "automattic/at-pressable-podcasting", "type": "vcs", "no-api": true, "url": "https://github.com/automattic/at-pressable-podcasting.git" }, { + "name": "automattic/text-media-widget-styles", "type": "vcs", "no-api": true, "url": "https://github.com/Automattic/text-media-widget-styles.git" }, { + "name": "automattic/wc-calypso-bridge", "type": "vcs", "no-api": true, "url": "https://github.com/Automattic/wc-calypso-bridge.git" diff --git a/projects/plugins/wpcomsh/composer.lock b/projects/plugins/wpcomsh/composer.lock index 65a9882b39836..d7d7162f66b85 100644 --- a/projects/plugins/wpcomsh/composer.lock +++ b/projects/plugins/wpcomsh/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d93707e0127e4b653ef7cbe67245bc39", + "content-hash": "2fbe57d46fc37e2ff4d82f863058a224", "packages": [ { "name": "automattic/at-pressable-podcasting",