1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-16845] Lint unowned dependencies (#12748)

* Lint unowned dependencies

* Split npm ci and run linter

* Set explicit versions for unchanged parts of the workflow ....

* Rename yao-pkg

* Add owners for sdk-internal, fuses and angular-eslint/schematics

* Assign owners for angular and storybook

* Add typescript-strict-plugin

* Add two more unowned dependencies

---------

Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com>
Co-authored-by: Addison Beck <github@addisonbeck.com>
This commit is contained in:
Oscar Hinton
2025-01-08 19:37:08 +01:00
committed by GitHub
parent 38c1cdfb62
commit 48f99099b2
3 changed files with 45 additions and 3 deletions

31
scripts/dep-ownership.ts Normal file
View File

@@ -0,0 +1,31 @@
/* eslint-disable no-console */
/// Ensure that all dependencies in package.json have an owner in the renovate.json file.
import fs from "fs";
import path from "path";
const renovateConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "..", ".github", "renovate.json"), "utf8"),
);
const packagesWithOwners = renovateConfig.packageRules
.flatMap((rule: any) => rule.matchPackageNames)
.filter((packageName: string) => packageName != null);
const packageJson = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "..", "package.json"), "utf8"),
);
const dependencies = Object.keys(packageJson.dependencies).concat(
Object.keys(packageJson.devDependencies),
);
const missingOwners = dependencies.filter((dep) => !packagesWithOwners.includes(dep));
if (missingOwners.length > 0) {
console.error("Missing owners for the following dependencies:");
console.error(missingOwners.join("\n"));
process.exit(1);
}
console.log("All dependencies have owners.");