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

推荐订阅源

MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
雷峰网
雷峰网
V
Visual Studio Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
月光博客
月光博客
A
About on SuperTechFans
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale

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(release): validate plugin npm publish args · openclaw...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -2,18 +2,40 @@

22
33

set -euo pipefail

44
5-

mode="${1:-}"

6-

package_dir="${2:-}"

5+

usage() {

6+

echo "usage: bash scripts/plugin-npm-publish.sh [--dry-run|--pack-dry-run|--publish] <package-dir>"

7+

}

8+
9+

if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then

10+

usage

11+

exit 0

12+

fi

713
14+

mode="${1:-}"

815

if [[ "${mode}" != "--dry-run" && "${mode}" != "--pack-dry-run" && "${mode}" != "--publish" ]]; then

9-

echo "usage: bash scripts/plugin-npm-publish.sh [--dry-run|--pack-dry-run|--publish] <package-dir>" >&2

16+

usage >&2

1017

exit 2

1118

fi

19+

shift

1220
21+

if [[ "${1:-}" == "--" ]]; then

22+

shift

23+

fi

24+

package_dir=""

25+

if [[ "$#" -gt 0 ]]; then

26+

case "$1" in

27+

-*) echo "unexpected plugin npm package-dir option: $1" >&2; exit 2 ;;

28+

*) package_dir="$1"; shift ;;

29+

esac

30+

fi

1331

if [[ -z "${package_dir}" ]]; then

1432

echo "missing package dir" >&2

1533

exit 2

1634

fi

35+

if [[ "$#" -gt 0 ]]; then

36+

echo "unexpected plugin npm publish argument: $1" >&2

37+

exit 2

38+

fi

1739
1840

package_name="$(node -e 'const pkg = require(require("node:path").resolve(process.argv[1], "package.json")); console.log(pkg.name)' "${package_dir}")"

1941

package_version="$(node -e 'const pkg = require(require("node:path").resolve(process.argv[1], "package.json")); console.log(pkg.version)' "${package_dir}")"

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,50 @@

1+

// Plugin NPM Publish tests cover publish wrapper argument safety.

2+

import { spawnSync } from "node:child_process";

3+

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

4+
5+

const scriptPath = "scripts/plugin-npm-publish.sh";

6+
7+

function runPluginPublishWrapper(args: string[]) {

8+

return spawnSync("bash", [scriptPath, ...args], {

9+

cwd: process.cwd(),

10+

encoding: "utf8",

11+

});

12+

}

13+
14+

describe("plugin npm publish wrapper", () => {

15+

it("prints help before package or npm checks", () => {

16+

const result = runPluginPublishWrapper(["--help"]);

17+
18+

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

19+

expect(result.stdout.trim()).toBe(

20+

"usage: bash scripts/plugin-npm-publish.sh [--dry-run|--pack-dry-run|--publish] <package-dir>",

21+

);

22+

expect(result.stderr).toBe("");

23+

});

24+
25+

it("rejects missing mode before package checks", () => {

26+

const result = runPluginPublishWrapper([]);

27+
28+

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

29+

expect(result.stdout).toBe("");

30+

expect(result.stderr.trim()).toBe(

31+

"usage: bash scripts/plugin-npm-publish.sh [--dry-run|--pack-dry-run|--publish] <package-dir>",

32+

);

33+

});

34+
35+

it("rejects option-like package dirs before package checks", () => {

36+

const result = runPluginPublishWrapper(["--dry-run", "--wat"]);

37+
38+

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

39+

expect(result.stdout).toBe("");

40+

expect(result.stderr.trim()).toBe("unexpected plugin npm package-dir option: --wat");

41+

});

42+
43+

it("rejects extra arguments before package checks", () => {

44+

const result = runPluginPublishWrapper(["--dry-run", "extensions/telegram", "extra"]);

45+
46+

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

47+

expect(result.stdout).toBe("");

48+

expect(result.stderr.trim()).toBe("unexpected plugin npm publish argument: extra");

49+

});

50+

});