refactor: convert map feature to strict TypeScript

This commit is contained in:
sjg
2026-08-01 13:39:41 +02:00
parent 0338c8b8d2
commit 82121491c5
8 changed files with 3606 additions and 3451 deletions
@@ -7,6 +7,8 @@ import test from "node:test";
import { readFile } from "node:fs/promises";
const indexPath = new URL("../../assets/web/index.html", import.meta.url);
const pluginLoaderPath = new URL("../src/plugin-loader.ts", import.meta.url);
const mapCorePath = new URL("../src/map-core.ts", import.meta.url);
test("index loads the shared UI before the application", async () => {
const html = await readFile(indexPath, "utf8");
@@ -26,3 +28,14 @@ test("startup has no remote script or stylesheet dependencies", async () => {
false,
);
});
test("lazy frontend features use modules and local map symbols", async () => {
const [loader, map] = await Promise.all([
readFile(pluginLoaderPath, "utf8"),
readFile(mapCorePath, "utf8"),
]);
assert.equal(loader.includes("createElement(\"script\")"), false);
assert.match(loader, /import\(path\)/);
assert.match(map, /aprs-symbol-local/);
assert.equal(map.includes("raw.githubusercontent.com"), false);
});