From a5dafa27b6b1f079697a4185d1de605fc48fdd73 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 15 Apr 2026 20:49:27 +0100 Subject: [PATCH] fix(release): allow legacy qa sidecar verification --- scripts/openclaw-npm-postpublish-verify.ts | 20 ++++++-------------- test/openclaw-npm-postpublish-verify.test.ts | 6 ++---- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/scripts/openclaw-npm-postpublish-verify.ts b/scripts/openclaw-npm-postpublish-verify.ts index f46e8b54b94..fe7a5733912 100644 --- a/scripts/openclaw-npm-postpublish-verify.ts +++ b/scripts/openclaw-npm-postpublish-verify.ts @@ -166,20 +166,12 @@ export function resolveInstalledBinaryPath(prefixDir: string, platform = process : join(prefixDir, "bin", "openclaw"); } -function collectExpectedBundledExtensionPackageIds( - sourceExtensionsDir = join(process.cwd(), "extensions"), -): ReadonlySet | null { - if (!existsSync(sourceExtensionsDir)) { - return null; - } - +function collectExpectedBundledExtensionPackageIds(): ReadonlySet { const ids = new Set(); - for (const entry of readdirSync(sourceExtensionsDir, { withFileTypes: true })) { - if (!entry.isDirectory()) { - continue; - } - if (existsSync(join(sourceExtensionsDir, entry.name, "package.json"))) { - ids.add(entry.name); + for (const relativePath of listBundledPluginPackArtifacts()) { + const match = /^dist\/extensions\/([^/]+)\/package\.json$/u.exec(relativePath); + if (match) { + ids.add(match[1]); } } return ids; @@ -206,7 +198,7 @@ function readBundledExtensionPackageJsons(packageRoot: string): { const extensionDirPath = join(extensionsDir, entry.name); const packageJsonPath = join(extensionsDir, entry.name, "package.json"); if (!existsSync(packageJsonPath)) { - if (expectedPackageIds === null || expectedPackageIds.has(entry.name)) { + if (expectedPackageIds.has(entry.name)) { errors.push(`installed bundled extension manifest missing: ${packageJsonPath}.`); } continue; diff --git a/test/openclaw-npm-postpublish-verify.test.ts b/test/openclaw-npm-postpublish-verify.test.ts index d88ef4221a2..dc26443e113 100644 --- a/test/openclaw-npm-postpublish-verify.test.ts +++ b/test/openclaw-npm-postpublish-verify.test.ts @@ -315,7 +315,7 @@ describe("collectInstalledMirroredRootDependencyManifestErrors", () => { } }); - it("rejects packaged qa channel sidecar directories that are missing package.json", () => { + it("accepts legacy qa channel sidecar directories without package.json", () => { const packageRoot = makeInstalledPackageRoot(); try { @@ -330,9 +330,7 @@ describe("collectInstalledMirroredRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledMirroredRootDependencyManifestErrors(packageRoot)).toEqual([ - `installed bundled extension manifest missing: ${join(packageRoot, "dist/extensions/qa-channel/package.json")}.`, - ]); + expect(collectInstalledMirroredRootDependencyManifestErrors(packageRoot)).toEqual([]); } finally { rmSync(packageRoot, { recursive: true, force: true }); }