From 537461b03fdf95a4107b4d024612c510d88f45af Mon Sep 17 00:00:00 2001
From: RahulGautamSingh <rahultesnik@gmail.com>
Date: Fri, 18 Feb 2022 12:15:59 +0545
Subject: [PATCH] feat: migrate packagist to v2 (#14104)

---
 .../packagist/__fixtures__/mailchimp-api.json | 657 ++++++------------
 .../__fixtures__/mailchimp-api~dev.json       | 118 ++++
 .../__snapshots__/index.spec.ts.snap          |  76 +-
 lib/datasource/packagist/index.spec.ts        |  25 +-
 lib/datasource/packagist/index.ts             |  20 +-
 5 files changed, 433 insertions(+), 463 deletions(-)
 create mode 100644 lib/datasource/packagist/__fixtures__/mailchimp-api~dev.json

diff --git a/lib/datasource/packagist/__fixtures__/mailchimp-api.json b/lib/datasource/packagist/__fixtures__/mailchimp-api.json
index 7fb2a254e0..3e3206c10b 100644
--- a/lib/datasource/packagist/__fixtures__/mailchimp-api.json
+++ b/lib/datasource/packagist/__fixtures__/mailchimp-api.json
@@ -1,42 +1,17 @@
 {
+  "minified": "composer/2.0",
   "packages": {
-    "drewm/mailchimp-api": {
-      "dev-api-v2": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v2 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "dev-api-v2",
-        "version_normalized": "dev-api-v2",
-        "license": ["MIT"],
-        "authors": [
-          { "name": "Drew McLellan", "homepage": "http://allinthehead.com/" }
-        ],
-        "source": {
-          "type": "git",
-          "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "2ace9cf087bea43d0bf9c7207d94ce93642e6262"
-        },
-        "dist": {
-          "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/2ace9cf087bea43d0bf9c7207d94ce93642e6262",
-          "reference": "2ace9cf087bea43d0bf9c7207d94ce93642e6262",
-          "shasum": ""
-        },
-        "type": "library",
-        "time": "2016-01-17T15:57:27+00:00",
-        "autoload": { "psr-0": { "Drewm": "src/" } },
-        "require": { "php": ">=5.3" },
-        "uid": 660713
-      },
-      "dev-api-v3": {
+    "drewm/mailchimp-api": [
+      {
         "name": "drewm/mailchimp-api",
         "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
         "keywords": [],
         "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "dev-api-v3",
-        "version_normalized": "dev-api-v3",
-        "license": ["MIT"],
+        "version": "v2.5.4",
+        "version_normalized": "2.5.4.0",
+        "license": [
+          "MIT"
+        ],
         "authors": [
           {
             "name": "Drew McLellan",
@@ -47,311 +22,215 @@
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "268dca3f0e35bdc263ceb8114b24c7496c3b46f5"
+          "reference": "c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/268dca3f0e35bdc263ceb8114b24c7496c3b46f5",
-          "reference": "268dca3f0e35bdc263ceb8114b24c7496c3b46f5",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a",
+          "reference": "c6cdfab4ca6ddbc3b260913470bd0a4a5cb84c7a",
           "shasum": ""
         },
         "type": "library",
-        "time": "2016-01-17T15:59:26+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
+        "time": "2019-08-06T09:24:58+00:00",
+        "autoload": {
+          "psr-4": {
+            "DrewM\\MailChimp\\": "src"
+          }
+        },
+        "require": {
+          "php": ">=5.3",
+          "ext-curl": "*",
+          "ext-json": "*"
+        },
         "require-dev": {
-          "phpunit/phpunit": "4.0.*",
+          "phpunit/phpunit": "7.0.*",
           "vlucas/phpdotenv": "^2.0"
         },
-        "uid": 456958
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/master"
+        }
       },
-      "dev-master": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "dev-master",
-        "version_normalized": "9999999-dev",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.5.3",
+        "version_normalized": "2.5.3.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "e3febc93dbe8047f0a14fea19c1efe79cecc7e98"
+          "reference": "a6519cafba509e754e748d93f3532ad7f3aa515a"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/e3febc93dbe8047f0a14fea19c1efe79cecc7e98",
-          "reference": "e3febc93dbe8047f0a14fea19c1efe79cecc7e98",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a6519cafba509e754e748d93f3532ad7f3aa515a",
+          "reference": "a6519cafba509e754e748d93f3532ad7f3aa515a",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2018-02-23T09:45:38+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "vlucas/phpdotenv": "^2.0",
-          "phpunit/phpunit": "7.0.*"
-        },
-        "uid": 112102
+        "time": "2019-03-28T15:20:43+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.5.3"
+        }
       },
-      "v1.0": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v2 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v1.0",
-        "version_normalized": "1.0.0.0",
-        "license": ["MIT"],
-        "authors": [
-          { "name": "Drew McLellan", "homepage": "http://allinthehead.com/" }
-        ],
+      {
+        "version": "v2.5.2",
+        "version_normalized": "2.5.2.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "0b763f05fe18610061b8289a399a9d0569036a50"
+          "reference": "3e290e5640f56292b06403f3f4d3574e1e777948"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/0b763f05fe18610061b8289a399a9d0569036a50",
-          "reference": "0b763f05fe18610061b8289a399a9d0569036a50",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/3e290e5640f56292b06403f3f4d3574e1e777948",
+          "reference": "3e290e5640f56292b06403f3f4d3574e1e777948",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2014-05-30T16:51:39+00:00",
-        "autoload": { "psr-0": { "Drewm": "src/" } },
-        "require": { "php": ">=5.3" },
-        "uid": 249784
+        "time": "2019-03-26T09:00:38+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.5.2"
+        }
       },
-      "v1.1": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v2 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v1.1",
-        "version_normalized": "1.1.0.0",
-        "license": ["MIT"],
-        "authors": [
-          { "name": "Drew McLellan", "homepage": "http://allinthehead.com/" }
-        ],
+      {
+        "version": "v2.5.1",
+        "version_normalized": "2.5.1.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "707d555962442b21a75683a56bdb7cebd0a19f72"
+          "reference": "40296b5ea9d8b53e6478891e11dff30c1ef96cdc"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/707d555962442b21a75683a56bdb7cebd0a19f72",
-          "reference": "707d555962442b21a75683a56bdb7cebd0a19f72",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/40296b5ea9d8b53e6478891e11dff30c1ef96cdc",
+          "reference": "40296b5ea9d8b53e6478891e11dff30c1ef96cdc",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2015-07-07T15:38:25+00:00",
-        "autoload": { "psr-0": { "Drewm": "src/" } },
-        "require": { "php": ">=5.3" },
-        "uid": 454905
+        "time": "2019-03-19T11:43:38+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/master"
+        }
       },
