Serve Two Rivers modules with production MIME type
All checks were successful
Build Org Website / build (push) Successful in 45s

This commit is contained in:
gitea-actions
2026-08-11 13:40:14 +01:00
parent 262d943443
commit 08516fda14
9 changed files with 21 additions and 16 deletions

View File

@@ -6,9 +6,9 @@ import {fileURLToPath} from "node:url";
import {
applyEffects, createStore, freshState, normalizeState, relationshipStage,
resolveEnding, requirementMet, RELATIONSHIPS
} from "../../assets/scripts/games/two-rivers/core/state.mjs";
import {validateContent} from "../../assets/scripts/games/two-rivers/core/content.mjs";
import {createSaveService, SAVE_KEY} from "../../assets/scripts/games/two-rivers/core/save.mjs";
} from "../../assets/scripts/games/two-rivers/core/state.js";
import {validateContent} from "../../assets/scripts/games/two-rivers/core/content.js";
import {createSaveService, SAVE_KEY} from "../../assets/scripts/games/two-rivers/core/save.js";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const read = (file) => fs.readFileSync(path.join(root, file), "utf8");
@@ -134,17 +134,19 @@ test("page uses local pinned libraries and production source is clean", () => {
assert.match(page, /gsap-3\.13\.0\.min\.js/);
assert.match(page, /howler-2\.2\.4\.min\.js/);
assert.match(page, /games\/two-rivers\/gate\.js\?v=1\.0\.1/);
assert.match(page, /games\/two-rivers\/main\.js\?v=1\.0\.2/);
assert.doesNotMatch(page, /https?:\/\//);
const source = [
page,
read("assets/scripts/games/two-rivers/main.js"),
read("assets/scripts/games/two-rivers/gate.js"),
read("assets/scripts/games/two-rivers/core/state.mjs"),
read("assets/scripts/games/two-rivers/ui/interface.mjs"),
read("assets/scripts/games/two-rivers/scenes/game-scenes.mjs")
read("assets/scripts/games/two-rivers/core/state.js"),
read("assets/scripts/games/two-rivers/ui/interface.js"),
read("assets/scripts/games/two-rivers/scenes/game-scenes.js")
].join("\n");
assert.doesNotMatch(source, /\bTODO\b|placeholder implementation|lorem ipsum/i);
assert.doesNotMatch(source, /\bReact\b|\bVue\b|\bAngular\b|\bjQuery\b/);
assert.doesNotMatch(source, /\.mjs(?:["'?#]|$)/, "production runtime must use the server's JavaScript MIME mapping");
assert.ok(read("assets/styles/pages/two-rivers.css").length > 15000);
});