ci(release): bypass pnpm for tsdown package build

This commit is contained in:
Peter Steinberger
2026-05-22 14:16:37 +01:00
parent 04ebdc6da5
commit fea89cd384
2 changed files with 49 additions and 10 deletions

View File

@@ -257,17 +257,28 @@ export function createTsdownOutputScanner(params = {}) {
export function resolveTsdownBuildInvocation(params = {}) {
const env = resolveTsdownEnv(params.env ?? process.env);
const tsdownArgs = [
"--config-loader",
"unrun",
"--logLevel",
logLevel,
"--no-clean",
...extraArgs,
];
if (env.OPENCLAW_BUILD_ALL_NO_PNPM === "1") {
return {
command: params.nodeExecPath ?? process.execPath,
args: ["node_modules/tsdown/dist/run.mjs", ...tsdownArgs],
options: {
stdio: ["ignore", "pipe", "pipe"],
shell: false,
windowsVerbatimArguments: undefined,
env,
},
};
}
const runner = resolvePnpmRunner({
pnpmArgs: [
"exec",
"tsdown",
"--config-loader",
"unrun",
"--logLevel",
logLevel,
"--no-clean",
...extraArgs,
],
pnpmArgs: ["exec", "tsdown", ...tsdownArgs],
nodeExecPath: params.nodeExecPath ?? process.execPath,
npmExecPath: params.npmExecPath ?? env.npm_execpath,
comSpec: params.comSpec ?? env.ComSpec,

View File

@@ -69,6 +69,34 @@ describe("resolveTsdownBuildInvocation", () => {
expect(result.options.env.NODE_OPTIONS).toBe("--trace-warnings --max-old-space-size=8192");
});
it("can run tsdown without invoking pnpm", () => {
const result = resolveTsdownBuildInvocation({
nodeExecPath: "/usr/bin/node",
env: { OPENCLAW_BUILD_ALL_NO_PNPM: "1" },
});
expect(result).toEqual({
command: "/usr/bin/node",
args: [
"node_modules/tsdown/dist/run.mjs",
"--config-loader",
"unrun",
"--logLevel",
"warn",
"--no-clean",
],
options: {
stdio: ["ignore", "pipe", "pipe"],
shell: false,
windowsVerbatimArguments: undefined,
env: {
NODE_OPTIONS: "--max-old-space-size=6144",
OPENCLAW_BUILD_ALL_NO_PNPM: "1",
},
},
});
});
it("keeps source-checkout prune best-effort", () => {
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
const rmSync = vi.spyOn(fs, "rmSync");