build: keep a2ui bundle stable

This commit is contained in:
Peter Steinberger
2026-04-21 04:07:58 +01:00
parent 32434b5f81
commit d7d1270ced
5 changed files with 25 additions and 11 deletions

View File

@@ -12,10 +12,8 @@ const hashFile = path.join(rootDir, "src", "canvas-host", "a2ui", ".bundle.hash"
const outputFile = path.join(rootDir, "src", "canvas-host", "a2ui", "a2ui.bundle.js");
const a2uiRendererDir = path.join(rootDir, "vendor", "a2ui", "renderers", "lit");
const a2uiAppDir = path.join(rootDir, "apps", "shared", "OpenClawKit", "Tools", "CanvasA2UI");
const rootPackageFile = path.join(rootDir, "package.json");
const pnpmLockFile = path.join(rootDir, "pnpm-lock.yaml");
const uiPackageFile = path.join(rootDir, "ui", "package.json");
const repoInputPaths = [rootPackageFile, pnpmLockFile, uiPackageFile, a2uiRendererDir, a2uiAppDir];
const repoInputPaths = [uiPackageFile, a2uiRendererDir, a2uiAppDir];
const ignoredBundleHashInputPrefixes = ["vendor/a2ui/renderers/lit/dist"];
const relativeRepoInputPaths = repoInputPaths.map((inputPath) =>
normalizePath(path.relative(rootDir, inputPath)),
@@ -67,8 +65,6 @@ export function getLocalRolldownCliCandidates(repoRoot = rootDir) {
export function getBundleHashRepoInputPaths(repoRoot = rootDir) {
return [
path.join(repoRoot, "package.json"),
path.join(repoRoot, "pnpm-lock.yaml"),
path.join(repoRoot, "ui", "package.json"),
path.join(repoRoot, "vendor", "a2ui", "renderers", "lit"),
path.join(repoRoot, "apps", "shared", "OpenClawKit", "Tools", "CanvasA2UI"),

View File

@@ -201,6 +201,10 @@ const TOOLING_TEST_TARGETS = new Map([
["test/scripts/vitest-local-scheduling.test.ts"],
],
]);
const GENERATED_CHANGED_TEST_TARGETS = new Set([
"src/canvas-host/a2ui/.bundle.hash",
"src/canvas-host/a2ui/a2ui.bundle.js",
]);
const VITEST_CONFIG_TARGET_KIND_BY_PATH = new Map(
Object.entries(VITEST_CONFIG_BY_KIND).map(([kind, config]) => [config, kind]),
);
@@ -404,6 +408,9 @@ function resolveToolingChangedTestTargets(changedPaths) {
}
function isRoutableChangedTarget(changedPath) {
if (GENERATED_CHANGED_TEST_TARGETS.has(changedPath)) {
return false;
}
return /^(?:src|test|extensions|ui|packages)(?:\/|$)/u.test(changedPath);
}