fix(release): classify packaged runtime deps roots

This commit is contained in:
Peter Steinberger
2026-05-02 02:17:00 +01:00
parent 3f6b67fd4e
commit 1844c1fb38
4 changed files with 53 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ import { tmpdir } from "node:os";
import path from "node:path";
import { describe, expect, it, vi } from "vitest";
import {
isSourceCheckoutRoot,
isDirectPostinstallInvocation,
pruneOpenClawCompileCache,
pruneInstalledPackageDist,
@@ -136,6 +137,23 @@ describe("bundled plugin postinstall", () => {
);
});
it("does not classify published packages with source files as source checkouts", () => {
const packageRoot = "/pkg";
const existingPaths = new Set([
path.join(packageRoot, "pnpm-workspace.yaml"),
path.join(packageRoot, "src"),
path.join(packageRoot, "extensions"),
path.join(packageRoot, "dist", "postinstall-inventory.json"),
]);
expect(
isSourceCheckoutRoot({
packageRoot,
existsSync: (value: string) => existingPaths.has(value),
}),
).toBe(false);
});
it("prunes source-checkout bundled plugin node_modules", async () => {
const packageRoot = await createTempDirAsync("openclaw-source-checkout-");
const extensionsDir = path.join(packageRoot, "extensions");