chore(deps): update pnpm to v11 (#5660)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
1 parent
df953771a7
commit
b8e0123893
9 files changed
+80
-194
No files matched your search
@@ -2,21 +2,24 @@ import fs from "fs/promises";
|
||||
import { join } from "path";
|
||||
import json5 from "json5";
|
||||
import { describe, test } from "vitest";
|
||||
import { parse as parseYaml } from "yaml";
|
||||
|
||||
describe("Renovate configuration tests", () => {
|
||||
test("automerge should be disabled for onlyBuiltDependencies", async () => {
|
||||
const packageJson = await import("../package.json");
|
||||
test("automerge should be disabled for built dependencies", async () => {
|
||||
const pnpmConfig = await fs.readFile(join(__dirname, "../pnpm-workspace.yaml"), "utf-8").then(parseYaml);
|
||||
const renovateConfig = await fs.readFile(join(__dirname, "../.github/renovate.json5"), "utf-8").then(json5.parse);
|
||||
const onlyBuiltDependencies = packageJson.pnpm.onlyBuiltDependencies;
|
||||
const dependenciesWithBuilt = Object.entries(pnpmConfig.allowBuilds)
|
||||
.filter(([_, value]) => value === true)
|
||||
.map(([key, _]) => key);
|
||||
const automergeDisabledDeps = renovateConfig.packageRules
|
||||
.filter((rule: any) => rule.automerge === false)
|
||||
.flatMap((rule: any) => rule.matchPackageNames || []);
|
||||
|
||||
const missingDeps = onlyBuiltDependencies.filter((dep: string) => !automergeDisabledDeps.includes(dep));
|
||||
const missingDeps = dependenciesWithBuilt.filter((dep: string) => !automergeDisabledDeps.includes(dep));
|
||||
|
||||
if (missingDeps.length > 0) {
|
||||
throw new Error(
|
||||
`The following onlyBuiltDependencies are missing automerge disable rules in renovate.json5: ${missingDeps.join(", ")}`,
|
||||
`The following built dependencies are missing automerge disable rules in renovate.json5: ${missingDeps.join(", ")}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user