-      "v2.0": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.0",
-        "version_normalized": "2.0.0.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.5",
+        "version_normalized": "2.5.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "a2eb58b615aff713fcb1714e33f321712c5be3c8"
+          "reference": "f532fa26cd6e7d17c9ba40a757d8c6bfee47dace"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a2eb58b615aff713fcb1714e33f321712c5be3c8",
-          "reference": "a2eb58b615aff713fcb1714e33f321712c5be3c8",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/f532fa26cd6e7d17c9ba40a757d8c6bfee47dace",
+          "reference": "f532fa26cd6e7d17c9ba40a757d8c6bfee47dace",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-01-17T13:08:01+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 660717
+        "time": "2018-02-16T15:31:05+00:00",
+        "require": {
+          "php": ">=5.3",
+          "ext-curl": "*"
+        },
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.5"
+        }
       },
-      "v2.1": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.1",
-        "version_normalized": "2.1.0.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.4",
+        "version_normalized": "2.4.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "a9bf617afb5a9bcb2601f5cc23b01a7b581d5659"
+          "reference": "fe480bb652f85270227bf6d639b0026a531f21fc"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a9bf617afb5a9bcb2601f5cc23b01a7b581d5659",
-          "reference": "a9bf617afb5a9bcb2601f5cc23b01a7b581d5659",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/fe480bb652f85270227bf6d639b0026a531f21fc",
+          "reference": "fe480bb652f85270227bf6d639b0026a531f21fc",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-01-30T16:12:54+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
+        "time": "2017-02-16T13:24:20+00:00",
         "require-dev": {
           "phpunit/phpunit": "4.0.*",
           "vlucas/phpdotenv": "^2.0"
         },
-        "uid": 678375
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/master"
+        }
       },
