Publish The Great Migration Alpha 1.0.0.6 and 1.0.0.7 release
This commit is contained in:
parent
e772698229
commit
04730a1323
10 changed files with 346 additions and 79 deletions
|
|
@ -1,34 +1,34 @@
|
|||
import {nativeForumFeed} from './native-forum-feed.mjs';
|
||||
import {randomUUID} from 'node:crypto';
|
||||
import {readFile} from 'node:fs/promises';
|
||||
import {json} from './game-link.mjs';
|
||||
import {OFFICIAL_ACCOUNT} from './official-account.mjs';
|
||||
export const NEWS_CATEGORIES={world:'World',news:'NEWS',maintenance:'Maintenance',changelogs:'Changelogs',events:'Events',community:'Community',unis_blog:"Uni’s Blog"};
|
||||
export function publicNewsExcerpt(body){return String(body||'').replace(/!\[[^\]]*\]\([^)]*\)/g,'').replace(/\[([^\]]+)\]\([^)]*\)/g,'$1').replace(/^\s*#{1,6}\s+/gm,'').replace(/[*_`]/g,'').replace(/\s+/g,' ').trim().slice(0,220);}
|
||||
export async function initializeNews(db){
|
||||
for(const [key,label] of Object.entries(NEWS_CATEGORIES))await db.prepare('INSERT INTO website_post_categories(category_key,label,artwork) VALUES(?,?,?) ON CONFLICT(category_key) DO UPDATE SET label=excluded.label').bind(key,label,'assets/news-'+(key==='unis_blog'?'news':key)+'.png').run();
|
||||
// Only published release records become posts. Pending work never becomes a release announcement.
|
||||
let releases=[];try{const file=JSON.parse(await readFile(new URL('../scripts/changelog.json',import.meta.url),'utf8'));releases=Array.isArray(file)?file:file.releases||[];}catch{}
|
||||
for(const release of releases){
|
||||
const key='release:'+String(release.version).slice(0,100),existing=await db.prepare('SELECT id FROM website_posts WHERE source_key=?').bind(key).first();if(existing)continue;
|
||||
const date=Date.parse(release.date);if(!Number.isFinite(date)||date>Date.now())continue;
|
||||
const body=[release.synopsis,...(release.tasks||[]).flatMap(t=>[t.title,...(t.changes||[]).map(x=>'• '+x)])].filter(Boolean).join('\n\n').slice(0,12000);
|
||||
await db.prepare('INSERT INTO website_posts(id,source_key,category,title,body,status,author_id,created_at,updated_at,published_at,version) VALUES(?,?,?,?,?,?,?,?,?,?,1) ON CONFLICT(source_key) DO UPDATE SET source_key=excluded.source_key').bind(randomUUID(),key,'changelogs',String(release.title||release.version).slice(0,120),body,'published',OFFICIAL_ACCOUNT.id,date,date,date).run();
|
||||
}
|
||||
}
|
||||
export async function forumLinks(db,posts){try{if(!posts.length)return posts;const{results}=await db.prepare('SELECT post_id,thread_id FROM forum_news_delivery WHERE post_id IN ('+posts.map(()=>'?').join(',')+") AND thread_id>0 AND state='sent'").bind(...posts.map(p=>p.id)).all();const links=new Map(results.filter(r=>Number.isSafeInteger(Number(r.thread_id))&&Number(r.thread_id)>0).map(r=>[r.post_id,'https://forums.dunerealms.com/showthread.php?tid='+Number(r.thread_id)]));return posts.map(p=>({...p,forum_url:links.get(p.id)||null}));}catch{return posts.map(p=>({...p,forum_url:null}));}}
|
||||
export function createPublicNews(db){return async request=>{
|
||||
const url=new URL(request.url);if(request.method!=='GET')return json({message:'Method not allowed'},405);
|
||||
if(url.pathname==='/api/home/forum'){
|
||||
const page=Number(url.searchParams.get('page')||1);if(!Number.isSafeInteger(page)||page<1||page>3)return json({message:'Invalid page'},400);
|
||||
try{return json(await nativeForumFeed(page));}catch{return json({message:'Forum updates are temporarily unavailable.'},503);}
|
||||
}
|
||||
const match=url.pathname.match(/^\/api\/news\/([0-9a-f-]{36})$/i);
|
||||
if(match){const post=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.id=? AND p.status='published' AND p.published_at<=?").bind(match[1],Date.now()).first();return post?json({post:(await forumLinks(db,[post]))[0]}):json({message:'Post not found'},404);}
|
||||
if(url.pathname!=='/api/news')return json({message:'Not found'},404);
|
||||
const page=Number(url.searchParams.get('page')||1),archive=url.searchParams.get('surface')==='archive',size=archive?25:5;
|
||||
if(!Number.isSafeInteger(page)||page<1||page>1000000)return json({message:'Invalid page'},400);
|
||||
const count=await db.prepare("SELECT COUNT(*) AS count FROM website_posts WHERE status='published' AND published_at<=?").bind(Date.now()).first();
|
||||
const {results}=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=? ORDER BY p.published_at DESC,p.id DESC LIMIT ? OFFSET ?").bind(Date.now(),size,(page-1)*size).all();
|
||||
return json({posts:await forumLinks(db,results.map(p=>({...p,body:publicNewsExcerpt(p.body)}))),page,pages:Math.max(1,Math.ceil(Number(count.count)/size)),total:Number(count.count)});
|
||||
};}
|
||||
import {nativeForumFeed} from './native-forum-feed.mjs';
|
||||
import {randomUUID} from 'node:crypto';
|
||||
import {readFile} from 'node:fs/promises';
|
||||
import {json} from './game-link.mjs';
|
||||
import {OFFICIAL_ACCOUNT} from './official-account.mjs';
|
||||
export const NEWS_CATEGORIES={world:'World',news:'NEWS',maintenance:'Maintenance',changelogs:'Changelogs',events:'Events',community:'Community',unis_blog:"Uni’s Blog"};
|
||||
export function publicNewsExcerpt(body){return String(body||'').replace(/!\[[^\]]*\]\([^)]*\)/g,'').replace(/\[([^\]]+)\]\([^)]*\)/g,'$1').replace(/^\s*#{1,6}\s+/gm,'').replace(/[*_`]/g,'').replace(/\s+/g,' ').trim().slice(0,220);}
|
||||
export async function initializeNews(db){
|
||||
for(const [key,label] of Object.entries(NEWS_CATEGORIES))await db.prepare('INSERT INTO website_post_categories(category_key,label,artwork) VALUES(?,?,?) ON CONFLICT(category_key) DO UPDATE SET label=excluded.label').bind(key,label,'assets/news-'+(key==='unis_blog'?'news':key)+'.png').run();
|
||||
// Only published release records become posts. Pending work never becomes a release announcement.
|
||||
let releases=[];try{const file=JSON.parse(await readFile(new URL('../scripts/changelog.json',import.meta.url),'utf8'));releases=Array.isArray(file)?file:file.releases||[];}catch{}
|
||||
for(const release of releases){
|
||||
const key='release:'+String(release.version).slice(0,100),existing=await db.prepare('SELECT id FROM website_posts WHERE source_key=?').bind(key).first();if(existing)continue;
|
||||
const date=Date.parse(release.publishedAt||release.date);if(!Number.isFinite(date)||date>Date.now())continue;
|
||||
const body=[release.synopsis,...(release.tasks||[]).flatMap(t=>[t.title,...(t.changes||[]).map(x=>'• '+x)])].filter(Boolean).join('\n\n').slice(0,12000);
|
||||
await db.prepare('INSERT INTO website_posts(id,source_key,category,title,body,status,author_id,created_at,updated_at,published_at,version) VALUES(?,?,?,?,?,?,?,?,?,?,1) ON CONFLICT(source_key) DO UPDATE SET source_key=excluded.source_key').bind(randomUUID(),key,'changelogs',String(release.title||release.version).slice(0,120),body,'published',OFFICIAL_ACCOUNT.id,date,date,date).run();
|
||||
}
|
||||
}
|
||||
export async function forumLinks(db,posts){try{if(!posts.length)return posts;const{results}=await db.prepare('SELECT post_id,thread_id FROM forum_news_delivery WHERE post_id IN ('+posts.map(()=>'?').join(',')+") AND thread_id>0 AND state='sent'").bind(...posts.map(p=>p.id)).all();const links=new Map(results.filter(r=>Number.isSafeInteger(Number(r.thread_id))&&Number(r.thread_id)>0).map(r=>[r.post_id,'https://forums.dunerealms.com/showthread.php?tid='+Number(r.thread_id)]));return posts.map(p=>({...p,forum_url:links.get(p.id)||null}));}catch{return posts.map(p=>({...p,forum_url:null}));}}
|
||||
export function createPublicNews(db){return async request=>{
|
||||
const url=new URL(request.url);if(request.method!=='GET')return json({message:'Method not allowed'},405);
|
||||
if(url.pathname==='/api/home/forum'){
|
||||
const page=Number(url.searchParams.get('page')||1);if(!Number.isSafeInteger(page)||page<1||page>3)return json({message:'Invalid page'},400);
|
||||
try{return json(await nativeForumFeed(page));}catch{return json({message:'Forum updates are temporarily unavailable.'},503);}
|
||||
}
|
||||
const match=url.pathname.match(/^\/api\/news\/([0-9a-f-]{36})$/i);
|
||||
if(match){const post=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.id=? AND p.status='published' AND p.published_at<=?").bind(match[1],Date.now()).first();return post?json({post:(await forumLinks(db,[post]))[0]}):json({message:'Post not found'},404);}
|
||||
if(url.pathname!=='/api/news')return json({message:'Not found'},404);
|
||||
const page=Number(url.searchParams.get('page')||1),archive=url.searchParams.get('surface')==='archive',size=archive?25:5;
|
||||
if(!Number.isSafeInteger(page)||page<1||page>1000000)return json({message:'Invalid page'},400);
|
||||
const count=await db.prepare("SELECT COUNT(*) AS count FROM website_posts WHERE status='published' AND published_at<=?").bind(Date.now()).first();
|
||||
const {results}=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=? ORDER BY p.published_at DESC,p.id DESC LIMIT ? OFFSET ?").bind(Date.now(),size,(page-1)*size).all();
|
||||
return json({posts:await forumLinks(db,results.map(p=>({...p,body:publicNewsExcerpt(p.body)}))),page,pages:Math.max(1,Math.ceil(Number(count.count)/size)),total:Number(count.count)});
|
||||
};}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ const scripts=new URL('./',import.meta.url),web=new URL('../web/',import.meta.ur
|
|||
const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
const urgent=releases.filter(r=>r.kind==='bugfix').slice(0,3);const urgentCards=urgent.length?'<section class="urgent-bugfix-news" aria-label="Urgent development bugfixes"><h2>Urgent bugfix reports</h2><div>'+urgent.map(r=>'<article><img src="assets/bugfix-seal.svg" alt=""><p>BUGFIX · '+esc(r.version)+'</p><h3><a href="'+releaseFile(r.version)+'">'+esc(r.title)+'</a></h3><p>'+esc(r.synopsis)+'</p><a href="'+releaseFile(r.version)+'">Problem, repair & verification →</a></article>').join('')+'</div></section>':'';
|
||||
for(const file of readdirSync(web).filter(x=>x.endsWith('.html'))){let text=readFileSync(new URL(file,web),'utf8');text=text.replace(/<section class="urgent-bugfix-news"[\s\S]*?<\/section>/g,'');if(urgentCards&&['news.html','index.html'].includes(file))text=text.replace(/(<nav id="realm-menu"[\s\S]*?<\/nav>)/,'$1'+urgentCards);text=text.replace(/<footer>[\s\S]*?<\/footer>/,footer=>footer.includes('href="patch-notes.html"')?footer:footer.replace('<a href="staff.html">','<a href="patch-notes.html">Patch notes →</a><a href="staff.html">'));if(file==='news.html'&&!text.includes('class="development-news-link"'))text=text.replace(/(<nav id="realm-menu"[\s\S]*?<\/nav>)/,'$1<aside class="development-news-link"><a class="button gold" href="patch-notes.html">Website & plugin patch notes →</a><p>Game dispatches appear below. Development releases have their own register.</p></aside>');writeFileSync(new URL(file,web),text)}
|
||||
const base=readFileSync(new URL('index.html',web),'utf8'),header=base.match(/<header>[\s\S]*?<\/header>/)[0].replace(/ aria-current="page"/g,''),menu=base.match(/<nav id="realm-menu"[\s\S]*?<\/nav>/)[0],footer=base.match(/<footer>[\s\S]*?<\/footer>/)[0];
|
||||
function shell(title,body){return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>'+esc(title)+' — dunerealms.com</title><meta name="description" content="dunerealms.com development releases, urgent bugfix reports and pending feature bundles."><link rel="icon" href="assets/favicon.svg">'+['styles','pages','minecraft','lore','patchnotes'].map(x=>'<link rel="stylesheet" href="'+x+'.css">').join('')+'<script src="pages.js" defer></script><script src="patchnotes.js" defer></script></head><body><a class="skip" href="#patchnotes-content">Skip to content</a>'+header+'<main><section class="page-intro intro-patchnotes"><p class="eyebrow">dunerealms.com / GUILD CHANGE REGISTER</p><h1>'+esc(title)+'</h1><p>Traceable changes to the website and plugin. Completed work, published bundles and urgent repairs.</p></section>'+menu+'<div id="patchnotes-content" class="patchnotes-content">'+body+'</div></main>'+footer+'<div class="toast" role="status" aria-live="polite"></div></body></html>'}
|
||||
const base=readFileSync(new URL('index.html',web),'utf8'),header=base.match(/<header\b[^>]*>[\s\S]*?<\/header>/)[0].replace(/ aria-current="page"/g,''),menu=(base.match(/<nav id="realm-menu"[\s\S]*?<\/nav>/)?.[0]||'<nav aria-label="Release register"><a href="patch-notes.html">All releases</a> · <a href="news.html">News</a></nav>'),footer=base.match(/<footer>[\s\S]*?<\/footer>/)[0];
|
||||
function shell(title,body){return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>'+esc(title)+' — dunerealms.com</title><meta name="description" content="dunerealms.com development releases, urgent bugfix reports and pending feature bundles."><link rel="icon" href="assets/favicon.svg">'+['styles','pages','minecraft','lore','patchnotes'].map(x=>'<link rel="stylesheet" href="'+x+'.css">').join('')+'<link rel="stylesheet" href="portal-navigation.css"><script src="portal-navigation.js" defer></script><script src="pages.js" defer></script><script src="patchnotes.js" defer></script></head><body><a class="skip" href="#patchnotes-content">Skip to content</a>'+header+'<main><section class="page-intro intro-patchnotes"><p class="eyebrow">dunerealms.com / GUILD CHANGE REGISTER</p><h1>'+esc(title)+'</h1><p>Traceable changes to the website and plugin. Completed work, published bundles and urgent repairs.</p></section>'+menu+'<div id="patchnotes-content" class="patchnotes-content">'+body+'</div></main>'+footer+'<div class="toast" role="status" aria-live="polite"></div></body></html>'}
|
||||
const stats='<section class="patch-stats"><div><strong>'+releases.filter(x=>x.kind==='normal').length+'</strong><span>Published bundles</span></div><div><strong>'+releases.filter(x=>x.kind==='bugfix').length+'</strong><span>Urgent bugfix reports</span></div><div><strong>'+pending.completed.length+' / 5</strong><span>Completed tasks toward next bundle</span></div></section>';
|
||||
const cards=releases.map(r=>'<article class="patch-card kind-'+r.kind+'" data-kind="'+r.kind+'"><p class="patch-kind">'+(r.kind==='bugfix'?'URGENT BUGFIX':'BUNDLED PRODUCT UPDATE')+' · '+esc(r.version)+'</p><h3><a href="'+releaseFile(r.version)+'">'+esc(r.title)+'</a></h3><p>'+esc(r.synopsis)+'</p><small>'+esc(r.date)+' · '+r.tasks.length+' product '+(r.tasks.length===1?'task':'tasks')+'</small><a href="'+releaseFile(r.version)+'">Read full patch note →</a></article>').join('');
|
||||
const waiting=pending.completed.map(t=>'<article class="pending-task"><p class="patch-kind">'+t.promptIds.map(esc).join(' · ')+' / '+esc(t.priority)+'</p><h3>'+esc(t.title)+'</h3><ul>'+t.changes.map(c=>'<li>'+esc(c)+'</li>').join('')+'</ul><small>Completed '+esc(t.completedAt)+' · awaiting a normal bundle</small></article>').join('');
|
||||
|
|
|
|||
|
|
@ -1 +1,96 @@
|
|||
[]
|
||||
[
|
||||
{
|
||||
"version": "1.0.0.7",
|
||||
"date": "2026-11-15",
|
||||
"title": "Alpha 1.0.0.6 & 1.0.0.7 · The Great Migration",
|
||||
"synopsis": "The Great Migration brings banking, staff management, identity and clan services into connected DuneRealms workspaces. This release combines the completed website work for Alpha .6 and .7. Game-bank linking and the Political & Company Update remain separate future work.",
|
||||
"kind": "normal",
|
||||
"tasks": [
|
||||
{
|
||||
"id": "great-migration-1",
|
||||
"promptIds": [
|
||||
"DUNE-005"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "Imperial Postbank",
|
||||
"changes": [
|
||||
"Independent website bank with personal and authorised entity accounts, transfers, statements and reviewed credit.",
|
||||
"Start, Flow and Pro packages; Pro includes unlimited instant payments and higher personal credit ceilings. Available funds and payment security still apply."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-2",
|
||||
"promptIds": [
|
||||
"DUNE-006"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "People & Organisation",
|
||||
"changes": [
|
||||
"Payroll follows the highest active staff rank once per person, with separate net salary and tax entries.",
|
||||
"Missing staff current accounts receive the free Start package. P&O uses its own virtual issuer; bank treasury funding has been corrected. Public tariffs and tax rules have a downloadable guide."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-3",
|
||||
"promptIds": [
|
||||
"DUNE-007"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "Personnel Management",
|
||||
"changes": [
|
||||
"A central directory dashboard brings users, staff, teams and rank assignments together.",
|
||||
"Permanent person numbers appear on profiles and staff financial attribution. Account archival preserves receipts and audit history."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-4",
|
||||
"promptIds": [
|
||||
"DUNE-008"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "Identity & recognition",
|
||||
"changes": [
|
||||
"Minecraft face avatars, public citizen profiles and the verified DuneRealms official account are integrated.",
|
||||
"Recognition uses the approved seal artwork and existing audited award controls."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-5",
|
||||
"promptIds": [
|
||||
"DUNE-009"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "Clan Control Panel",
|
||||
"changes": [
|
||||
"A separate feudal clan workspace contains My Clan, Quests, Kits and Events. Clan banners, homeworlds and rosters use existing membership flows.",
|
||||
"Clan treasury, correspondence, shop and tailor reuse current services. Clan expeditions, campaigns and events remain clearly marked where not yet available."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-6",
|
||||
"promptIds": [
|
||||
"DUNE-010"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "One connected website",
|
||||
"changes": [
|
||||
"Shared headers, navigation and page banners connect the account centre, profiles, staff roster, clans and public politics.",
|
||||
"Forum author cards group identity, clan banner, recognition and statistics. Public political offices include vacant seats."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "great-migration-7",
|
||||
"promptIds": [
|
||||
"DUNE-011"
|
||||
],
|
||||
"priority": "P1",
|
||||
"title": "Credit & service clarity",
|
||||
"changes": [
|
||||
"Credit applications link to support review and retain their accepted repayment schedules.",
|
||||
"Loan details distinguish queued repayments from the additional amount still payable. Scheduler controls explain four-hour settlement windows."
|
||||
]
|
||||
}
|
||||
],
|
||||
"publishedAt": "2026-11-15T14:10:26.215Z"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {MAIN_MENU} from './main-menu.mjs';
|
||||
import{existsSync,readFileSync,writeFileSync}from'node:fs';import{execFileSync}from'node:child_process';import{fileURLToPath}from'node:url';import path from'node:path';import{RELEASE_VERSION}from'./release-branding.mjs';
|
||||
export function pagesForChanges(paths){const pages=new Set();for(let p of paths){p=p.replaceAll('\\','/');if(!p.includes('/tests/')){if(/^website\/(?:web\/portal-navigation\.(?:css|js)|scripts\/(?:portal-navigation|main-menu)\.mjs)$/.test(p))for(const [,href]of MAIN_MENU)pages.add(href);const scopes=[[/postbank|bank-rates/,'bank'],[/politic|election|charter/,'politics'],[/internal-mail|mail-service|post-pages/,'post'],[/organisation-|citizen-directory|account-admin|honours|permissions/,'bureau'],[/forge-pages|dev-request|git-identity/,'forge'],[/exchange-public|commodity/,'market'],[/passport|personal-records|user-pages/,'realm']];for(const [pattern,scope]of scopes)if(pattern.test(p)){pages.add('https://cp.dunerealms.com/');pages.add('https://cp.dunerealms.com/#'+scope);}}if(/website\/node\/staff-roster\.mjs$/.test(p))pages.add('https://www.dunerealms.com/staff.html');if(/website\/node\/memorials\.mjs$|website\/node\/public\/memorial\./.test(p))pages.add('https://www.dunerealms.com/');if(/website\/control-panel\//.test(p)||/website\/node\/(auth|permissions|account-admin|account-archive|honours|profile)\.mjs$/.test(p))pages.add('https://cp.dunerealms.com/');if(/website\/integrations\/azuriom\//.test(p))pages.add('https://www.dunerealms.com/shop.html');if(/website\/integrations\/osticket\//.test(p))pages.add('https://support.dunerealms.com/');if(/website\/web\/([a-z-]+)\.html$/.test(p)){const name=p.match(/([^/]+)\.html$/)[1];pages.add('https://www.dunerealms.com/'+(['index','portal'].includes(name)?'':name+'.html'));}}return[...pages].sort();}
|
||||
export function recordPageUpdates({root=fileURLToPath(new URL('../',import.meta.url)),paths,newPages=[],version=RELEASE_VERSION}={}){if(!/^\d+(?:\.\d+){3}$/.test(version))throw Error('Invalid release');const repo=path.resolve(root,'..');const publication=path.join(root,'publication-changes.json');if(paths===undefined&&existsSync(publication)){const change=JSON.parse(readFileSync(publication,'utf8'));if(!Array.isArray(change.paths)||!Array.isArray(change.added))throw Error('Invalid publication change record.');paths=change.paths;newPages=pagesForChanges(change.added).filter(href=>!href.startsWith('https://cp.dunerealms.com/'));}if(paths===undefined){let changed='';try{const gitRoot=execFileSync('git',['rev-parse','--show-toplevel'],{cwd:repo,encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim();if(path.resolve(gitRoot)===repo)changed=execFileSync('git',['diff','--name-only','HEAD'],{cwd:repo,encoding:'utf8'}).trim();}catch(error){if(error?.status!==128&&error?.status!==129&&error?.code!=='ENOENT')throw error;}paths=changed?changed.split('\n'):[];}const file=path.join(root,'web/menu-new-items.json'),data=JSON.parse(readFileSync(file,'utf8'));const pages=pagesForChanges(paths);if(paths.length||existsSync(publication)){for(const item of data.items)delete item.badge;}for(const href of pages){let entry=data.items.find(x=>x.href===href);if(!entry){entry={href};data.items.push(entry);}entry.updatedIn=version;entry.badge=newPages.includes(href)?'NEW':'UPDATE';}writeFileSync(file,JSON.stringify(data,null,2)+'\n');return pages;}
|
||||
export function recordPageUpdates({root=fileURLToPath(new URL('../',import.meta.url)),paths,newPages=[],version=RELEASE_VERSION}={}){if(!/^\d+(?:\.\d+){3}$/.test(version))throw Error('Invalid release');const repo=path.resolve(root,'..');const publication=path.join(root,'publication-changes.json');if(paths===undefined&&existsSync(publication)){const change=JSON.parse(readFileSync(publication,'utf8'));if(!Array.isArray(change.paths)||!Array.isArray(change.added))throw Error('Invalid publication change record.');paths=change.paths;newPages=pagesForChanges(change.added).filter(href=>!href.startsWith('https://cp.dunerealms.com/'));}if(paths===undefined){let changed='';try{const gitRoot=execFileSync('git',['rev-parse','--show-toplevel'],{cwd:repo,encoding:'utf8',stdio:['ignore','pipe','ignore']}).trim();if(path.resolve(gitRoot)===repo)changed=execFileSync('git',['diff','--name-only','HEAD'],{cwd:repo,encoding:'utf8'}).trim();}catch(error){if(error?.status!==128&&error?.status!==129&&error?.code!=='ENOENT')throw error;}paths=changed?changed.split('\n'):[];}const file=path.join(root,'web/menu-new-items.json'),data=JSON.parse(readFileSync(file,'utf8'));const pages=pagesForChanges(paths);if(paths.includes('website/web/release.json')){const releaseFile=path.join(root,'web/release.json');if(existsSync(releaseFile)){const release=JSON.parse(readFileSync(releaseFile,'utf8'));if(release.version===version&&Array.isArray(release.menuUpdates)){const allowed=new Set([...MAIN_MENU.map(([,href])=>href),...['realm','bureau','forge','politics','post','bank','market'].map(id=>'https://cp.dunerealms.com/#'+id)]);for(const update of release.menuUpdates){if(!allowed.has(update.href)||!['NEW','UPDATE'].includes(update.badge))throw Error('Invalid release menu highlight.');if(!pages.includes(update.href))pages.push(update.href);if(update.badge==='NEW'&&!newPages.includes(update.href))newPages.push(update.href);}}}}if(paths.length||existsSync(publication)){for(const item of data.items)delete item.badge;}for(const href of pages){let entry=data.items.find(x=>x.href===href);if(!entry){entry={href};data.items.push(entry);}entry.updatedIn=version;entry.badge=newPages.includes(href)?'NEW':'UPDATE';}writeFileSync(file,JSON.stringify(data,null,2)+'\n');return pages;}
|
||||
export function menuBadgeScript(){const data=JSON.parse(readFileSync(new URL('../web/menu-new-items.json',import.meta.url),'utf8'));return `\n/* Central automatic release menu badges */\n(()=>{let items=${JSON.stringify(data.items)};function mark(){const release=document.querySelector('.dune-release-badge')?.textContent.match(/\\d+(?:\\.\\d+){3}/)?.[0];for(const a of document.querySelectorAll('header nav[aria-label="Main navigation"] a,#portals .portal[data-id]')){const href=a.matches('#portals .portal')?'https://cp.dunerealms.com/#'+a.dataset.id:a.href;const item=items.find(x=>x.href===href),label=['NEW','UPDATE'].includes(item?.badge)?item.badge:null;let tag=a.querySelector('.dune-new-overlay');if(label){if(!tag){tag=document.createElement('span');tag.className='dune-new-overlay';a.append(tag);}if(tag.textContent!==label)tag.textContent=label;tag.classList.toggle('dune-update-overlay',label==='UPDATE');tag.setAttribute('aria-label',label==='NEW'?'New this release':'Updated this release');}else if(tag)tag.remove();}}fetch('/menu-new-items.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(data=>{if(Array.isArray(data?.items)){items=data.items;mark();}}).catch(()=>{});mark();new MutationObserver(mark).observe(document.body,{childList:true,subtree:true,characterData:true});})();\n`;}
|
||||
export function withMenuBadges(s){return s.replace(/\n?\/\* Central automatic release menu badges \*\/[\s\S]*?(?=\n\/\*|$)/,'').replace(/\(\(\)=>\{const items=\[[\s\S]*?new MutationObserver\(mark\)\.observe\(document.body,\{childList:true,subtree:true,characterData:true\}\);\}\)\(\);/,'')+menuBadgeScript();}
|
||||
export function patchMenuBadges(root=fileURLToPath(new URL('../',import.meta.url))){const file=path.join(root,'web/portal-navigation.js');writeFileSync(file,withMenuBadges(readFileSync(file,'utf8')));}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,122 @@
|
|||
{
|
||||
"format": 1,
|
||||
"priorityOrder": ["BUGFIX", "P0", "P1", "P2", "P3", "PARKEREN"],
|
||||
"priorityOrder": [
|
||||
"BUGFIX",
|
||||
"P0",
|
||||
"P1",
|
||||
"P2",
|
||||
"P3",
|
||||
"PARKEREN"
|
||||
],
|
||||
"tasks": [
|
||||
{"id":"DUNE-001","priority":"P2","receiptOrder":1,"title":"Staff & Contributors page","kind":"product","status":"done","completedAt":"2026-10-14","commit":"89acb00"},
|
||||
{"id":"DUNE-002","priority":"P2","receiptOrder":2,"title":"Patchnote system and colleague consultation","kind":"product","status":"done","completedAt":"2026-10-14"},
|
||||
{"id":"DUNE-003","priority":"P0","receiptOrder":3,"title":"Persist priority rules and apply them in colleague consultation","kind":"workflow","status":"done","completedAt":"2026-10-14","commit":"40efbff"},
|
||||
{"id":"DUNE-004","priority":"P2","receiptOrder":4,"title":"End every colleague message with einde prompt","kind":"workflow","status":"done","completedAt":"2026-10-14","commit":"89acb00"}
|
||||
{
|
||||
"id": "DUNE-001",
|
||||
"priority": "P2",
|
||||
"receiptOrder": 1,
|
||||
"title": "Staff & Contributors page",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-10-14",
|
||||
"commit": "89acb00"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-002",
|
||||
"priority": "P2",
|
||||
"receiptOrder": 2,
|
||||
"title": "Patchnote system and colleague consultation",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-10-14"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-003",
|
||||
"priority": "P0",
|
||||
"receiptOrder": 3,
|
||||
"title": "Persist priority rules and apply them in colleague consultation",
|
||||
"kind": "workflow",
|
||||
"status": "done",
|
||||
"completedAt": "2026-10-14",
|
||||
"commit": "40efbff"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-004",
|
||||
"priority": "P2",
|
||||
"receiptOrder": 4,
|
||||
"title": "End every colleague message with einde prompt",
|
||||
"kind": "workflow",
|
||||
"status": "done",
|
||||
"completedAt": "2026-10-14",
|
||||
"commit": "89acb00"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-005",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 5,
|
||||
"title": "Imperial Postbank",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-006",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 6,
|
||||
"title": "People & Organisation",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-007",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 7,
|
||||
"title": "Personnel Management",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-008",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 8,
|
||||
"title": "Identity & recognition",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-009",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 9,
|
||||
"title": "Clan Control Panel",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-010",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 10,
|
||||
"title": "One connected website",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
},
|
||||
{
|
||||
"id": "DUNE-011",
|
||||
"priority": "P1",
|
||||
"receiptOrder": 11,
|
||||
"title": "Credit & service clarity",
|
||||
"kind": "product",
|
||||
"status": "done",
|
||||
"completedAt": "2026-11-15",
|
||||
"release": "1.0.0.7"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,3 +27,5 @@ test('V2 workspace tiles use the shared manifest even with the simple Alpha head
|
|||
test('New publication clears untouched badges and distinguishes a new page from an update',()=>{const repo=mkdtempSync(path.join(tmpdir(),'dune-badge-expiry-'));try{const root=path.join(repo,'website');mkdirSync(path.join(root,'web'),{recursive:true});const file=path.join(root,'web/menu-new-items.json');writeFileSync(file,JSON.stringify({items:[{href:'https://clans.dunerealms.com/',badge:'NEW'},{href:'https://www.dunerealms.com/staff.html',badge:'NEW',introducedIn:'1.0.0.4'}]}));recordPageUpdates({root,version:'1.0.0.4',paths:['website/node/staff-roster.mjs','website/web/rates-and-charges.html'],newPages:['https://www.dunerealms.com/rates-and-charges.html']});const items=JSON.parse(readFileSync(file)).items;assert.equal(items.find(x=>x.href==='https://clans.dunerealms.com/').badge,undefined);assert.equal(items.find(x=>x.href.endsWith('/staff.html')).badge,'UPDATE');assert.equal(items.find(x=>x.href.endsWith('/rates-and-charges.html')).badge,'NEW');}finally{rmSync(repo,{recursive:true,force:true});}});
|
||||
|
||||
test('Bank changes update the bank workspace badge without marking unrelated workspace tiles',()=>{assert.deepEqual(pagesForChanges(['website/node/postbank-payments.mjs']),['https://cp.dunerealms.com/','https://cp.dunerealms.com/#bank']);assert.deepEqual(pagesForChanges(['website/tests/postbank-payments.test.mjs']),[]);});
|
||||
|
||||
test('combined release highlights apply only when that release is published and expire on the next ordinary update',()=>{const repo=mkdtempSync(path.join(tmpdir(),'dune-release-highlights-'));try{const root=path.join(repo,'website');mkdirSync(path.join(root,'web'),{recursive:true});const file=path.join(root,'web/menu-new-items.json');writeFileSync(file,JSON.stringify({items:[]}));writeFileSync(path.join(root,'web/release.json'),JSON.stringify({version:'1.0.0.7',menuUpdates:[{href:'https://cp.dunerealms.com/#bank',badge:'NEW'},{href:'https://clans.dunerealms.com/',badge:'UPDATE'}]}));recordPageUpdates({root,version:'1.0.0.7',paths:['website/web/release.json']});let items=JSON.parse(readFileSync(file)).items;assert.equal(items.find(x=>x.href.endsWith('#bank')).badge,'NEW');assert.equal(items.find(x=>x.href==='https://clans.dunerealms.com/').badge,'UPDATE');recordPageUpdates({root,version:'1.0.0.7',paths:['website/node/staff-roster.mjs']});items=JSON.parse(readFileSync(file)).items;assert.equal(items.find(x=>x.href.endsWith('#bank')).badge,undefined);}finally{rmSync(repo,{recursive:true,force:true});}});
|
||||
|
|
|
|||
|
|
@ -2,99 +2,118 @@
|
|||
"items": [
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#shop",
|
||||
"introducedIn": "1.0.0.2",
|
||||
"badge": "NEW"
|
||||
"introducedIn": "1.0.0.2"
|
||||
},
|
||||
{
|
||||
"href": "https://wiki.dunerealms.com/",
|
||||
"introducedIn": "1.0.0.2",
|
||||
"badge": "NEW"
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://clans.dunerealms.com/",
|
||||
"introducedIn": "1.0.0.2",
|
||||
"badge": "NEW"
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/",
|
||||
"badge": "NEW",
|
||||
"updatedIn": "1.0.1.0",
|
||||
"introducedIn": "1.0.1.0"
|
||||
"updatedIn": "1.0.0.7",
|
||||
"introducedIn": "1.0.1.0",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#exchange",
|
||||
"updatedIn": "1.0.0.2",
|
||||
"badge": "UPDATE"
|
||||
"updatedIn": "1.0.0.2"
|
||||
},
|
||||
{
|
||||
"href": "https://support.dunerealms.com/",
|
||||
"updatedIn": "1.0.0.3",
|
||||
"badge": "UPDATE"
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/staff.html",
|
||||
"updatedIn": "1.0.0.5",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "1.0.0.3",
|
||||
"updatedIn": "1.0.0.3"
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/shop.html",
|
||||
"updatedIn": "1.0.0.5",
|
||||
"badge": "UPDATE"
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/kits.html",
|
||||
"introducedIn": "1.0.0.5",
|
||||
"badge": "NEW"
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#kits-exchange",
|
||||
"introducedIn": "1.0.0.5",
|
||||
"badge": "NEW"
|
||||
"introducedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#realm",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
"introducedIn": "v2-api",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#bureau",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
"introducedIn": "v2-api",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#forge",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#politics",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
"introducedIn": "v2-api",
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#post",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
"introducedIn": "v2-api",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#bank",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
"introducedIn": "v2-api",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "NEW"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#market",
|
||||
"badge": "NEW",
|
||||
"introducedIn": "v2-api"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/rates-and-charges.html",
|
||||
"updatedIn": "1.0.1.0",
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://forums.dunerealms.com/",
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/discord.html",
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/exchange.html",
|
||||
"updatedIn": "1.0.0.5"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/government.html",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "NEW"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/patch-notes.html",
|
||||
"updatedIn": "1.0.0.7",
|
||||
"badge": "UPDATE"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
1
website/web/patch-note-1-0-0-7.html
Normal file
1
website/web/patch-note-1-0-0-7.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,44 @@
|
|||
{
|
||||
"version": "1.0.0.5",
|
||||
"version": "1.0.0.7",
|
||||
"stage": "alpha",
|
||||
"updatedAt": "2026-11-13T00:06:04.014493+00:00",
|
||||
"scope": "Latest published Alpha release. Development batches are not a new published release."
|
||||
"updatedAt": "2026-11-15T14:09:40.015Z",
|
||||
"scope": "The Great Migration: combined website release for Alpha 1.0.0.6 and 1.0.0.7.",
|
||||
"menuUpdates": [
|
||||
{
|
||||
"href": "https://www.dunerealms.com/",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/staff.html",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://www.dunerealms.com/government.html",
|
||||
"badge": "NEW"
|
||||
},
|
||||
{
|
||||
"href": "https://clans.dunerealms.com/",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#bank",
|
||||
"badge": "NEW"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#bureau",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#realm",
|
||||
"badge": "UPDATE"
|
||||
},
|
||||
{
|
||||
"href": "https://cp.dunerealms.com/#post",
|
||||
"badge": "UPDATE"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff