From ae0bbe1a37c566b1630afb2d10e3dc6ca715246c Mon Sep 17 00:00:00 2001 From: secustor Date: Tue, 25 Feb 2025 00:55:02 +0100 Subject: [PATCH] chore: run prettier --- .github/workflows/ci.yaml | 4 +- README.md | 30 +++++--- app.json5 | 10 +-- default.json | 6 +- presets/group-by-plugin.json | 2 +- presets/no-esm.json | 82 +++++---------------- presets/unsupported-framework-upgrades.json | 14 +--- presets/update-backstage-json.json | 2 +- renovate.json | 4 +- self-hosted.json5 | 22 +++--- 10 files changed, 66 insertions(+), 110 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a4ecf6b..7aa4bf8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - + - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - + - name: Setup Node.js uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 with: diff --git a/README.md b/README.md index c2dc03b..8f6db1d 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,34 @@ # backstage-renovate-config + Holds Renovate presets targeted at Backstage repos > [!NOTE] > Be aware that this requires significant trust in the owner of this repository as it always the case for external Renovate presets! -This is as it can introduce changes without your input in case you are not requiring approval for PRs or allow merging changes in without PRs. -YOU HAVE BEEN WARNED! +> This is as it can introduce changes without your input in case you are not requiring approval for PRs or allow merging changes in without PRs. +> YOU HAVE BEEN WARNED! ## Usage + This repository contains a set of Renovate presets that can be used to configure Renovate for Backstage repositories. To use these presets, you need to add a `renovate.json` file to your repository that looks like this: + ```json { - "extends": [ - "github>secustor/backstage-renovate-config" - ] + "extends": ["github>secustor/backstage-renovate-config"] } ``` + The above config will use the `default` preset. If you want to use different presets, you can specify them like this: + ```json { - "extends": [ - "github>secustor/backstage-renovate-config:self-hosted.json5" - ] + "extends": ["github>secustor/backstage-renovate-config:self-hosted.json5"] } ``` + The above config will use the `self-hosted` preset. For more information on how to configure Renovate presets, see the [Renovate documentation](https://docs.renovatebot.com/config-presets/) @@ -53,19 +55,23 @@ This means that [`allowedPostUpgradeCommands`](https://docs.renovatebot.com/self ## Feature presets ### Unsupported Framework Upgrades + Prevent upgrades to frameworks that are not supported by Backstage. ### Group by plugin -Groups all PRs based on the plugin. Therefore, all updates of the `catalog` are grouped together including `catalog`, `catalog-backend` and so on. + +Groups all PRs based on the plugin. Therefore, all updates of the `catalog` are grouped together including `catalog`, `catalog-backend` and so on. ### Exclude ESM updates -Backstage does not support ESM at the moment. This means updates which are ESM-only will break the setup. -This rule prevents updates to known ESM-only packages. + +Backstage does not support ESM at the moment. This means updates which are ESM-only will break the setup. +This rule prevents updates to known ESM-only packages. ### Update `backstage.json` + This rule will update the `backstage.json` file in the repository to the latest Backstage release. It is used by full config presets, but can also be used standalone. ## Contributing -If you want to propose a new preset or modify an existing one, you can open a PR with the changes. +If you want to propose a new preset or modify an existing one, you can open a PR with the changes. diff --git a/app.json5 b/app.json5 index 8fd6214..cd9cc6c 100644 --- a/app.json5 +++ b/app.json5 @@ -3,7 +3,7 @@ extends: [ "github>secustor/backstage-renovate-config//presets/no-esm", "github>secustor/backstage-renovate-config//presets/unsupported-framework-upgrades", - "github>secustor/backstage-renovate-config//presets/update-backstage-json" + "github>secustor/backstage-renovate-config//presets/update-backstage-json", ], // create a single PR to update all in range upgrades, to save CI minutes @@ -12,7 +12,7 @@ }, postUpdateOptions: [ // run `yarn dedupe --strategy highest` after every npm package upgrade - 'yarnDedupeHighest', + "yarnDedupeHighest", ], packageRules: [ @@ -21,7 +21,7 @@ // update Backstage packages immediately, this is to prevent to update backstage.json only but not the packages minimumReleaseAge: null, // group all Backstage packages together - groupName: "Backstage Core" - } + groupName: "Backstage Core", + }, ], -} \ No newline at end of file +} diff --git a/default.json b/default.json index ec33e7c..596a723 100644 --- a/default.json +++ b/default.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "github>secustor/backstage-renovate-config:app.json5" - ] -} \ No newline at end of file + "extends": ["github>secustor/backstage-renovate-config:app.json5"] +} diff --git a/presets/group-by-plugin.json b/presets/group-by-plugin.json index de9184a..da3db5c 100644 --- a/presets/group-by-plugin.json +++ b/presets/group-by-plugin.json @@ -9,4 +9,4 @@ "groupName": "Backstage plugin {{ lookup (split packageName '-') 1 }}" } ] -} \ No newline at end of file +} diff --git a/presets/no-esm.json b/presets/no-esm.json index 0c4b83a..4eae23a 100644 --- a/presets/no-esm.json +++ b/presets/no-esm.json @@ -1,29 +1,17 @@ { "packageRules": [ { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "node-fetch" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["node-fetch"], "allowedVersions": "<3.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "nanoid", - "octokit", - "p-limit" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["nanoid", "octokit", "p-limit"], "allowedVersions": "<4.0.0" }, { - "matchDatasources": [ - "npm" - ], + "matchDatasources": ["npm"], "matchPackageNames": [ "@octokit/webhooks-methods", "@sindresorhus/is", @@ -34,69 +22,39 @@ "allowedVersions": "<5.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "find-up" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["find-up"], "allowedVersions": "<6.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/auth-app", - "@octokit/oauth-app" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/auth-app", "@octokit/oauth-app"], "allowedVersions": "<7.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/graphql" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/graphql"], "allowedVersions": "<8.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/plugin-throttling", - "@octokit/request" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/plugin-throttling", "@octokit/request"], "allowedVersions": "<9.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/graphql-schema" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/graphql-schema"], "allowedVersions": "<15.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/webhooks" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/webhooks"], "allowedVersions": "<13.0.0" }, { - "matchDatasources": [ - "npm" - ], - "matchPackageNames": [ - "@octokit/rest" - ], + "matchDatasources": ["npm"], + "matchPackageNames": ["@octokit/rest"], "allowedVersions": "<21.0.0" } ] -} \ No newline at end of file +} diff --git a/presets/unsupported-framework-upgrades.json b/presets/unsupported-framework-upgrades.json index 90580c2..5a0c304 100644 --- a/presets/unsupported-framework-upgrades.json +++ b/presets/unsupported-framework-upgrades.json @@ -6,9 +6,7 @@ "Do not upgrade to Express v5", "https://github.com/backstage/backstage/issues/27808" ], - "matchDatasources": [ - "npm" - ], + "matchDatasources": ["npm"], "matchPackageNames": [ "express", "@types/express", @@ -21,9 +19,7 @@ "Do not upgrade to React 19", "https://github.com/backstage/backstage/issues/28080" ], - "extends": [ - "packages:react" - ], + "extends": ["packages:react"], "allowedVersions": "<19.0.0" }, { @@ -31,10 +27,8 @@ "Do not upgrade to React Router v7", "https://github.com/backstage/backstage/issues/27927" ], - "matchSourceUrls": [ - "https://github.com/remix-run/react-router" - ], + "matchSourceUrls": ["https://github.com/remix-run/react-router"], "allowedVersions": "<7.0.0" } ] -} \ No newline at end of file +} diff --git a/presets/update-backstage-json.json b/presets/update-backstage-json.json index 590a2c4..8ec0746 100644 --- a/presets/update-backstage-json.json +++ b/presets/update-backstage-json.json @@ -11,4 +11,4 @@ "versioningTemplate": "semver-coerced" } ] -} \ No newline at end of file +} diff --git a/renovate.json b/renovate.json index 5db72dd..22a9943 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ] + "extends": ["config:recommended"] } diff --git a/self-hosted.json5 b/self-hosted.json5 index 2baa570..3f05eb5 100644 --- a/self-hosted.json5 +++ b/self-hosted.json5 @@ -3,7 +3,7 @@ extends: [ "github>secustor/backstage-renovate-config//presets/no-esm", "github>secustor/backstage-renovate-config//presets/unsupported-framework-upgrades", - "github>secustor/backstage-renovate-config//presets/update-backstage-json" + "github>secustor/backstage-renovate-config//presets/update-backstage-json", ], // create a single PR to update all in range upgrades, to save CI minutes @@ -13,23 +13,25 @@ postUpdateOptions: [ // run `yarn dedupe --strategy highest` after every npm package upgrade - 'yarnDedupeHighest', + "yarnDedupeHighest", ], - + packageRules: [ { // disable updating NPM packages of Backstage Core as these are updated by Backstage CLI matchDatasources: ["npm"], matchSourceUrls: ["https://github.com/backstage/backstage"], - enabled: false + enabled: false, }, { // run backstage upgrade command if there is a new Backstage release matchPackageNames: ["backstage/backstage"], - "postUpgradeTasks": { - "commands": ["yarn backstage-cli versions:bump --pattern '@{backstage}/*' --release {{{newVersion}}}"], - "executionMode": "branch" - } - } + postUpgradeTasks: { + commands: [ + "yarn backstage-cli versions:bump --pattern '@{backstage}/*' --release {{{newVersion}}}", + ], + executionMode: "branch", + }, + }, ], -} \ No newline at end of file +}