fix(ci): read sparse package manifests from index

This commit is contained in:
Vincent Koc
2026-05-14 13:03:59 +08:00
parent ce63b9ca46
commit bc0def52af
2 changed files with 31 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { execFileSync } from "node:child_process";
import { mkdirSync, writeFileSync } from "node:fs";
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { collectDependencyPinViolations } from "../../scripts/check-dependency-pins.mjs";
@@ -143,6 +143,21 @@ packageExtensions:
]);
});
it("reads tracked package manifests from the index when sparse checkout omits them", () => {
const dir = makeRepo();
mkdirSync(path.join(dir, "qa", "convex-credential-broker"), { recursive: true });
writeJson(path.join(dir, "package.json"), {});
writeJson(path.join(dir, "qa", "convex-credential-broker", "package.json"), {
dependencies: {
exact: "1.2.3",
},
});
git(dir, ["add", "package.json", "qa/convex-credential-broker/package.json"]);
rmSync(path.join(dir, "qa"), { recursive: true, force: true });
expect(collectDependencyPinViolations(dir)).toEqual([]);
});
it("rejects floating workspace overrides and package extension dependencies", () => {
const dir = makeRepo();
writeJson(path.join(dir, "package.json"), {});