-      "v2.1.1": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.1.1",
-        "version_normalized": "2.1.1.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.3",
+        "version_normalized": "2.3.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "86f529eba05a7e4c3a3e091aed8ff056137e6251"
+          "reference": "6a5373378f8e61284be81d6424d22fb2a3a1ff9e"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/86f529eba05a7e4c3a3e091aed8ff056137e6251",
-          "reference": "86f529eba05a7e4c3a3e091aed8ff056137e6251",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6a5373378f8e61284be81d6424d22fb2a3a1ff9e",
+          "reference": "6a5373378f8e61284be81d6424d22fb2a3a1ff9e",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-04-06T08:37:20+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 766160
+        "time": "2016-12-21T14:50:24+00:00"
       },
-      "v2.1.2": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.1.2",
-        "version_normalized": "2.1.2.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.2.4",
+        "version_normalized": "2.2.4.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "f4539014e9cc96eab0f187f52eb60499518a31bb"
+          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/f4539014e9cc96eab0f187f52eb60499518a31bb",
-          "reference": "f4539014e9cc96eab0f187f52eb60499518a31bb",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
+          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-04-06T12:41:37+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 766567
+        "time": "2016-07-01T15:53:33+00:00"
       },
-      "v2.1.3": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.1.3",
-        "version_normalized": "2.1.3.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.2.3",
+        "time": "2016-07-01T15:53:33.000Z",
+        "version_normalized": "2.2.3.0"
+      },
+      {
+        "version": "v2.2.2",
+        "version_normalized": "2.2.2.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "6188e2be5827efb6595f63ad6f01a26e84bd39f7"
+          "reference": "6ebcfd131fd6f3cac69be9fccb6c3f8102736952"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6188e2be5827efb6595f63ad6f01a26e84bd39f7",
-          "reference": "6188e2be5827efb6595f63ad6f01a26e84bd39f7",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6ebcfd131fd6f3cac69be9fccb6c3f8102736952",
+          "reference": "6ebcfd131fd6f3cac69be9fccb6c3f8102736952",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-04-12T09:09:47+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
+        "time": "2016-07-01T09:58:24+00:00"
+      },
+      {
+        "version": "v2.2.1",
+        "version_normalized": "2.2.1.0",
+        "source": {
+          "type": "git",
+          "url": "https://github.com/drewm/mailchimp-api.git",
+          "reference": "a2bf78208c49b205482c5ca884cb45a8cd266d5c"
+        },
+        "dist": {
+          "type": "zip",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a2bf78208c49b205482c5ca884cb45a8cd266d5c",
+          "reference": "a2bf78208c49b205482c5ca884cb45a8cd266d5c",
+          "shasum": ""
         },
-        "uid": 774505
+        "time": "2016-04-23T18:00:21+00:00"
       },
-      "v2.2": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
+      {
         "version": "v2.2",
         "version_normalized": "2.2.0.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
@@ -363,268 +242,164 @@
           "reference": "590fb71e3493b5daba382c44f714f2e25d785814",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-04-23T12:43:28+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 790573
+        "time": "2016-04-23T12:43:28+00:00"
       },
-      "v2.2.1": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.2.1",
-        "version_normalized": "2.2.1.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.1.3",
+        "version_normalized": "2.1.3.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "a2bf78208c49b205482c5ca884cb45a8cd266d5c"
+          "reference": "6188e2be5827efb6595f63ad6f01a26e84bd39f7"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a2bf78208c49b205482c5ca884cb45a8cd266d5c",
-          "reference": "a2bf78208c49b205482c5ca884cb45a8cd266d5c",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6188e2be5827efb6595f63ad6f01a26e84bd39f7",
+          "reference": "6188e2be5827efb6595f63ad6f01a26e84bd39f7",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-04-23T18:00:21+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
+        "time": "2016-04-12T09:09:47+00:00",
+        "require": {
+          "php": ">=5.3"
         },
-        "uid": 843075
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.1.3"
+        }
       },
-      "v2.2.2": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.2.2",
-        "version_normalized": "2.2.2.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.1.2",
+        "version_normalized": "2.1.2.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "6ebcfd131fd6f3cac69be9fccb6c3f8102736952"
+          "reference": "f4539014e9cc96eab0f187f52eb60499518a31bb"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6ebcfd131fd6f3cac69be9fccb6c3f8102736952",
-          "reference": "6ebcfd131fd6f3cac69be9fccb6c3f8102736952",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/f4539014e9cc96eab0f187f52eb60499518a31bb",
+          "reference": "f4539014e9cc96eab0f187f52eb60499518a31bb",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-07-01T09:58:24+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 884940
+        "time": "2016-04-06T12:41:37+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/master"
+        }
       },
