From 7a550821de76aeb85fcdd30588679231afac6370 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 28 Nov 2026 19:43:28 +0100 Subject: [PATCH] Validate the restored guide and cookbook in the full site build --- website/tests/build-artifact-stream.test.mjs | 6 ++++-- website/tests/realm-page-design.test.mjs | 3 ++- website/web/imperial-recipe-book.html | 3 ++- website/web/lets-play.html | 7 ++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/website/tests/build-artifact-stream.test.mjs b/website/tests/build-artifact-stream.test.mjs index c28a7f51..cabb61b1 100644 --- a/website/tests/build-artifact-stream.test.mjs +++ b/website/tests/build-artifact-stream.test.mjs @@ -1,6 +1,7 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import {createReadStream,statSync,readdirSync,readFileSync} from 'node:fs'; +import {recipeCatalogue,recipeIcons} from '../scripts/recipe-catalogue.mjs'; import {MAIN_MENU} from '../scripts/main-menu.mjs'; import {fileURLToPath} from 'node:url'; import {scanAssetChunk,ASSET_ENTRY} from './build-artifact-scan.mjs'; @@ -12,7 +13,8 @@ test('built Worker embeds complete public assets and runtime without loading the const entrySource=readFileSync(path,'utf8'),assetFiles=[...entrySource.matchAll(/import DATA\d+ from ["']\.\/(assets-[a-f0-9]+\.mjs)["']/g)].map(m=>fileURLToPath(new URL('../dist/server/'+m[1],import.meta.url)));async function* builtStream(){for(const file of assetFiles.length?[...assetFiles,path]:[path])yield* createReadStream(file,{highWaterMark:65536});} let count=0,prefix='',suffix='',carry='',hasBuildStamp=false; const nativeOnly=new Set(['organisation-deed-keys-v1.png','organisation-deeds-clan-tiers-v1.png','organisation-deeds-company-tiers-v1.png','organisation-deeds-protected-v1.png'].map(name=>'/assets/'+name)); - const required=new Set(['/index.html','/kits.html','/manual-data.json','/assets/item-0.webp','/kits.js','/kits.css']); + const generatedRecipes=['/recipe-catalogue.json',...recipeIcons(recipeCatalogue()).map(([url])=>url)]; + const required=new Set([...generatedRecipes,'/lets-play.html','/imperial-recipe-book.html','/index.html','/kits.html','/manual-data.json','/assets/item-0.webp','/kits.js','/kits.css']); const found=new Set(); const entry=ASSET_ENTRY; for await(const chunk of builtStream()){ @@ -30,7 +32,7 @@ test('built Worker embeds complete public assets and runtime without loading the const web=fileURLToPath(new URL('../web/',import.meta.url)); const expected=(dir)=>readdirSync(dir,{withFileTypes:true}).reduce((n,entry)=>{const name=dir+'/'+entry.name;if(entry.isDirectory())return n+expected(name);return n+(!/^assets\/seals\/[^/]+-provenance\.txt$/.test(name.slice(web.length+1))&&!nativeOnly.has('/'+name.slice(web.length+1))?1:0);},0); for(const asset of nativeOnly){assert.ok(statSync(web+asset).size>0);assert.ok(readFileSync(new URL('../control-panel/server.mjs',import.meta.url),'utf8').includes(asset.split('/').pop()),'CP artwork route must retain '+asset);} - assert.equal(count,expected(web)+Number(hasBuildStamp),'Unexpected number of embedded public assets'); + assert.equal(count,expected(web)+generatedRecipes.length+Number(hasBuildStamp),'Unexpected number of embedded public assets'); if(/^[0-9a-f]{40}$/.test(process.env.GITHUB_SHA||''))assert.ok(hasBuildStamp,'CI bundle must identify the exact publication'); assert.deepEqual(found,required,'Essential pages or assets missing from built Worker'); // A bounded rolling window extracts the navigation entry even when it crosses chunks. diff --git a/website/tests/realm-page-design.test.mjs b/website/tests/realm-page-design.test.mjs index 95485ffd..b41995e6 100644 --- a/website/tests/realm-page-design.test.mjs +++ b/website/tests/realm-page-design.test.mjs @@ -2,7 +2,8 @@ import test from 'node:test';import assert from 'node:assert/strict';import {rea import {applyRealmPageDesign,REALM_PAGE_DESIGNS} from '../scripts/realm-page-design.mjs'; const web=new URL('../web/',import.meta.url); test('every public document opts into the common design and every legacy page owns a labelled illustrated banner',()=>{ - const files=readdirSync(web).filter(f=>f.endsWith('.html'));assert.equal(files.length,38); + const files=readdirSync(web).filter(f=>f.endsWith('.html'));assert.equal(files.length,40); + for(const restored of ['lets-play.html','imperial-recipe-book.html'])assert(files.includes(restored),restored); for(const file of files){const html=readFileSync(new URL(file,web),'utf8');assert.match(html,/data-realm-design/,file);assert.match(html,/realm-design\.css/,file);assert.match(html,/realm-design\.js/,file);if(REALM_PAGE_DESIGNS[file]){assert.match(html,/data-realm-layout="2"/,file);assert.equal((html.match(/class="dr-page-banner"/g)||[]).length,1,file);assert(html.indexOf('class="dr-page-banner"') - + +
diff --git a/website/web/lets-play.html b/website/web/lets-play.html index e2fd39f7..59dc2596 100644 --- a/website/web/lets-play.html +++ b/website/web/lets-play.html @@ -6,6 +6,7 @@ +
@@ -16,7 +17,7 @@
  • Connect
  • Choose a House
  • Travel
  • -
  • Survive Arrakis
  • +
  • Survive Arrakduin
  • Trade
  • Imperial Recipe Book @@ -43,7 +44,7 @@
    -

    Prepare for Arrakis

    +

    Prepare for Arrakduin

    Bring water and supplies before leaving the settlement. The recipe book shows what you can make, which ingredients you need and what each workstation produces.

    Open the Imperial Recipe Book
    @@ -51,7 +52,7 @@

    Sell spice and trade

    -

    On Arrakis, /spice shows Guild and available Smuggler sales. The Smuggler route requires its quest. To sell eligible spice through the Guild in one go, use /sellall guild.

    +

    On Arrakduin, /spice shows Guild and available Smuggler sales. The Smuggler route requires its quest. To sell eligible spice through the Guild in one go, use /sellall guild.

    Use /exchange to browse offers and kits, or /drscoreboard to toggle your personal scoreboard.

    Browse the Player Exchange