fix(FN-0000): include compound engineering dashboard css
This commit is contained in:
5
.changeset/fix-compound-engineering-css-build.md
Normal file
5
.changeset/fix-compound-engineering-css-build.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix the bundled Compound Engineering dashboard plugin build so its CSS is included in `dist`.
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc && node scripts/copy-css.mjs",
|
||||||
"test": "vitest run --silent=passed-only --reporter=dot"
|
"test": "vitest run --silent=passed-only --reporter=dot"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
// Copies every .css file under src/ to the mirrored path under dist/.
|
||||||
|
import { cp, mkdir, readdir } from "node:fs/promises";
|
||||||
|
import { dirname, join, relative } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const root = dirname(fileURLToPath(import.meta.url)) + "/..";
|
||||||
|
const srcDir = join(root, "src");
|
||||||
|
const distDir = join(root, "dist");
|
||||||
|
|
||||||
|
async function* cssFiles(dir) {
|
||||||
|
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
||||||
|
const full = join(dir, entry.name);
|
||||||
|
if (entry.isDirectory()) yield* cssFiles(full);
|
||||||
|
else if (entry.isFile() && entry.name.endsWith(".css")) yield full;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for await (const file of cssFiles(srcDir)) {
|
||||||
|
const dest = join(distDir, relative(srcDir, file));
|
||||||
|
await mkdir(dirname(dest), { recursive: true });
|
||||||
|
await cp(file, dest);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import manifest from "../../manifest.json";
|
import manifest from "../../manifest.json";
|
||||||
|
import packageJson from "../../package.json";
|
||||||
import plugin from "../index.js";
|
import plugin from "../index.js";
|
||||||
import { COMPOUND_ENGINEERING_SKILLS } from "../skills.js";
|
import { COMPOUND_ENGINEERING_SKILLS } from "../skills.js";
|
||||||
import { settingsSchema } from "../settings.js";
|
import { settingsSchema } from "../settings.js";
|
||||||
@@ -75,6 +76,11 @@ describe("compound engineering plugin manifest", () => {
|
|||||||
expect(typeof plugin.hooks?.onLoad).toBe("function");
|
expect(typeof plugin.hooks?.onLoad).toBe("function");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("copies dashboard CSS into dist during build", () => {
|
||||||
|
expect(packageJson.scripts.build).toContain("tsc");
|
||||||
|
expect(packageJson.scripts.build).toContain("node scripts/copy-css.mjs");
|
||||||
|
});
|
||||||
|
|
||||||
it("wires the settings schema onto the runtime manifest and manifest.json (U9)", () => {
|
it("wires the settings schema onto the runtime manifest and manifest.json (U9)", () => {
|
||||||
const expectedKeys = [
|
const expectedKeys = [
|
||||||
"defaultProvider",
|
"defaultProvider",
|
||||||
|
|||||||
Reference in New Issue
Block a user