- TypeScript 5.9 → 6.0: add types: ["node"] to base tsconfig, remove deprecated baseUrl where unused, add ignoreDeprecations for docs app, fix node_modules/ prefix imports with proper package exports - Vite 7 → 8 + @vitejs/plugin-react 5 → 6: add vite as direct dep - Add CSS module type declarations for TS6 compatibility - Update renovate test for pnpm v11 allowBuilds migration
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import fs from "fs/promises";
|
|
import { join } from "path";
|
|
import json5 from "json5";
|
|
import { parse } from "yaml";
|
|
import { describe, test } from "vitest";
|
|
|
|
describe("Renovate configuration tests", () => {
|
|
test("automerge should be disabled for allowBuilds dependencies", async () => {
|
|
const workspaceYaml = await fs.readFile(join(__dirname, "../pnpm-workspace.yaml"), "utf-8").then(parse);
|
|
const renovateConfig = await fs.readFile(join(__dirname, "../.github/renovate.json5"), "utf-8").then(json5.parse);
|
|
const allowedBuilds = Object.entries(workspaceYaml.allowBuilds ?? {})
|
|
.filter(([, allowed]) => allowed === true)
|
|
.map(([name]) => name);
|
|
const automergeDisabledDeps = renovateConfig.packageRules
|
|
.filter((rule: any) => rule.automerge === false)
|
|
.flatMap((rule: any) => rule.matchPackageNames || []);
|
|
|
|
const missingDeps = allowedBuilds.filter((dep: string) => !automergeDisabledDeps.includes(dep));
|
|
|
|
if (missingDeps.length > 0) {
|
|
throw new Error(
|
|
`The following allowBuilds dependencies are missing automerge disable rules in renovate.json5: ${missingDeps.join(", ")}`,
|
|
);
|
|
}
|
|
});
|
|
});
|