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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Last Week in AI
Last Week in AI
月光博客
月光博客
D
DataBreaches.Net
WordPress大学
WordPress大学
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
C
Check Point Blog
F
Fortinet All Blogs
B
Blog
小众软件
小众软件
Vercel News
Vercel News
罗磊的独立博客
有赞技术团队
有赞技术团队

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(plugins): reject omitted package runtime files · open...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1,3 +1,4 @@

1+

import { spawnSync } from "node:child_process";

12

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

23

import { dirname, join } from "node:path";

34

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

@@ -49,6 +50,28 @@ function writeFileText(filePath: string, text: string): void {

4950

writeFileSync(filePath, text, "utf8");

5051

}

515253+

function listNpmPackDryRunFiles(packageDir: string): string[] {

54+

const result = spawnSync("npm", ["pack", "--dry-run", "--json", "--ignore-scripts"], {

55+

cwd: packageDir,

56+

encoding: "utf8",

57+

stdio: ["ignore", "pipe", "pipe"],

58+

});

59+

if (result.error) {

60+

throw result.error;

61+

}

62+

if (result.status !== 0) {

63+

throw new Error(result.stderr.trim() || `npm pack failed with exit ${result.status}`);

64+

}

65+

const [packResult] = JSON.parse(result.stdout) as [

66+

{

67+

files?: { path?: string }[];

68+

},

69+

];

70+

return (packResult?.files ?? []).flatMap((entry) =>

71+

typeof entry.path === "string" ? [entry.path] : [],

72+

);

73+

}

74+5275

function writePublishablePluginPackage(repoDir: string): string {

5376

const packageDir = join(repoDir, "extensions", "diffs");

5477

mkdirSync(packageDir, { recursive: true });

@@ -194,4 +217,40 @@ describe("plugin npm package manifest staging", () => {

194217

"package-local plugin runtime is missing for diffs: ./dist/index.js, ./dist/setup-entry.js",

195218

);

196219

});

220+221+

it("refuses package file rules that omit advertised package-local runtime files", () => {

222+

const repoDir = makeTempRepoRoot(tempDirs, "openclaw-plugin-npm-package-runtime-excluded-");

223+

const packageDir = writePublishablePluginPackage(repoDir);

224+

writeFileText(join(packageDir, "dist", "index.js"), "export {};\n");

225+

writeFileText(join(packageDir, "dist", "setup-entry.js"), "export {};\n");

226+

writeJsonFile(join(packageDir, "package.json"), {

227+

name: "@openclaw/diffs",

228+

version: "2026.5.3",

229+

type: "module",

230+

files: ["dist/**", "!dist/setup-entry.js"],

231+

openclaw: {

232+

extensions: ["./index.ts"],

233+

setupEntry: "./setup-entry.ts",

234+

compat: {

235+

pluginApi: ">=2026.4.30",

236+

},

237+

release: {

238+

publishToNpm: true,

239+

},

240+

},

241+

});

242+243+

const packedFiles = listNpmPackDryRunFiles(packageDir);

244+

expect(packedFiles).toContain("dist/index.js");

245+

expect(packedFiles).not.toContain("dist/setup-entry.js");

246+247+

expect(() =>

248+

resolveAugmentedPluginNpmPackageJson({

249+

repoRoot: repoDir,

250+

packageDir,

251+

}),

252+

).toThrow(

253+

"package file rule '!dist/setup-entry.js' excludes required package-local runtime file './dist/setup-entry.js' for diffs",

254+

);

255+

});

197256

});