Skip to content

Commit 1d8bcb7

Browse files
committed
site
1 parent 13d4db3 commit 1d8bcb7

File tree

2 files changed

+130
-19
lines changed

2 files changed

+130
-19
lines changed

scripts/build-site.mjs

Lines changed: 89 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,37 +1296,107 @@ function buildExamplesIndexPage(examples, css) {
12961296

12971297
function buildSdkIndexPage(runtimes, css) {
12981298
const sdkUrl = `${siteUrl}sdk/`;
1299-
const runtimeSummaries = {
1300-
typescript: "Typed reference implementation for TPS constants, validation, parsing, compilation, and player behavior.",
1301-
javascript: "Built JavaScript runtime package for consumers plus parity tests against the compiled artifact.",
1302-
dotnet: ".NET SDK and xUnit suite under the ManagedCode.Tps prefix.",
1303-
flutter: "Reserved workspace for a future Flutter TPS runtime.",
1304-
swift: "Reserved workspace for a future Swift TPS runtime.",
1305-
java: "Reserved workspace for a future Java TPS runtime."
1299+
const runtimeIcons = {
1300+
typescript: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#3178C6"/><path d="M7.8 8.2h8.4v2H13v6.1h-2.4v-6.1H7.8v-2Zm7.2 0h6.2v1.9h-1.8c-.7 0-1.1.2-1.1.7 0 .4.3.7 1.2 1l.6.2c1.6.5 2.3 1.3 2.3 2.6 0 1.7-1.4 2.8-3.7 2.8-1.3 0-2.5-.3-3.5-.9v-2.1c1 .7 2.1 1 3.1 1 .8 0 1.2-.2 1.2-.7 0-.4-.3-.6-1.1-.9l-.7-.2c-1.7-.5-2.4-1.4-2.4-2.7 0-1.6 1.3-2.8 3.6-2.8.9 0 1.9.2 2.8.5v2c-.9-.4-1.8-.6-2.6-.6-.8 0-1.2.2-1.2.6 0 .3.3.5 1.1.8l.8.2c1.8.6 2.5 1.4 2.5 2.8 0 1.8-1.4 2.9-3.8 2.9-1.4 0-2.6-.3-3.7-.9v-2.2c1.1.8 2.3 1.2 3.5 1.2.8 0 1.2-.3 1.2-.7 0-.4-.3-.6-1.2-.9l-.8-.2c-1.7-.5-2.4-1.3-2.4-2.6 0-1.7 1.4-2.8 3.7-2.8.9 0 1.8.1 2.7.4V8.2H15Z" fill="#fff"/></svg>',
1301+
javascript: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#F7DF1E"/><path d="M13.1 8.1h2.3v6.6c0 2-.9 3.1-2.9 3.1-.9 0-1.6-.2-2.3-.7l.6-1.8c.4.3.8.4 1.2.4.7 0 1.1-.4 1.1-1.4V8.1Zm4 8.7.7-1.8c.7.5 1.6.8 2.4.8 1 0 1.5-.3 1.5-.9 0-.5-.4-.8-1.6-1.2l-.4-.1c-1.8-.6-2.8-1.5-2.8-3 0-1.8 1.4-3 3.6-3 1.1 0 2.1.2 3 .7l-.7 1.8c-.8-.4-1.6-.6-2.3-.6-.9 0-1.4.3-1.4.8 0 .5.4.7 1.6 1.1l.4.1c1.9.6 2.8 1.5 2.8 3.1 0 1.9-1.5 3.1-3.9 3.1-1.3 0-2.6-.3-3.5-.9Z" fill="#1F2328"/></svg>',
1302+
dotnet: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#68217A"/><text x="12" y="15" text-anchor="middle" font-size="8.2" font-weight="700" fill="#fff" font-family="ui-sans-serif, system-ui, -apple-system, sans-serif">C#</text></svg>',
1303+
flutter: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#EAF4FF"/><path d="M7 14.7 13.9 8h3.2l-6.9 6.7H7Zm3.2 3.3 3.7-3.6h3.2L13.4 18h-3.2Zm0-3.4 1.6-1.5 5.3 5.1h-3.2l-3.7-3.6Z" fill="#47C5FB"/><path d="M10.2 14.6 13.9 18h3.2l-5.3-5.1-1.6 1.7Z" fill="#00569E"/></svg>',
1304+
swift: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#F05138"/><path d="M17.7 15.5c-.5.3-1 .5-1.5.6-1 .2-2-.1-2.8-.7-1-.7-1.8-1.7-2.7-2.7.5.4 1 .8 1.6 1.1 1.2.7 2.3 1 3.4.9-1-.4-2-.9-3-1.6-1.5-1-2.6-2.1-3.3-3.3.9.8 2 1.5 3.1 2.1-.8-.7-1.5-1.5-2-2.4-.5-.8-.8-1.6-.9-2.3.8 1 1.8 2 3 2.8 1.2.9 2.5 1.6 3.8 2.1.1-.2.2-.5.2-.8 0-1.1-.5-2.1-1.4-2.9 1.4.7 2.5 2 2.8 3.5.2 1.1 0 2.3-.6 3.3.5.3.9.7 1.2 1.3-.4-.3-.7-.5-.9-.6Z" fill="#fff2e8"/></svg>',
1305+
java: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><rect x="2.5" y="2.5" width="19" height="19" rx="5" fill="#F5F1EA"/><path d="M13.6 6.8c1 .8-1.2 1.4-.4 2.4.4.5 1.2.7 1.2 1.6 0 .7-.5 1.3-1.4 1.8.5-.6.6-1.1.4-1.5-.3-.5-.9-.7-1.1-1.3-.3-.8.3-1.5 1.3-3Z" fill="#EA2D2E"/><path d="M9.3 15.2h5.8c.6 0 1-.4 1-1v-.2h1v.2c0 1.1-.9 2-2 2H9.3c-1.1 0-2-.9-2-2V11h1v3.2c0 .6.4 1 1 1Z" fill="#3A75B0"/><path d="M9.5 11.4h6v.9h-6v-.9Zm.8 1.7h4.4v.8h-4.4v-.8Z" fill="#3A75B0"/></svg>'
1306+
};
1307+
const runtimeDetails = {
1308+
typescript: {
1309+
summary: "Canonical typed source and source of truth for the TPS runtime contract.",
1310+
chips: ["Source Of Truth"],
1311+
facts: [
1312+
{ label: "State", valueHtml: "Active reference runtime used to define TPS behavior across the SDK workspace." },
1313+
{ label: "Contract", valueHtml: "<code>TpsSpec</code>, <code>TpsKeywords</code>, <code>validateTps</code>, <code>parseTps</code>, <code>compileTps</code>, <code>TpsPlayer</code>." },
1314+
{ label: "Verification", valueHtml: "<code>build:tps</code> for compile output and <code>test:types</code> for type-checked parity." },
1315+
{ label: "Workspace", valueHtml: "<code>SDK/ts</code> emits the runtime consumed by <code>SDK/js/lib</code>." }
1316+
]
1317+
},
1318+
javascript: {
1319+
summary: "Consumer JavaScript artifact generated from the TypeScript runtime and tested as built output.",
1320+
chips: ["Generated Artifact"],
1321+
facts: [
1322+
{ label: "State", valueHtml: "Active consumer runtime with CI verification and separate coverage gating." },
1323+
{ label: "Contract", valueHtml: "Package <code>managedcode.tps</code> exports the same API surface from <code>lib/index.js</code>." },
1324+
{ label: "Verification", valueHtml: "<code>test:js</code> runs Node tests against built files and <code>coverage:js</code> enforces <strong>90%+</strong>." },
1325+
{ label: "Workspace", valueHtml: "<code>SDK/js</code> contains the generated runtime, package metadata, and consumer-facing entry points." }
1326+
]
1327+
},
1328+
dotnet: {
1329+
summary: "ManagedCode.Tps runtime for .NET consumers with xUnit parity tests and coverage thresholds.",
1330+
chips: ["ManagedCode.Tps", "net10.0"],
1331+
facts: [
1332+
{ label: "State", valueHtml: "Active C# runtime with CI verification and separate coverage gating." },
1333+
{ label: "Contract", valueHtml: "Namespace and package <code>ManagedCode.Tps</code> expose <code>TpsSpec</code>, <code>TpsRuntime.Validate/Parse/Compile</code>, and <code>TpsPlayer</code>." },
1334+
{ label: "Verification", valueHtml: "<code>ManagedCode.Tps.slnx</code> builds and tests in CI, with a separate <strong>90%+</strong> coverage run." },
1335+
{ label: "Workspace", valueHtml: "<code>SDK/dotnet</code> contains the runtime project plus <code>ManagedCode.Tps.Tests</code>." }
1336+
]
1337+
},
1338+
flutter: {
1339+
summary: "Placeholder workspace only. No Flutter TPS runtime has been implemented yet.",
1340+
chips: ["Placeholder"],
1341+
facts: [
1342+
{ label: "State", valueHtml: "Planned runtime only. No CI job runs for Flutter yet." },
1343+
{ label: "Contract", valueHtml: "No parser, compiler, validator, or player implementation exists yet." },
1344+
{ label: "Activation", valueHtml: "Add the real runtime, tests, and CI integration when Flutter work starts." },
1345+
{ label: "Workspace", valueHtml: "<code>SDK/flutter</code> currently contains documentation scaffolding only." }
1346+
]
1347+
},
1348+
swift: {
1349+
summary: "Placeholder workspace only. No Swift TPS runtime has been implemented yet.",
1350+
chips: ["Placeholder"],
1351+
facts: [
1352+
{ label: "State", valueHtml: "Planned runtime only. No CI job runs for Swift yet." },
1353+
{ label: "Contract", valueHtml: "No parser, compiler, validator, or player implementation exists yet." },
1354+
{ label: "Activation", valueHtml: "Add the real runtime, tests, and CI integration when Swift work starts." },
1355+
{ label: "Workspace", valueHtml: "<code>SDK/swift</code> currently contains documentation scaffolding only." }
1356+
]
1357+
},
1358+
java: {
1359+
summary: "Placeholder workspace only. No Java TPS runtime has been implemented yet.",
1360+
chips: ["Placeholder"],
1361+
facts: [
1362+
{ label: "State", valueHtml: "Planned runtime only. No CI job runs for Java yet." },
1363+
{ label: "Contract", valueHtml: "No parser, compiler, validator, or player implementation exists yet." },
1364+
{ label: "Activation", valueHtml: "Add the real runtime, tests, and CI integration when Java work starts." },
1365+
{ label: "Workspace", valueHtml: "<code>SDK/java</code> currently contains documentation scaffolding only." }
1366+
]
1367+
}
13061368
};
13071369
const runtimeCards = runtimes
13081370
.map((runtime, index) => {
13091371
const readmeUrl = `${repoUrl}/blob/main/${runtime.path}/README.md`;
13101372
const codeUrl = `${repoUrl}/tree/main/${runtime.path}`;
13111373
const statusLabel = runtime.enabled ? "Available" : "Planned";
1374+
const details = runtimeDetails[runtime.id] ?? {
1375+
summary: "TPS runtime workspace.",
1376+
chips: [],
1377+
facts: [
1378+
{ label: "State", valueHtml: runtime.enabled ? "Active runtime." : "Planned runtime." },
1379+
{ label: "Workspace", valueHtml: `<code>${escapeHtml(runtime.path)}</code>` }
1380+
]
1381+
};
13121382
const chips = [
13131383
`<span class="meta-chip">${statusLabel}</span>`,
13141384
`<span class="meta-chip">${escapeHtml(runtime.language)}</span>`,
1385+
...details.chips.map(chip => `<span class="meta-chip">${escapeHtml(chip)}</span>`),
13151386
runtime.enabled ? `<span class="meta-chip">CI</span>` : "",
13161387
runtime.coverage ? `<span class="meta-chip">Coverage 90%+</span>` : ""
13171388
].filter(Boolean).join("");
1318-
const icons = [
1319-
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M12 2v20M4 7h16M4 17h16" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',
1320-
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M8 7l-5 5 5 5M16 7l5 5-5 5M14 4l-4 16" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>',
1321-
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M5 5h14v14H5z" stroke="currentColor" stroke-width="1.6"/><path d="M9 9h6M9 12h6M9 15h4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>'
1322-
];
1323-
1324-
return `<article class="answer-card reveal" id="sdk-${escapeHtml(runtime.id)}">
1325-
<div class="answer-icon">${icons[index % icons.length]}</div>
1389+
const facts = details.facts
1390+
.map(fact => `<div class="sdk-fact"><dt>${escapeHtml(fact.label)}</dt><dd>${fact.valueHtml}</dd></div>`)
1391+
.join("");
1392+
return `<article class="answer-card sdk-card" id="sdk-${escapeHtml(runtime.id)}">
1393+
<div class="answer-icon">${runtimeIcons[runtime.id] ?? runtimeIcons.typescript}</div>
13261394
<div class="content-meta">${chips}</div>
13271395
<h3>${escapeHtml(runtime.language)}</h3>
1328-
<p class="answer-answer">${escapeHtml(runtimeSummaries[runtime.id] ?? "TPS runtime workspace.")}</p>
1329-
<p class="answer-answer">Code path: <code>${escapeHtml(runtime.path)}</code></p>
1396+
<p class="sdk-summary">${escapeHtml(details.summary)}</p>
1397+
<dl class="sdk-facts">
1398+
${facts}
1399+
</dl>
13301400
<div class="hero-actions">
13311401
<a class="button button-primary" href="${codeUrl}" target="_blank" rel="noopener">View Code</a>
13321402
<a class="button button-secondary" href="${readmeUrl}" target="_blank" rel="noopener">README</a>
@@ -1379,7 +1449,7 @@ function buildSdkIndexPage(runtimes, css) {
13791449
<h1>TPS SDKs</h1>
13801450
<p class="example-meta">
13811451
<a href="../">&larr; Back to spec</a> &middot;
1382-
Runtime catalog generated from <code>SDK/manifest.json</code>.
1452+
Runtime catalog for the current TPS SDK workspace.
13831453
</p>
13841454
<p class="example-desc">Each TPS SDK exposes the same contract: constants, validation, parser, compiler, and player APIs. Use this page to jump directly into the implementation folders in the repository. Need terminology? Open the <a href="../glossary/">TPS glossary</a>.</p>
13851455
@@ -1394,7 +1464,7 @@ function buildSdkIndexPage(runtimes, css) {
13941464
</div>
13951465
13961466
<div class="examples-info-box">
1397-
<p>Active runtimes participate in build and test CI, while runtimes with a coverage command also pass the separate <strong>90%+</strong> coverage pipeline.</p>
1467+
<p>Active runtimes are implemented and verified in CI. Planned runtimes are placeholders only until real code and tests are added.</p>
13981468
</div>
13991469
</div>
14001470

website/site.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,47 @@ pre code {
308308
.answer-card:nth-child(3) .answer-icon { background: rgba(37,99,235,0.08); color: var(--tps-blue); }
309309
.answer-card h3 { margin: 0; font-size: 1rem; font-weight: 700; }
310310
.answer-answer { margin: 0.45rem 0 0; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.65; }
311+
.sdk-card {
312+
display: flex;
313+
flex-direction: column;
314+
height: 100%;
315+
}
316+
.sdk-summary {
317+
margin: 0.45rem 0 0;
318+
color: var(--text-secondary);
319+
font-size: 0.9rem;
320+
line-height: 1.6;
321+
}
322+
.sdk-facts {
323+
display: grid;
324+
gap: 0.55rem;
325+
margin: 0.9rem 0 0;
326+
}
327+
.sdk-fact {
328+
padding-top: 0.55rem;
329+
border-top: 1px solid var(--line-soft);
330+
}
331+
.sdk-fact dt {
332+
margin: 0;
333+
color: var(--muted);
334+
font-size: 0.7rem;
335+
font-weight: 700;
336+
letter-spacing: 0.08em;
337+
text-transform: uppercase;
338+
}
339+
.sdk-fact dd {
340+
margin: 0.22rem 0 0;
341+
color: var(--text-secondary);
342+
font-size: 0.84rem;
343+
line-height: 1.55;
344+
}
345+
.sdk-fact code {
346+
font-size: 0.79rem;
347+
}
348+
.sdk-card .hero-actions {
349+
margin-top: auto;
350+
padding-top: 1rem;
351+
}
311352

312353
/* ── Layout ── */
313354
.layout {

0 commit comments

Comments
 (0)