-      "v2.2.3": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.2.3",
-        "version_normalized": "2.2.3.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.1.1",
+        "version_normalized": "2.1.1.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8"
+          "reference": "86f529eba05a7e4c3a3e091aed8ff056137e6251"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
-          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/86f529eba05a7e4c3a3e091aed8ff056137e6251",
+          "reference": "86f529eba05a7e4c3a3e091aed8ff056137e6251",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-07-01T15:53:33+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 897514
+        "time": "2016-04-06T08:37:20+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.1.1"
+        }
       },
-      "v2.2.4": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.2.4",
-        "version_normalized": "2.2.4.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.1",
+        "version_normalized": "2.1.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8"
+          "reference": "a9bf617afb5a9bcb2601f5cc23b01a7b581d5659"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
-          "reference": "89b7dbc54b7ba8c2e249d6e63f66d22ecb8070f8",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a9bf617afb5a9bcb2601f5cc23b01a7b581d5659",
+          "reference": "a9bf617afb5a9bcb2601f5cc23b01a7b581d5659",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-07-01T15:53:33+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 897515
+        "time": "2016-01-30T16:12:54+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.1"
+        }
       },
-      "v2.3": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.3",
-        "version_normalized": "2.3.0.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v2.0",
+        "version_normalized": "2.0.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "6a5373378f8e61284be81d6424d22fb2a3a1ff9e"
+          "reference": "a2eb58b615aff713fcb1714e33f321712c5be3c8"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/6a5373378f8e61284be81d6424d22fb2a3a1ff9e",
-          "reference": "6a5373378f8e61284be81d6424d22fb2a3a1ff9e",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/a2eb58b615aff713fcb1714e33f321712c5be3c8",
+          "reference": "a2eb58b615aff713fcb1714e33f321712c5be3c8",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2016-12-21T14:50:24+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 1137300
+        "time": "2016-01-17T13:08:01+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v2.0"
+        }
       },
-      "v2.4": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.4",
-        "version_normalized": "2.4.0.0",
-        "license": ["MIT"],
+      {
+        "description": "Super-simple, minimum abstraction MailChimp API v2 wrapper",
+        "version": "v1.1",
+        "version_normalized": "1.1.0.0",
         "authors": [
           {
             "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
             "homepage": "http://allinthehead.com/"
           }
         ],
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "fe480bb652f85270227bf6d639b0026a531f21fc"
+          "reference": "707d555962442b21a75683a56bdb7cebd0a19f72"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/fe480bb652f85270227bf6d639b0026a531f21fc",
-          "reference": "fe480bb652f85270227bf6d639b0026a531f21fc",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/707d555962442b21a75683a56bdb7cebd0a19f72",
+          "reference": "707d555962442b21a75683a56bdb7cebd0a19f72",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2017-02-16T13:24:20+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "4.0.*",
-          "vlucas/phpdotenv": "^2.0"
+        "time": "2015-07-07T15:38:25+00:00",
+        "autoload": {
+          "psr-0": {
+            "Drewm": "src/"
+          }
+        },
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/v1.1"
         },
-        "uid": 1237997
+        "require-dev": "__unset"
       },
