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

推荐订阅源

量子位
WordPress大学
WordPress大学
小众软件
小众软件
云风的 BLOG
云风的 BLOG
IT之家
IT之家
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
宝玉的分享
宝玉的分享
博客园 - Franky
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
D
Docker
博客园 - 聂微东
C
Check Point Blog
H
Help Net Security

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
build(pnpm): upgrade workspace to pnpm 11 · openclaw/open...
altaywtf · 2026-05-11 · via Recent Commits to openclaw:main

@@ -16,6 +16,80 @@ function readJson(file) {

1616

return JSON.parse(fs.readFileSync(file, "utf8"));

1717

}

181819+

// Runs inside the bare Docker E2E image, before package dependencies are installed.

20+

// Keep this to the small pnpm-workspace.yaml surface the fixture mutates.

21+

function findTopLevelBlock(lines, key) {

22+

const start = lines.findIndex((line) => new RegExp(`^${key}:\\s*(?:#.*)?$`).test(line));

23+

if (start === -1) {

24+

return null;

25+

}

26+

let end = start + 1;

27+

while (end < lines.length && !/^[A-Za-z0-9_-]+:\s*/.test(lines[end])) {

28+

end += 1;

29+

}

30+

return { start, end };

31+

}

32+33+

function parseYamlScalar(raw) {

34+

const trimmed = raw.trim();

35+

const withoutComment = trimmed.replace(/\s+#.*$/, "");

36+

if (withoutComment.startsWith('"') && withoutComment.endsWith('"')) {

37+

return withoutComment.slice(1, -1);

38+

}

39+

if (withoutComment.startsWith("'") && withoutComment.endsWith("'")) {

40+

return withoutComment.slice(1, -1);

41+

}

42+

return withoutComment;

43+

}

44+45+

function readWorkspacePatchedDependencies(file) {

46+

const lines = fs.readFileSync(file, "utf8").split("\n");

47+

const block = findTopLevelBlock(lines, "patchedDependencies");

48+

if (!block) {

49+

return { patches: undefined };

50+

}

51+52+

const patches = {};

53+

for (const line of lines.slice(block.start + 1, block.end)) {

54+

const match = line.match(/^\s+(.+?):\s+(.+?)\s*$/);

55+

if (!match) {

56+

continue;

57+

}

58+

patches[parseYamlScalar(match[1])] = parseYamlScalar(match[2]);

59+

}

60+

return { patches };

61+

}

62+63+

function writeWorkspacePnpmConfig(file, keptPatches) {

64+

const original = fs.readFileSync(file, "utf8");

65+

const hadTrailingNewline = original.endsWith("\n");

66+

const lines = original.replace(/\n$/, "").split("\n");

67+

const patchBlock = findTopLevelBlock(lines, "patchedDependencies");

68+69+

if (patchBlock) {

70+

const nextLines = [];

71+

nextLines.push(...lines.slice(0, patchBlock.start));

72+

if (Object.keys(keptPatches).length > 0) {

73+

nextLines.push("patchedDependencies:");

74+

for (const [dependency, patchFile] of Object.entries(keptPatches)) {

75+

nextLines.push(` ${JSON.stringify(dependency)}: ${JSON.stringify(patchFile)}`);

76+

}

77+

}

78+

nextLines.push(...lines.slice(patchBlock.end));

79+

lines.length = 0;

80+

lines.push(...nextLines);

81+

}

82+83+

const allowUnusedIndex = lines.findIndex((line) => /^allowUnusedPatches:\s*/.test(line));

84+

if (allowUnusedIndex === -1) {

85+

lines.push("allowUnusedPatches: true");

86+

} else {

87+

lines[allowUnusedIndex] = "allowUnusedPatches: true";

88+

}

89+90+

fs.writeFileSync(file, `${lines.join("\n")}${hadTrailingNewline ? "\n" : ""}`);

91+

}

92+1993

function writeControlUi(root) {

2094

const file = path.join(root, "dist", "control-ui", "index.html");

2195

fs.mkdirSync(path.dirname(file), { recursive: true });

@@ -25,31 +99,41 @@ function writeControlUi(root) {

2599

function prepareGitFixture(root) {

26100

const packageJsonPath = path.join(root, "package.json");

27101

const packageJson = readJson(packageJsonPath);

28-

packageJson.pnpm = { ...packageJson.pnpm, allowUnusedPatches: true };

29-

const patches = packageJson.pnpm.patchedDependencies;

102+

const pnpmWorkspacePath = path.join(root, "pnpm-workspace.yaml");

103+

const workspaceConfig = fs.existsSync(pnpmWorkspacePath)

104+

? readWorkspacePatchedDependencies(pnpmWorkspacePath)

105+

: undefined;

106+

const pnpmConfig = workspaceConfig ? {} : { ...packageJson.pnpm };

107+

const patches = workspaceConfig?.patches ?? pnpmConfig.patchedDependencies;

108+

const keptPatches = {};

30109

if (patches && typeof patches === "object" && !Array.isArray(patches)) {

31-

const kept = {};

32110

const missing = [];

33111

for (const [dependency, patchFile] of Object.entries(patches)) {

34112

const exists =

35113

typeof patchFile === "string" &&

36114

fs.existsSync(path.resolve(path.dirname(packageJsonPath), patchFile));

37115

if (exists) {

38-

kept[dependency] = patchFile;

116+

keptPatches[dependency] = patchFile;

39117

} else {

40118

missing.push(`${dependency} -> ${String(patchFile)}`);

41119

}

42120

}

43121

if (missing.length > 0 && !legacyPackageAcceptanceCompat(packageJson.version)) {

44122

throw new Error(

45-

`package ${packageJson.version} has missing pnpm.patchedDependencies in package fixture: ${missing.join(", ")}`,

123+

`package ${packageJson.version} has missing pnpm patchedDependencies in package fixture: ${missing.join(", ")}`,

46124

);

47125

}

48-

if (Object.keys(kept).length > 0) {

49-

packageJson.pnpm.patchedDependencies = kept;

126+

}

127+

if (workspaceConfig) {

128+

writeWorkspacePnpmConfig(pnpmWorkspacePath, keptPatches);

129+

} else {

130+

pnpmConfig.allowUnusedPatches = true;

131+

if (Object.keys(keptPatches).length > 0) {

132+

pnpmConfig.patchedDependencies = keptPatches;

50133

} else {

51-

delete packageJson.pnpm.patchedDependencies;

134+

delete pnpmConfig.patchedDependencies;

52135

}

136+

packageJson.pnpm = pnpmConfig;

53137

}

54138

const fixtureUiBuildSource = `const fs=require("node:fs");fs.mkdirSync("dist/control-ui",{recursive:true});fs.writeFileSync("dist/control-ui/index.html",${JSON.stringify(controlUiHtml)})`;

55139

packageJson.scripts = {