106文字
1分
編集

Renovateでパッケージをreplaceする

Renovate が次のような PR を作ってきた。パッケージがメンテナも異なるパッケージに置換されており、これがどのような仕組みで行われているのかを調べた。

plaintext
chore(deps): replace dependency npm-run-all with npm-run-all2 5.0.0

これの対応は Renovate 側で行われていた。

https://github.com/renovatebot/renovate/pull/25085

この設定はユーザー側の renovate.json でも行える。

https://docs.renovatebot.com/presets-replacements/#replacementsnpm-run-all-to-maintenance-fork

json
{
  "packageRules": [
    {
      "matchDatasources": ["npm"],
      "matchPackageNames": ["npm-run-all"],
      "replacementName": "npm-run-all2",
      "replacementVersion": "5.0.0"
    }
  ]
}
編集