feat: make route map the interactive landing page
This commit is contained in:
+15
-4
@@ -1,6 +1,7 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
|
||||
const html = read('index.html');
|
||||
const landingHtml = read('index.html');
|
||||
const html = read('full-guide/index.html');
|
||||
const js = read('app.js');
|
||||
const refs = read('docs/references/README.md');
|
||||
const additional = read('docs/references/additional-reading.md');
|
||||
@@ -38,9 +39,9 @@ console.log('rules content verification passed');
|
||||
for (const token of ['const languageCopy','const stages','const skills','const prompts','renderStage','renderSkill','renderLanguage','copyPrompt','addEventListener']) if (!rulesJs.includes(token)) throw new Error(`missing rules interaction ${token}`);
|
||||
for (const token of ['data-lang="en"','data-lang="pt"','data-copy-prompt','aria-live="polite"','role="tablist"']) if (!rulesHtml.includes(token)) throw new Error(`missing rules control ${token}`);
|
||||
console.log('rules interaction verification passed');
|
||||
if (!html.includes('href="rules/"')) throw new Error('main presentation does not link to rules page');
|
||||
if (!html.includes('href="skills-review/"')) throw new Error('main presentation does not link to skills review page');
|
||||
for (const token of ['summary/','models/','agents/','skills/','chapter-route']) if (!html.includes(token)) throw new Error(`main presentation missing chapter route ${token}`);
|
||||
if (!html.includes('href="../rules/"')) throw new Error('main presentation does not link to rules page');
|
||||
if (!html.includes('href="../skills-review/"')) throw new Error('main presentation does not link to skills review page');
|
||||
for (const token of ['../summary/','../models/','../agents/','../skills/','chapter-route']) if (!html.includes(token)) throw new Error(`main presentation missing chapter route ${token}`);
|
||||
if (rulesHtml.includes('script src="http') || rulesHtml.includes('rel="stylesheet" href="http')) throw new Error('rules page has an external runtime dependency');
|
||||
for (const token of ['@media(min-width:2200px)','@media(max-width:900px)','@media(max-width:600px)','prefers-reduced-motion']) if (!rulesCss.includes(token)) throw new Error(`missing rules responsive contract ${token}`);
|
||||
console.log('rules standalone verification passed');
|
||||
@@ -53,3 +54,13 @@ console.log('skills review verification passed');
|
||||
for (const page of [summaryHtml, modelsHtml, agentsHtml, skillsHtml]) if (!page.includes('../chapters.css') || !page.includes('ROUTE MAP')) throw new Error('chapter page missing shared navigation');
|
||||
for (const token of ['--ink','@media(max-width:800px)','@media(max-width:520px)']) if (!chaptersCss.includes(token)) throw new Error(`missing chapter responsive contract ${token}`);
|
||||
console.log('chapter route verification passed');
|
||||
for (const token of ['The short route','full-guide/','models/','agents/','skills/','rules/','hands-on/starter/','skills-review/']) if (!landingHtml.includes(token)) throw new Error(`landing page missing ${token}`);
|
||||
if (landingHtml.includes('app.js')) throw new Error('landing page should remain a fast, static route map');
|
||||
console.log('landing route verification passed');
|
||||
for (const token of ['data-package-file="skill"','data-package-file="references"','data-package-file="scripts"','data-package-file="assets"','id="package-preview"','script src="app.js"']) if (!skillsHtml.includes(token)) throw new Error(`skills anatomy missing ${token}`);
|
||||
const skillsApp = read('skills/app.js');
|
||||
const skillsCss = read('skills/styles.css');
|
||||
for (const token of ['const packageFiles','function renderPackage','addEventListener','renderPackage(\'skill\')']) if (!skillsApp.includes(token)) throw new Error(`skills anatomy interaction missing ${token}`);
|
||||
for (const token of ['grid-template-columns:minmax(190px','overflow-wrap:anywhere','@media(max-width:800px)','prefers-reduced-motion']) if (!skillsCss.includes(token)) throw new Error(`skills anatomy responsive contract missing ${token}`);
|
||||
console.log('skills anatomy verification passed');
|
||||
console.log('presentation verification passed');
|
||||
|
||||
Reference in New Issue
Block a user