fix(inventory): omit qa-matrix dist artifacts

This commit is contained in:
Ayaan Zaidi
2026-04-15 12:14:44 +05:30
parent 2791b00e72
commit a1d4eb255a
4 changed files with 17 additions and 5 deletions

View File

@@ -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),
);

View File

@@ -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([

View File

@@ -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;

View File

@@ -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",