-      "v2.5": {
-        "name": "drewm/mailchimp-api",
-        "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
-        "keywords": [],
-        "homepage": "https://github.com/drewm/mailchimp-api",
-        "version": "v2.5",
-        "version_normalized": "2.5.0.0",
-        "license": ["MIT"],
-        "authors": [
-          {
-            "name": "Drew McLellan",
-            "email": "drew.mclellan@gmail.com",
-            "homepage": "http://allinthehead.com/"
-          }
-        ],
+      {
+        "version": "v1.0",
+        "version_normalized": "1.0.0.0",
         "source": {
           "type": "git",
           "url": "https://github.com/drewm/mailchimp-api.git",
-          "reference": "f532fa26cd6e7d17c9ba40a757d8c6bfee47dace"
+          "reference": "0b763f05fe18610061b8289a399a9d0569036a50"
         },
         "dist": {
           "type": "zip",
-          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/f532fa26cd6e7d17c9ba40a757d8c6bfee47dace",
-          "reference": "f532fa26cd6e7d17c9ba40a757d8c6bfee47dace",
+          "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/0b763f05fe18610061b8289a399a9d0569036a50",
+          "reference": "0b763f05fe18610061b8289a399a9d0569036a50",
           "shasum": ""
         },
-        "type": "library",
-        "time": "2018-02-16T15:31:05+00:00",
-        "autoload": { "psr-4": { "DrewM\\MailChimp\\": "src" } },
-        "require": { "php": ">=5.3", "ext-curl": "*" },
-        "require-dev": {
-          "phpunit/phpunit": "7.0.*",
-          "vlucas/phpdotenv": "^2.0"
-        },
-        "uid": 1920725
+        "time": "2014-05-30T16:51:39+00:00",
+        "support": {
+          "issues": "https://github.com/drewm/mailchimp-api/issues",
+          "source": "https://github.com/drewm/mailchimp-api/tree/master"
+        }
       }
-    }
+    ]
   }
