mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 18:14:46 +00:00
fix(ci): read sparse package manifests from index
This commit is contained in:
@@ -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"), {});
|
||||
|
||||
Reference in New Issue
Block a user