fix: run packed bundled postinstall in release check

This commit is contained in:
Peter Steinberger
2026-04-21 09:34:33 +01:00
parent adef75c1e1
commit e57e54e591
4 changed files with 60 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import {
createBundledRuntimeDependencyInstallArgs,
createBundledRuntimeDependencyInstallEnv,
createNestedNpmInstallEnv,
isDirectPostinstallInvocation,
pruneInstalledPackageDist,
discoverBundledPluginRuntimeDeps,
pruneBundledPluginSourceNodeModules,
@@ -82,6 +83,20 @@ describe("bundled plugin postinstall", () => {
});
}
it("recognizes direct invocation through symlinked temp prefixes", () => {
const realpathSync = vi.fn((value: string) =>
value.replace(/^\/var\/folders\//u, "/private/var/folders/"),
);
expect(
isDirectPostinstallInvocation({
entryPath: "/var/folders/tmp/openclaw/scripts/postinstall-bundled-plugins.mjs",
modulePath: "/private/var/folders/tmp/openclaw/scripts/postinstall-bundled-plugins.mjs",
realpathSync,
}),
).toBe(true);
});
async function writeDiscordDaveyOptionalDependencyFixture(
extensionsDir: string,
packageRoot: string,