mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:30:45 +00:00
fix: narrow a2ui bundle hash inputs
This commit is contained in:
@@ -2,7 +2,10 @@ import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
compareNormalizedPaths,
|
||||
getBundleHashInputPaths,
|
||||
getBundleHashRepoInputPaths,
|
||||
getLocalRolldownCliCandidates,
|
||||
getResolvedBundleDependencyPackageJsonPaths,
|
||||
isBundleHashInputPath,
|
||||
} from "../../scripts/bundle-a2ui.mjs";
|
||||
|
||||
@@ -48,4 +51,31 @@ describe("scripts/bundle-a2ui.mjs", () => {
|
||||
"repo/ä.ts",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps repo-root package churn out of bundle hash inputs", () => {
|
||||
const repoRoot = path.resolve("repo-root");
|
||||
const inputPaths = getBundleHashRepoInputPaths(repoRoot);
|
||||
|
||||
expect(inputPaths).toContain(path.join(repoRoot, "ui", "package.json"));
|
||||
expect(inputPaths).not.toContain(path.join(repoRoot, "package.json"));
|
||||
expect(inputPaths).not.toContain(path.join(repoRoot, "pnpm-lock.yaml"));
|
||||
});
|
||||
|
||||
it("tracks only the resolved bundle dependency manifests from node_modules", () => {
|
||||
const repoRoot = process.cwd();
|
||||
const dependencyPaths = getResolvedBundleDependencyPackageJsonPaths(repoRoot);
|
||||
|
||||
expect(dependencyPaths).toContain(path.join(repoRoot, "node_modules", "lit", "package.json"));
|
||||
expect(dependencyPaths).toContain(
|
||||
path.join(repoRoot, "node_modules", "@lit/context", "package.json"),
|
||||
);
|
||||
expect(dependencyPaths).toContain(
|
||||
path.join(repoRoot, "node_modules", "@lit-labs/signals", "package.json"),
|
||||
);
|
||||
expect(dependencyPaths).toContain(
|
||||
path.join(repoRoot, "node_modules", "signal-utils", "package.json"),
|
||||
);
|
||||
expect(getBundleHashInputPaths(repoRoot)).not.toContain(path.join(repoRoot, "package.json"));
|
||||
expect(getBundleHashInputPaths(repoRoot)).not.toContain(path.join(repoRoot, "pnpm-lock.yaml"));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user