mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:10:49 +00:00
build: restore qa lab updater sidecar
This commit is contained in:
@@ -46,6 +46,7 @@ const LEGACY_CONTEXT_ENGINE_UNRESOLVED_RUNTIME_MARKER =
|
||||
"Failed to load legacy context engine runtime.";
|
||||
const LEGACY_UPDATE_COMPAT_RUNTIME_SIDECAR_PATHS = [
|
||||
"dist/extensions/qa-channel/runtime-api.js",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
] as const;
|
||||
const PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS = [
|
||||
...BUNDLED_RUNTIME_SIDECAR_PATHS.filter((relativePath) =>
|
||||
|
||||
@@ -59,7 +59,10 @@ export type NpmDistTagMirrorAuth = {
|
||||
};
|
||||
const EXPECTED_REPOSITORY_URL = "https://github.com/openclaw/openclaw";
|
||||
const MAX_CALVER_DISTANCE_DAYS = 2;
|
||||
const LEGACY_UPDATE_COMPAT_PACKED_PATHS = ["dist/extensions/qa-channel/runtime-api.js"] as const;
|
||||
const LEGACY_UPDATE_COMPAT_PACKED_PATHS = [
|
||||
"dist/extensions/qa-channel/runtime-api.js",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
] as const;
|
||||
const REQUIRED_PACKED_PATHS = [
|
||||
PACKAGE_DIST_INVENTORY_RELATIVE_PATH,
|
||||
"dist/control-ui/index.html",
|
||||
|
||||
@@ -41,6 +41,12 @@ const LEGACY_UPDATE_COMPAT_SIDECARS = [
|
||||
content:
|
||||
"// Compatibility stub for older OpenClaw updaters. The QA channel implementation is not packaged.\nexport {};\n",
|
||||
},
|
||||
{
|
||||
path: "dist/extensions/qa-lab/runtime-api.js",
|
||||
removedPrefix: "dist/extensions/qa-lab/",
|
||||
content:
|
||||
"// Compatibility stub for older OpenClaw updaters. The QA lab implementation is not packaged.\nexport {};\n",
|
||||
},
|
||||
];
|
||||
const BAILEYS_MEDIA_FILE = join(
|
||||
"node_modules",
|
||||
@@ -313,10 +319,9 @@ export function restoreLegacyUpdaterCompatSidecars(params = {}) {
|
||||
const restored = [];
|
||||
|
||||
for (const sidecar of LEGACY_UPDATE_COMPAT_SIDECARS) {
|
||||
// Older npm updater builds verify this exact sidecar after npm has already
|
||||
// replaced the package. npm may remove stale QA Lab files before this
|
||||
// postinstall hook runs, so this must be generated independently of prune
|
||||
// results. The tarball and dist inventory still omit QA Lab.
|
||||
// Older npm updater builds verify these exact sidecars after npm has
|
||||
// already replaced the package, so generate them independently of prune
|
||||
// results.
|
||||
const sidecarPath = join(packageRoot, sidecar.path);
|
||||
makeDirectory(dirname(sidecarPath), { recursive: true });
|
||||
writeFile(sidecarPath, sidecar.content, "utf8");
|
||||
|
||||
@@ -57,7 +57,13 @@ const requiredPathGroups = [
|
||||
"dist/build-info.json",
|
||||
"dist/channel-catalog.json",
|
||||
"dist/control-ui/index.html",
|
||||
"dist/extensions/qa-channel/runtime-api.js",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
];
|
||||
const legacyUpdateCompatPackPaths = new Set([
|
||||
"dist/extensions/qa-channel/runtime-api.js",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
]);
|
||||
const forbiddenPrefixes = [
|
||||
"dist-runtime/",
|
||||
"dist/OpenClaw.app/",
|
||||
@@ -274,7 +280,9 @@ export function collectForbiddenPackPaths(paths: Iterable<string>): string[] {
|
||||
return [...paths]
|
||||
.filter(
|
||||
(path) =>
|
||||
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) || /node_modules\//.test(path),
|
||||
!legacyUpdateCompatPackPaths.has(path) &&
|
||||
(forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) ||
|
||||
/node_modules\//.test(path)),
|
||||
)
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user