mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
fix(inventory): omit qa-matrix dist artifacts
This commit is contained in:
@@ -11,6 +11,6 @@ export const NPM_UPDATE_COMPAT_SIDECARS = [
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const NPM_UPDATE_COMPAT_SIDECAR_PATHS = new Set(
|
||||
export const NPM_UPDATE_COMPAT_SIDECAR_PATHS = new Set<string>(
|
||||
NPM_UPDATE_COMPAT_SIDECARS.map((entry) => entry.path),
|
||||
);
|
||||
|
||||
@@ -45,10 +45,19 @@ describe("package dist inventory", () => {
|
||||
"runtime-api.js",
|
||||
);
|
||||
const omittedQaChunk = path.join(packageRoot, "dist", "extensions", "qa-channel", "cli.js");
|
||||
const omittedQaMatrixChunk = path.join(
|
||||
packageRoot,
|
||||
"dist",
|
||||
"extensions",
|
||||
"qa-matrix",
|
||||
"index.js",
|
||||
);
|
||||
const omittedMap = path.join(packageRoot, "dist", "feature.runtime.js.map");
|
||||
await fs.mkdir(path.dirname(packagedQaRuntime), { recursive: true });
|
||||
await fs.mkdir(path.dirname(omittedQaMatrixChunk), { recursive: true });
|
||||
await fs.writeFile(packagedQaRuntime, "export {};\n", "utf8");
|
||||
await fs.writeFile(omittedQaChunk, "export {};\n", "utf8");
|
||||
await fs.writeFile(omittedQaMatrixChunk, "export {};\n", "utf8");
|
||||
await fs.writeFile(omittedMap, "{}", "utf8");
|
||||
|
||||
await expect(writePackageDistInventory(packageRoot)).resolves.toEqual([
|
||||
|
||||
@@ -6,6 +6,11 @@ const PACKAGED_QA_RUNTIME_PATHS = new Set([
|
||||
"dist/extensions/qa-channel/runtime-api.js",
|
||||
"dist/extensions/qa-lab/runtime-api.js",
|
||||
]);
|
||||
const OMITTED_QA_EXTENSION_PREFIXES = [
|
||||
"dist/extensions/qa-channel/",
|
||||
"dist/extensions/qa-lab/",
|
||||
"dist/extensions/qa-matrix/",
|
||||
];
|
||||
|
||||
function normalizeRelativePath(value: string): string {
|
||||
return value.replace(/\\/g, "/");
|
||||
@@ -24,10 +29,7 @@ function isPackagedDistPath(relativePath: string): boolean {
|
||||
if (relativePath === "dist/plugin-sdk/.tsbuildinfo") {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
relativePath.startsWith("dist/extensions/qa-channel/") ||
|
||||
relativePath.startsWith("dist/extensions/qa-lab/")
|
||||
) {
|
||||
if (OMITTED_QA_EXTENSION_PREFIXES.some((prefix) => relativePath.startsWith(prefix))) {
|
||||
return PACKAGED_QA_RUNTIME_PATHS.has(relativePath);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -87,6 +87,7 @@ describe("resolveBuildAllSteps", () => {
|
||||
"canvas:a2ui:bundle",
|
||||
"tsdown",
|
||||
"runtime-postbuild",
|
||||
"write-npm-update-compat-sidecars",
|
||||
"build-stamp",
|
||||
"canvas-a2ui-copy",
|
||||
"copy-hook-metadata",
|
||||
|
||||
Reference in New Issue
Block a user