fix: hide bundled runtime npm windows

This commit is contained in:
Peter Steinberger
2026-04-27 08:30:59 +01:00
parent 720ea766e6
commit d23ee2f702
7 changed files with 74 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ describe("bundled plugin postinstall", () => {
},
shell: false,
stdio: "pipe",
windowsHide: true,
windowsVerbatimArguments: undefined,
});
}

View File

@@ -2,6 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
import {
__testing as stageBundledPluginRuntimeDepsTesting,
collectRuntimeDependencyInstallManifest,
collectRuntimeDependencyInstallSpecs,
stageBundledPluginRuntimeDeps,
@@ -129,6 +130,31 @@ describe("stageBundledPluginRuntimeDeps", () => {
});
});
it("hides npm child windows during fallback runtime installs", () => {
const spawnSyncImpl = vi.fn(() => ({ status: 0, stderr: "", stdout: "" }));
stageBundledPluginRuntimeDepsTesting.runNpmInstall({
cwd: "C:\\openclaw\\dist\\extensions\\telegram\\.openclaw-install-stage",
npmRunner: {
command: "npm.cmd",
args: ["install", "--silent"],
env: { PATH: "C:\\node" },
shell: false,
windowsVerbatimArguments: true,
},
spawnSyncImpl,
});
expect(spawnSyncImpl).toHaveBeenCalledWith(
"npm.cmd",
["install", "--silent"],
expect.objectContaining({
windowsHide: true,
windowsVerbatimArguments: true,
}),
);
});
it("skips restaging when runtime deps stamp matches the sanitized manifest", () => {
const { pluginDir, repoRoot } = createBundledPluginFixture({
packageJson: {