mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:40:44 +00:00
fix: exclude qa extensions from npm package
This commit is contained in:
@@ -52,7 +52,6 @@ const providerConfig = {
|
||||
};
|
||||
|
||||
const PACKAGE_DIST_INVENTORY_RELATIVE_PATH = "dist/postinstall-inventory.json";
|
||||
const PACKAGED_QA_RUNTIME_PATHS = new Set(["dist/extensions/qa-channel/runtime-api.js"]);
|
||||
const OMITTED_QA_EXTENSION_PREFIXES = [
|
||||
"dist/extensions/qa-channel/",
|
||||
"dist/extensions/qa-lab/",
|
||||
@@ -478,7 +477,7 @@ function isPackagedDistPath(relativePath) {
|
||||
return false;
|
||||
}
|
||||
if (OMITTED_QA_EXTENSION_PREFIXES.some((prefix) => relativePath.startsWith(prefix))) {
|
||||
return PACKAGED_QA_RUNTIME_PATHS.has(relativePath);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -59,14 +59,9 @@ 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",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
] as const;
|
||||
const REQUIRED_PACKED_PATHS = [
|
||||
PACKAGE_DIST_INVENTORY_RELATIVE_PATH,
|
||||
"dist/control-ui/index.html",
|
||||
...LEGACY_UPDATE_COMPAT_PACKED_PATHS,
|
||||
...WORKSPACE_TEMPLATE_PACK_PATHS,
|
||||
];
|
||||
const CONTROL_UI_ASSET_PREFIX = "dist/control-ui/assets/";
|
||||
@@ -104,6 +99,7 @@ const FORBIDDEN_PACKED_PATH_RULES = [
|
||||
] as const;
|
||||
const FORBIDDEN_PRIVATE_QA_CONTENT_MARKERS = [
|
||||
"//#region extensions/qa-lab/",
|
||||
"qa-channel/runtime-api.js",
|
||||
"qa-lab/cli.js",
|
||||
"qa-lab/runtime-api.js",
|
||||
] as const;
|
||||
@@ -532,9 +528,6 @@ function collectPackedTarballErrors(): string[] {
|
||||
export function collectForbiddenPackedPathErrors(paths: Iterable<string>): string[] {
|
||||
const errors: string[] = [];
|
||||
for (const packedPath of paths) {
|
||||
if ((LEGACY_UPDATE_COMPAT_PACKED_PATHS as readonly string[]).includes(packedPath)) {
|
||||
continue;
|
||||
}
|
||||
const matchedRule = FORBIDDEN_PACKED_PATH_RULES.find((rule) =>
|
||||
packedPath.startsWith(rule.prefix),
|
||||
);
|
||||
|
||||
@@ -66,16 +66,11 @@ 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/",
|
||||
"dist/extensions/qa-channel/",
|
||||
"dist/extensions/qa-lab/",
|
||||
"dist/plugin-sdk/extensions/qa-lab/",
|
||||
"dist/plugin-sdk/qa-lab.",
|
||||
@@ -89,6 +84,7 @@ const forbiddenPrefixes = [
|
||||
];
|
||||
const forbiddenPrivateQaContentMarkers = [
|
||||
"//#region extensions/qa-lab/",
|
||||
"qa-channel/runtime-api.js",
|
||||
"qa-lab/cli.js",
|
||||
"qa-lab/runtime-api.js",
|
||||
] as const;
|
||||
@@ -460,9 +456,7 @@ export function collectForbiddenPackPaths(paths: Iterable<string>): string[] {
|
||||
return [...paths]
|
||||
.filter(
|
||||
(path) =>
|
||||
!legacyUpdateCompatPackPaths.has(path) &&
|
||||
(forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) ||
|
||||
/node_modules\//.test(path)),
|
||||
forbiddenPrefixes.some((prefix) => path.startsWith(prefix)) || /node_modules\//.test(path),
|
||||
)
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user