mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:10:49 +00:00
fix(release): classify packaged runtime deps roots
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user