fix(FN-3789): add @fusion/dashboard to REQUIRED_BUILD_PACKAGES
@fusion/desktop tests dynamically import('@fusion/dashboard') in
local-runtime.ts. When packages/dashboard/dist/index.js is absent
(fresh checkout, merger verification env, CI without an explicit
dashboard build) Vite fails with 'Failed to resolve entry for package
@fusion/dashboard' before the desktop vitest alias takes effect.
scripts/ensure-test-artifacts.mjs is the canonical bootstrap layer
that pnpm test calls before running suites; register @fusion/dashboard
there so the dist is built on demand. Extends node:test coverage
mirroring the hermes/openclaw patterns.
Unblocks: FN-3789, FN-3793, FN-3795, FN-3803 (and any future task
whose merger verification path runs desktop tests).
This commit is contained in:
5
.changeset/ensure-dashboard-test-artifact.md
Normal file
5
.changeset/ensure-dashboard-test-artifact.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Bootstrap `@fusion/dashboard` dist before running tests so `@fusion/desktop` (which dynamically imports `@fusion/dashboard`) does not fail with "Failed to resolve entry for package @fusion/dashboard" in clean checkouts and merger verification environments.
|
||||||
@@ -36,6 +36,27 @@ test("ensureTestArtifacts builds only missing packages", () => {
|
|||||||
assert.deepEqual(calls[0].args, ["--filter", "@fusion-plugin-examples/openclaw-runtime", "build"]);
|
assert.deepEqual(calls[0].args, ["--filter", "@fusion-plugin-examples/openclaw-runtime", "build"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("detectMissingArtifacts flags @fusion/dashboard when dist/index.js is missing", () => {
|
||||||
|
const missing = detectMissingArtifacts("/repo", (fullPath) => !fullPath.endsWith("packages/dashboard/dist/index.js"));
|
||||||
|
const names = missing.map((pkg) => pkg.name);
|
||||||
|
|
||||||
|
assert.ok(names.includes("@fusion/dashboard"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("ensureTestArtifacts rebuilds @fusion/dashboard when its dist is missing", () => {
|
||||||
|
const calls = [];
|
||||||
|
const built = ensureTestArtifacts(
|
||||||
|
"/repo",
|
||||||
|
(cmd, args, cwd) => calls.push({ cmd, args, cwd }),
|
||||||
|
(fullPath) => !fullPath.endsWith("packages/dashboard/dist/index.js"),
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.deepEqual(built, ["@fusion/dashboard"]);
|
||||||
|
assert.equal(calls.length, 1);
|
||||||
|
assert.equal(calls[0].cmd, "pnpm");
|
||||||
|
assert.deepEqual(calls[0].args, ["--filter", "@fusion/dashboard", "build"]);
|
||||||
|
});
|
||||||
|
|
||||||
test("detectMissingArtifacts flags hermes when dist/index.js exists but dist/cli-spawn.js is missing", () => {
|
test("detectMissingArtifacts flags hermes when dist/index.js exists but dist/cli-spawn.js is missing", () => {
|
||||||
const missing = detectMissingArtifacts("/repo", (fullPath) => !fullPath.endsWith("dist/cli-spawn.js"));
|
const missing = detectMissingArtifacts("/repo", (fullPath) => !fullPath.endsWith("dist/cli-spawn.js"));
|
||||||
const names = missing.map((pkg) => pkg.name);
|
const names = missing.map((pkg) => pkg.name);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { spawnSync } from "node:child_process";
|
|||||||
|
|
||||||
export const REQUIRED_BUILD_PACKAGES = [
|
export const REQUIRED_BUILD_PACKAGES = [
|
||||||
{ name: "@fusion/core", requiredArtifacts: ["packages/core/dist/index.js"] },
|
{ name: "@fusion/core", requiredArtifacts: ["packages/core/dist/index.js"] },
|
||||||
|
{ name: "@fusion/dashboard", requiredArtifacts: ["packages/dashboard/dist/index.js"] },
|
||||||
{ name: "@fusion/plugin-sdk", requiredArtifacts: ["packages/plugin-sdk/dist/index.js"] },
|
{ name: "@fusion/plugin-sdk", requiredArtifacts: ["packages/plugin-sdk/dist/index.js"] },
|
||||||
{
|
{
|
||||||
name: "@fusion-plugin-examples/hermes-runtime",
|
name: "@fusion-plugin-examples/hermes-runtime",
|
||||||
|
|||||||
Reference in New Issue
Block a user