chore: update docs to WRNexusJS 0.2.14

This commit is contained in:
2026-07-12 16:58:47 +05:30
parent 70ff967da4
commit 042cdd64b8
37 changed files with 222 additions and 172 deletions
+10 -5
View File
@@ -2,6 +2,11 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { join, resolve } from "node:path";
const root = resolve(import.meta.dir, "..");
const projectPackage = JSON.parse(readFileSync(join(root, "package.json"), "utf8")) as {
wrnexus?: { version?: string };
};
const frameworkVersion = projectPackage.wrnexus?.version;
if (!frameworkVersion) throw new Error("package.json is missing wrnexus.version");
const pages = join(root, "app", "pages");
const packagePages = join(pages, "packages");
mkdirSync(packagePages, { recursive: true });
@@ -201,7 +206,7 @@ ${state}
<button data-wire-theme-toggle class="theme-button" aria-label="Toggle theme">Theme</button>
</header>
${content}
<footer>WrNexus 0.2.12 · SSR-first · Bun-native · Documentation generated from published package APIs.</footer>
<footer>WrNexus ${frameworkVersion} · SSR-first · Bun-native · Documentation generated from published package APIs.</footer>
</div>
}
}
@@ -237,7 +242,7 @@ writeFileSync(
shell(
"Packages",
"Explore every WrNexus package, API, function, and copy-ready usage example.",
`<main class="page"><section class="hero compact"><span class="eyebrow">25 focused packages</span><h1>Package reference</h1><p>Everything in the framework, organized by responsibility and documented from the published 0.2.12 APIs.</p><input class="search" type="search" placeholder="Search packages, features, or categories…" @input="query = event.target.value" /></section><section class="category-filter" aria-label="Filter packages by category"><div class="category-row">${categoryButtons}</div><p>Showing <strong>{category}</strong> packages</p></section><section class="package-grid">${cards}</section></main>`,
`<main class="page"><section class="hero compact"><span class="eyebrow">25 focused packages</span><h1>Package reference</h1><p>Everything in the framework, organized by responsibility and documented from the published ${frameworkVersion} APIs.</p><input class="search" type="search" placeholder="Search packages, features, or categories…" @input="query = event.target.value" /></section><section class="category-filter" aria-label="Filter packages by category"><div class="category-row">${categoryButtons}</div><p>Showing <strong>{category}</strong> packages</p></section><section class="package-grid">${cards}</section></main>`,
' state query = ""\n state category = "All"\n',
),
);
@@ -263,8 +268,8 @@ for (const [name, category, summary] of catalog) {
)
.join("");
const content = `<main class="page package-page">
<aside class="sidebar"><a href="/packages">← All packages</a><span class="category">${category}</span><h1>@wrnexus/${name}</h1><p>${summary}</p><code>bun add @wrnexus/${name}@0.2.12</code><nav><a href="#guide">Guide</a><a href="#api">Complete API</a></nav></aside>
<article class="documentation"><section class="doc-intro"><span class="eyebrow">${category}</span><h1>@wrnexus/${name}</h1><p>${summary}</p><pre><code>bun add @wrnexus/${name}@0.2.12</code></pre></section><section id="guide" class="prose">${guide.html}</section><section id="api" class="prose api"><h2>Complete TypeScript API</h2><p>This declaration is generated from the exact published package and lists its exported functions, classes, interfaces, and types.</p><pre data-language="typescript"><code>${escape(types)}</code></pre></section><section id="examples" class="prose examples"><h2>Examples</h2><p>Copy-ready examples taken from this package's published documentation.</p><div class="example-grid">${examplesFrom(readme, name)}</div></section></article>
<aside class="sidebar"><a href="/packages">← All packages</a><span class="category">${category}</span><h1>@wrnexus/${name}</h1><p>${summary}</p><code>bun add @wrnexus/${name}@${frameworkVersion}</code><nav><a href="#guide">Guide</a><a href="#api">Complete API</a></nav></aside>
<article class="documentation"><section class="doc-intro"><span class="eyebrow">${category}</span><h1>@wrnexus/${name}</h1><p>${summary}</p><pre><code>bun add @wrnexus/${name}@${frameworkVersion}</code></pre></section><section id="guide" class="prose">${guide.html}</section><section id="api" class="prose api"><h2>Complete TypeScript API</h2><p>This declaration is generated from the exact published package and lists its exported functions, classes, interfaces, and types.</p><pre data-language="typescript"><code>${escape(types)}</code></pre></section><section id="examples" class="prose examples"><h2>Examples</h2><p>Copy-ready examples taken from this package's published documentation.</p><div class="example-grid">${examplesFrom(readme, name)}</div></section></article>
<aside class="on-this-page"><h2>On this page</h2><nav>${toc}</nav></aside>
</main>`;
writeFileSync(join(packagePages, `${name}.wrn`), shell(`@wrnexus/${name}`, summary, content));
@@ -275,7 +280,7 @@ writeFileSync(
shell(
"Home",
"WrNexus documentation: build secure, server-rendered, reactive applications with Bun.",
`<main class="page"><section class="hero"><span class="eyebrow">WrNexus 0.2.12</span><h1>Build from the server.<br><em>Ship only what matters.</em></h1><p>An SSR-first, Bun-native framework with reactive .wrn components, typed data, realtime rooms, mobile capabilities, and production security built in.</p><div class="actions"><a class="primary" href="/getting-started">Start building</a><a href="/packages">Explore 25 packages</a></div><div class="code-window"><span>app/pages/counter.wrn</span><pre><code>page Counter {
`<main class="page"><section class="hero"><span class="eyebrow">WrNexus ${frameworkVersion}</span><h1>Build from the server.<br><em>Ship only what matters.</em></h1><p>An SSR-first, Bun-native framework with reactive .wrn components, typed data, realtime rooms, mobile capabilities, and production security built in.</p><div class="actions"><a class="primary" href="/getting-started">Start building</a><a href="/packages">Explore 25 packages</a></div><div class="code-window"><span>app/pages/counter.wrn</span><pre><code>page Counter {
state count = 0
view {
&lt;button @click=&quot;count++&quot;&gt;