惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
D
Docker
GbyAI
GbyAI
宝玉的分享
宝玉的分享
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Vercel News
Vercel News
博客园_首页
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
V
V2EX
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(mac): use corepack pnpm for app packaging · openclaw/...
vincentkoc · 2026-05-27 · via Recent Commits to openclaw:main

@@ -1,5 +1,5 @@

11

import { spawnSync } from "node:child_process";

2-

import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

2+

import { chmodSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

33

import { tmpdir } from "node:os";

44

import path from "node:path";

55

import { afterEach, describe, expect, it } from "vitest";

@@ -36,6 +36,17 @@ function runHelper(script: string) {

3636

});

3737

}

383839+

function getPackageManagerHelperBlock(): string {

40+

const script = readFileSync(scriptPath, "utf8");

41+

const start = script.indexOf("PNPM_CMD=()");

42+

const end = script.indexOf("merge_framework_machos()");

43+44+

expect(start).toBeGreaterThanOrEqual(0);

45+

expect(end).toBeGreaterThan(start);

46+47+

return script.slice(start, end);

48+

}

49+3950

afterEach(() => {

4051

for (const dir of tempDirs.splice(0)) {

4152

rmSync(dir, { recursive: true, force: true });

@@ -50,11 +61,71 @@ describe("package-mac-app plist stamping", () => {

5061

script.indexOf('if [[ -z "${APP_BUILD:-}" ]]'),

5162

);

526353-

expect(installBlock).toContain("pnpm install --frozen-lockfile");

64+

expect(installBlock).toContain("run_pnpm install --frozen-lockfile");

5465

expect(installBlock).toContain("--config.node-linker=hoisted");

5566

expect(installBlock).not.toContain("--no-frozen-lockfile");

5667

});

576869+

it("falls back to corepack pnpm when the pnpm shim is absent", () => {

70+

const helperBlock = getPackageManagerHelperBlock();

71+

const tempRoot = mkdtempSync(path.join(tmpdir(), "openclaw-package-pnpm-root-"));

72+

const toolsDir = mkdtempSync(path.join(tmpdir(), "openclaw-package-pnpm-tools-"));

73+

const logPath = path.join(tempRoot, "corepack.log");

74+

tempDirs.push(tempRoot, toolsDir);

75+76+

const corepackPath = path.join(toolsDir, "corepack");

77+

writeFileSync(

78+

corepackPath,

79+

[

80+

"#!/usr/bin/env bash",

81+

"set -euo pipefail",

82+

"printf '%s|%s\\n' \"$PWD\" \"$*\" >> \"$OPENCLAW_TEST_LOG\"",

83+

"if [[ \"${1:-}\" == \"pnpm\" && \"${2:-}\" == \"--version\" ]]; then",

84+

" echo '11.2.2'",

85+

"fi",

86+

"",

87+

].join("\n"),

88+

"utf8",

89+

);

90+

chmodSync(corepackPath, 0o755);

91+92+

const result = runHelper(`

93+

set -euo pipefail

94+

ROOT_DIR=${JSON.stringify(tempRoot)}

95+

OPENCLAW_TEST_LOG=${JSON.stringify(logPath)}

96+

export OPENCLAW_TEST_LOG

97+

PATH=${JSON.stringify(`${toolsDir}:/usr/bin:/bin`)}

98+

${helperBlock}

99+

run_pnpm install --frozen-lockfile --config.node-linker=hoisted

100+

run_pnpm build

101+

`);

102+103+

expect(result.status).toBe(0);

104+

expect(readFileSync(logPath, "utf8").trim().split("\n")).toEqual([

105+

`${tempRoot}|pnpm --version`,

106+

`${tempRoot}|pnpm install --frozen-lockfile --config.node-linker=hoisted`,

107+

`${tempRoot}|pnpm build`,

108+

]);

109+

});

110+111+

it("fails with an actionable error when neither pnpm nor corepack pnpm is available", () => {

112+

const helperBlock = getPackageManagerHelperBlock();

113+

const tempRoot = mkdtempSync(path.join(tmpdir(), "openclaw-package-pnpm-root-"));

114+

const toolsDir = mkdtempSync(path.join(tmpdir(), "openclaw-package-pnpm-tools-"));

115+

tempDirs.push(tempRoot, toolsDir);

116+117+

const result = runHelper(`

118+

set -euo pipefail

119+

ROOT_DIR=${JSON.stringify(tempRoot)}

120+

PATH=${JSON.stringify(`${toolsDir}:/usr/bin:/bin`)}

121+

${helperBlock}

122+

run_pnpm build

123+

`);

124+125+

expect(result.status).toBe(1);

126+

expect(result.stderr).toContain("pnpm is not on PATH and corepack pnpm is unavailable");

127+

});

128+58129

it("does not kill unrelated OpenClaw processes during packaging", () => {

59130

const script = readFileSync(scriptPath, "utf8");

60131

const stopBlock = script.slice(