fix(ci): slim build-artifacts dist producer

This commit is contained in:
Vincent Koc
2026-04-15 00:12:34 +01:00
parent 87ef32c937
commit f1c2be7d32
4 changed files with 65 additions and 3 deletions

View File

@@ -1,5 +1,10 @@
import { describe, expect, it } from "vitest";
import { BUILD_ALL_STEPS, resolveBuildAllStep } from "../../scripts/build-all.mjs";
import {
BUILD_ALL_PROFILES,
BUILD_ALL_STEPS,
resolveBuildAllStep,
resolveBuildAllSteps,
} from "../../scripts/build-all.mjs";
describe("resolveBuildAllStep", () => {
it("routes pnpm steps through the npm_execpath pnpm runner on Windows", () => {
@@ -70,3 +75,29 @@ describe("resolveBuildAllStep", () => {
});
});
});
describe("resolveBuildAllSteps", () => {
it("keeps the full profile aligned with the declared steps", () => {
expect(resolveBuildAllSteps("full")).toEqual(BUILD_ALL_STEPS);
expect(BUILD_ALL_PROFILES.full).toEqual(BUILD_ALL_STEPS.map((step) => step.label));
});
it("uses a runtime-only profile for ci artifacts", () => {
expect(resolveBuildAllSteps("ciArtifacts").map((step) => step.label)).toEqual([
"canvas:a2ui:bundle",
"tsdown",
"runtime-postbuild",
"build-stamp",
"canvas-a2ui-copy",
"copy-hook-metadata",
"copy-export-html-templates",
"write-build-info",
"write-cli-startup-metadata",
"write-cli-compat",
]);
});
it("rejects unknown build profiles", () => {
expect(() => resolveBuildAllSteps("wat")).toThrow("Unknown build profile: wat");
});
});