From b24d7297688dcc5e51270fa6deb62539fe2fc367 Mon Sep 17 00:00:00 2001 From: Jiahao Guo Date: Fri, 10 Nov 2023 10:12:01 +0800 Subject: [PATCH] feat: add a new preset for library projects resolves #14 Co-authored-by: Bryan Lee <38807139+liby@users.noreply.github.com> --- README.md | 7 +++++-- default.json | 7 +++---- library.json | 19 +++++++++++++++++++ package.json | 5 +++-- 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 library.json diff --git a/README.md b/README.md index 53869dd..445618e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [ci-badge]: https://github.com/RightCapitalHQ/renovate-config/actions/workflows/ci.yml/badge.svg [ci-url]: https://github.com/RightCapitalHQ/renovate-config/actions/workflows/ci.yml -A [shareable config preset](https://docs.renovatebot.com/config-presets/) for Renovate used in [RightCapital](https://www.rightcapital.com/). +[Shareable config presets](https://docs.renovatebot.com/config-presets/) for Renovate used in [RightCapital](https://www.rightcapital.com/). ## Usage @@ -16,7 +16,10 @@ Enable Renovate in your repository and just `extends` in _renovate.json_. ```json { - "extends": ["github>RightCapitalHQ/renovate-config"] + "extends": ["github>RightCapitalHQ/renovate-config"], + + // for library projects, use library preset instead + "extends": ["github>RightCapitalHQ/renovate-config:library"] } ``` diff --git a/default.json b/default.json index 0e828da..c0912b7 100644 --- a/default.json +++ b/default.json @@ -1,6 +1,6 @@ { "automergeType": "pr", - "description": "Default config for RightCapital repositories", + "description": "App-specific config for RightCapital repositories", "extends": ["config:recommended", ":pinAllExceptPeerDependencies"], "labels": ["renovate"], "npm": { @@ -8,9 +8,8 @@ }, "packageRules": [ { - "description": "Automerge non-major updates", - "groupName": "Non-major Updates", - "groupSlug": "auto-merge-non-major-updates", + "description": "Automerge non-major updates and lockfile maintenance", + "groupName": "Non-major Updates and Lockfile Maintenance(auto merge)", "matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"], "automerge": true } diff --git a/library.json b/library.json new file mode 100644 index 0000000..a199bcc --- /dev/null +++ b/library.json @@ -0,0 +1,19 @@ +{ + "automergeType": "pr", + "description": "Library-specific config for RightCapital repositories", + "extends": ["config:recommended", ":pinAllExceptPeerDependencies"], + "labels": ["renovate"], + "npm": { "commitMessageTopic": "{{prettyDepType}} {{depName}}" }, + "packageRules": [ + { + "description": "Automerge non-major updates", + "groupName": "Non-major Updates(auto merge)", + "matchUpdateTypes": ["minor", "patch"], + "automerge": true + } + ], + "platformAutomerge": true, + "postUpdateOptions": ["npmDedupe", "pnpmDedupe", "yarnDedupeFewer"], + "prCreation": "immediate", + "rangeStrategy": "auto" +} diff --git a/package.json b/package.json index 450ce1a..5c64bbf 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,9 @@ "scripts": { "lint": "prettier -c .", "fix": "prettier -w .", - "validate": "renovate-config-validator --strict default.json", - "test": "pnpm run validate", + "validate:default": "renovate-config-validator --strict default.json", + "validate:library": "renovate-config-validator --strict library.json", + "test": "pnpm run /^validate:/", "prepare": "pnpm run test" }, "devDependencies": {