-}
+}
\ No newline at end of file
diff --git a/lib/datasource/packagist/__fixtures__/mailchimp-api~dev.json b/lib/datasource/packagist/__fixtures__/mailchimp-api~dev.json
new file mode 100644
index 0000000000..cbed44976f
--- /dev/null
+++ b/lib/datasource/packagist/__fixtures__/mailchimp-api~dev.json
@@ -0,0 +1,118 @@
+{
+    "minified": "composer/2.0",
+    "packages": {
+        "drewm/mailchimp-api": [
+            {
+                "name": "drewm/mailchimp-api",
+                "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
+                "keywords": [],
+                "homepage": "https://github.com/drewm/mailchimp-api",
+                "version": "dev-master",
+                "version_normalized": "dev-master",
+                "license": [
+                    "MIT"
+                ],
+                "authors": [
+                    {
+                        "name": "Drew McLellan",
+                        "email": "drew.mclellan@gmail.com",
+                        "homepage": "http://allinthehead.com/"
+                    }
+                ],
+                "source": {
+                    "type": "git",
+                    "url": "https://github.com/drewm/mailchimp-api.git",
+                    "reference": "62da03fa38a0d3d855486f059c1f917976d02372"
+                },
+                "dist": {
+                    "type": "zip",
+                    "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/62da03fa38a0d3d855486f059c1f917976d02372",
+                    "reference": "62da03fa38a0d3d855486f059c1f917976d02372",
+                    "shasum": ""
+                },
+                "type": "library",
+                "time": "2021-02-02T16:29:03+00:00",
+                "autoload": {
+                    "psr-4": {
+                        "DrewM\\MailChimp\\": "src"
+                    }
+                },
+                "default-branch": true,
+                "require": {
+                    "php": ">=5.3",
+                    "ext-curl": "*",
+                    "ext-json": "*"
+                },
+                "require-dev": {
+                    "phpunit/phpunit": "7.0.*",
+                    "vlucas/phpdotenv": "^2.0"
+                },
+                "support": {
+                    "issues": "https://github.com/drewm/mailchimp-api/issues",
+                    "source": "https://github.com/drewm/mailchimp-api/tree/master"
+                }
+            },
+            {
+                "version": "dev-api-v3",
+                "version_normalized": "dev-api-v3",
+                "source": {
+                    "type": "git",
+                    "url": "https://github.com/drewm/mailchimp-api.git",
+                    "reference": "268dca3f0e35bdc263ceb8114b24c7496c3b46f5"
+                },
+                "dist": {
+                    "type": "zip",
+                    "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/268dca3f0e35bdc263ceb8114b24c7496c3b46f5",
+                    "reference": "268dca3f0e35bdc263ceb8114b24c7496c3b46f5",
+                    "shasum": ""
+                },
+                "time": "2016-01-17T15:59:26+00:00",
+                "require": {
+                    "php": ">=5.3"
+                },
+                "require-dev": {
+                    "phpunit/phpunit": "4.0.*",
+                    "vlucas/phpdotenv": "^2.0"
+                },
+                "support": {
+                    "issues": "https://github.com/drewm/mailchimp-api/issues",
+                    "source": "https://github.com/drewm/mailchimp-api/tree/api-v3"
+                },
+                "default-branch": "__unset"
+            },
+            {
+                "description": "Super-simple, minimum abstraction MailChimp API v2 wrapper",
+                "version": "dev-api-v2",
+                "version_normalized": "dev-api-v2",
+                "authors": [
+                    {
+                        "name": "Drew McLellan",
+                        "homepage": "http://allinthehead.com/"
+                    }
+                ],
+                "source": {
+                    "type": "git",
+                    "url": "https://github.com/drewm/mailchimp-api.git",
+                    "reference": "2ace9cf087bea43d0bf9c7207d94ce93642e6262"
+                },
+                "dist": {
+                    "type": "zip",
+                    "url": "https://api.github.com/repos/drewm/mailchimp-api/zipball/2ace9cf087bea43d0bf9c7207d94ce93642e6262",
+                    "reference": "2ace9cf087bea43d0bf9c7207d94ce93642e6262",
+                    "shasum": ""
+                },
+                "time": "2016-01-17T15:57:27+00:00",
+                "autoload": {
+                    "psr-0": {
+                        "Drewm": "src/"
+                    }
+                },
+                "support": {
+                    "issues": "https://github.com/drewm/mailchimp-api/issues",
+                    "source": "https://github.com/drewm/mailchimp-api/tree/api-v2"
+                },
+                "require-dev": "__unset"
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/lib/datasource/packagist/__snapshots__/index.spec.ts.snap b/lib/datasource/packagist/__snapshots__/index.spec.ts.snap
index c34ca81ee0..c649e5d8df 100644
--- a/lib/datasource/packagist/__snapshots__/index.spec.ts.snap
+++ b/lib/datasource/packagist/__snapshots__/index.spec.ts.snap
@@ -79,6 +79,26 @@ Object {
       "releaseTimestamp": "2018-02-16T15:31:05.000Z",
       "version": "2.5",
     },
+    Object {
+      "gitRef": "v2.5.1",
+      "releaseTimestamp": "2019-03-19T11:43:38.000Z",
+      "version": "2.5.1",
+    },
+    Object {
+      "gitRef": "v2.5.2",
+      "releaseTimestamp": "2019-03-26T09:00:38.000Z",
+      "version": "2.5.2",
+    },
+    Object {
+      "gitRef": "v2.5.3",
+      "releaseTimestamp": "2019-03-28T15:20:43.000Z",
+      "version": "2.5.3",
+    },
+    Object {
+      "gitRef": "v2.5.4",
+      "releaseTimestamp": "2019-08-06T09:24:58.000Z",
+      "version": "2.5.4",
+    },
   ],
   "sourceUrl": "https://github.com/drewm/mailchimp-api",
 }
@@ -94,7 +114,17 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/drewm/mailchimp-api.json",
+    "url": "https://packagist.org/p2/drewm/mailchimp-api.json",
+  },
+  Object {
+    "headers": Object {
+      "accept": "application/json",
+      "accept-encoding": "gzip, deflate, br",
+      "host": "packagist.org",
+      "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
+    },
+    "method": "GET",
+    "url": "https://packagist.org/p2/drewm/mailchimp-api~dev.json",
   },
 ]
 `;
@@ -119,7 +149,7 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/vendor/package-name.json",
+    "url": "https://packagist.org/p2/vendor/package-name.json",
   },
 ]
 `;
@@ -144,7 +174,7 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/drewm/mailchip-api.json",
+    "url": "https://packagist.org/p2/drewm/mailchimp-api.json",
   },
 ]
 `;
@@ -179,7 +209,7 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/some/other.json",
+    "url": "https://packagist.org/p2/some/other.json",
   },
 ]
 `;
@@ -204,7 +234,7 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/some/other.json",
+    "url": "https://packagist.org/p2/some/other.json",
   },
 ]
 `;
@@ -229,7 +259,7 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/vendor/package-name2.json",
+    "url": "https://packagist.org/p2/vendor/package-name2.json",
   },
 ]
 `;
@@ -313,6 +343,26 @@ Object {
       "releaseTimestamp": "2018-02-16T15:31:05.000Z",
       "version": "2.5",
     },
