diff --git a/package.json b/package.json index 3177e357935..c2c4464e846 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "!dist/**/*.map", "!dist/plugin-sdk/.tsbuildinfo", "!dist/extensions/qa-channel/**", - "dist/extensions/qa-channel/runtime-api.js", "!dist/extensions/qa-lab/**", "!dist/extensions/qa-matrix/**", "docs/", diff --git a/scripts/build-all.mjs b/scripts/build-all.mjs index 343fb7a3c8d..34ce0b76db7 100644 --- a/scripts/build-all.mjs +++ b/scripts/build-all.mjs @@ -10,11 +10,6 @@ export const BUILD_ALL_STEPS = [ { label: "canvas:a2ui:bundle", kind: "pnpm", pnpmArgs: ["canvas:a2ui:bundle"] }, { label: "tsdown", kind: "node", args: ["scripts/tsdown-build.mjs"] }, { label: "runtime-postbuild", kind: "node", args: ["scripts/runtime-postbuild.mjs"] }, - { - label: "write-npm-update-compat-sidecars", - kind: "node", - args: ["scripts/write-npm-update-compat-sidecars.mjs"], - }, { label: "build-stamp", kind: "node", args: ["scripts/build-stamp.mjs"] }, { label: "build:plugin-sdk:dts", diff --git a/scripts/lib/npm-update-compat-sidecars.mjs b/scripts/lib/npm-update-compat-sidecars.mjs deleted file mode 100644 index 66211821b77..00000000000 --- a/scripts/lib/npm-update-compat-sidecars.mjs +++ /dev/null @@ -1,11 +0,0 @@ -export const NPM_UPDATE_COMPAT_SIDECARS = [ - { - path: "dist/extensions/qa-channel/runtime-api.js", - content: - "// Compatibility stub for older OpenClaw updaters. The QA channel implementation is not packaged.\nexport {};\n", - }, -]; - -export const NPM_UPDATE_COMPAT_SIDECAR_PATHS = new Set( - NPM_UPDATE_COMPAT_SIDECARS.map((entry) => entry.path), -); diff --git a/scripts/openclaw-npm-postpublish-verify.ts b/scripts/openclaw-npm-postpublish-verify.ts index 7725319d51b..197d2e00abe 100644 --- a/scripts/openclaw-npm-postpublish-verify.ts +++ b/scripts/openclaw-npm-postpublish-verify.ts @@ -20,7 +20,6 @@ import { collectRootDistBundledRuntimeMirrors, collectRuntimeDependencySpecs, } from "./lib/bundled-plugin-root-runtime-mirrors.mjs"; -import { NPM_UPDATE_COMPAT_SIDECAR_PATHS } from "./lib/npm-update-compat-sidecars.mjs"; import { runInstalledWorkspaceBootstrapSmoke } from "./lib/workspace-bootstrap-smoke.mjs"; import { parseReleaseVersion, resolveNpmCommandInvocation } from "./openclaw-npm-release-check.ts"; @@ -44,13 +43,6 @@ type InstalledBundledExtensionManifestRecord = { const MAX_BUNDLED_EXTENSION_MANIFEST_BYTES = 1024 * 1024; const LEGACY_CONTEXT_ENGINE_UNRESOLVED_RUNTIME_MARKER = "Failed to load legacy context engine runtime."; -const NPM_UPDATE_COMPAT_EXTENSION_DIRS = new Set( - [...NPM_UPDATE_COMPAT_SIDECAR_PATHS].map((relativePath) => { - const pathParts = relativePath.split("/"); - pathParts.pop(); - return pathParts.join("/"); - }), -); export type PublishedInstallScenario = { name: string; @@ -183,20 +175,6 @@ function collectExpectedBundledExtensionPackageIds( return ids; } -function isNpmUpdateCompatOnlyExtensionDir(params: { - extensionId: string; - packageRoot: string; -}): boolean { - const relativeExtensionDir = `dist/extensions/${params.extensionId}`; - if (!NPM_UPDATE_COMPAT_EXTENSION_DIRS.has(relativeExtensionDir)) { - return false; - } - - return [...NPM_UPDATE_COMPAT_SIDECAR_PATHS] - .filter((relativePath) => relativePath.startsWith(`${relativeExtensionDir}/`)) - .every((relativePath) => existsSync(join(params.packageRoot, relativePath))); -} - function readBundledExtensionPackageJsons(packageRoot: string): { manifests: InstalledBundledExtensionManifestRecord[]; errors: string[]; @@ -218,9 +196,6 @@ function readBundledExtensionPackageJsons(packageRoot: string): { const extensionDirPath = join(extensionsDir, entry.name); const packageJsonPath = join(extensionsDir, entry.name, "package.json"); if (!existsSync(packageJsonPath)) { - if (isNpmUpdateCompatOnlyExtensionDir({ extensionId: entry.name, packageRoot })) { - continue; - } if (expectedPackageIds === null || expectedPackageIds.has(entry.name)) { errors.push(`installed bundled extension manifest missing: ${packageJsonPath}.`); } diff --git a/scripts/openclaw-npm-release-check.ts b/scripts/openclaw-npm-release-check.ts index 49ca6dff643..eb5c40adde0 100644 --- a/scripts/openclaw-npm-release-check.ts +++ b/scripts/openclaw-npm-release-check.ts @@ -9,7 +9,6 @@ import { resolveNpmDistTagMirrorAuth as resolveNpmDistTagMirrorAuthBase, parseReleaseVersion as parseReleaseVersionBase, } from "./lib/npm-publish-plan.mjs"; -import { NPM_UPDATE_COMPAT_SIDECAR_PATHS } from "./lib/npm-update-compat-sidecars.mjs"; import { WORKSPACE_TEMPLATE_PACK_PATHS } from "./lib/workspace-bootstrap-smoke.mjs"; type PackageJson = { @@ -465,9 +464,6 @@ function collectPackedTarballErrors(): string[] { export function collectForbiddenPackedPathErrors(paths: Iterable): string[] { const errors: string[] = []; for (const packedPath of paths) { - if (NPM_UPDATE_COMPAT_SIDECAR_PATHS.has(packedPath)) { - continue; - } const matchedRule = FORBIDDEN_PACKED_PATH_RULES.find((rule) => packedPath.startsWith(rule.prefix), ); diff --git a/scripts/write-npm-update-compat-sidecars.mjs b/scripts/write-npm-update-compat-sidecars.mjs deleted file mode 100644 index 1b65463df7a..00000000000 --- a/scripts/write-npm-update-compat-sidecars.mjs +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node - -import fs from "node:fs"; -import path from "node:path"; -import { NPM_UPDATE_COMPAT_SIDECARS } from "./lib/npm-update-compat-sidecars.mjs"; - -for (const entry of NPM_UPDATE_COMPAT_SIDECARS) { - fs.mkdirSync(path.dirname(entry.path), { recursive: true }); - fs.writeFileSync(entry.path, entry.content, "utf8"); -} diff --git a/test/openclaw-npm-postpublish-verify.test.ts b/test/openclaw-npm-postpublish-verify.test.ts index 176448210bb..51522df0e9f 100644 --- a/test/openclaw-npm-postpublish-verify.test.ts +++ b/test/openclaw-npm-postpublish-verify.test.ts @@ -301,7 +301,7 @@ describe("collectInstalledMirroredRootDependencyManifestErrors", () => { } }); - it("allows npm update compatibility sidecar directories without package.json", () => { + it("rejects private qa sidecar directories that are missing package.json", () => { const packageRoot = makeInstalledPackageRoot(); try { @@ -322,7 +322,10 @@ describe("collectInstalledMirroredRootDependencyManifestErrors", () => { "utf8", ); - expect(collectInstalledMirroredRootDependencyManifestErrors(packageRoot)).toEqual([]); + expect(collectInstalledMirroredRootDependencyManifestErrors(packageRoot)).toEqual([ + `installed bundled extension manifest missing: ${join(packageRoot, "dist/extensions/qa-channel/package.json")}.`, + `installed bundled extension manifest missing: ${join(packageRoot, "dist/extensions/qa-lab/package.json")}.`, + ]); } finally { rmSync(packageRoot, { recursive: true, force: true }); } diff --git a/test/openclaw-npm-release-check.test.ts b/test/openclaw-npm-release-check.test.ts index 910b95cf7dd..b64b683c46e 100644 --- a/test/openclaw-npm-release-check.test.ts +++ b/test/openclaw-npm-release-check.test.ts @@ -325,6 +325,8 @@ describe("collectForbiddenPackedPathErrors", () => { ]), ).toEqual([ 'npm package must not include private QA channel artifact "dist/extensions/qa-channel/package.json".', + 'npm package must not include private QA channel artifact "dist/extensions/qa-channel/runtime-api.js".', + 'npm package must not include private QA lab artifact "dist/extensions/qa-lab/runtime-api.js".', 'npm package must not include private QA lab artifact "dist/extensions/qa-lab/src/cli.js".', ]); });