fix: restore premium marketing homepage

This commit is contained in:
2026-07-12 23:55:27 +05:30
parent d150e99809
commit cc5ca221e4
12 changed files with 307 additions and 12 deletions
+45 -6
View File
@@ -47,6 +47,45 @@ function shell(title: string, description: string, body: string, section = "Docu
}`;
}
function marketingShell(description: string, body: string) {
const codeCard = `<div class="code-window"><span>app/pages/dashboard.wrn</span><pre><code>page Dashboard &#123;
ssr &#123; api tasks GET /api/tasks &#123; return tasks &#125; &#125;
view &#123;
&lt;main&gt;
&lt;h1&gt;Tasks&lt;/h1&gt;
&#123;#each tasks as task&#125;
&lt;article&gt;&#123;task.title&#125;&lt;/article&gt;
&#123;:empty&#125;
&lt;p&gt;Nothing waiting.&lt;/p&gt;
&#123;/each&#125;
&lt;/main&gt;
&#125;
&#125;</code></pre></div>`;
const marketingBody = body
.replace("hero portal-hero", "hero marketing-hero")
.replace(
"Packages require approved private-registry access. No public installation command is currently available.",
"Private developer preview. Request access to the package registry.",
)
.replace("</section>", `${codeCard}</section>`);
return `page Home {
seo {
title = "WRNexusJS — Bun-native server-first framework"
description = "${description.replaceAll('"', "'")}"
canonical = "https://wrnexusjs.dev/"
}
view {
<a class="skip-link" href="#main">Skip to content</a>
<div class="docs-shell marketing-shell">
<header class="topbar marketing-header"><a class="brand" href="/"><span>W</span> WRNexusJS</a><nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v${version}</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme">◐</button></div></header>
<div class="marketing-mobile-nav"><details><summary>Menu</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/examples">Examples</a></nav></details></div>
<main id="main" class="marketing-main">${marketingBody}</main>
<footer><p><strong>WRNexusJS ${version}</strong> · Bun-native · Created by <a href="https://workroot.in/">WorkRoot</a></p><nav aria-label="Footer"><a href="/getting-started">Documentation</a><a href="/roadmap">Roadmap</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav></footer>
</div>
}
}`;
}
const slugs: Record<string, string> = {
Home: "",
Packages: "/packages",
@@ -72,18 +111,18 @@ function page(route: string, title: string, description: string, body: string, s
}
const status = `<span class="status status-beta"><span aria-hidden="true">●</span> Private Developer Preview</span>`;
page(
"/",
"Home",
"WRNexusJS is a Bun-native, SSR-first full-stack framework using the .wrn component language.",
`<section class="hero portal-hero">${status}<p class="eyebrow">WRNexusJS v${version}</p><h1>Build from the server.<br><em>Ship only what matters.</em></h1><p>WRNexusJS is an SSR-first, Bun-native full-stack framework. Build typed pages, APIs, validated forms, realtime rooms, secure sessions, workspaces, and optional mobile experiences with the <code>.wrn</code> component language.</p><div class="actions"><a class="primary" href="/access">Request preview access</a><a href="/getting-started">Read the preview docs</a></div><p class="access-note">Packages require approved private-registry access. No public installation command is currently available.</p></section>
writeFileSync(
join(pages, "index.wrn"),
marketingShell(
"WRNexusJS is a Bun-native, SSR-first full-stack framework using the .wrn component language.",
`<section class="hero portal-hero">${status}<p class="eyebrow">WRNexusJS v${version}</p><h1>Build from the server.<br><em>Ship only what matters.</em></h1><p>WRNexusJS is an SSR-first, Bun-native full-stack framework. Build typed pages, APIs, validated forms, realtime rooms, secure sessions, workspaces, and optional mobile experiences with the <code>.wrn</code> component language.</p><div class="actions"><a class="primary" href="/access">Request preview access</a><a href="/getting-started">Read the preview docs</a></div><p class="access-note">Packages require approved private-registry access. No public installation command is currently available.</p></section>
<section><h2>Why WRNexusJS</h2><div class="feature-grid"><article><h3>Server-first rendering</h3><p>Useful HTML is rendered first; reactive scopes hydrate only where declared.</p></article><article><h3><code>.wrn</code> components</h3><p>Pages, layouts, props, state, events, server loops, and directives live in a focused language.</p></article><article><h3>Bun-native runtime</h3><p>The runtime is Bun. Node compatibility is not claimed.</p></article><article><h3>Typed data and validation</h3><p>Database queries and shared validation connect server routes to forms.</p></article><article><h3>Integrated security</h3><p>CSP, CSRF, sessions, authorization, encryption, and safe output are framework primitives.</p></article><article><h3>Realtime and workspaces</h3><p>Rooms, Redis pub/sub, and multi-app gateways support live and isolated applications.</p></article></div></section>
<section><h2>A small full-stack flow</h2>${code(`// app/schemas/contact.ts\nimport { v } from "@wrnexus/validation";\nexport default v.object({ email: v.string().email(), message: v.string().min(10) });\n\n// app/api/contacts.ts\nimport schema from "../schemas/contact";\nimport { parseBody } from "@wrnexus/validation";\nexport const POST = async (ctx) => {\n const result = await parseBody(schema, ctx.req);\n return result.ok ? Response.json({ ok: true }, { status: 201 }) : result.response;\n};`)}</section>
<section><h2>Request lifecycle</h2><ol class="lifecycle"><li><strong>Request</strong><span>Security headers and request limits</span></li><li><strong>Middleware</strong><span>Authentication, policy, and context</span></li><li><strong>File route</strong><span>Page or API handler</span></li><li><strong>Compiler + SSR</strong><span>Safe HTML and scoped runtime</span></li><li><strong>Response</strong><span>HTML, JSON, stream, or realtime upgrade</span></li></ol></section>
<section><h2>Production proof</h2><div class="feature-grid"><article><h3><a href="https://workroot.in/">WorkRoot</a></h3><p>Public creator/company site and approved WRNexusJS production showcase.</p></article><article><h3><a href="https://wrnexusjs.dev/">wrnexusjs.dev</a></h3><p>This documentation application runs WRNexusJS ${version}.</p></article></div><p><a href="/showcase">View deployment notes and showcase status →</a></p></section>
<section><h2>Capability status</h2><div class="table-wrap"><table><thead><tr><th>Capability</th><th>Status</th><th>Details</th></tr></thead><tbody><tr><td>SSR, routing, compiler, APIs</td><td>Preview</td><td>Installed in ${version}; public support policy pending.</td></tr><tr><td>Mobile/native</td><td>Experimental</td><td>Capacitor compatibility and native generation have platform limitations.</td></tr><tr><td>Durable queues</td><td>Experimental</td><td>Production durability requires an appropriate driver strategy.</td></tr></tbody></table></div></section>
<section><h2>Continue exploring</h2><div class="actions"><a href="/packages">Explore 25 packages</a><a href="/changelog">Release notes</a><a href="/roadmap">Roadmap</a><a href="/support">Support and access</a></div></section>`,
"Framework",
),
);
page(