+    Object {
+      "gitRef": "v2.5.1",
+      "releaseTimestamp": "2019-03-19T11:43:38.000Z",
+      "version": "2.5.1",
+    },
+    Object {
+      "gitRef": "v2.5.2",
+      "releaseTimestamp": "2019-03-26T09:00:38.000Z",
+      "version": "2.5.2",
+    },
+    Object {
+      "gitRef": "v2.5.3",
+      "releaseTimestamp": "2019-03-28T15:20:43.000Z",
+      "version": "2.5.3",
+    },
+    Object {
+      "gitRef": "v2.5.4",
+      "releaseTimestamp": "2019-08-06T09:24:58.000Z",
+      "version": "2.5.4",
+    },
   ],
   "sourceUrl": "https://github.com/drewm/mailchimp-api",
 }
@@ -328,7 +378,17 @@ Array [
       "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
     },
     "method": "GET",
-    "url": "https://packagist.org/p/drewm/mailchimp-api.json",
+    "url": "https://packagist.org/p2/drewm/mailchimp-api.json",
+  },
+  Object {
+    "headers": Object {
+      "accept": "application/json",
+      "accept-encoding": "gzip, deflate, br",
+      "host": "packagist.org",
+      "user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
+    },
+    "method": "GET",
+    "url": "https://packagist.org/p2/drewm/mailchimp-api~dev.json",
   },
 ]
 `;
@@ -729,4 +789,4 @@ Object {
   ],
   "sourceUrl": "https://plugins.svn.wordpress.org/1beyt/",
 }
-`;
+`;
\ No newline at end of file
diff --git a/lib/datasource/packagist/index.spec.ts b/lib/datasource/packagist/index.spec.ts
index 359d43d9b6..4f620825e3 100644
--- a/lib/datasource/packagist/index.spec.ts
+++ b/lib/datasource/packagist/index.spec.ts
@@ -13,6 +13,7 @@ const hostRules = _hostRules;
 const includesJson: any = loadJsonFixture('includes.json');
 const beytJson: any = loadJsonFixture('1beyt.json');
 const mailchimpJson: any = loadJsonFixture('mailchimp-api.json');
+const mailchimpDevJson: any = loadJsonFixture('mailchimp-api~dev.json');
 
 const baseUrl = 'https://packagist.org';
 const datasource = PackagistDatasource.id;
@@ -79,7 +80,7 @@ describe('datasource/packagist/index', () => {
         .scope('https://composer.renovatebot.com')
         .get('/packages.json')
         .replyWithError({ code: 'ETIMEDOUT' });
-      httpMock.scope(baseUrl).get('/p/vendor/package-name2.json').reply(200);
+      httpMock.scope(baseUrl).get('/p2/vendor/package-name2.json').reply(200);
       const res = await getPkgReleases({
         ...config,
         datasource,
@@ -94,7 +95,7 @@ describe('datasource/packagist/index', () => {
         .scope('https://composer.renovatebot.com')
         .get('/packages.json')
         .reply(403);
-      httpMock.scope(baseUrl).get('/p/vendor/package-name.json').reply(200);
+      httpMock.scope(baseUrl).get('/p2/vendor/package-name.json').reply(200);
       const res = await getPkgReleases({
         ...config,
         datasource,
@@ -109,12 +110,12 @@ describe('datasource/packagist/index', () => {
         .scope('https://composer.renovatebot.com')
         .get('/packages.json')
         .reply(404);
-      httpMock.scope(baseUrl).get('/p/drewm/mailchip-api.json').reply(200);
+      httpMock.scope(baseUrl).get('/p2/drewm/mailchimp-api.json').reply(200);
       const res = await getPkgReleases({
         ...config,
         datasource,
         versioning,
-        depName: 'drewm/mailchip-api',
+        depName: 'drewm/mailchimp-api',
       });
       expect(res).toBeNull();
       expect(httpMock.getTrace()).toMatchSnapshot();
@@ -263,7 +264,7 @@ describe('datasource/packagist/index', () => {
           '/p/providers-2018-09$14346045d7a7261cb3a12a6b7a1a7c4151982530347b115e5e277d879cad1942.json'
         )
         .reply(200, fileJson);
-      httpMock.scope(baseUrl).get('/p/some/other.json').reply(200, beytJson);
+      httpMock.scope(baseUrl).get('/p2/some/other.json').reply(200, beytJson);
       const res = await getPkgReleases({
         ...config,
         datasource,
@@ -353,7 +354,7 @@ describe('datasource/packagist/index', () => {
         .scope('https://composer.renovatebot.com')
         .get('/packages.json')
         .reply(200, packagesJson);
-      httpMock.scope(baseUrl).get('/p/some/other.json').reply(200, beytJson);
+      httpMock.scope(baseUrl).get('/p2/some/other.json').reply(200, beytJson);
       const res = await getPkgReleases({
         ...config,
         datasource,
@@ -366,8 +367,12 @@ describe('datasource/packagist/index', () => {
     it('processes real versioned data', async () => {
       httpMock
         .scope(baseUrl)
-        .get('/p/drewm/mailchimp-api.json')
+        .get('/p2/drewm/mailchimp-api.json')
         .reply(200, mailchimpJson);
+      httpMock
+        .scope(baseUrl)
+        .get('/p2/drewm/mailchimp-api~dev.json')
+        .reply(200, mailchimpDevJson);
       config.registryUrls = ['https://packagist.org'];
       expect(
         await getPkgReleases({
@@ -382,8 +387,12 @@ describe('datasource/packagist/index', () => {
     it('adds packagist source implicitly', async () => {
       httpMock
         .scope(baseUrl)
-        .get('/p/drewm/mailchimp-api.json')
+        .get('/p2/drewm/mailchimp-api.json')
         .reply(200, mailchimpJson);
+      httpMock
+        .scope(baseUrl)
+        .get('/p2/drewm/mailchimp-api~dev.json')
+        .reply(200, mailchimpDevJson);
       config.registryUrls = [];
       expect(
         await getPkgReleases({
diff --git a/lib/datasource/packagist/index.ts b/lib/datasource/packagist/index.ts
index 6e820b70bb..fcb694749c 100644
--- a/lib/datasource/packagist/index.ts
+++ b/lib/datasource/packagist/index.ts
@@ -7,7 +7,7 @@ import { cache } from '../../util/cache/package/decorator';
 import * as hostRules from '../../util/host-rules';
 import type { HttpOptions } from '../../util/http';
 import { regEx } from '../../util/regex';
-import { ensureTrailingSlash } from '../../util/url';
+import { ensureTrailingSlash, joinUrlParts } from '../../util/url';
 import * as composerVersioning from '../../versioning/composer';
 import { Datasource } from '../datasource';
 import type { GetReleasesConfig, ReleaseResult } from '../types';
@@ -137,13 +137,14 @@ export class PackagistDatasource extends Datasource {
     }
     dep.releases = Object.keys(versions).map((version) => {
       const release = versions[version];
+      const parsedVersion = release.version ?? version;
       dep.homepage = release.homepage || dep.homepage;
       if (release.source?.url) {
         dep.sourceUrl = release.source.url;
       }
       return {
-        version: version.replace(regEx(/^v/), ''),
-        gitRef: version,
+        version: parsedVersion.replace(regEx(/^v/), ''),
+        gitRef: parsedVersion,
         releaseTimestamp: release.time,
       };
     });
@@ -210,9 +211,16 @@ export class PackagistDatasource extends Datasource {
     }
     let dep: ReleaseResult = null;
     const regUrl = 'https://packagist.org';
-    const pkgUrl = URL.resolve(regUrl, `/p/${name}.json`);
+    const pkgUrl = [
+      joinUrlParts(regUrl, `/p2/${name}.json`),
+      joinUrlParts(regUrl, `/p2/${name}~dev.json`),
+    ];
     // TODO: fix types (#9610)
-    const res = (await this.http.getJson<any>(pkgUrl)).body.packages[name];
+    let res = (await this.http.getJson<any>(pkgUrl[0])).body.packages[name];
+    res = [
+      ...res,
+      ...(await this.http.getJson<any>(pkgUrl[1])).body.packages[name],
+    ];
     if (res) {
       dep = PackagistDatasource.extractDepReleases(res);
       logger.trace({ dep }, 'dep');
@@ -246,7 +254,7 @@ export class PackagistDatasource extends Datasource {
       if (includesPackages?.[name]) {
         return includesPackages[name];
       }
-      let pkgUrl;
+      let pkgUrl: string;
       if (name in providerPackages) {
         pkgUrl = URL.resolve(
           regUrl,
-- 
GitLab