feat(KB-168): remove legacy public/ directory and server fallback

- Delete public/index.html, public/style.css, and public/board.js legacy assets
- Remove public/ fallback from server.ts clientDir resolution chain
- Simplify clientDir to fall through to client/ instead of public/
- Add no-legacy-public test asserting public/ files and server references are gone
This commit is contained in:
Dustin Byrne
2026-03-28 10:06:47 -04:00
parent 96f1070108
commit b286ee5a2b
5 changed files with 32 additions and 949 deletions

View File

@@ -0,0 +1,31 @@
import { describe, it, expect } from "vitest";
import { existsSync, readFileSync } from "fs";
import { resolve } from "path";
describe("legacy public/ directory removal", () => {
const publicDir = resolve(__dirname, "../../public");
it("public/style.css does not exist", () => {
expect(existsSync(resolve(publicDir, "style.css"))).toBe(false);
});
it("public/board.js does not exist", () => {
expect(existsSync(resolve(publicDir, "board.js"))).toBe(false);
});
it("public/index.html does not exist", () => {
expect(existsSync(resolve(publicDir, "index.html"))).toBe(false);
});
it("server.ts clientDir resolution does not reference 'public'", () => {
const serverSrc = readFileSync(
resolve(__dirname, "../../src/server.ts"),
"utf-8",
);
// Extract the clientDir resolution block (from "const clientDir" to the semicolon)
const match = serverSrc.match(/const clientDir[\s\S]*?;/);
expect(match).toBeTruthy();
expect(match![0]).not.toContain('"public"');
expect(match![0]).not.toContain("'public'");
});
});