revert(deps): downgrade pnpm to v10 (#5673)
This commit is contained in:
1 parent
00a055283e
commit
44a2973b1a
9 files changed
+185
-79
No files matched your search
@@ -2,24 +2,21 @@ 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 built dependencies", async () => {
|
||||
const pnpmConfig = await fs.readFile(join(__dirname, "../pnpm-workspace.yaml"), "utf-8").then(parseYaml);
|
||||
test("automerge should be disabled for onlyBuiltDependencies", async () => {
|
||||
const packageJson = await import("../package.json");
|
||||
const renovateConfig = await fs.readFile(join(__dirname, "../.github/renovate.json5"), "utf-8").then(json5.parse);
|
||||
const dependenciesWithBuilt = Object.entries(pnpmConfig.allowBuilds)
|
||||
.filter(([_, value]) => value === true)
|
||||
.map(([key, _]) => key);
|
||||
const onlyBuiltDependencies = packageJson.pnpm.onlyBuiltDependencies;
|
||||
const automergeDisabledDeps = renovateConfig.packageRules
|
||||
.filter((rule: any) => rule.automerge === false)
|
||||
.flatMap((rule: any) => rule.matchPackageNames || []);
|
||||
|
||||
const missingDeps = dependenciesWithBuilt.filter((dep: string) => !automergeDisabledDeps.includes(dep));
|
||||
const missingDeps = onlyBuiltDependencies.filter((dep: string) => !automergeDisabledDeps.includes(dep));
|
||||
|
||||
if (missingDeps.length > 0) {
|
||||
throw new Error(
|
||||
`The following built dependencies are missing automerge disable rules in renovate.json5: ${missingDeps.join(", ")}`,
|
||||
`The following onlyBuiltDependencies are missing automerge disable rules in renovate.json5: ${missingDeps.join(", ")}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user