Skip to content

Commit

Permalink
Migrate Renovate config to JSON5 (bitwarden#13233)
Browse files Browse the repository at this point in the history
* Renamed to JSON5

* Updated linting script to use new file name.

* Add JSON5 dependency

* Added JSON5 to renovate.

* Removed JSON5 formatting

* Prettier

* Added comment for demonstration

---------

Co-authored-by: Matt Bishop <[email protected]>
  • Loading branch information
trmartin4 and withinfocus authored Feb 18, 2025
1 parent 5633a25 commit 2622422
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 85 deletions.
165 changes: 83 additions & 82 deletions .github/renovate.json → .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>bitwarden/renovate-config"],
"enabledManagers": ["cargo", "github-actions", "npm"],
"packageRules": [
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["github>bitwarden/renovate-config"], // Extends our base config for pinned dependencies
enabledManagers: ["cargo", "github-actions", "npm"],
packageRules: [
{
"groupName": "github-action minor",
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["minor"]
groupName: "github-action minor",
matchManagers: ["github-actions"],
matchUpdateTypes: ["minor"],
},
{
"matchManagers": ["cargo"],
"commitMessagePrefix": "[deps] Platform:"
matchManagers: ["cargo"],
commitMessagePrefix: "[deps] Platform:",
},
{
"groupName": "napi",
"matchPackageNames": ["napi", "napi-build", "napi-derive"]
groupName: "napi",
matchPackageNames: ["napi", "napi-build", "napi-derive"],
},
{
"matchPackageNames": ["typescript", "zone.js"],
"matchUpdateTypes": ["major", "minor"],
"description": "Determined by Angular",
"enabled": false
matchPackageNames: ["typescript", "zone.js"],
matchUpdateTypes: ["major", "minor"],
description: "Determined by Angular",
enabled: false,
},
{
"matchPackageNames": ["typescript", "zone.js"],
"matchUpdateTypes": "patch"
matchPackageNames: ["typescript", "zone.js"],
matchUpdateTypes: "patch",
},
{
"groupName": "jest",
"matchPackageNames": ["@types/jest", "jest", "ts-jest", "jest-preset-angular"],
"matchUpdateTypes": "major"
groupName: "jest",
matchPackageNames: ["@types/jest", "jest", "ts-jest", "jest-preset-angular"],
matchUpdateTypes: "major",
},
{
"groupName": "macOS/iOS bindings",
"matchPackageNames": ["core-foundation", "security-framework", "security-framework-sys"]
groupName: "macOS/iOS bindings",
matchPackageNames: ["core-foundation", "security-framework", "security-framework-sys"],
},
{
"groupName": "zbus",
"matchPackageNames": ["zbus", "zbus_polkit"]
groupName: "zbus",
matchPackageNames: ["zbus", "zbus_polkit"],
},
{
"matchPackageNames": [
matchPackageNames: [
"base64-loader",
"buffer",
"bufferutil",
Expand All @@ -56,20 +56,20 @@
"style-loader",
"ts-loader",
"url",
"util"
"util",
],
"description": "Admin Console owned dependencies",
"commitMessagePrefix": "[deps] AC:",
"reviewers": ["team:team-admin-console-dev"]
description: "Admin Console owned dependencies",
commitMessagePrefix: "[deps] AC:",
reviewers: ["team:team-admin-console-dev"],
},
{
"matchPackageNames": ["qrious"],
"description": "Auth owned dependencies",
"commitMessagePrefix": "[deps] Auth:",
"reviewers": ["team:team-auth-dev"]
matchPackageNames: ["qrious"],
description: "Auth owned dependencies",
commitMessagePrefix: "[deps] Auth:",
reviewers: ["team:team-auth-dev"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@angular-eslint/schematics",
"angular-eslint",
"eslint-config-prettier",
Expand All @@ -82,14 +82,14 @@
"eslint",
"husky",
"lint-staged",
"typescript-eslint"
"typescript-eslint",
],
"description": "Architecture owned dependencies",
"commitMessagePrefix": "[deps] Architecture:",
"reviewers": ["team:dept-architecture"]
description: "Architecture owned dependencies",
commitMessagePrefix: "[deps] Architecture:",
reviewers: ["team:dept-architecture"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@angular-eslint/eslint-plugin-template",
"@angular-eslint/eslint-plugin",
"@angular-eslint/schematics",
Expand All @@ -105,13 +105,13 @@
"eslint-plugin-tailwindcss",
"eslint",
"husky",
"lint-staged"
"lint-staged",
],
"groupName": "Linting minor-patch",
"matchUpdateTypes": ["minor", "patch"]
groupName: "Linting minor-patch",
matchUpdateTypes: ["minor", "patch"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@emotion/css",
"@webcomponents/custom-elements",
"concurrently",
Expand All @@ -126,20 +126,20 @@
"@storybook/web-components-webpack5",
"tabbable",
"tldts",
"wait-on"
"wait-on",
],
"description": "Autofill owned dependencies",
"commitMessagePrefix": "[deps] Autofill:",
"reviewers": ["team:team-autofill-dev"]
description: "Autofill owned dependencies",
commitMessagePrefix: "[deps] Autofill:",
reviewers: ["team:team-autofill-dev"],
},
{
"matchPackageNames": ["braintree-web-drop-in"],
"description": "Billing owned dependencies",
"commitMessagePrefix": "[deps] Billing:",
"reviewers": ["team:team-billing-dev"]
matchPackageNames: ["braintree-web-drop-in"],
description: "Billing owned dependencies",
commitMessagePrefix: "[deps] Billing:",
reviewers: ["team:team-billing-dev"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@babel/core",
"@babel/preset-env",
"@bitwarden/sdk-internal",
Expand Down Expand Up @@ -167,6 +167,7 @@
"electron-updater",
"html-webpack-injector",
"html-webpack-plugin",
"json5",
"lowdb",
"node-forge",
"node-ipc",
Expand All @@ -179,14 +180,14 @@
"webpack",
"webpack-cli",
"webpack-dev-server",
"webpack-node-externals"
"webpack-node-externals",
],
"description": "Platform owned dependencies",
"commitMessagePrefix": "[deps] Platform:",
"reviewers": ["team:team-platform-dev"]
description: "Platform owned dependencies",
commitMessagePrefix: "[deps] Platform:",
reviewers: ["team:team-platform-dev"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@angular-devkit/build-angular",
"@angular/animations",
"@angular/cdk",
Expand Down Expand Up @@ -225,27 +226,27 @@
"remark-gfm",
"storybook",
"tailwindcss",
"zone.js"
"zone.js",
],
"description": "UI Foundation owned dependencies",
"commitMessagePrefix": "[deps] UI Foundation:",
"reviewers": ["team:team-ui-foundation"]
description: "UI Foundation owned dependencies",
commitMessagePrefix: "[deps] UI Foundation:",
reviewers: ["team:team-ui-foundation"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@types/jest",
"jest-junit",
"jest-mock-extended",
"jest-preset-angular",
"jest-diff",
"ts-jest"
"ts-jest",
],
"description": "Secrets Manager owned dependencies",
"commitMessagePrefix": "[deps] SM:",
"reviewers": ["team:team-secrets-manager-dev"]
description: "Secrets Manager owned dependencies",
commitMessagePrefix: "[deps] SM:",
reviewers: ["team:team-secrets-manager-dev"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@microsoft/signalr-protocol-msgpack",
"@microsoft/signalr",
"@types/jsdom",
Expand All @@ -256,14 +257,14 @@
"oidc-client-ts",
"papaparse",
"utf-8-validate",
"zxcvbn"
"zxcvbn",
],
"description": "Tools owned dependencies",
"commitMessagePrefix": "[deps] Tools:",
"reviewers": ["team:team-tools-dev"]
description: "Tools owned dependencies",
commitMessagePrefix: "[deps] Tools:",
reviewers: ["team:team-tools-dev"],
},
{
"matchPackageNames": [
matchPackageNames: [
"@koa/multer",
"@koa/router",
"@types/inquirer",
Expand All @@ -289,18 +290,18 @@
"node-fetch",
"open",
"proper-lockfile",
"qrcode-parser"
"qrcode-parser",
],
"description": "Vault owned dependencies",
"commitMessagePrefix": "[deps] Vault:",
"reviewers": ["team:team-vault-dev"]
description: "Vault owned dependencies",
commitMessagePrefix: "[deps] Vault:",
reviewers: ["team:team-vault-dev"],
},
{
"matchPackageNames": ["@types/argon2-browser", "argon2", "argon2-browser", "big-integer"],
"description": "Key Management owned dependencies",
"commitMessagePrefix": "[deps] KM:",
"reviewers": ["team:team-key-management-dev"]
}
matchPackageNames: ["@types/argon2-browser", "argon2", "argon2-browser", "big-integer"],
description: "Key Management owned dependencies",
commitMessagePrefix: "[deps] KM:",
reviewers: ["team:team-key-management-dev"],
},
],
"ignoreDeps": ["@types/koa-bodyparser", "bootstrap", "node-ipc", "node", "npm"]
ignoreDeps: ["@types/koa-bodyparser", "bootstrap", "node-ipc", "node", "npm"],
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"jest-junit": "16.0.0",
"jest-mock-extended": "3.0.7",
"jest-preset-angular": "14.1.1",
"json5": "2.2.3",
"lint-staged": "15.4.1",
"mini-css-extract-plugin": "2.9.2",
"node-ipc": "9.2.1",
Expand Down
6 changes: 4 additions & 2 deletions scripts/dep-ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import fs from "fs";
import path from "path";

const renovateConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "..", ".github", "renovate.json"), "utf8"),
import JSON5 from "json5";

const renovateConfig = JSON5.parse(
fs.readFileSync(path.join(__dirname, "..", "..", ".github", "renovate.json5"), "utf8"),
);

const packagesWithOwners = renovateConfig.packageRules
Expand Down

0 comments on commit 2622422

Please sign in to comment.