docs: update portal for WRNexusJS 0.8.0
This commit is contained in:
+24
-1
@@ -14,31 +14,46 @@ const expected = [
|
||||
"ai",
|
||||
"auth",
|
||||
"authz",
|
||||
"benchmark",
|
||||
"cache",
|
||||
"captcha",
|
||||
"cli",
|
||||
"compiler",
|
||||
"content",
|
||||
"core",
|
||||
"csr",
|
||||
"db",
|
||||
"dev-server",
|
||||
"dev-toolbar",
|
||||
"encryption",
|
||||
"graphql",
|
||||
"helpers",
|
||||
"i18n",
|
||||
"identity",
|
||||
"image",
|
||||
"jwt",
|
||||
"language-server",
|
||||
"mcp",
|
||||
"mobile",
|
||||
"native",
|
||||
"oauth",
|
||||
"observability",
|
||||
"playground",
|
||||
"plugin",
|
||||
"pubsub",
|
||||
"pwa",
|
||||
"queue",
|
||||
"reactive",
|
||||
"realtime",
|
||||
"router",
|
||||
"security",
|
||||
"ssr",
|
||||
"store",
|
||||
"styles",
|
||||
"syntax",
|
||||
"test",
|
||||
"tracking",
|
||||
"typecheck",
|
||||
"ui",
|
||||
"uploader",
|
||||
"validation",
|
||||
@@ -201,5 +216,13 @@ test("clicking a category hides packages from other categories", async () => {
|
||||
.querySelectorAll(".package-card")
|
||||
.filter((card) => (card as HTMLElement).style.display !== "none")
|
||||
.map((card) => card.getAttribute("href"));
|
||||
expect(visible).toEqual(["/packages/db", "/packages/queue", "/packages/uploader"]);
|
||||
expect(visible).toEqual([
|
||||
"/packages/cache",
|
||||
"/packages/content",
|
||||
"/packages/db",
|
||||
"/packages/graphql",
|
||||
"/packages/queue",
|
||||
"/packages/store",
|
||||
"/packages/uploader",
|
||||
]);
|
||||
});
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@ page Pagenotfound {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Error</span><span aria-hidden="true">/</span><span aria-current="page">Page not found</span></nav><article class="documentation prose standalone"><span class="eyebrow">404</span><h1>Page not found</h1><p>The address may be outdated or misspelled. No private or duplicate route is exposed here.</p><div class="actions"><a class="primary" href="/search">Search documentation</a><a href="/getting-started">Getting started</a><a href="/packages">Package reference</a></div></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Access {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Status</span><span aria-hidden="true">/</span><span aria-current="page">Access</span></nav><article class="documentation prose standalone"><Badge class="status status-beta" label="Private Developer Preview" variant="info" /><h1>Request preview access</h1><p>WRNexusJS 0.7.0 packages are not available from the public npm registry. Installation requires approval and private registry credentials supplied by WorkRoot. Never paste registry tokens into source control, issue reports, or support messages.</p><h2>Request process</h2><ol><li>Contact WorkRoot through the public contact path at <a href="https://workroot.in/">workroot.in</a>.</li><li>Describe the application, team, expected deployment, and Bun environment.</li><li>After approval, follow the registry instructions supplied privately.</li><li>Use the canonical scaffold command below only after authentication.</li></ol><pre><code>bunx @wrnexus/cli@0.7.0 create my-app</code></pre><p>Access approval, response time, licensing terms, and support level remain owner-controlled. This site does not collect access requests directly.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Status</span><span aria-hidden="true">/</span><span aria-current="page">Access</span></nav><article class="documentation prose standalone"><Badge class="status status-beta" label="Private Developer Preview" variant="info" /><h1>Request preview access</h1><p>WRNexusJS 0.8.0 packages are not available from the public npm registry. Installation requires approval and private registry credentials supplied by WorkRoot. Never paste registry tokens into source control, issue reports, or support messages.</p><h2>Request process</h2><ol><li>Contact WorkRoot through the public contact path at <a href="https://workroot.in/">workroot.in</a>.</li><li>Describe the application, team, expected deployment, and Bun environment.</li><li>After approval, follow the registry instructions supplied privately.</li><li>Use the canonical scaffold command below only after authentication.</li></ol><pre><code>bunx @wrnexus/cli@0.8.0 create my-app</code></pre><p>Access approval, response time, licensing terms, and support level remain owner-controlled. This site does not collect access requests directly.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Architecture {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">Architecture</span></nav><article class="documentation prose standalone"><span class="status status-beta">Framework architecture · 0.7.0</span><h1>Architecture</h1><p>WRNexusJS is Bun-native and SSR-first. File discovery maps pages and API handlers; middleware enriches or short-circuits a request; the compiler turns <code>.wrn</code> declarations into server render functions and small feature runtimes.</p><h2>Request and build lifecycle</h2><ol class="lifecycle"><li><strong>Discover</strong><span>Pages, APIs, middleware, components, layouts, schemas, rooms</span></li><li><strong>Compile</strong><span>Parse .wrn, validate grammar, generate server code</span></li><li><strong>Request</strong><span>Limits, security, locale, session, middleware</span></li><li><strong>Match</strong><span>Static and dynamic file route</span></li><li><strong>Render</strong><span>SSR data, escaped interpolation, components, metadata</span></li><li><strong>Enhance</strong><span>Only required reactive/directive runtimes</span></li></ol><h2>Package boundaries</h2><p><code>core</code> owns contexts, middleware, sessions and rooms; <code>router</code> discovers routes; <code>compiler</code> parses <code>.wrn</code>; <code>ssr</code> renders documents; <code>csr</code> supplies browser runtimes; <code>dev-server</code> and <code>cli</code> orchestrate development and builds.</p><h2>Security and data flow</h2><p>Validation happens at trust boundaries. Session authentication establishes identity; authorization makes resource decisions. CSP, Trusted Types, CSRF, upload checks, WebSocket origins, request limits, and output escaping are layered controls—not substitutes for application policy.</p><h2>Realtime and scale</h2><p>Rooms are process-local unless connected through pub/sub. Redis-backed pub/sub distributes events. Queue durability depends on the selected driver and must be evaluated explicitly.</p><h2>Workspaces and gateways</h2><p>The gateway can dispatch multiple applications while preserving route, component, asset, config, and session boundaries. Validate host routing and isolation before production.</p><h2>Build and deployment</h2><p><code>wrnexus build .</code> produces <code>dist/server.js</code> and hashed/static assets. Run the server with Bun, apply migrations before traffic, terminate TLS at a trusted edge, and forward only expected proxy headers.</p><h2>Mobile</h2><p>Mobile compatibility bridges SSR-safe Capacitor capabilities; native route generation is experimental and is not general web portability. Test each target platform.</p><h2>Generated files and limits</h2><p><code>app/routes.gen.ts</code>, <code>.wrnexus/</code>, and <code>dist/</code> are generated. The runtime is Bun-only. Preview packages are private. Historical compatibility and long-term support policy are not yet published.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">Architecture</span></nav><article class="documentation prose standalone"><span class="status status-beta">Framework architecture · 0.8.0</span><h1>Architecture</h1><p>WRNexusJS is Bun-native and SSR-first. File discovery maps pages and API handlers; middleware enriches or short-circuits a request; the compiler turns <code>.wrn</code> declarations into server render functions and small feature runtimes.</p><h2>Request and build lifecycle</h2><ol class="lifecycle"><li><strong>Discover</strong><span>Pages, APIs, middleware, components, layouts, schemas, rooms</span></li><li><strong>Compile</strong><span>Parse .wrn, validate grammar, generate server code</span></li><li><strong>Request</strong><span>Limits, security, locale, session, middleware</span></li><li><strong>Match</strong><span>Static and dynamic file route</span></li><li><strong>Render</strong><span>SSR data, escaped interpolation, components, metadata</span></li><li><strong>Enhance</strong><span>Only required reactive/directive runtimes</span></li></ol><h2>Package boundaries</h2><p><code>core</code> owns contexts, middleware, sessions and rooms; <code>router</code> discovers routes; <code>compiler</code> parses <code>.wrn</code>; <code>ssr</code> renders documents; <code>csr</code> supplies browser runtimes; <code>dev-server</code> and <code>cli</code> orchestrate development and builds.</p><h2>Security and data flow</h2><p>Validation happens at trust boundaries. Session authentication establishes identity; authorization makes resource decisions. CSP, Trusted Types, CSRF, upload checks, WebSocket origins, request limits, and output escaping are layered controls—not substitutes for application policy.</p><h2>Realtime and scale</h2><p>Rooms are process-local unless connected through pub/sub. Redis-backed pub/sub distributes events. Queue durability depends on the selected driver and must be evaluated explicitly.</p><h2>Workspaces and gateways</h2><p>The gateway can dispatch multiple applications while preserving route, component, asset, config, and session boundaries. Validate host routing and isolation before production.</p><h2>Build and deployment</h2><p><code>wrnexus build .</code> produces <code>dist/server.js</code> and hashed/static assets. Run the server with Bun, apply migrations before traffic, terminate TLS at a trusted edge, and forward only expected proxy headers.</p><h2>Mobile</h2><p>Mobile compatibility bridges SSR-safe Capacitor capabilities; native route generation is experimental and is not general web portability. Test each target platform.</p><h2>Generated files and limits</h2><p><code>app/routes.gen.ts</code>, <code>.wrnexus/</code>, and <code>dist/</code> are generated. The runtime is Bun-only. Preview packages are private. Historical compatibility and long-term support policy are not yet published.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Benchmarks {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Project</span><span aria-hidden="true">/</span><span aria-current="page">Benchmarks</span></nav><article class="documentation prose standalone"><h1>Benchmarks</h1><span class="status status-planned">No publishable benchmark dataset yet</span><p>No comparative speed claims are published. A valid baseline must record scripts, commit, Bun/framework versions, hardware, OS, warmup, samples, workload, raw results, median, percentiles, memory, HTML size, browser JavaScript size, and run date.</p><p>The roadmap starts with WRNexusJS-only measurements before any maintained equivalent-workload comparison.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Changelog {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Project</span><span aria-hidden="true">/</span><span aria-current="page">Changelog</span></nav><article class="documentation prose standalone"><h1>Changelog</h1><h2>0.7.0 <small>2026-07-13</small></h2><p>Documentation is aligned to all 38 installed packages. This release adds <code>@wrnexus/helpers</code>, original-request URL helpers, safe login redirects, working <code>wrnexus workspace add</code>, and forward-auth redirect propagation.</p><h3>Migration notes</h3><p>Run <code>wrnexus update --latest</code> and keep every <code>@wrnexus/*</code> package on 0.7.0. Existing applications must explicitly add <code>@wrnexus/helpers</code> before importing it; newly scaffolded applications include it automatically.</p><h2>Versioning and support</h2><p>The packages use semantic-looking versions, but a formal compatibility and old-release support policy has not been approved. Preview consumers should treat minor releases as potentially requiring migration review.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Project</span><span aria-hidden="true">/</span><span aria-current="page">Changelog</span></nav><article class="documentation prose standalone"><h1>Changelog</h1><h2>0.8.0 <small>2026-07-13</small></h2><p>Documentation is aligned to all 46 installed packages. This release adds <code>@wrnexus/helpers</code>, original-request URL helpers, safe login redirects, working <code>wrnexus workspace add</code>, and forward-auth redirect propagation.</p><h3>Migration notes</h3><p>Run <code>wrnexus update --latest</code> and keep every <code>@wrnexus/*</code> package on 0.8.0. Existing applications must explicitly add <code>@wrnexus/helpers</code> before importing it; newly scaffolded applications include it automatically.</p><h2>Versioning and support</h2><p>The packages use semantic-looking versions, but a formal compatibility and old-release support policy has not been approved. Preview consumers should treat minor releases as potentially requiring migration review.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Examples {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Learn</span><span aria-hidden="true">/</span><span aria-current="page">Examples</span></nav><article class="documentation prose standalone"><h1>Examples</h1><p>Examples are tied to installed 0.7.0 package documentation. The focused snippets in guides are source-verified; standalone runnable projects and CI compilation are tracked as remaining work.</p><div class="coverage-list"><article><h2>Minimal .wrn page</h2><span class="status status-beta">Documented</span></article><article><h2>Database CRUD</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Authentication and protected route</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Permissions</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Forms and validation</h2><span class="status status-beta">Documented</span></article><article><h2>Realtime dashboard</h2><span class="status status-planned">Planned fixture</span></article><article><h2>File upload</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Background queue</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Redis pub/sub</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Workspace gateway</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Deployment</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Experimental mobile mode</h2><span class="status status-planned">Planned fixture</span></article></div></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Learn</span><span aria-hidden="true">/</span><span aria-current="page">Examples</span></nav><article class="documentation prose standalone"><h1>Examples</h1><p>Examples are tied to installed 0.8.0 package documentation. The focused snippets in guides are source-verified; standalone runnable projects and CI compilation are tracked as remaining work.</p><div class="coverage-list"><article><h2>Minimal .wrn page</h2><span class="status status-beta">Documented</span></article><article><h2>Database CRUD</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Authentication and protected route</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Permissions</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Forms and validation</h2><span class="status status-beta">Documented</span></article><article><h2>Realtime dashboard</h2><span class="status status-planned">Planned fixture</span></article><article><h2>File upload</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Background queue</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Redis pub/sub</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Workspace gateway</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Deployment</h2><span class="status status-planned">Planned fixture</span></article><article><h2>Experimental mobile mode</h2><span class="status status-planned">Planned fixture</span></article></div></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ page Gettingstarted {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">Getting started</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · v0.7.0</span><h1>Build a contact inbox</h1><p>This path creates a server-rendered page, validated API route, middleware, and realtime next step. It requires approved registry access and Bun 1.3.x; this site was verified with Bun 1.3.14.</p><h2 id="create">1. Create the project</h2><pre><code>bunx @wrnexus/cli@0.7.0 create my-app
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">Getting started</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · v0.8.0</span><h1>Build a contact inbox</h1><p>This path creates a server-rendered page, validated API route, middleware, and realtime next step. It requires approved registry access and Bun 1.3.x; this site was verified with Bun 1.3.14.</p><h2 id="create">1. Create the project</h2><pre><code>bunx @wrnexus/cli@0.8.0 create my-app
|
||||
cd my-app
|
||||
bun install
|
||||
bun run dev</code></pre><h2 id="structure">2. Know the structure</h2><pre><code>app/pages/ # file-based .wrn routes
|
||||
@@ -39,7 +39,7 @@ export const POST = async (ctx) => {
|
||||
}</code></pre><h2 id="test-build">7. Test and ship</h2><pre><code>bun run test
|
||||
bun run build
|
||||
bun dist/server.js</code></pre><p>Next: <a href="/guides/deployment">deployment</a>, <a href="/guides/database">database</a>, <a href="/guides/authentication">authentication</a>, and <a href="/guides/workspaces-and-gateway">workspaces</a>.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page APIroutes {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">API routes</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>API routes</h1><p>Export GET, POST, PUT, PATCH, or DELETE from app/api files. Validate request bodies, enforce authentication and authorization, cap request sizes, and return Web Responses.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">API routes</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>API routes</h1><p>Export GET, POST, PUT, PATCH, or DELETE from app/api files. Validate request bodies, enforce authentication and authorization, cap request sizes, and return Web Responses.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Authentication {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Authentication</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Authentication</h1><p>Configure session authentication, log users in through supported auth helpers, and read identity from context. Cookie flags, rotation, expiry, and secret storage remain deployment responsibilities.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Authentication</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Authentication</h1><p>Configure session authentication, log users in through supported auth helpers, and read identity from context. Cookie flags, rotation, expiry, and secret storage remain deployment responsibilities.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Authorization {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Authorization</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Authorization</h1><p>Authentication identifies; authorization decides. Enforce permissions in server routes and policies, including object ownership. UI hiding is never an authorization boundary.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Authorization</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Authorization</h1><p>Authentication identifies; authorization decides. Enforce permissions in server routes and policies, including object ownership. UI hiding is never an authorization boundary.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Configurationandprofiles {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Configuration and profiles</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Configuration and profiles</h1><p>wrnexus.config.ts owns styles, SEO, security, data, mobile, fonts, and profiles. Keep secrets in validated environment variables and review merged production configuration.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Configuration and profiles</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Configuration and profiles</h1><p>wrnexus.config.ts owns styles, SEO, security, data, mobile, fonts, and profiles. Keep secrets in validated environment variables and review merged production configuration.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Database {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Database</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Database</h1><p>Configure SQLite or the installed supported driver, keep queries in named SQL blocks, generate typed functions, and apply migrations before traffic. Back up data and test rollback independently.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Database</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Database</h1><p>Configure SQLite or the installed supported driver, keep queries in named SQL blocks, generate typed functions, and apply migrations before traffic. Back up data and test rollback independently.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Deployment {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Deployment</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Deployment</h1><p>Run bun run build, apply migrations, and start dist/server.js with Bun. Configure TLS, proxy trust, environment validation, health checks, graceful restarts, logs, backups, and restrictive security headers.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Deployment</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Deployment</h1><p>Run bun run build, apply migrations, and start dist/server.js with Bun. Configure TLS, proxy trust, environment validation, health checks, graceful restarts, logs, backups, and restrictive security headers.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Formsandvalidation {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Forms and validation</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Forms and validation</h1><p>Define a v.object schema, use data-schema on the form, show field errors with data-error, and always call parseBody on the server. refine is server-only.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Forms and validation</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Forms and validation</h1><p>Define a v.object schema, use data-schema on the form, show field errors with data-error, and always call parseBody on the server. refine is server-only.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Internationalizationandthemes {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Internationalization and themes</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Internationalization and themes</h1><p>Store locale JSON under app/locales and use translation directives. Themes resolve CSS tokens; ensure contrast, system preference behavior, persistence, and non-color cues.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Internationalization and themes</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Internationalization and themes</h1><p>Store locale JSON under app/locales and use translation directives. Themes resolve CSS tokens; ensure contrast, system preference behavior, persistence, and non-color cues.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Middleware {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Middleware</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Middleware</h1><p>Middleware receives context and next. Return next() to continue or return a Response to stop. Put request limits and trust-boundary controls before business logic.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Middleware</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Middleware</h1><p>Middleware receives context and next. Return next() to continue or return a Response to stop. Put request limits and trust-boundary controls before business logic.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Mobile {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Mobile</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Mobile</h1><p>Mobile capabilities are experimental in this preview. Test Capacitor permissions and lifecycle on each platform; do not assume every .wrn or browser API converts to native.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Mobile</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Mobile</h1><p>Mobile capabilities are experimental in this preview. Test Capacitor permissions and lifecycle on each platform; do not assume every .wrn or browser API converts to native.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Observability {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Observability</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Observability</h1><p>Use tracking middleware and sinks with redaction, sampling, stable request identifiers, alert ownership, and retention limits. Never capture registry tokens or session secrets.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Observability</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Observability</h1><p>Use tracking middleware and sinks with redaction, sampling, stable request identifiers, alert ownership, and retention limits. Never capture registry tokens or session secrets.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Pagesandcomponents {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Pages and components</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Pages and components</h1><p>Pages are routable, components are reusable, and layouts provide shared slots. Mount a component with data-component and keep browser state scoped and minimal.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Pages and components</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Pages and components</h1><p>Pages are routable, components are reusable, and layouts provide shared slots. Mount a component with data-component and keep browser state scoped and minimal.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Projectstructure {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Project structure</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Project structure</h1><p>Pages, components, layouts, APIs, middleware, schemas, database files, locales, realtime rooms, and styles live under app. Never edit app/routes.gen.ts, .wrnexus, or dist by hand.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Project structure</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Project structure</h1><p>Pages, components, layouts, APIs, middleware, schemas, database files, locales, realtime rooms, and styles live under app. Never edit app/routes.gen.ts, .wrnexus, or dist by hand.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Pubsub {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Pub/sub</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Pub/sub</h1><p>The in-process driver cannot cross processes. Use Redis where instances must share events, define channel ownership, and design for reconnects and duplicate delivery.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Pub/sub</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Pub/sub</h1><p>The in-process driver cannot cross processes. Use Redis where instances must share events, define channel ownership, and design for reconnects and duplicate delivery.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Queues {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Queues</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Queues</h1><p>Queue behavior is preview-level. Treat in-process work as non-durable, make handlers idempotent, cap retries, record failures, and choose a production persistence strategy.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Queues</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Queues</h1><p>Queue behavior is preview-level. Treat in-process work as non-durable, make handlers idempotent, cap retries, record failures, and choose a production persistence strategy.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Realtime {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Realtime</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Realtime</h1><p>defineRoom handles connection and messages. Validate message shapes, authorize subscriptions, restrict origins, bound payloads, and use pub/sub to scale across processes.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Realtime</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Realtime</h1><p>defineRoom handles connection and messages. Validate message shapes, authorize subscriptions, restrict origins, bound payloads, and use pub/sub to scale across processes.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Routing {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Routing</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Routing</h1><p>A page filename defines its URL; index maps to the directory root and bracket segments are dynamic parameters. API files under app/api expose HTTP method functions and receive a Context.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Routing</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Routing</h1><p>A page filename defines its URL; index maps to the directory root and bracket segments are dynamic parameters. API files under app/api expose HTTP method functions and receive a Context.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Applicationsecurity {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Application security</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Application security</h1><p>Use CSP, CSRF, Trusted Types, session hardening, validation, origin checks, upload restrictions, encryption, request limits, and explicit CORS. See the security policy for reporting.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Application security</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Application security</h1><p>Use CSP, CSRF, Trusted Types, session hardening, validation, origin checks, upload restrictions, encryption, request limits, and explicit CORS. See the security policy for reporting.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Serverdata {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Server data</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Server data</h1><p>Use an ssr API binding, return the desired response field, and render it with a server #each block. Values are escaped. Avoid fetching private data through a route that lacks authorization.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Server data</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Server data</h1><p>Use an ssr API binding, return the desired response field, and render it with a server #each block. Values are escaped. Avoid fetching private data through a route that lacks authorization.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Testing {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Testing</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Testing</h1><p>Use Bun tests and @wrnexus/test helpers. Cover server HTML, API status and validation, authorization failures, reactive behavior, and a production startup smoke test.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Testing</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Testing</h1><p>Use Bun tests and @wrnexus/test helpers. Cover server HTML, API status and validation, authorization failures, reactive behavior, and a production startup smoke test.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Troubleshooting {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Troubleshooting</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Troubleshooting</h1><p>Confirm Bun and package versions, regenerate docs/routes through supported commands, read the first compiler diagnostic, check file naming, validate config, and reproduce under a production build.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Troubleshooting</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Troubleshooting</h1><p>Confirm Bun and package versions, regenerate docs/routes through supported commands, read the first compiler diagnostic, check file naming, validate config, and reproduce under a production build.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Upgrading {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Upgrading</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Upgrading</h1><p>Back up and commit first, then use wrnexus update --latest as documented by the installed CLI. Review migrations and keep every @wrnexus package aligned. Current release: 0.7.0.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Upgrading</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Upgrading</h1><p>Back up and commit first, then use wrnexus update --latest as documented by the installed CLI. Review migrations and keep every @wrnexus package aligned. Current release: 0.8.0.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page Uploads {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Uploads</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Uploads</h1><p>Configure named stores, accepted MIME/extensions, and maxBytes. Random keys avoid path traversal. Private files require an authenticated serving route; v1 buffers each file in memory.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Uploads</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Uploads</h1><p>Configure named stores, accepted MIME/extensions, and maxBytes. Random keys avoid path traversal. Private files require an authenticated serving route; v1 buffers each file in memory.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ page Workspacesandgateway {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Workspaces and gateway</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.7.0</span><h1>Workspaces and gateway</h1><p>A workspace runs isolated applications behind one domain-routing gateway. Add an application from the workspace root; the CLI scaffolds <code>apps/reports</code> and registers it in <code>wrnexus.workspace.ts</code>:</p><pre><code>wrnexus workspace add reports --domain=reports.localhost
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Guides</span><span aria-hidden="true">/</span><span aria-current="page">Workspaces and gateway</span></nav><article class="documentation prose standalone"><span class="status status-beta">Preview guide · 0.8.0</span><h1>Workspaces and gateway</h1><p>A workspace runs isolated applications behind one domain-routing gateway. Add an application from the workspace root; the CLI scaffolds <code>apps/reports</code> and registers it in <code>wrnexus.workspace.ts</code>:</p><pre><code>wrnexus workspace add reports --domain=reports.localhost
|
||||
bun install
|
||||
bun run dev</code></pre><h2>Forward authentication</h2><p>Point protected applications at a dedicated verifier endpoint. The verifier must return 2xx for an authenticated session, 401/403 to deny access, or an HTTP redirect to begin browser login.</p><pre><code>// wrnexus.workspace.ts
|
||||
{
|
||||
@@ -28,8 +28,8 @@ export const GET = async (ctx: Context) => {
|
||||
return redirectToLogin(ctx, "/login", {
|
||||
allowedHosts: ["admin.localhost:3000", "reports.localhost:3000"],
|
||||
});
|
||||
};</code></pre><p>Always allowlist redirect hosts. After login, validate or sign the <code>returnTo</code> value before redirecting. Keep internal app ports private and open applications through the gateway port.</p><h2>Release scope</h2><p>This guide describes installed 0.7.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
};</code></pre><p>Always allowlist redirect hosts. After login, validate or sign the <code>returnTo</code> value before redirecting. Keep internal app ports private and open applications through the gateway port.</p><h2>Release scope</h2><p>This guide describes installed 0.8.0 capabilities. Follow linked package declarations for exact signatures; undocumented behavior is not guaranteed.</p><p><a href="/packages">Browse package APIs</a> · <a href="/guides/troubleshooting">Troubleshooting</a> · <a href="/support">Support</a></p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+6
-6
@@ -7,9 +7,9 @@ page Home {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme">◐</button></div></header>
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</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="https://component.wrnexusjs.dev/">Components</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"><section class="hero marketing-hero"><Badge class="status status-beta" label="Private Developer Preview" variant="info" /><p class="eyebrow">WRNexusJS v0.7.0</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">Private developer preview. Request access to the package registry.</p><div class="code-window"><span>app/pages/dashboard.wrn</span><pre><code>page Dashboard {
|
||||
<main id="main" class="marketing-main"><section class="hero marketing-hero"><Badge class="status status-beta" label="Private Developer Preview" variant="info" /><p class="eyebrow">WRNexusJS v0.8.0</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">Private developer preview. Request access to the package registry.</p><div class="code-window"><span>app/pages/dashboard.wrn</span><pre><code>page Dashboard {
|
||||
ssr { api tasks GET /api/tasks { return tasks } }
|
||||
view {
|
||||
<main>
|
||||
@@ -35,10 +35,10 @@ export const POST = async (ctx) => {
|
||||
return result.ok ? Response.json({ ok: true }, { status: 201 }) : result.response;
|
||||
};</code></pre></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 0.7.0.</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 0.7.0; 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 38 packages</a><a href="/changelog">Release notes</a><a href="/roadmap">Roadmap</a><a href="/support">Support and access</a></div></section></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Build from the server. Ship only what matters.</span></p></div><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><p class="footer-meta">Bun-native · Created by <a href="https://workroot.in/">WorkRoot</a></p></footer>
|
||||
<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 0.8.0.</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 0.8.0; 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 46 packages</a><a href="/changelog">Release notes</a><a href="/roadmap">Roadmap</a><a href="/support">Support and access</a></div></section></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Build from the server. Ship only what matters.</span></p></div><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><p class="footer-meta">Bun-native · Created by <a href="https://workroot.in/">WorkRoot</a></p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@ page Thewrnlanguage {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">The .wrn language</span></nav><article class="documentation prose standalone"><span class="status status-beta">Language reference · 0.7.0</span><h1>The <code>.wrn</code> language</h1><nav class="local-toc" aria-label="On this page"><a href="#anatomy">Anatomy</a><a href="#state">Props and state</a><a href="#server">Server control flow</a><a href="#directives">Directives</a><a href="#security">Security</a><a href="#errors">Errors</a></nav><h2 id="anatomy">File anatomy</h2><pre><code>page Account {
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Documentation</span><span aria-hidden="true">/</span><span aria-current="page">The .wrn language</span></nav><article class="documentation prose standalone"><span class="status status-beta">Language reference · 0.8.0</span><h1>The <code>.wrn</code> language</h1><nav class="local-toc" aria-label="On this page"><a href="#anatomy">Anatomy</a><a href="#state">Props and state</a><a href="#server">Server control flow</a><a href="#directives">Directives</a><a href="#security">Security</a><a href="#errors">Errors</a></nav><h2 id="anatomy">File anatomy</h2><pre><code>page Account {
|
||||
layout = "public"
|
||||
seo { title = "Account" description = "Manage your account." }
|
||||
state count = 0
|
||||
view { <button @click="count++">Count {count}</button> }
|
||||
}</code></pre><h2 id="state">Pages, components, layouts, props, and state</h2><p>Pages are routes. Components declare default-valued props and may hold state. Layouts provide shared slots. Mount components with <code>data-component</code>; fill default or named slots with <code>data-slot</code>.</p><h2 id="server">Interpolation, conditionals, and loops</h2><p>Interpolation is HTML-escaped. Use server <code>{#if}</code> and <code>{#each}</code> for SSR data. Use <code>data-show</code> for reactive client visibility.</p><h2 id="directives">Events and directives</h2><p><code>@click</code> and other events execute in the reactive scope. Data attributes opt into forms, i18n, themes, realtime, uploader, browser, and mobile behavior. Consult the exact package page because availability varies.</p><h2 id="forms">Forms, i18n, themes, and realtime</h2><p><code>form[data-schema]</code> connects descriptors to client and server validation. Translation keys use <code>{t:key}</code>. Theme toggles use <code>data-wire-theme-toggle</code>. Realtime pages opt into a named room.</p><h2 id="security">Escaping and security</h2><p>Text interpolation is escaped by default. Do not construct trusted HTML from user input. Server-only refinements must be repeated at the authoritative mutation boundary.</p><h2 id="errors">Common compiler errors</h2><ul><li>Use balanced braces; a literal brace must be escaped.</li><li>Declare UI in <code>view</code>, not JSX or hooks.</li><li>Use a valid page, component, or layout declaration matching the file role.</li><li>Keep server loops tied to available SSR bindings.</li><li>Check <a href="/guides/troubleshooting">troubleshooting</a> and <a href="/packages/compiler">compiler API</a> for this release.</li></ul></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ page License {
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<header class="topbar"><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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav><div class="topbar-actions"><a class="preview-pill" href="/access">Preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Trust</span><span aria-hidden="true">/</span><span aria-current="page">License</span></nav><article class="documentation prose standalone"><h1>License</h1><span class="status status-planned">Owner decision required</span><p>This documentation repository contains no public license file, and the packages are unavailable from the public npm registry. No open-source license or redistribution right should be inferred.</p><p>Approved preview users must follow the private/commercial terms supplied by WorkRoot. Contact <a href="https://workroot.in/">WorkRoot</a> before copying, redistributing, or using WRNexusJS in production.</p></article></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Server-first documentation for the Bun-native framework.</span></p></div><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Created by <a href="https://workroot.in/">WorkRoot</a> · Private Developer Preview</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+48
-3
@@ -12,10 +12,10 @@ page Packages {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="page"><section class="hero compact"><span class="eyebrow">31 focused packages</span><h1>Package reference</h1><p>Everything in the framework, organized by responsibility and documented from the published 0.7.0 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"><button type="button" @click="category = 'All'">All<span>31</span></button><button type="button" @click="category = 'AI'">AI<span>1</span></button><button type="button" @click="category = 'Security'">Security<span>7</span></button><button type="button" @click="category = 'Tooling'">Tooling<span>4</span></button><button type="button" @click="category = 'Core'">Core<span>4</span></button><button type="button" @click="category = 'Frontend'">Frontend<span>6</span></button><button type="button" @click="category = 'Data'">Data<span>3</span></button><button type="button" @click="category = 'Runtime'">Runtime<span>3</span></button><button type="button" @click="category = 'Native'">Native<span>2</span></button><button type="button" @click="category = 'Realtime'">Realtime<span>1</span></button></div><p>Showing <strong>{category}</strong> packages</p></section><section class="package-grid"><a class="package-card" href="/packages/ai" data-show="(category === 'All' ? true : category === 'AI') ? (query === '' ? true : 'ai ai server-side anthropic client with generation and streaming. '.includes(query.toLowerCase())) : false">
|
||||
<main class="page"><section class="hero compact"><span class="eyebrow">46 focused packages</span><h1>Package reference</h1><p>Everything in the framework, organized by responsibility and documented from the published 0.8.0 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"><button type="button" @click="category = 'All'">All<span>46</span></button><button type="button" @click="category = 'AI'">AI<span>1</span></button><button type="button" @click="category = 'Security'">Security<span>9</span></button><button type="button" @click="category = 'Tooling'">Tooling<span>9</span></button><button type="button" @click="category = 'Data'">Data<span>7</span></button><button type="button" @click="category = 'Core'">Core<span>4</span></button><button type="button" @click="category = 'Frontend'">Frontend<span>8</span></button><button type="button" @click="category = 'Runtime'">Runtime<span>4</span></button><button type="button" @click="category = 'Native'">Native<span>2</span></button><button type="button" @click="category = 'Realtime'">Realtime<span>2</span></button></div><p>Showing <strong>{category}</strong> packages</p></section><section class="package-grid"><a class="package-card" href="/packages/ai" data-show="(category === 'All' ? true : category === 'AI') ? (query === '' ? true : 'ai ai server-side anthropic client with generation and streaming. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">AI</span><h2>@wrnexus/ai</h2><p>Server-side Anthropic client with generation and streaming.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/auth" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'auth security authentication routes, sessions, forms, guards, and account flows. '.includes(query.toLowerCase())) : false">
|
||||
@@ -24,6 +24,12 @@ page Packages {
|
||||
<a class="package-card" href="/packages/authz" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'authz security role, permission, policy, and authorization guards. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/authz</h2><p>Role, permission, policy, and authorization guards.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/benchmark" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'benchmark tooling framework benchmark scenarios and repeatable performance measurements. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/benchmark</h2><p>Framework benchmark scenarios and repeatable performance measurements.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/cache" data-show="(category === 'All' ? true : category === 'Data') ? (query === '' ? true : 'cache data memory and distributed caching with coordination and invalidation. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Data</span><h2>@wrnexus/cache</h2><p>Memory and distributed caching with coordination and invalidation.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/captcha" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'captcha security managed captcha verification, middleware, and ui integration. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/captcha</h2><p>Managed CAPTCHA verification, middleware, and UI integration.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
@@ -33,6 +39,9 @@ page Packages {
|
||||
<a class="package-card" href="/packages/compiler" data-show="(category === 'All' ? true : category === 'Core') ? (query === '' ? true : 'compiler core parser and code generators for the .wrn language. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Core</span><h2>@wrnexus/compiler</h2><p>Parser and code generators for the .wrn language.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/content" data-show="(category === 'All' ? true : category === 'Data') ? (query === '' ? true : 'content data content collections, validation, querying, and publishing workflows. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Data</span><h2>@wrnexus/content</h2><p>Content collections, validation, querying, and publishing workflows.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/core" data-show="(category === 'All' ? true : category === 'Core') ? (query === '' ? true : 'core core contexts, middleware, security, sessions, caching, jsx, and realtime. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Core</span><h2>@wrnexus/core</h2><p>Contexts, middleware, security, sessions, caching, JSX, and realtime.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
@@ -51,15 +60,30 @@ page Packages {
|
||||
<a class="package-card" href="/packages/encryption" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'encryption security hashing, hmac, authenticated encryption, and key derivation. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/encryption</h2><p>Hashing, HMAC, authenticated encryption, and key derivation.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/graphql" data-show="(category === 'All' ? true : category === 'Data') ? (query === '' ? true : 'graphql data graphql schemas, routes, and framework plugin integration. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Data</span><h2>@wrnexus/graphql</h2><p>GraphQL schemas, routes, and framework plugin integration.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/helpers" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'helpers tooling safe context url helpers and forward-auth login redirects. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/helpers</h2><p>Safe Context URL helpers and forward-auth login redirects.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/i18n" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'i18n frontend translation loading, locale resolution, and intl formatting. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/i18n</h2><p>Translation loading, locale resolution, and Intl formatting.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/identity" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'identity security portable identity records, claims, and account linking. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/identity</h2><p>Portable identity records, claims, and account linking.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/image" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'image frontend responsive image optimization, loaders, placeholders, and components. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/image</h2><p>Responsive image optimization, loaders, placeholders, and components.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/jwt" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'jwt security hs256 jwt signing, verification, and bearer authentication. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/jwt</h2><p>HS256 JWT signing, verification, and bearer authentication.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/language-server" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'language-server tooling editor-neutral language intelligence for wrn files. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/language-server</h2><p>Editor-neutral language intelligence for WRN files.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/mcp" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'mcp tooling model context protocol tools for wrnexus projects. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/mcp</h2><p>Model Context Protocol tools for WRNexus projects.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/mobile" data-show="(category === 'All' ? true : category === 'Native') ? (query === '' ? true : 'mobile native ssr-safe compatibility access to capacitor plugins. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Native</span><h2>@wrnexus/mobile</h2><p>SSR-safe compatibility access to Capacitor plugins.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
@@ -69,24 +93,42 @@ page Packages {
|
||||
<a class="package-card" href="/packages/oauth" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'oauth security oauth 2.0, pkce, provider presets, and profile mapping. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/oauth</h2><p>OAuth 2.0, PKCE, provider presets, and profile mapping.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/observability" data-show="(category === 'All' ? true : category === 'Runtime') ? (query === '' ? true : 'observability runtime structured logging, tracing, health, and integration adapters. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Runtime</span><h2>@wrnexus/observability</h2><p>Structured logging, tracing, health, and integration adapters.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/playground" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'playground tooling interactive framework examples and executable playground utilities. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/playground</h2><p>Interactive framework examples and executable playground utilities.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/plugin" data-show="(category === 'All' ? true : category === 'Core') ? (query === '' ? true : 'plugin core plugin contracts, lifecycle hooks, composition, and framework integration. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Core</span><h2>@wrnexus/plugin</h2><p>Plugin contracts, lifecycle hooks, composition, and framework integration.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/pubsub" data-show="(category === 'All' ? true : category === 'Realtime') ? (query === '' ? true : 'pubsub realtime in-process and redis-backed publish/subscribe. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Realtime</span><h2>@wrnexus/pubsub</h2><p>In-process and Redis-backed publish/subscribe.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/pwa" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'pwa frontend progressive web app manifests, service workers, and offline strategies. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/pwa</h2><p>Progressive Web App manifests, service workers, and offline strategies.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/queue" data-show="(category === 'All' ? true : category === 'Data') ? (query === '' ? true : 'queue data background jobs with delay, concurrency, retry, and repetition. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Data</span><h2>@wrnexus/queue</h2><p>Background jobs with delay, concurrency, retry, and repetition.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/reactive" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'reactive frontend small type-safe reactive signal primitives. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/reactive</h2><p>Small type-safe reactive signal primitives.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/realtime" data-show="(category === 'All' ? true : category === 'Realtime') ? (query === '' ? true : 'realtime realtime rooms, presence, messaging, history, streams, and ui components. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Realtime</span><h2>@wrnexus/realtime</h2><p>Rooms, presence, messaging, history, streams, and UI components.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/router" data-show="(category === 'All' ? true : category === 'Core') ? (query === '' ? true : 'router core filesystem discovery, route matching, and typed route generation. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Core</span><h2>@wrnexus/router</h2><p>Filesystem discovery, route matching, and typed route generation.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/security" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'security security security headers, csrf protection, rate limits, and safe rendering. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/security</h2><p>Security headers, CSRF protection, rate limits, and safe rendering.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/ssr" data-show="(category === 'All' ? true : category === 'Runtime') ? (query === '' ? true : 'ssr runtime secure html document rendering and seo metadata. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Runtime</span><h2>@wrnexus/ssr</h2><p>Secure HTML document rendering and SEO metadata.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/store" data-show="(category === 'All' ? true : category === 'Data') ? (query === '' ? true : 'store data application state stores shared across server and browser runtimes. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Data</span><h2>@wrnexus/store</h2><p>Application state stores shared across server and browser runtimes.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/styles" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'styles frontend css pipeline, themes, fonts, profiles, and application config. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/styles</h2><p>CSS pipeline, themes, fonts, profiles, and application config.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
@@ -99,6 +141,9 @@ page Packages {
|
||||
<a class="package-card" href="/packages/tracking" data-show="(category === 'All' ? true : category === 'Runtime') ? (query === '' ? true : 'tracking runtime error/event capture, middleware, filtering, and sinks. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Runtime</span><h2>@wrnexus/tracking</h2><p>Error/event capture, middleware, filtering, and sinks.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/typecheck" data-show="(category === 'All' ? true : category === 'Tooling') ? (query === '' ? true : 'typecheck tooling wrn-aware typescript diagnostics and virtual documents. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Tooling</span><h2>@wrnexus/typecheck</h2><p>WRN-aware TypeScript diagnostics and virtual documents.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
<a class="package-card" href="/packages/ui" data-show="(category === 'All' ? true : category === 'Frontend') ? (query === '' ? true : 'ui frontend themeable server-rendered ui components and css. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Frontend</span><h2>@wrnexus/ui</h2><p>Themeable server-rendered UI components and CSS.</p><span class="card-link">Open documentation →</span>
|
||||
</a>
|
||||
@@ -108,7 +153,7 @@ page Packages {
|
||||
<a class="package-card" href="/packages/validation" data-show="(category === 'All' ? true : category === 'Security') ? (query === '' ? true : 'validation security typed schemas, coercion, validation, and browser descriptors. '.includes(query.toLowerCase())) : false">
|
||||
<span class="category">Security</span><h2>@wrnexus/validation</h2><p>Typed schemas, coercion, validation, and browser descriptors.</p><span class="card-link">Open documentation →</span>
|
||||
</a></section></main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+21
-110
@@ -10,11 +10,12 @@ page wrnexusai {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ai</span></nav><section class="doc-intro"><span class="eyebrow">AI · Package reference</span><h1>@wrnexus/ai</h1><p>Server-side Anthropic client with generation and streaming.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>AI</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ai@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>A tiny, zero-dependency Claude (Anthropic) client for WRNexusJS apps — generate and stream text with Claude from any server-side code.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ai</span></nav><section class="doc-intro"><span class="eyebrow">AI · Package reference</span><h1>@wrnexus/ai</h1><p>Server-side Anthropic client with generation and streaming.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>AI</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ai@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Provider-neutral AI orchestration for OpenAI, Anthropic, Google and local OpenAI-compatible models, with streaming, structured output, tools, embeddings, vector search/RAG, conversation persistence, templates, guardrails, usage events, fallback, rate limits and evaluation reports.</p>
|
||||
<blockquote>A tiny, zero-dependency Claude (Anthropic) client for WRNexusJS apps — generate and stream text with Claude from any server-side code.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/ai</code> is a thin, dependency-free wrapper over the Anthropic <strong>Messages API</strong>, built on <code>fetch</code> (Bun-native, no SDK). Use it in API routes, jobs, or middleware to call Claude. It defaults to the most capable model, <strong><code>claude-opus-4-8</code></strong>, reads your key from <code>ANTHROPIC_API_KEY</code>, and supports both one-shot generation and streaming.</p>
|
||||
@@ -75,6 +76,21 @@ try {
|
||||
/* back off */
|
||||
}
|
||||
}</code></pre>
|
||||
<h4 id="multi-provider-client">Multi-provider client</h4>
|
||||
<p><code>createAIClient</code> adds named-provider selection and fallback, capability discovery, validated JSON output, validated tool execution, abort-aware exponential retries, and per-provider circuit breakers. Attempt events intentionally contain metadata only: prompts, credentials, and raw model responses are never passed to telemetry.</p>
|
||||
<pre data-language="ts"><code>import { anthropicProvider, createAIClient } from "@wrnexus/ai";
|
||||
|
||||
const ai = createAIClient({
|
||||
providers: [anthropicProvider()],
|
||||
retry: { attempts: 3, baseDelayMs: 100, maxDelayMs: 2_000 },
|
||||
circuitBreaker: { failureThreshold: 5, resetAfterMs: 30_000 },
|
||||
});
|
||||
|
||||
const result = await ai.generateObject<{ title: string }>("Return a JSON title", {
|
||||
validate: (value): value is { title: string } =>
|
||||
typeof value === "object" && value !== null && "title" in value,
|
||||
});</code></pre>
|
||||
<p>Providers can return normalized <code>usage</code> (<code>inputTokens</code>, <code>outputTokens</code>, <code>totalTokens</code>, and <code>costUsd</code>) and <code>toolCalls</code>. Use <code>executeTools</code> with a named, validated tool registry; unknown tools and invalid arguments are rejected before application code runs. <code>deterministicAIProvider</code> supplies ordered or computed offline responses for tests and examples without API keys or network calls.</p>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<h4 id="return-generated-json-from-an-api-route">Return generated JSON from an API route</h4>
|
||||
<pre data-language="ts"><code>// app/api/summarize.ts — summarize posted text
|
||||
@@ -109,112 +125,7 @@ export const POST = async (ctx) => {
|
||||
<li><strong>Zero dependencies</strong> — no <code>@anthropic-ai/sdk</code>; talks to the Messages API directly.</li>
|
||||
<li>Defaults to <code>claude-opus-4-8</code>. Pass <code>{ model }</code> for a different model (e.g.</li>
|
||||
<p><code>"claude-sonnet-5"</code> for speed/cost, <code>"claude-haiku-4-5"</code> for the fastest).</p>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface AIUsage {
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
totalTokens?: number;
|
||||
}
|
||||
interface AIResult<T = string> {
|
||||
value: T;
|
||||
provider: string;
|
||||
model?: string;
|
||||
usage?: AIUsage;
|
||||
finishReason?: string;
|
||||
raw?: unknown;
|
||||
}
|
||||
interface AIProvider {
|
||||
name: string;
|
||||
generate(prompt: string | Message[], options?: GenerateOptions): Promise<AIResult<string>>;
|
||||
stream?(prompt: string | Message[], options?: GenerateOptions): AsyncGenerator<string, void, unknown>;
|
||||
}
|
||||
interface AIClientOptions {
|
||||
providers: AIProvider[];
|
||||
fallback?: boolean;
|
||||
onAttempt?: (provider: string, error?: unknown) => void | Promise<void>;
|
||||
}
|
||||
interface AIClient {
|
||||
generate(prompt: string | Message[], options?: GenerateOptions & {
|
||||
provider?: string;
|
||||
}): Promise<AIResult<string>>;
|
||||
generateObject<T>(prompt: string | Message[], options?: GenerateOptions & {
|
||||
provider?: string;
|
||||
validate?: (value: unknown) => value is T;
|
||||
}): Promise<AIResult<T>>;
|
||||
stream(prompt: string | Message[], options?: GenerateOptions & {
|
||||
provider?: string;
|
||||
}): AsyncGenerator<string, void, unknown>;
|
||||
}
|
||||
declare function anthropicProvider(config?: AIConfig): AIProvider;
|
||||
declare function aiProvider(name: string, client: AI): AIProvider;
|
||||
declare function createAIClient(options: AIClientOptions): AIClient;
|
||||
|
||||
/**
|
||||
* @wrnexus/ai — a tiny, zero-dependency Claude (Anthropic) client for WRNexusJS apps.
|
||||
*
|
||||
* Use it in API routes, jobs, or anywhere server-side to generate text with Claude.
|
||||
* It talks to the Anthropic Messages API over `fetch` (no SDK dependency, Bun-native),
|
||||
* and defaults to the most capable model, `claude-opus-4-8`.
|
||||
*
|
||||
* import { createAI } from "@wrnexus/ai";
|
||||
* const ai = createAI(); // reads ANTHROPIC_API_KEY
|
||||
* const text = await ai.generate("Write a haiku about Bun.");
|
||||
*
|
||||
* Streaming (great for API routes):
|
||||
* export const POST = async (ctx) => ai.streamResponse(await ctx.req.text());
|
||||
*/
|
||||
type Role = "user" | "assistant";
|
||||
interface Message {
|
||||
role: Role;
|
||||
content: string;
|
||||
}
|
||||
/** Reasoning effort — higher means deeper thinking + more tokens. */
|
||||
type Effort = "low" | "medium" | "high" | "xhigh" | "max";
|
||||
interface AIConfig {
|
||||
/** Anthropic API key. Default: `ANTHROPIC_API_KEY` from the environment. */
|
||||
apiKey?: string;
|
||||
/** Model id. Default: `claude-opus-4-8` (the most capable Claude model). */
|
||||
model?: string;
|
||||
/** Default max output tokens. Default: 4096. */
|
||||
maxTokens?: number;
|
||||
/** API base URL. Default: `https://api.anthropic.com`. */
|
||||
baseURL?: string;
|
||||
/** `anthropic-version` header. Default: `2023-06-01`. */
|
||||
version?: string;
|
||||
}
|
||||
interface GenerateOptions {
|
||||
/** System prompt — sets the assistant's role/behavior. */
|
||||
system?: string;
|
||||
/** Override the model for this call. */
|
||||
model?: string;
|
||||
/** Override max output tokens for this call. */
|
||||
maxTokens?: number;
|
||||
/** Enable adaptive extended thinking (slower, deeper reasoning). */
|
||||
thinking?: boolean;
|
||||
/** Reasoning effort / token spend (`output_config.effort`). */
|
||||
effort?: Effort;
|
||||
/** Full message history — supersedes the `prompt` argument when provided. */
|
||||
messages?: Message[];
|
||||
/** Abort the request. */
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
/** Thrown when the API returns a non-2xx response or refuses the request. */
|
||||
declare class AIError extends Error {
|
||||
readonly status: number;
|
||||
readonly type: string;
|
||||
constructor(message: string, status?: number, type?: string);
|
||||
}
|
||||
interface AI {
|
||||
/** Generate a full text response (non-streaming). */
|
||||
generate(prompt: string | Message[], opts?: GenerateOptions): Promise<string>;
|
||||
/** Stream the response as text deltas, as they arrive. */
|
||||
stream(prompt: string | Message[], opts?: GenerateOptions): AsyncGenerator<string, void, unknown>;
|
||||
/** Stream straight to a `Response` (text/plain) — drop-in for an API route return. */
|
||||
streamResponse(prompt: string | Message[], opts?: GenerateOptions): Response;
|
||||
}
|
||||
/** Create a Claude client. Reads `ANTHROPIC_API_KEY` from the environment by default. */
|
||||
declare function createAI(config?: AIConfig): AI;
|
||||
|
||||
export { type AI, type AIClient, type AIClientOptions, type AIConfig, AIError, type AIProvider, type AIResult, type AIUsage, type Effort, type GenerateOptions, type Message, type Role, aiProvider, anthropicProvider, createAI, createAIClient };
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { A as AI, a as AIAttemptEvent, b as AICircuitBreakerOptions, c as AIClient, d as AIClientOptions, e as AIConfig, f as AIError, AIGuardrail, g as AIProvider, h as AIProviderCapabilities, i as AIResult, j as AIRetryOptions, k as AITool, l as AIToolCall, m as AIUsage, ConversationStore, D as DeterministicAIProviderOptions, E as Effort, EmbeddingProvider, G as GenerateOptions, HttpAIProviderOptions, M as Message, R as Role, VectorMatch, VectorRecord, VectorStore, n as aiProvider, aiRateLimiter, o as anthropicProvider, p as createAI, q as createAIClient, createRagPipeline, r as deterministicAIProvider, evaluateAI, googleAIProvider, guardedProvider, localAIProvider, maxPromptLength, memoryConversationStore, memoryVectorStore, openAIEmbeddings, openAIProvider, promptTemplate } from './platform.js';
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Return generated JSON from an API route</h3><pre data-language="ts"><code>// app/api/summarize.ts — summarize posted text
|
||||
import { createAI } from "@wrnexus/ai";
|
||||
const ai = createAI();
|
||||
@@ -238,9 +149,9 @@ export const POST = async (ctx) => {
|
||||
maxTokens: 1_500,
|
||||
});
|
||||
};</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createai-config">createAI(config?)</a><a class="toc-level-4" href="#ai-generate-prompt-opts-promise-string">ai.generate(prompt, opts?): Promise<string></a><a class="toc-level-4" href="#ai-stream-prompt-opts-asyncgenerator-string">ai.stream(prompt, opts?): AsyncGenerator<string></a><a class="toc-level-4" href="#ai-streamresponse-prompt-opts-response">ai.streamResponse(prompt, opts?): Response</a><a class="toc-level-4" href="#generateoptions">GenerateOptions</a><a class="toc-level-4" href="#aierror">AIError</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#return-generated-json-from-an-api-route">Return generated JSON from an API route</a><a class="toc-level-4" href="#stream-a-chat-response-to-the-browser">Stream a chat response to the browser</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createai-config">createAI(config?)</a><a class="toc-level-4" href="#ai-generate-prompt-opts-promise-string">ai.generate(prompt, opts?): Promise<string></a><a class="toc-level-4" href="#ai-stream-prompt-opts-asyncgenerator-string">ai.stream(prompt, opts?): AsyncGenerator<string></a><a class="toc-level-4" href="#ai-streamresponse-prompt-opts-response">ai.streamResponse(prompt, opts?): Response</a><a class="toc-level-4" href="#generateoptions">GenerateOptions</a><a class="toc-level-4" href="#aierror">AIError</a><a class="toc-level-4" href="#multi-provider-client">Multi-provider client</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#return-generated-json-from-an-api-route">Return generated JSON from an API route</a><a class="toc-level-4" href="#stream-a-chat-response-to-the-browser">Stream a chat response to the browser</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+36
-10
@@ -10,11 +10,11 @@ page wrnexusauth {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/auth</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/auth</h1><p>Authentication routes, sessions, forms, guards, and account flows.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/auth@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Framework-native authentication, identity, account-security, and session management for WRNexusJS.</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/auth</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/auth</h1><p>Authentication routes, sessions, forms, guards, and account flows.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/auth@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Framework-native authentication, identity, account-security, and session management for WRNexusJS.</p>
|
||||
<h3 id="capabilities">Capabilities</h3>
|
||||
<ul>
|
||||
<li>Password registration, login, recovery, reset, and authenticated password changes</li>
|
||||
@@ -271,19 +271,29 @@ const auth = createAuthEngine({
|
||||
<h3 id="development">Development</h3>
|
||||
<pre data-language="bash"><code>bun run auth:dev
|
||||
bun run validate:auth</code></pre>
|
||||
<p>Read [SECURITY.md](./SECURITY.md) before production deployment.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { A as AuthEngine, c as createAuthEngine, i as inferIdentityType, n as normalizeEmail, a as normalizeIdentity, b as normalizePhone, d as normalizeUsername, p as publicUser, s as safeAuthReturnTo } from './engine-ZXtjHSyW.js';
|
||||
import { n as AuthRiskSignals, l as AuthRiskDecision } from './types-CbJKeaWh.js';
|
||||
export { A as AuthAccountStatus, a as AuthClock, b as AuthDeliveryMessage, c as AuthDeliveryProvider, d as AuthEngineOptions, e as AuthIdentity, f as AuthIdentityType, g as AuthImpersonationDecision, h as AuthMfaMethod, i as AuthPublicUser, j as AuthRandom, k as AuthResult, m as AuthRiskLevel, o as AuthSecretProtector, p as AuthSecurityEvent, q as AuthSession, r as AuthSessionVerificationHandler, s as AuthSignedInHandler, t as AuthSignedOutHandler, N as AuthStore, u as AuthSuccessfulSignUpAction, v as AuthSuccessfulSignUpHandler, w as AuthTokenPurpose, x as AuthTokenUrlInput, y as AuthUser, z as AuthenticatedContext, L as LoginAttempt, B as LoginInput, Q as MemoryPasskeyChallengeStore, O as OAuthAccount, C as OneTimeToken, D as OtpChallenge, P as PasskeyAuthenticationOptions, S as PasskeyChallengeKind, U as PasskeyChallengeRecord, V as PasskeyChallengeStore, E as PasskeyCredential, F as PasskeyProvider, G as PasskeyRegistrationOptions, H as PasskeyVerificationResult, I as PasswordBreachProvider, J as PasswordCredential, R as RecoveryCodeRecord, K as RegisterInput, T as TotpCredential, M as TrustedDevice, W as assertPasskeyProvider } from './types-CbJKeaWh.js';
|
||||
<p>Read [SECURITY.md](./SECURITY.md) before production deployment.</p>
|
||||
<h3 id="package-owned-ui-blocks-and-route-helpers">Package-owned UI blocks and route helpers</h3>
|
||||
<p>Authentication forms continue to compose <code>@wrnexus/ui</code> inputs, buttons, cards, alerts, badges, avatars, and PIN controls. The package also provides:</p>
|
||||
<ul>
|
||||
<li><code><AuthShell /></code></li>
|
||||
<li><code><AuthProviderButtons /></code></li>
|
||||
<li><code><AuthSecurityNotice /></code></li>
|
||||
<li>complete sign-in, sign-up, MFA, passkey, recovery, account-status, session, and impersonation blocks</li>
|
||||
</ul>
|
||||
<p>Server helpers include <code>authRoute</code>, <code>authSuccess</code>, <code>authFailure</code>, <code>requireAuthUser</code>, <code>optionalAuthUser</code>, <code>currentAuthSession</code>, and <code>authComponentProps</code>.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { A as AuthEngine } from './engine-BDu0-aZp.js';
|
||||
export { c as createAuthEngine, i as inferIdentityType, n as normalizeEmail, a as normalizeIdentity, b as normalizePhone, d as normalizeUsername, p as publicUser, s as safeAuthReturnTo } from './engine-BDu0-aZp.js';
|
||||
import { o as AuthRiskSignals, m as AuthRiskDecision, s as AuthSession, B as AuthUser } from './types-BhwPi3qr.js';
|
||||
export { A as AUTH_SECURITY_EVENT_TYPES, a as AuthAccountStatus, b as AuthClock, c as AuthDeliveryMessage, d as AuthDeliveryProvider, e as AuthEngineOptions, f as AuthIdentity, g as AuthIdentityType, h as AuthImpersonationDecision, i as AuthMfaMethod, j as AuthPublicUser, k as AuthRandom, l as AuthResult, n as AuthRiskLevel, p as AuthSecretProtector, q as AuthSecurityEvent, r as AuthSecurityEventType, t as AuthSessionVerificationHandler, u as AuthSignedInHandler, v as AuthSignedOutHandler, U as AuthStore, w as AuthSuccessfulSignUpAction, x as AuthSuccessfulSignUpHandler, y as AuthTokenPurpose, z as AuthTokenUrlInput, C as AuthenticatedContext, K as KnownAuthSecurityEventType, L as LoginAttempt, D as LoginInput, V as MemoryPasskeyChallengeStore, O as OAuthAccount, E as OneTimeToken, F as OtpChallenge, P as PasskeyAuthenticationOptions, W as PasskeyChallengeKind, X as PasskeyChallengeRecord, Y as PasskeyChallengeStore, G as PasskeyCredential, H as PasskeyProvider, I as PasskeyRegistrationOptions, J as PasskeyVerificationResult, M as PasswordBreachProvider, N as PasswordCredential, R as RecoveryCodeRecord, Q as RegisterInput, T as TotpCredential, S as TrustedDevice, Z as assertPasskeyProvider } from './types-BhwPi3qr.js';
|
||||
export { MemoryAuthStore } from './stores/memory.js';
|
||||
export { SqlAuthStore } from './stores/sql.js';
|
||||
export { AUTH_SESSION_KEY, authSession, clearAuthSession, establishAuthSession, getAuthSession, getAuthUser, isAuthenticatedContext, requireAuth } from './middleware.js';
|
||||
export { A as AuthHttpOptions, a as AuthPasskeyHttpOptions, b as AuthSchemaOverrides, c as AuthSchemaSet, d as authBrowserSchemaDescriptors, e as authBrowserSchemaMap, f as authSchemas, g as authenticatorConfirmSchema, h as authenticatorDisableSchema, i as authenticatorSetupSchema, j as changePasswordSchema, k as createAuthHttpHandlers, l as emptyActionSchema, m as impersonationStartSchema, n as invitationAcceptSchema, o as loginSchema, p as magicLinkConsumeSchema, q as magicLinkRequestSchema, r as mfaOtpRequestSchema, s as mfaSchema, t as otpIssueSchema, u as otpLoginCompleteSchema, v as otpLoginRequestSchema, w as otpSchema, x as passkeyAuthenticationOptionsSchema, y as passkeyAuthenticationVerifySchema, z as passkeyRegistrationOptionsSchema, B as passkeyRegistrationVerifySchema, C as passwordResetRequestSchema, D as passwordResetSchema, E as recoveryCodesSchema, F as registerSchema, G as resolveAuthSchemas, H as sessionRevokeSchema, I as signUpSchema, J as verificationRequestSchema, K as verificationTokenSchema } from './index-DS1geh2P.js';
|
||||
export { A as AuthHttpOptions, a as AuthPasskeyHttpOptions, b as AuthSchemaOverrides, c as AuthSchemaSet, d as authBrowserSchemaDescriptors, e as authBrowserSchemaMap, f as authSchemas, g as authenticatorConfirmSchema, h as authenticatorDisableSchema, i as authenticatorSetupSchema, j as changePasswordSchema, k as createAuthHttpHandlers, l as emptyActionSchema, m as impersonationStartSchema, n as invitationAcceptSchema, o as loginSchema, p as magicLinkConsumeSchema, q as magicLinkRequestSchema, r as mfaOtpRequestSchema, s as mfaSchema, t as otpIssueSchema, u as otpLoginCompleteSchema, v as otpLoginRequestSchema, w as otpSchema, x as passkeyAuthenticationOptionsSchema, y as passkeyAuthenticationVerifySchema, z as passkeyRegistrationOptionsSchema, B as passkeyRegistrationVerifySchema, C as passwordResetRequestSchema, D as passwordResetSchema, E as recoveryCodesSchema, F as registerSchema, G as resolveAuthSchemas, H as sessionRevokeSchema, I as signUpSchema, J as verificationRequestSchema, K as verificationTokenSchema } from './index-B4uaD0Z3.js';
|
||||
export { AuthAuditIssue, AuthConfig, AuthPluginOptions, AuthRoutesConfig, authComponentsDir, authPlugin } from './plugin.js';
|
||||
export { DefaultAuthRouteOptions, clearDefaultAuthEngine, getDefaultAuthEngine, getDefaultAuthRouteOptions, getDefaultAuthSchemas, hasDefaultAuthEngine, setDefaultAuthEngine, setDefaultAuthRouteOptions, setDefaultAuthSchemas, tryGetDefaultAuthEngine } from './runtime.js';
|
||||
export { createAuthSecretProtector } from './protector.js';
|
||||
export { decodeBase32, encodeBase32, generateTotp, generateTotpSecret, totpUri, verifyTotp } from './totp/index.js';
|
||||
import { Context } from '@wrnexus/core';
|
||||
import '@wrnexus/oauth';
|
||||
import '@wrnexus/core';
|
||||
import '@wrnexus/db';
|
||||
import '@wrnexus/validation';
|
||||
import '@wrnexus/plugin';
|
||||
@@ -296,7 +306,23 @@ interface RiskPolicy {
|
||||
}
|
||||
declare function evaluateAuthRisk(signals?: AuthRiskSignals, policy?: RiskPolicy): AuthRiskDecision;
|
||||
|
||||
export { AuthRiskDecision, AuthRiskSignals, type RiskPolicy, evaluateAuthRisk };
|
||||
type AuthRouteName = "signIn" | "signUp" | "signOut" | "forgotPassword" | "resetPassword" | "verifyEmail" | "verifyPhone" | "twoFactor" | "sessions" | "passkeys";
|
||||
declare function authRoute(name: AuthRouteName, options?: {
|
||||
basePath?: string;
|
||||
overrides?: Partial<Record<AuthRouteName, string>>;
|
||||
}): string;
|
||||
declare function authSuccess<T extends Record<string, unknown>>(data: T, init?: ResponseInit): Response;
|
||||
declare function authFailure(code: string, message: string, status?: number, details?: Record<string, unknown>): Response;
|
||||
declare function requireAuthUser(ctx: Context): AuthUser;
|
||||
declare function optionalAuthUser(ctx: Context): AuthUser | null;
|
||||
declare function currentAuthSession(engine: AuthEngine, sessionId: string | undefined): Promise<AuthSession | null>;
|
||||
declare function authComponentProps(input: Record<string, unknown>, defaults?: {
|
||||
color?: string;
|
||||
size?: string;
|
||||
class?: string;
|
||||
}): Record<string, unknown>;
|
||||
|
||||
export { AuthEngine, AuthRiskDecision, AuthRiskSignals, type AuthRouteName, AuthSession, AuthUser, type RiskPolicy, authComponentProps, authFailure, authRoute, authSuccess, currentAuthSession, evaluateAuthRisk, optionalAuthUser, requireAuthUser };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>## Install</h3><pre data-language="bash"><code>bun add @wrnexus/auth</code></pre></article><article class="example-card"><h3>Create the engine</h3><pre data-language="ts"><code>// app/lib/auth.ts
|
||||
import { createAuthEngine, MemoryAuthStore } from "@wrnexus/auth";
|
||||
|
||||
@@ -358,9 +384,9 @@ export const auth = createAuthEngine({
|
||||
migrations: true,
|
||||
},
|
||||
};</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#capabilities">Capabilities</a><a class="toc-level-3" href="#install">Install</a><a class="toc-level-3" href="#default-configuration">Default configuration</a><a class="toc-level-4" href="#successful-signup-behavior">Successful signup behavior</a><a class="toc-level-3" href="#sql-production-configuration">SQL production configuration</a><a class="toc-level-3" href="#delivered-action-urls">Delivered action URLs</a><a class="toc-level-3" href="#built-in-validation">Built-in validation</a><a class="toc-level-3" href="#route-controls">Route controls</a><a class="toc-level-3" href="#package-endpoints">Package endpoints</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-3" href="#captcha-and-risk">CAPTCHA and risk</a><a class="toc-level-3" href="#mfa">MFA</a><a class="toc-level-3" href="#passkeys">Passkeys</a><a class="toc-level-3" href="#protect-long-lived-secrets">Protect long-lived secrets</a><a class="toc-level-3" href="#custom-http-integration">Custom HTTP integration</a><a class="toc-level-3" href="#development">Development</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#capabilities">Capabilities</a><a class="toc-level-3" href="#install">Install</a><a class="toc-level-3" href="#default-configuration">Default configuration</a><a class="toc-level-4" href="#successful-signup-behavior">Successful signup behavior</a><a class="toc-level-3" href="#sql-production-configuration">SQL production configuration</a><a class="toc-level-3" href="#delivered-action-urls">Delivered action URLs</a><a class="toc-level-3" href="#built-in-validation">Built-in validation</a><a class="toc-level-3" href="#route-controls">Route controls</a><a class="toc-level-3" href="#package-endpoints">Package endpoints</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-3" href="#captcha-and-risk">CAPTCHA and risk</a><a class="toc-level-3" href="#mfa">MFA</a><a class="toc-level-3" href="#passkeys">Passkeys</a><a class="toc-level-3" href="#protect-long-lived-secrets">Protect long-lived secrets</a><a class="toc-level-3" href="#custom-http-integration">Custom HTTP integration</a><a class="toc-level-3" href="#development">Development</a><a class="toc-level-3" href="#package-owned-ui-blocks-and-route-helpers">Package-owned UI blocks and route helpers</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusauthz {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/authz</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/authz</h1><p>Role, permission, policy, and authorization guards.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/authz@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Composable authorization for WRNexusJS — role-based (RBAC), policy-based (PBAC), and attribute-based (ABAC) access control that reduces to a boolean check plus an <code>authorize()</code> guard.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/authz</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/authz</h1><p>Role, permission, policy, and authorization guards.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/authz@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Composable authorization for WRNexusJS — role-based (RBAC), policy-based (PBAC), and attribute-based (ABAC) access control that reduces to a boolean check plus an <code>authorize()</code> guard.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/authz</code> is a small, server-side authorization toolkit. It gives you three interchangeable models — RBAC (roles → permissions), PBAC (policy predicates), and ABAC (attribute matchers) — that all collapse to a <code>boolean | Promise<boolean></code> decision. Wrap any decision in a <code>Middleware</code> guard (<code>authorize</code>, <code>requireRole</code>, <code>requirePermission</code>) to protect WRNexusJS routes. Reach for it whenever a route or action needs to be gated on who the user is, what roles they hold, or attributes of the user and the resource. It plugs into <code>@wrnexus/core</code> by reading <code>ctx.user</code> as the authorization subject.</p>
|
||||
@@ -242,7 +242,7 @@ app.put(
|
||||
);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#types">Types</a><a class="toc-level-4" href="#rbac">RBAC</a><a class="toc-level-4" href="#definerbac-roles-record-string-string-rbac">defineRbac(roles: Record<string, string[]>): Rbac</a><a class="toc-level-4" href="#hasrole-subject-subject-undefined-required-string-boolean">hasRole(subject: Subject | undefined, ...required: string[]): boolean</a><a class="toc-level-4" href="#pbac-abac-combinators">PBAC / ABAC combinators</a><a class="toc-level-4" href="#guards-middleware">Guards (middleware)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#rbac-2">RBAC</a><a class="toc-level-4" href="#guarding-routes">Guarding routes</a><a class="toc-level-4" href="#pbac-abac-policies">PBAC / ABAC policies</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
page wrnexusbenchmark {
|
||||
seo {
|
||||
title = "@wrnexus/benchmark"
|
||||
description = "Framework benchmark scenarios and repeatable performance measurements."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/benchmark</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/benchmark</h1><p>Framework benchmark scenarios and repeatable performance measurements.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/benchmark@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Deterministic benchmark execution, percentiles, baseline comparisons, and regression budgets for builds, SSR, hydration, stores, and application hot paths.</p>
|
||||
<pre data-language="ts"><code>import { runBenchmark, assertBenchmarkBudget } from "@wrnexus/benchmark";
|
||||
const result = await runBenchmark("render", render, { iterations: 100 });
|
||||
assertBenchmarkBudget(result, baseline, { p95Percent: 5 });</code></pre></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface BenchmarkOptions {
|
||||
iterations?: number;
|
||||
warmup?: number;
|
||||
clock?: () => number;
|
||||
setup?: () => void | Promise<void>;
|
||||
teardown?: () => void | Promise<void>;
|
||||
}
|
||||
interface BenchmarkResult {
|
||||
name: string;
|
||||
iterations: number;
|
||||
totalMs: number;
|
||||
meanMs: number;
|
||||
minMs: number;
|
||||
maxMs: number;
|
||||
p50Ms: number;
|
||||
p95Ms: number;
|
||||
p99Ms: number;
|
||||
operationsPerSecond: number;
|
||||
samples: number[];
|
||||
}
|
||||
interface RegressionBudget {
|
||||
meanPercent?: number;
|
||||
p95Percent?: number;
|
||||
maxAbsoluteMs?: number;
|
||||
minOperationsPerSecond?: number;
|
||||
}
|
||||
interface RegressionViolation {
|
||||
metric: "meanMs" | "p95Ms" | "maxMs" | "operationsPerSecond";
|
||||
baseline?: number;
|
||||
current: number;
|
||||
limit: number;
|
||||
message: string;
|
||||
}
|
||||
declare function percentile(values: readonly number[], quantile: number): number;
|
||||
declare function runBenchmark(name: string, operation: () => void | Promise<void>, options?: BenchmarkOptions): Promise<BenchmarkResult>;
|
||||
declare function compareBenchmark(current: BenchmarkResult, baseline: BenchmarkResult | undefined, budget?: RegressionBudget): RegressionViolation[];
|
||||
declare function assertBenchmarkBudget(current: BenchmarkResult, baseline: BenchmarkResult | undefined, budget: RegressionBudget): void;
|
||||
|
||||
export { type BenchmarkOptions, type BenchmarkResult, type RegressionBudget, type RegressionViolation, assertBenchmarkBudget, compareBenchmark, percentile, runBenchmark };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Deterministic benchmark execution, percentiles, baseline comparisons, and regression budgets for builds, SSR, hydration, stores, and application hot paths.</h3><pre data-language="ts"><code>import { runBenchmark, assertBenchmarkBudget } from "@wrnexus/benchmark";
|
||||
const result = await runBenchmark("render", render, { iterations: 100 });
|
||||
assertBenchmarkBudget(result, baseline, { p95Percent: 5 });</code></pre></article><article class="example-card"><h3>Install @wrnexus/benchmark</h3><pre data-language="sh"><code>bun add @wrnexus/benchmark</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
page wrnexuscache {
|
||||
seo {
|
||||
title = "@wrnexus/cache"
|
||||
description = "Memory and distributed caching with coordination and invalidation."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/cache</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/cache</h1><p>Memory and distributed caching with coordination and invalidation.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/cache@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Bounded in-memory/tag caching and HTTP response caching for WRNexusJS. Supports request deduplication, tag invalidation, ETags, fresh/stale states, and optional detached stale revalidation.</p>
|
||||
<pre data-language="ts"><code>import { connectCacheInvalidation, TagCache, responseCache } from "@wrnexus/cache";
|
||||
const cache = new TagCache({ ttlMs: 60_000, staleWhileRevalidateMs: 300_000 });
|
||||
export default responseCache({ cache, tags: ["products"] });</code></pre>
|
||||
<p><code>TagCache</code> bounds entries with LRU-style eviction, deduplicates concurrent loaders, and prevents an invalidated in-flight loader from repopulating stale data. Use <code>lookup()</code> when fresh/stale state matters, or <code>getOrLoad()</code> for stampede-safe loading.</p>
|
||||
<p>For multi-instance applications, connect the cache to any compatible pub/sub bus (including <code>@wrnexus/pubsub</code>). Namespaces isolate applications sharing the same broker. Local invalidation happens first and the returned promise confirms cross-instance publication; failures remain visible to the caller.</p>
|
||||
<pre data-language="ts"><code>import { connectCacheInvalidation, TagCache } from "@wrnexus/cache";
|
||||
import { createPubSub } from "@wrnexus/pubsub";
|
||||
import { redisDriver } from "@wrnexus/pubsub/redis";
|
||||
|
||||
const cache = new TagCache({ maxEntries: 10_000 });
|
||||
const bus = createPubSub(redisDriver(process.env.REDIS_URL));
|
||||
const invalidation = connectCacheInvalidation(cache, bus, {
|
||||
namespace: "storefront-production",
|
||||
onError: (error) => logger.error("cache invalidation failed", { error }),
|
||||
});
|
||||
|
||||
await invalidation.invalidateTag("products");
|
||||
await invalidation.delete("product:42");
|
||||
|
||||
// Unsubscribes this cache only; the shared bus remains owned by the app.
|
||||
invalidation.close();
|
||||
await bus.close();</code></pre>
|
||||
<h3 id="framework-cache-layers">Framework cache layers</h3>
|
||||
<p><code>CacheCoordinator</code> keeps the four cache lifetimes explicit:</p>
|
||||
<ul>
|
||||
<li><code>coordinator.request()</code> creates request-only deduplication.</li>
|
||||
<li><code>coordinator.data</code> caches loader/query results.</li>
|
||||
<li><code>coordinator.component</code> caches reusable rendered fragments.</li>
|
||||
<li><code>coordinator.page</code> caches complete safe documents.</li>
|
||||
</ul>
|
||||
<p>All cross-request layers are bounded, tag-aware, stale-while-revalidate capable, stampede-safe, and expose <code>withLock()</code> for exclusive per-key work. <code>inspect()</code> returns metadata without cached values. Development applications expose that inspection through the Cache panel and <code>GET /__wrnexus/cache</code>.</p>
|
||||
<p>Pages and components can opt in declaratively:</p>
|
||||
<pre data-language="wrn"><code>cache {
|
||||
scope = "page"
|
||||
strategy = "stale-while-revalidate"
|
||||
ttl = "5m"
|
||||
stale = "10m"
|
||||
tags = ["catalog", "marketing"]
|
||||
vary = ["tenant", "language"]
|
||||
}</code></pre>
|
||||
<p>Omit <code>scope</code> to cache named loader data. Use <code>scope = "page"</code> for full-page caching. Component policies cache their rendered fragment. Authenticated user and tenant identities are always included automatically; page caches also vary by language, theme, and accent. Add header names or <code>cookie:name</code> entries for other application-specific variation. Pages containing CSRF forms are never stored in the full-page cache.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Context, Middleware } from '@wrnexus/core';
|
||||
|
||||
interface CacheEntry<V> {
|
||||
value: V;
|
||||
createdAt: number;
|
||||
expiresAt: number;
|
||||
staleUntil: number;
|
||||
tags: string[];
|
||||
}
|
||||
type CacheLookup<V> = {
|
||||
state: "miss";
|
||||
} | {
|
||||
state: "fresh" | "stale";
|
||||
entry: CacheEntry<V>;
|
||||
};
|
||||
interface CacheSetOptions {
|
||||
ttlMs?: number;
|
||||
staleWhileRevalidateMs?: number;
|
||||
tags?: string[];
|
||||
}
|
||||
interface TagCacheOptions {
|
||||
ttlMs?: number;
|
||||
staleWhileRevalidateMs?: number;
|
||||
maxEntries?: number;
|
||||
clock?: () => number;
|
||||
onEvent?: (event: CacheEvent) => void;
|
||||
}
|
||||
interface CacheEvent {
|
||||
operation: "hit" | "stale" | "miss" | "set" | "delete" | "invalidate" | "clear" | "load";
|
||||
key?: string;
|
||||
tags?: string[];
|
||||
at: number;
|
||||
}
|
||||
interface CacheSnapshotEntry {
|
||||
key: string;
|
||||
state: "fresh" | "stale";
|
||||
createdAt: number;
|
||||
expiresAt: number;
|
||||
staleUntil: number;
|
||||
tags: string[];
|
||||
}
|
||||
declare class TagCache<V = unknown> {
|
||||
private entries;
|
||||
private tagIndex;
|
||||
private pending;
|
||||
private locks;
|
||||
private revisions;
|
||||
private readonly ttlMs;
|
||||
private readonly staleMs;
|
||||
private readonly maxEntries;
|
||||
private readonly clock;
|
||||
private readonly onEvent?;
|
||||
constructor(options?: TagCacheOptions);
|
||||
private emit;
|
||||
lookup(key: string): CacheLookup<V>;
|
||||
get(key: string): V | undefined;
|
||||
set(key: string, value: V, options?: CacheSetOptions): void;
|
||||
private store;
|
||||
getOrLoad(key: string, loader: () => V | Promise<V>, options?: CacheSetOptions): Promise<V>;
|
||||
/** Serialize arbitrary cache-adjacent work for a key without storing its result. */
|
||||
withLock<T>(key: string, task: () => T | Promise<T>): Promise<T>;
|
||||
delete(key: string): boolean;
|
||||
private removeEntry;
|
||||
invalidateTag(tag: string): number;
|
||||
invalidateTags(tags: Iterable<string>): number;
|
||||
clear(): void;
|
||||
get size(): number;
|
||||
snapshot(): CacheSnapshotEntry[];
|
||||
private revision;
|
||||
private bump;
|
||||
}
|
||||
|
||||
type CacheLayerName = "data" | "component" | "page";
|
||||
interface CacheInspection {
|
||||
layers: Record<CacheLayerName, ReturnType<TagCache<unknown>["snapshot"]>>;
|
||||
recentEvents: Array<CacheEvent & {
|
||||
layer: CacheLayerName;
|
||||
}>;
|
||||
}
|
||||
interface CacheCoordinatorOptions extends Omit<TagCacheOptions, "onEvent"> {
|
||||
eventLimit?: number;
|
||||
onEvent?: (event: CacheEvent & {
|
||||
layer: CacheLayerName;
|
||||
}) => void;
|
||||
}
|
||||
/** A request-lifetime cache: deduplicates work without leaking values between requests. */
|
||||
declare class RequestCache {
|
||||
private pending;
|
||||
getOrLoad<V>(key: string, loader: () => V | Promise<V>): Promise<V>;
|
||||
clear(): void;
|
||||
}
|
||||
/** Owns the three cross-request cache layers and creates isolated request caches. */
|
||||
declare class CacheCoordinator {
|
||||
readonly data: TagCache<unknown>;
|
||||
readonly component: TagCache<unknown>;
|
||||
readonly page: TagCache<unknown>;
|
||||
private readonly events;
|
||||
private readonly eventLimit;
|
||||
constructor(options?: CacheCoordinatorOptions);
|
||||
request(): RequestCache;
|
||||
layer(name: CacheLayerName): TagCache<unknown>;
|
||||
getOrLoad<V>(layer: CacheLayerName, key: string, loader: () => V | Promise<V>, options?: CacheSetOptions): Promise<V>;
|
||||
invalidateTags(tags: Iterable<string>): number;
|
||||
inspect(): CacheInspection;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
interface CachedResponse {
|
||||
status: number;
|
||||
statusText: string;
|
||||
headers: [string, string][];
|
||||
body: Uint8Array;
|
||||
etag: string;
|
||||
}
|
||||
interface ResponseCacheOptions extends CacheSetOptions {
|
||||
cache?: TagCache<CachedResponse>;
|
||||
key?: (ctx: Context) => string;
|
||||
vary?: string[];
|
||||
shouldCache?: (ctx: Context, response: Response) => boolean;
|
||||
/**
|
||||
* Optional detached revalidator used for stale-while-revalidate. Middleware
|
||||
* `next()` is deliberately never called after a response has been returned,
|
||||
* because many middleware pipelines are single-use.
|
||||
*/
|
||||
revalidate?: (ctx: Context) => Promise<Response>;
|
||||
onRevalidateError?: (error: unknown, ctx: Context) => void;
|
||||
}
|
||||
declare function responseCache(options?: ResponseCacheOptions): Middleware;
|
||||
|
||||
interface CacheInvalidationBus {
|
||||
publish(topic: string, message: unknown): void | Promise<void>;
|
||||
subscribe(pattern: string, handler: (message: unknown) => void | Promise<void>): () => void;
|
||||
}
|
||||
interface DistributedInvalidationOptions {
|
||||
namespace?: string;
|
||||
instanceId?: string;
|
||||
onError?: (error: unknown) => void;
|
||||
}
|
||||
interface DistributedInvalidation {
|
||||
invalidateTag(tag: string): Promise<number>;
|
||||
invalidateTags(tags: Iterable<string>): Promise<number>;
|
||||
delete(key: string): Promise<boolean>;
|
||||
clear(): Promise<void>;
|
||||
close(): void;
|
||||
}
|
||||
/**
|
||||
* Propagate cache invalidations over any structurally compatible pub/sub bus.
|
||||
* The bus is intentionally not closed because applications commonly share it.
|
||||
*/
|
||||
declare function connectCacheInvalidation<V>(cache: TagCache<V>, bus: CacheInvalidationBus, options?: DistributedInvalidationOptions): DistributedInvalidation;
|
||||
|
||||
export { CacheCoordinator, type CacheCoordinatorOptions, type CacheEntry, type CacheEvent, type CacheInspection, type CacheInvalidationBus, type CacheLayerName, type CacheLookup, type CacheSetOptions, type CacheSnapshotEntry, type CachedResponse, type DistributedInvalidation, type DistributedInvalidationOptions, RequestCache, type ResponseCacheOptions, TagCache, type TagCacheOptions, connectCacheInvalidation, responseCache };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Bounded in-memory/tag caching and HTTP response caching for WRNexusJS. Supports request deduplication, tag invalidation, ETags, fresh/stale states, and optional detached stale revalidation.</h3><pre data-language="ts"><code>import { connectCacheInvalidation, TagCache, responseCache } from "@wrnexus/cache";
|
||||
const cache = new TagCache({ ttlMs: 60_000, staleWhileRevalidateMs: 300_000 });
|
||||
export default responseCache({ cache, tags: ["products"] });</code></pre></article><article class="example-card"><h3>cross-instance publication; failures remain visible to the caller.</h3><pre data-language="ts"><code>import { connectCacheInvalidation, TagCache } from "@wrnexus/cache";
|
||||
import { createPubSub } from "@wrnexus/pubsub";
|
||||
import { redisDriver } from "@wrnexus/pubsub/redis";
|
||||
|
||||
const cache = new TagCache({ maxEntries: 10_000 });
|
||||
const bus = createPubSub(redisDriver(process.env.REDIS_URL));
|
||||
const invalidation = connectCacheInvalidation(cache, bus, {
|
||||
namespace: "storefront-production",
|
||||
onError: (error) => logger.error("cache invalidation failed", { error }),
|
||||
});
|
||||
|
||||
await invalidation.invalidateTag("products");
|
||||
await invalidation.delete("product:42");
|
||||
|
||||
// Unsubscribes this cache only; the shared bus remains owned by the app.
|
||||
invalidation.close();
|
||||
await bus.close();</code></pre></article><article class="example-card"><h3>Pages and components can opt in declaratively</h3><pre data-language="wrn"><code>cache {
|
||||
scope = "page"
|
||||
strategy = "stale-while-revalidate"
|
||||
ttl = "5m"
|
||||
stale = "10m"
|
||||
tags = ["catalog", "marketing"]
|
||||
vary = ["tenant", "language"]
|
||||
}</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#framework-cache-layers">Framework cache layers</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexuscaptcha {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/captcha</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/captcha</h1><p>Managed CAPTCHA verification, middleware, and UI integration.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/captcha@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>A first-class CAPTCHA and anti-automation package for WRNexusJS. It supports self-hosted challenges, a managed WRNexus service, external providers, form submission guards, page gates, accessible audio, adaptive risk checks, and a Tailwind-only <code>.wrn</code> component.</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/captcha</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/captcha</h1><p>Managed CAPTCHA verification, middleware, and UI integration.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/captcha@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>A first-class CAPTCHA and anti-automation package for WRNexusJS. It supports self-hosted challenges, a managed WRNexus service, external providers, form submission guards, page gates, accessible audio, adaptive risk checks, and a Tailwind-only <code>.wrn</code> component.</p>
|
||||
<h3 id="install">Install</h3>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/captcha</code></pre>
|
||||
<p>WRNexusJS automatically discovers the package plugin, component, client runtime, styles, and DevToolbar audit. Use <code><Captcha /></code> directly after installation. The browser runtime is injected once only on responses that render a CAPTCHA; no script tag, public-file copy, or manual plugin registration is required. Call <code>captchaPlugin(options)</code> explicitly only when an application needs to override the discovered package configuration.</p>
|
||||
@@ -253,7 +253,16 @@ const wordChallenge = defineCaptchaGenerator({
|
||||
});
|
||||
|
||||
const engine = createCaptchaEngine({ secret, generators: [wordChallenge] });</code></pre>
|
||||
<p>Applications may also implement <code>CaptchaStore</code>, <code>CaptchaAudioRenderer</code>, or use <code>defineCaptchaProvider()</code> for a completely custom service.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { CaptchaAudioRenderer, CaptchaBinding, CaptchaChallenge, CaptchaChallengeGenerator, CaptchaChallengeRecord, CaptchaChallengeType, CaptchaConcreteImageStyle, CaptchaDifficulty, CaptchaEngine, CaptchaEngineOptions, CaptchaFailureCode, CaptchaGeneratorContext, CaptchaGuardOptions, CaptchaHttpHandlers, CaptchaImageItem, CaptchaImageStyle, CaptchaMiddleware, CaptchaPageGateOptions, CaptchaPolicyMode, CaptchaPolicyOptions, CaptchaPresentation, CaptchaProvider, CaptchaProviderClientConfig, CaptchaProviderName, CaptchaResponseTokenRecord, CaptchaRiskResult, CaptchaRiskSignals, CaptchaStore, CaptchaVerificationResult, CreateCaptchaOptions, GeneratedCaptchaChallenge, VerifyCaptchaInput } from './types.js';
|
||||
<p>Applications may also implement <code>CaptchaStore</code>, <code>CaptchaAudioRenderer</code>, or use <code>defineCaptchaProvider()</code> for a completely custom service.</p>
|
||||
<h3 id="helper-and-block-kit">Helper and block kit</h3>
|
||||
<p>The package exports <code>captchaTokenFrom</code>, <code>captchaHeaders</code>, <code>captchaFields</code>, <code>verifyCaptcha</code>, <code>verifyCaptchaOrThrow</code>, <code>captchaResultResponse</code>, and <code>captchaContext</code> for consistent server and client integration.</p>
|
||||
<p>Enable the CAPTCHA plugin to use the low-level <code><Captcha /></code> challenge plus complete UI-composed blocks:</p>
|
||||
<ul>
|
||||
<li><code><CaptchaField /></code></li>
|
||||
<li><code><CaptchaStatus /></code></li>
|
||||
</ul>
|
||||
<p><code>CaptchaField</code> composes <code>Card</code> from <code>@wrnexus/ui</code> and keeps the CAPTCHA-specific size separate from the surrounding UI size.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { CaptchaVerificationResult, CaptchaProvider, CaptchaEngine, VerifyCaptchaInput } from './types.js';
|
||||
export { CaptchaAudioRenderer, CaptchaBinding, CaptchaChallenge, CaptchaChallengeGenerator, CaptchaChallengeRecord, CaptchaChallengeType, CaptchaConcreteImageStyle, CaptchaDifficulty, CaptchaEngineOptions, CaptchaFailureCode, CaptchaGeneratorContext, CaptchaGuardOptions, CaptchaHttpHandlers, CaptchaImageItem, CaptchaImageStyle, CaptchaMiddleware, CaptchaPageGateOptions, CaptchaPolicyMode, CaptchaPolicyOptions, CaptchaPresentation, CaptchaProviderClientConfig, CaptchaProviderName, CaptchaResponseTokenRecord, CaptchaRiskResult, CaptchaRiskSignals, CaptchaStore, CreateCaptchaOptions, GeneratedCaptchaChallenge } from './types.js';
|
||||
export { CaptchaHttpOptions, CaptchaParseResult, CaptchaSessionGrant, DefaultCaptchaEngine, ParseWithCaptchaOptions, bindingHash, bytesToBase64Url, captchaGuard, captchaPageGate, clearCaptchaGrants, constantTimeEqual, createCaptchaEngine, createCaptchaHttpHandlers, defaultRandomBytes, evaluateCaptchaRisk, hmacSha256, parseWithCaptcha, randomId, sha256, shouldRequireCaptcha, validCaptchaGrant } from './server/index.js';
|
||||
export { CaptchaAuditIssue, CaptchaPluginOptions, captchaComponentsDir, captchaPlugin } from './plugin.js';
|
||||
export { MemoryCaptchaStore, MemoryCaptchaStoreOptions, createMemoryCaptchaStore } from './stores/memory.js';
|
||||
@@ -268,9 +277,19 @@ export { ManagedCaptchaProvider, ManagedCaptchaProviderOptions, managedCapt
|
||||
export { defineCaptchaProvider } from './providers/custom.js';
|
||||
export { CAPTCHA_CONCRETE_IMAGE_STYLES, CAPTCHA_IMAGE_STYLES, CalculationCaptchaGenerator, ImageCaptchaGenerator, InvisibleCaptchaGenerator, ResolveCaptchaImageStyleOptions, ResolvedCaptchaImageStyle, Rgba, RgbaImage, TextCaptchaGenerator, alphaCaptchaGenerator, alphanumericCaptchaGenerator, bytesToBase64, calculationCaptchaGenerator, createImage, defaultCaptchaGenerators, defineCaptchaGenerator, drawGlyph, drawLine, drawText, encodePng, fillCircle, fillPolygon, fillRect, honeypotCaptchaGenerator, imageCaptchaGenerator, isCaptchaImageStyle, normalizeCaptchaImageStyle, normalizeCaptchaImageStyleList, notRobotCaptchaGenerator, numberCaptchaGenerator, pngDataUri, resolveCaptchaImageStyle, setPixel, timingCaptchaGenerator } from './challenges/index.js';
|
||||
export { AssetAudioRenderer, AssetAudioRendererOptions, createAssetAudioRenderer, resolveCaptchaAudioAssetsDir } from './audio/index.js';
|
||||
import '@wrnexus/core';
|
||||
import { Context } from '@wrnexus/core';
|
||||
import '@wrnexus/validation';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
declare function captchaTokenFrom(value: Request | Headers | FormData | URLSearchParams | Record<string, unknown>, field?: string): Promise<string | undefined> | string | undefined;
|
||||
declare function captchaHeaders(token: string): HeadersInit;
|
||||
declare function captchaFields(token: string, field?: string): Record<string, string>;
|
||||
declare function verifyCaptcha(providerOrEngine: CaptchaProvider | CaptchaEngine, input: VerifyCaptchaInput): Promise<CaptchaVerificationResult>;
|
||||
declare function verifyCaptchaOrThrow(providerOrEngine: CaptchaProvider | CaptchaEngine, input: VerifyCaptchaInput): Promise<CaptchaVerificationResult>;
|
||||
declare function captchaResultResponse(result: CaptchaVerificationResult): Response;
|
||||
declare function captchaContext(ctx: Context): CaptchaVerificationResult | null;
|
||||
|
||||
export { CaptchaEngine, CaptchaProvider, CaptchaVerificationResult, VerifyCaptchaInput, captchaContext, captchaFields, captchaHeaders, captchaResultResponse, captchaTokenFrom, verifyCaptcha, verifyCaptchaOrThrow };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>## Install</h3><pre data-language="bash"><code>bun add @wrnexus/captcha</code></pre></article><article class="example-card"><h3>## Create the self-hosted engine</h3><pre data-language="ts"><code>import {
|
||||
createCaptchaEngine,
|
||||
createCaptchaHttpHandlers,
|
||||
@@ -312,9 +331,9 @@ export const HEAD = POST;</code></pre></article><article class="example-card"><h
|
||||
<Captcha size="normal" action="standard-form" />
|
||||
<Captcha size="big" action="security-page" /></code></pre></article><article class="example-card"><h3>Listen button visibility</h3><pre data-language="wrn"><code><Captcha showListen="false" action="without-listen-button" />
|
||||
<Captcha showAudio="false" action="without-audio-alternative" /></code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#install">Install</a><a class="toc-level-3" href="#included-challenge-modes">Included challenge modes</a><a class="toc-level-3" href="#create-the-self-hosted-engine">Create the self-hosted engine</a><a class="toc-level-3" href="#use-the-component">Use the component</a><a class="toc-level-4" href="#main-props">Main props</a><a class="toc-level-4" href="#component-sizes">Component sizes</a><a class="toc-level-4" href="#listen-button-visibility">Listen button visibility</a><a class="toc-level-4" href="#i-m-not-a-robot-checkbox">I’m not a robot checkbox</a><a class="toc-level-4" href="#visual-disturbance">Visual disturbance</a><a class="toc-level-4" href="#generated-image-renderer-styles">Generated image renderer styles</a><a class="toc-level-4" href="#events">Events</a><a class="toc-level-3" href="#protect-a-validated-form-api">Protect a validated form API</a><a class="toc-level-4" href="#retryable-operations-such-as-login">Retryable operations such as login</a><a class="toc-level-3" href="#validate-a-schema-and-captcha-together">Validate a schema and CAPTCHA together</a><a class="toc-level-3" href="#page-gate">Page gate</a><a class="toc-level-3" href="#external-providers">External providers</a><a class="toc-level-3" href="#managed-provider">Managed provider</a><a class="toc-level-3" href="#stores">Stores</a><a class="toc-level-3" href="#audio">Audio</a><a class="toc-level-3" href="#devtoolbar">DevToolbar</a><a class="toc-level-3" href="#testing">Testing</a><a class="toc-level-3" href="#custom-challenge-generator">Custom challenge generator</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#install">Install</a><a class="toc-level-3" href="#included-challenge-modes">Included challenge modes</a><a class="toc-level-3" href="#create-the-self-hosted-engine">Create the self-hosted engine</a><a class="toc-level-3" href="#use-the-component">Use the component</a><a class="toc-level-4" href="#main-props">Main props</a><a class="toc-level-4" href="#component-sizes">Component sizes</a><a class="toc-level-4" href="#listen-button-visibility">Listen button visibility</a><a class="toc-level-4" href="#i-m-not-a-robot-checkbox">I’m not a robot checkbox</a><a class="toc-level-4" href="#visual-disturbance">Visual disturbance</a><a class="toc-level-4" href="#generated-image-renderer-styles">Generated image renderer styles</a><a class="toc-level-4" href="#events">Events</a><a class="toc-level-3" href="#protect-a-validated-form-api">Protect a validated form API</a><a class="toc-level-4" href="#retryable-operations-such-as-login">Retryable operations such as login</a><a class="toc-level-3" href="#validate-a-schema-and-captcha-together">Validate a schema and CAPTCHA together</a><a class="toc-level-3" href="#page-gate">Page gate</a><a class="toc-level-3" href="#external-providers">External providers</a><a class="toc-level-3" href="#managed-provider">Managed provider</a><a class="toc-level-3" href="#stores">Stores</a><a class="toc-level-3" href="#audio">Audio</a><a class="toc-level-3" href="#devtoolbar">DevToolbar</a><a class="toc-level-3" href="#testing">Testing</a><a class="toc-level-3" href="#custom-challenge-generator">Custom challenge generator</a><a class="toc-level-3" href="#helper-and-block-kit">Helper and block kit</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,16 @@ page wrnexuscli {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/cli</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/cli</h1><p>Create, develop, build, generate, test, and maintain WRNexusJS apps.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/cli@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The <code>wrnexus</code> command-line tool that scaffolds, runs, builds, tests, and manages WRNexusJS apps.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/cli</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/cli</h1><p>Create, develop, build, generate, test, and maintain WRNexusJS apps.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/cli@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Production parity commands:</p>
|
||||
<pre data-language="bash"><code>wrnexus build .
|
||||
wrnexus preview . --port=3000
|
||||
wrnexus dev . --production-runtime</code></pre>
|
||||
<p><code>preview</code> refuses to start without <code>dist/server.js</code> and executes that exact artifact with the production profile. Production-runtime development rebuilds the same minified artifact after app, public, or configuration changes and keeps the last good server running when a rebuild fails.</p>
|
||||
<blockquote>The <code>wrnexus</code> command-line tool that scaffolds, runs, builds, tests, and manages WRNexusJS apps.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/cli</code> provides the <code>wrnexus</code> executable — the single entry point for developing a WRNexusJS app. It runs the HMR dev server, produces a self-contained production build, scaffolds apps/pages/components, drives database migrations, regenerates typed routes and queries, runs tests, and manages configuration profiles. It also scaffolds multi-app monorepos and serves them behind a domain-routing gateway. This is a CLI/build-time package (it shells out to the Bun binary for the dev child and tests) and it also exports the workspace config types via a subpath.</p>
|
||||
@@ -25,11 +30,18 @@ page wrnexuscli {
|
||||
<pre data-language="bash"><code>bunx wrnexus dev
|
||||
# or add scripts: "dev": "wrnexus dev .", "build": "wrnexus build ."</code></pre>
|
||||
<h3 id="commands">Commands</h3>
|
||||
<h4 id="local-production-services">Local production services</h4>
|
||||
<p><code>wrnexus dev . --services</code> starts the application and the bounded local database, cache, mail, SMS, webhook, storage, queue, cron, authentication and metrics simulator. It generates a localhost/<code>*.localhost</code> development certificate under <code>.wrnexus/certificates/</code> and serves both the application and service console over HTTPS. Trust that certificate locally to remove the browser warning. Use <code>--services-http</code> only when an external development proxy already terminates TLS.</p>
|
||||
<h4 id="exact-production-runtime-with-live-updates">Exact production runtime with live updates</h4>
|
||||
<p><code>wrnexus dev . --production-runtime</code> rebuilds and executes <code>dist/server.js</code> with production resolution, serialization, caching, headers and assets. The supervisor keeps the last good process when a build fails. On a successful rebuild the opt-in production HMR socket reconnects, requests the new document and morphs it into the browser; ordinary <code>wrnexus preview</code> and deployed production servers never include that client.</p>
|
||||
<h4 id="api-platform">API platform</h4>
|
||||
<p><code>wrnexus api generate [app-dir]</code> (or <code>api docs</code>) derives operations from file routes and emits <code>generated/api/openapi.json</code>, safe static documentation, Postman collection, curl examples, and TypeScript, JavaScript, Java, Go and Python SDKs. Generate one client with <code>wrnexus sdk generate <language> [app-dir]</code>.</p>
|
||||
<p>Every command accepts an optional <code>[app-dir]</code> (defaults to <code>.</code>). Commands that read config or <code>.env</code> also accept <code>--profile=<name></code> (see [Profiles](#profiles)).</p>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Command</th><th>Purpose</th></tr></thead>
|
||||
<tbody><tr><td><code>wrnexus dev [app-dir] [--port=3000]</code></td><td>Start the development server with live reload / HMR.</td></tr><tr><td><code>wrnexus build [app-dir]</code></td><td>Build a self-contained production server bundle + assets into <code>dist/</code>.</td></tr><tr><td><code>wrnexus create <app-name></code></td><td>Scaffold a new single app from an inline template.</td></tr><tr><td><code>wrnexus workspace <name></code></td><td>Scaffold a monorepo (<code>apps/*</code> + shared <code>packages/*</code>).</td></tr><tr><td><code>wrnexus workspace add <name></code></td><td>Add and register an app in the current workspace.</td></tr><tr><td><code>wrnexus gateway [--port=3000]</code></td><td>Serve every workspace app behind one port, routed by domain.</td></tr><tr><td><code>wrnexus production [workspace-dir]</code></td><td>Build, migrate, and serve every workspace app in production.</td></tr><tr><td><code>wrnexus generate <type> <name></code></td><td>Scaffold a <code>page</code> \</td><td><code>component</code> \</td><td><code>api</code> \</td><td><code>schema</code>.</td></tr><tr><td><code>wrnexus generate routes</code></td><td>Regenerate the typed routes file (<code>app/routes.gen.ts</code>).</td></tr><tr><td><code>wrnexus generate docker</code></td><td>Scaffold <code>Dockerfile</code>, <code>.dockerignore</code>, and <code>docker-compose.yml</code>.</td></tr><tr><td><code>wrnexus generate mobile</code></td><td>Scaffold a Capacitor shell for iOS and Android.</td></tr><tr><td><code>wrnexus mobile add <package...></code></td><td>Install Capacitor plugins and sync native projects.</td></tr><tr><td><code>wrnexus eject <name...></code></td><td>Copy Wire UI component <code>.wrn</code> sources into <code>app/components/</code>.</td></tr><tr><td><code>wrnexus db <cmd></code></td><td>Database migrations and tooling (see [db](#wrnexus-db)).</td></tr><tr><td><code>wrnexus test [app-dir] [--watch]</code></td><td>Run the app's tests via <code>bun test</code> (defaults to the <code>test</code> profile).</td></tr><tr><td><code>wrnexus profiles [app-dir]</code></td><td>List config profiles and their <code>.env</code> files, marking the active one.</td></tr><tr><td><code>wrnexus help</code></td><td>Print usage.</td></tr></tbody></table></div>
|
||||
<tbody><tr><td><code>wrnexus dev [app-dir] [--port=3000]</code></td><td>Start the development server with live reload / HMR.</td></tr><tr><td><code>wrnexus build [app-dir]</code></td><td>Build a self-contained production server bundle + assets into <code>dist/</code>.</td></tr><tr><td><code>wrnexus create <app-name></code></td><td>Scaffold a new single app from an inline template.</td></tr><tr><td><code>wrnexus workspace <name></code></td><td>Scaffold a monorepo (<code>apps/*</code> + shared <code>packages/*</code>).</td></tr><tr><td><code>wrnexus workspace add <name></code></td><td>Add and register an app in the current workspace.</td></tr><tr><td><code>wrnexus gateway [--port=3000]</code></td><td>Serve every workspace app behind one port, routed by domain.</td></tr><tr><td><code>wrnexus production [workspace-dir]</code></td><td>Build, migrate, and serve every workspace app in production.</td></tr><tr><td><code>wrnexus generate <type> <name></code></td><td>Scaffold a <code>page</code> \</td><td><code>component</code> \</td><td><code>api</code> \</td><td><code>schema</code>.</td></tr><tr><td><code>wrnexus generate routes</code></td><td>Regenerate the typed routes file (<code>app/routes.gen.ts</code>).</td></tr><tr><td><code>wrnexus generate docker</code></td><td>Scaffold <code>Dockerfile</code>, <code>.dockerignore</code>, and <code>docker-compose.yml</code>.</td></tr><tr><td><code>wrnexus generate mobile</code></td><td>Scaffold a Capacitor shell for iOS and Android.</td></tr><tr><td><code>wrnexus mobile add <package...></code></td><td>Install Capacitor plugins and sync native projects.</td></tr><tr><td><code>wrnexus eject <name...></code></td><td>Copy Wire UI component <code>.wrn</code> sources into <code>app/components/</code>.</td></tr><tr><td><code>wrnexus db <cmd></code></td><td>Database migrations and tooling (see [db](#wrnexus-db)).</td></tr><tr><td><code>wrnexus test [app-dir] [--watch]</code></td><td>Run the app's tests via <code>bun test</code> (defaults to the <code>test</code> profile).</td></tr><tr><td><code>wrnexus profiles [app-dir]</code></td><td>List config profiles and their <code>.env</code> files, marking the active one.</td></tr><tr><td><code>wrnexus compatibility check</code></td><td>Check whether behavior defaults are explicitly pinned and current.</td></tr><tr><td><code>wrnexus compatibility explain</code></td><td>Explain configured, effective, and current compatibility behavior.</td></tr><tr><td><code>wrnexus compatibility upgrade</code></td><td>Back up config and explicitly opt into reviewed current behavior.</td></tr><tr><td><code>wrnexus help</code></td><td>Print usage.</td></tr></tbody></table></div>
|
||||
<p><code>wrnexus g</code> is an alias for <code>wrnexus generate</code>.</p>
|
||||
<p>Compatibility upgrades never happen implicitly. New applications pin <code>compatibilityDate</code> and <code>frameworkBehaviour</code>; existing applications use <code>wrnexus compatibility explain</code> before the backed-up, idempotent upgrade command.</p>
|
||||
<h4 id="wrnexus-dev"><code>wrnexus dev</code></h4>
|
||||
<p>Supervises a child dev-server process (from <code>@wrnexus/dev-server</code>). The child owns file watching and HMR: CSS and client-island edits update the live page over a WebSocket with no restart; when a server module changes, the child exits with a restart code and the supervisor respawns it (the browser reconnects and morphs in the new HTML). On startup it regenerates typed DB queries and typed routes (best effort). Use <code>--port=</code> to change the port (default <code>3000</code>).</p>
|
||||
<pre data-language="bash"><code>wrnexus dev . --port=8080</code></pre>
|
||||
@@ -45,7 +57,8 @@ page wrnexuscli {
|
||||
# Generated apps also provide: npm start
|
||||
# Build and start together: npm run production</code></pre>
|
||||
<h4 id="wrnexus-create"><code>wrnexus create</code></h4>
|
||||
<p>Scaffolds a new app from an inline (dependency-free) template — <code>package.json</code>, <code>.gitignore</code>, config, and starter <code>app/</code> files. Use <code>npm run dev</code> during development, <code>npm run build && npm start</code> for production, or <code>npm run production</code> to build and start in one command. The generated production server currently requires Bun even when npm is used to manage packages and scripts.</p>
|
||||
<p>Scaffolds a complete v0.8 app from an inline template. The generated project includes strict TypeScript, ESLint and Prettier, editor recommendations, environment templates, database migrations, locales, schemas, tests, API/middleware/realtime examples, Tailwind and Iconify, PWA/mobile defaults, and the framework package kits. Its <code>wrnexus.config.ts</code> documents the current imports, types, stores, performance, observability, tenancy, build, navigation, theme, i18n, database, storage, realtime, security, and profile configuration.</p>
|
||||
<p>Use <code>bun run dev</code> during development, <code>bun run check</code> for the complete typecheck/lint/test/format gate, <code>bun run build && bun run start</code> for production, or <code>bun run production</code> to build and start in one command.</p>
|
||||
<h4 id="wrnexus-update"><code>wrnexus update</code></h4>
|
||||
<p><code>wrnexus update --latest</code> performs a complete project upgrade. It hands control to the exact target CLI, backs up important project files under <code>.wrnexus/update-backups/</code>, updates every <code>@wrnexus/*</code> dependency, refreshes framework-owned references, and applies every versioned syntax/config/file migration between the project version and target version. After installation it runs the project's <code>check</code> and <code>build</code> scripts; the new version is recorded only after verification succeeds.</p>
|
||||
<p>Use <code>--dry-run</code> to preview an upgrade or <code>--no-verify</code> when verification is intentionally handled elsewhere. Migrations never overwrite user-owned configuration wholesale: each release must provide a focused, idempotent transformation for any changed syntax or config contract.</p>
|
||||
@@ -81,7 +94,7 @@ wrnexus db migrate
|
||||
wrnexus db studio users
|
||||
wrnexus db status --db=analytics</code></pre>
|
||||
<h4 id="wrnexus-workspace-and-wrnexus-gateway"><code>wrnexus workspace</code> and <code>wrnexus gateway</code></h4>
|
||||
<p><code>workspace <name></code> scaffolds a monorepo: several WRNexusJS apps under <code>apps/*</code> and shared libraries under <code>packages/*</code>, plus a <code>wrnexus.workspace.ts</code> that maps each app to the domains it serves. <code>gateway</code> runs every app behind one port and routes by <code>Host</code> header, with optional per-app auth and gateway-wide security (trusted hosts, rate limit, security headers, access log).</p>
|
||||
<p><code>workspace <name></code> scaffolds a monorepo: complete v0.8 apps under <code>apps/*</code>, shared libraries under <code>packages/*</code>, root TypeScript/lint/format/editor/environment tooling, and a <code>wrnexus.workspace.ts</code> that maps each app to the domains it serves. <code>gateway</code> runs every app behind one port and routes by <code>Host</code> header, with optional per-app auth and gateway-wide security (trusted hosts, rate limit, security headers, access log). Newly added workspace apps use the same current scaffold.</p>
|
||||
<pre data-language="bash"><code>wrnexus workspace acme
|
||||
wrnexus gateway --port=3000</code></pre>
|
||||
<p>For a complete production start, use the first-class workspace orchestrator:</p>
|
||||
@@ -116,6 +129,7 @@ wrnexus gateway --port=3000</code></pre>
|
||||
<pre data-language="bash"><code>wrnexus update --latest --dry-run
|
||||
wrnexus update --latest
|
||||
wrnexus doctor</code></pre>
|
||||
<p>Use <code>wrnexus doctor --fix [app-dir]</code> to apply conservative repairs before the health check: create missing <code>app/pages</code> and a default config, align skewed <code>@wrnexus/*</code> dependency ranges, record the current migration marker, and format only syntax-valid <code>.wrn</code> files. Invalid JSON or WRN sources are reported/skipped instead of overwritten; repeat runs are idempotent.</p>
|
||||
<h3 id="profiles">Profiles</h3>
|
||||
<p>Pass <code>--profile=<name></code> to <code>dev</code>, <code>build</code>, <code>db</code> (or set <code>WRNEXUS_PROFILE</code>) to select a config profile. The CLI publishes <code>WRNEXUS_PROFILE</code> so config loaders and the dev child pick it up, and loads that profile's <code>.env</code> cascade (<code>.env</code>, <code>.env.local</code>, <code>.env.<profile></code>, <code>.env.<profile>.local</code>) into <code>process.env</code>.</p>
|
||||
<pre data-language="bash"><code>wrnexus dev --profile=uat
|
||||
@@ -151,9 +165,9 @@ bun install
|
||||
wrnexus gateway --port=3000</code></pre></article><article class="example-card"><h3>Upgrade with migrations and verification</h3><pre data-language="bash"><code>wrnexus update --latest --dry-run
|
||||
wrnexus update --latest
|
||||
wrnexus doctor</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#commands">Commands</a><a class="toc-level-4" href="#wrnexus-dev">wrnexus dev</a><a class="toc-level-4" href="#wrnexus-build">wrnexus build</a><a class="toc-level-4" href="#wrnexus-create">wrnexus create</a><a class="toc-level-4" href="#wrnexus-update">wrnexus update</a><a class="toc-level-4" href="#wrnexus-generate">wrnexus generate</a><a class="toc-level-4" href="#wrnexus-eject">wrnexus eject</a><a class="toc-level-4" href="#wrnexus-db">wrnexus db</a><a class="toc-level-4" href="#wrnexus-workspace-and-wrnexus-gateway">wrnexus workspace and wrnexus gateway</a><a class="toc-level-4" href="#wrnexus-test">wrnexus test</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#create-and-run-a-single-application">Create and run a single application</a><a class="toc-level-4" href="#add-routes-and-shared-ui-to-an-existing-app">Add routes and shared UI to an existing app</a><a class="toc-level-4" href="#create-a-multi-app-workspace-and-add-another-app">Create a multi-app workspace and add another app</a><a class="toc-level-4" href="#upgrade-with-migrations-and-verification">Upgrade with migrations and verification</a><a class="toc-level-3" href="#profiles">Profiles</a><a class="toc-level-3" href="#subpath-exports">Subpath exports</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#commands">Commands</a><a class="toc-level-4" href="#local-production-services">Local production services</a><a class="toc-level-4" href="#exact-production-runtime-with-live-updates">Exact production runtime with live updates</a><a class="toc-level-4" href="#api-platform">API platform</a><a class="toc-level-4" href="#wrnexus-dev">wrnexus dev</a><a class="toc-level-4" href="#wrnexus-build">wrnexus build</a><a class="toc-level-4" href="#wrnexus-create">wrnexus create</a><a class="toc-level-4" href="#wrnexus-update">wrnexus update</a><a class="toc-level-4" href="#wrnexus-generate">wrnexus generate</a><a class="toc-level-4" href="#wrnexus-eject">wrnexus eject</a><a class="toc-level-4" href="#wrnexus-db">wrnexus db</a><a class="toc-level-4" href="#wrnexus-workspace-and-wrnexus-gateway">wrnexus workspace and wrnexus gateway</a><a class="toc-level-4" href="#wrnexus-test">wrnexus test</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#create-and-run-a-single-application">Create and run a single application</a><a class="toc-level-4" href="#add-routes-and-shared-ui-to-an-existing-app">Add routes and shared UI to an existing app</a><a class="toc-level-4" href="#create-a-multi-app-workspace-and-add-another-app">Create a multi-app workspace and add another app</a><a class="toc-level-4" href="#upgrade-with-migrations-and-verification">Upgrade with migrations and verification</a><a class="toc-level-3" href="#profiles">Profiles</a><a class="toc-level-3" href="#subpath-exports">Subpath exports</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,12 +10,26 @@ page wrnexuscompiler {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/compiler</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/compiler</h1><p>Parser and code generators for the .wrn language.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/compiler@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Compiler for the <code>.wrn</code> language — tokenizes, parses, and lowers <code>.wrn</code> page and component files to TypeScript.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/compiler</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/compiler</h1><p>Parser and code generators for the .wrn language.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/compiler@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><h3 id="partial-static-rendering">Partial-static rendering</h3>
|
||||
<p>Pages can select <code>render = "partial-static"</code> and divide their view with <code><Static></code> and <code><Dynamic></code> boundaries. The compiler emits a build-only shell renderer that never evaluates dynamic-boundary children. <code>wrnexus build</code> expands static component mounts into <code>dist/partial-shells.json</code>, records byte/region evidence in <code>build-report.json</code>, and embeds the shell in the production route manifest. At request time the production runtime retains request-aware layouts, locale/theme metadata and security nonces while streaming dynamic regions into stable placeholders.</p>
|
||||
<blockquote>Compiler for the <code>.wrn</code> language — tokenizes, parses, and lowers <code>.wrn</code> page and component files to TypeScript.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<p>Production adapters use <code>analyzeRuntimeImports</code> before bundling. Edge, worker, service-worker, and browser targets reject Node filesystem, TCP, and process modules with <code>WRN-RUNTIME-CAPABILITY</code>. Package manifests can declare supported <code>wrnexus.runtimes</code> and required <code>wrnexus.requires</code> capabilities; discovery fails when the selected deployment cannot satisfy them.</p>
|
||||
<h3 id="server-actions">Server actions</h3>
|
||||
<pre data-language="wrn"><code>action createUser using CreateUserSchema {
|
||||
const user = await users.create(input)
|
||||
invalidate("users")
|
||||
return user
|
||||
}
|
||||
|
||||
view {
|
||||
<form @submit="createUser">...</form>
|
||||
}</code></pre>
|
||||
<p>The compiler produces a schema-aware server registry, a fully inferred action client, and progressively enhanced form metadata. The shared runtime performs validation, authentication/permission checks, CSRF verification, serialization, invalidation reporting, and browser lifecycle events.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/compiler</code> turns <code>.wrn</code> source into TypeScript that targets the framework's runtime primitives. A <code>.wrn</code> file declares either a <code>page</code> (a route) or a <code>component</code> (a reusable, prop-driven fragment) with blocks for <code>state</code>, <code>view</code> (plain HTML), <code>seo</code>, <code>style</code>, <code>functions</code>, <code>api</code>, <code>ssr</code>/<code>client</code> data bindings, and <code>realtime</code> websocket handlers. The pipeline is <code>source → Lexer → parse() → PageAst → generate() → TypeScript</code>. It is a build/server-side library — the WRNexusJS dev loader calls it to compile <code>.wrn</code> files on the fly, surfacing <code>ParseError</code> as a readable error page.</p>
|
||||
<p>Static ES module imports may appear before the root declaration. Imported values are available to server-rendered expressions, including component props:</p>
|
||||
@@ -124,7 +138,7 @@ lx.next(); // { type: "lbrace", value: "{", pos: 1
|
||||
<li>Pure TypeScript with no runtime dependencies; runs under <strong>Bun</strong> as part of the WRNexusJS toolchain (Node is not supported).</li>
|
||||
<li>Generated modules target WRNexusJS runtime primitives (<code>data-scope</code>, <code>data-text</code>, <code>data-on-*</code>, <code>data-for</code>, <code>data-component</code>, <code>__wrnexus*</code>/<code>__wire*</code> helpers) — consume the output within a WRNexusJS app, e.g. via <code>@wrnexus/core</code>'s dev loader.</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { PageAst as PageAst$1, StructuredImportDecl, WrnDiagnostic } from '@wrnexus/syntax';
|
||||
export { ActionBlock, ApiBlock, Attr, ComputedDecl, DataApiBlock, DataMode, EffectBlock, EventDecl, LexError, Lexer, LoadBlock, ModeFunctionsBlock, OutputDecl, PageAst, ParseError, PropDecl, RealtimeBlock, RuntimeFunctionDecl, SeoBlock, StateDecl, StateRuntime, StoreKind, StructuredImportDecl, ViewNode, WrnDiagnostic, assertValidAst, diagnose, diagnosticFromError, eraseFunctionTypes, formatDiagnostic, inferredRuntimeType, parse, runtimeTypeOf } from '@wrnexus/syntax';
|
||||
export { ActionBlock, ApiBlock, Attr, ComputedDecl, DataApiBlock, DataMode, EffectBlock, EventDecl, FormatWrnOptions, LexError, Lexer, LoadBlock, ModeFunctionsBlock, OutputDecl, PageAst, ParseError, PropDecl, RealtimeBlock, RuntimeFunctionDecl, SeoBlock, StateDecl, StateRuntime, StoreKind, StructuredImportDecl, ViewNode, WrnDiagnostic, assertValidAst, diagnose, diagnosticFromError, eraseFunctionTypes, formatDiagnostic, formatWrn, inferredRuntimeType, parse, runtimeTypeOf } from '@wrnexus/syntax';
|
||||
import { PageAst } from '@wrnexus/syntax/parser';
|
||||
|
||||
/**
|
||||
@@ -263,9 +277,43 @@ interface RuntimeRequirements {
|
||||
needsServerRuntime: boolean;
|
||||
hydrationStrategy: string | null;
|
||||
reasons: string[];
|
||||
optimization: OptimizationReport;
|
||||
cachePolicy: Record<string, string>;
|
||||
requiredPermission: string | null;
|
||||
}
|
||||
interface OptimizationReport {
|
||||
staticNodes: number;
|
||||
reactiveRegions: number;
|
||||
eliminatedBranches: number;
|
||||
unusedState: string[];
|
||||
unusedHandlers: string[];
|
||||
constantProps: string[];
|
||||
unusedLocalCssClasses: string[];
|
||||
batchableStateUpdates: number;
|
||||
memoizableComponents: string[];
|
||||
preloadDependencies: string[];
|
||||
serverOnlyModules: string[];
|
||||
}
|
||||
/** Safe compile-time folding for literal conditional branches. */
|
||||
declare function optimizeAst(ast: PageAst$1): {
|
||||
ast: PageAst$1;
|
||||
eliminatedBranches: number;
|
||||
};
|
||||
declare function analyzeOptimizations(ast: PageAst$1): OptimizationReport;
|
||||
declare function analyzeRuntimeRequirements(ast: PageAst$1): RuntimeRequirements;
|
||||
|
||||
type DeploymentRuntime = "bun" | "node" | "edge" | "worker" | "service-worker" | "browser";
|
||||
type RuntimeCapability = "filesystem" | "tcp" | "process" | "websocket" | "crypto" | "streams" | "background-tasks";
|
||||
interface RuntimeCapabilityDiagnostic {
|
||||
code: "WRN-RUNTIME-CAPABILITY";
|
||||
runtime: DeploymentRuntime;
|
||||
module: string;
|
||||
capability: RuntimeCapability;
|
||||
message: string;
|
||||
}
|
||||
declare function runtimeCapabilities(runtime: DeploymentRuntime): ReadonlySet<RuntimeCapability>;
|
||||
declare function analyzeRuntimeImports(source: string, runtime: DeploymentRuntime): RuntimeCapabilityDiagnostic[];
|
||||
|
||||
declare class NativeCompileError extends Error {
|
||||
constructor(message: string);
|
||||
}
|
||||
@@ -330,7 +378,7 @@ declare function compileWireFile(source: string, filePath?: string): string;
|
||||
/** Richer entry point returning the AST and structured diagnostics. */
|
||||
declare function compile(source: string, filePath?: string): CompileResult;
|
||||
|
||||
export { type CompilationCache, type CompilationCacheEntry, type CompilationCacheOptions, type CompileResult, DependencyGraph, NativeCompileError, type RouteExecutionKind, type RuntimeRequirements, analyzeRuntimeRequirements, compilationKey, compile, compileNativeWireFile, compileWireFile, createCompilationCache, createComponentContract, createWrnSourceMap, generate, generateBrowserModule, generateDeclarations, generateNative, generateServerFunctionsModule, generateStoreBrowserModule, generateStoreModule, generateTargets, resolveWrnImport, resolveWrnImports, rpcManifest };
|
||||
export { type CompilationCache, type CompilationCacheEntry, type CompilationCacheOptions, type CompileResult, DependencyGraph, type DeploymentRuntime, NativeCompileError, type OptimizationReport, type RouteExecutionKind, type RuntimeCapability, type RuntimeCapabilityDiagnostic, type RuntimeRequirements, analyzeOptimizations, analyzeRuntimeImports, analyzeRuntimeRequirements, compilationKey, compile, compileNativeWireFile, compileWireFile, createCompilationCache, createComponentContract, createWrnSourceMap, generate, generateBrowserModule, generateDeclarations, generateNative, generateServerFunctionsModule, generateStoreBrowserModule, generateStoreModule, generateTargets, optimizeAst, resolveWrnImport, resolveWrnImports, rpcManifest, runtimeCapabilities };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Compile a page</h3><pre data-language="ts"><code>import { compileWireFile } from "@wrnexus/compiler";
|
||||
|
||||
const ts = compileWireFile(`
|
||||
@@ -359,9 +407,9 @@ const lx = new Lexer("page Home {");
|
||||
lx.next(); // { type: "ident", value: "page", pos: 0 }
|
||||
lx.next(); // { type: "ident", value: "Home", pos: 5 }
|
||||
lx.next(); // { type: "lbrace", value: "{", pos: 10 }</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#compilewirefile-source-string-string">compileWireFile(source: string): string</a><a class="toc-level-4" href="#compile-source-string-compileresult">compile(source: string): CompileResult</a><a class="toc-level-4" href="#parse-source-string-pageast">parse(source: string): PageAst</a><a class="toc-level-4" href="#generate-ast-pageast-string">generate(ast: PageAst): string</a><a class="toc-level-4" href="#lexer">Lexer</a><a class="toc-level-4" href="#errors">Errors</a><a class="toc-level-4" href="#ast-types">AST types</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#the-wrn-language-as-parsed">The .wrn language (as parsed)</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#partial-static-rendering">Partial-static rendering</a><a class="toc-level-3" href="#server-actions">Server actions</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#compilewirefile-source-string-string">compileWireFile(source: string): string</a><a class="toc-level-4" href="#compile-source-string-compileresult">compile(source: string): CompileResult</a><a class="toc-level-4" href="#parse-source-string-pageast">parse(source: string): PageAst</a><a class="toc-level-4" href="#generate-ast-pageast-string">generate(ast: PageAst): string</a><a class="toc-level-4" href="#lexer">Lexer</a><a class="toc-level-4" href="#errors">Errors</a><a class="toc-level-4" href="#ast-types">AST types</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#the-wrn-language-as-parsed">The .wrn language (as parsed)</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
page wrnexuscontent {
|
||||
seo {
|
||||
title = "@wrnexus/content"
|
||||
description = "Content collections, validation, querying, and publishing workflows."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/content</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/content</h1><p>Content collections, validation, querying, and publishing workflows.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/content@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Typed content collections for Markdown/MDX-like documents and remote CMS records. Collections validate frontmatter through any <code>{ parse(input) }</code> schema, render escaped HTML, and expose draft preview, versions, references, headings, search indexes, pagination, RSS and sitemaps.</p>
|
||||
<pre data-language="ts"><code>const posts = defineCollection({
|
||||
name: "posts",
|
||||
schema: PostSchema,
|
||||
loader: localContentLoader("content/posts"),
|
||||
previewToken: process.env.CONTENT_PREVIEW_TOKEN,
|
||||
});
|
||||
|
||||
const published = await posts.load();
|
||||
const preview = await posts.load({ previewToken: request.headers.get("x-preview-token") ?? "" });</code></pre>
|
||||
<p>Remote systems implement <code>CmsAdapter</code>, use <code>cmsContentLoader</code>, or return JSON records through <code>remoteContentLoader</code>. Markdown HTML is escaped by default; raw executable HTML is never trusted.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>type MdxComponent = (props: Record<string, string>, children: string) => string;
|
||||
/** Execute explicitly registered MDX components without evaluating arbitrary JavaScript. */
|
||||
declare function renderMdxComponents(source: string, components: Record<string, MdxComponent>): string;
|
||||
interface SyntaxLanguageBundle {
|
||||
highlight(source: string): string;
|
||||
}
|
||||
declare function createIncrementalHighlighter(loaders: Record<string, () => SyntaxLanguageBundle | Promise<SyntaxLanguageBundle>>): {
|
||||
languages: () => string[];
|
||||
highlight(language: string, source: string): Promise<string>;
|
||||
render(html: string): Promise<string>;
|
||||
};
|
||||
interface VendorAdapterOptions {
|
||||
fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
||||
token?: string;
|
||||
map?: (entry: any) => {
|
||||
id: string;
|
||||
content: string;
|
||||
source?: string;
|
||||
};
|
||||
}
|
||||
declare function contentfulAdapter(space: string, environment?: string, options?: VendorAdapterOptions): {
|
||||
list(collection: string): Promise<any>;
|
||||
};
|
||||
declare function sanityAdapter(project: string, dataset: string, options?: VendorAdapterOptions & {
|
||||
apiVersion?: string;
|
||||
}): {
|
||||
list(collection: string): Promise<any>;
|
||||
};
|
||||
declare function strapiAdapter(baseUrl: string, options?: VendorAdapterOptions): {
|
||||
list(collection: string): Promise<any>;
|
||||
};
|
||||
|
||||
interface ContentSchema<T> {
|
||||
parse(input: unknown): T;
|
||||
}
|
||||
interface ContentEntry<T = Record<string, unknown>> {
|
||||
id: string;
|
||||
slug: string;
|
||||
collection: string;
|
||||
data: T;
|
||||
body: string;
|
||||
html: string;
|
||||
excerpt: string;
|
||||
headings: ContentHeading[];
|
||||
draft: boolean;
|
||||
version?: string;
|
||||
source: string;
|
||||
}
|
||||
interface ContentHeading {
|
||||
depth: number;
|
||||
text: string;
|
||||
slug: string;
|
||||
}
|
||||
interface ContentLoaderResult {
|
||||
id: string;
|
||||
source: string;
|
||||
content: string;
|
||||
}
|
||||
interface ContentLoader {
|
||||
load(): ContentLoaderResult[] | Promise<ContentLoaderResult[]>;
|
||||
}
|
||||
interface ContentCollectionOptions<T> {
|
||||
name: string;
|
||||
schema: ContentSchema<T>;
|
||||
loader: ContentLoader;
|
||||
includeDrafts?: boolean;
|
||||
previewToken?: string;
|
||||
references?: Record<string, ContentCollection<unknown>>;
|
||||
}
|
||||
interface ContentCollection<T> {
|
||||
name: string;
|
||||
load(options?: {
|
||||
drafts?: boolean;
|
||||
previewToken?: string;
|
||||
version?: string;
|
||||
}): Promise<ContentEntry<T>[]>;
|
||||
get(id: string, options?: {
|
||||
drafts?: boolean;
|
||||
previewToken?: string;
|
||||
version?: string;
|
||||
}): Promise<ContentEntry<T> | null>;
|
||||
}
|
||||
declare function parseFrontmatter(source: string): {
|
||||
data: Record<string, unknown>;
|
||||
body: string;
|
||||
};
|
||||
declare function renderMarkdown(source: string): {
|
||||
html: string;
|
||||
headings: ContentHeading[];
|
||||
excerpt: string;
|
||||
};
|
||||
declare function localContentLoader(directory: string): ContentLoader;
|
||||
declare function remoteContentLoader(url: string, options?: {
|
||||
fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
||||
headers?: HeadersInit;
|
||||
}): ContentLoader;
|
||||
declare function defineCollection<T>(options: ContentCollectionOptions<T>): ContentCollection<T>;
|
||||
declare function resolveContentReference(collections: Record<string, ContentCollection<unknown>>, reference: string): Promise<ContentEntry<unknown> | null>;
|
||||
declare function paginateContent<T>(entries: T[], page?: number, pageSize?: number): {
|
||||
items: T[];
|
||||
page: number;
|
||||
pageSize: number;
|
||||
total: number;
|
||||
totalPages: number;
|
||||
hasNext: boolean;
|
||||
hasPrevious: boolean;
|
||||
};
|
||||
declare function createSearchIndex(entries: ContentEntry[]): {
|
||||
id: string;
|
||||
slug: string;
|
||||
title: string;
|
||||
text: string;
|
||||
}[];
|
||||
declare function searchContent(index: ReturnType<typeof createSearchIndex>, query: string): {
|
||||
id: string;
|
||||
slug: string;
|
||||
title: string;
|
||||
text: string;
|
||||
}[];
|
||||
declare function contentSitemap(entries: ContentEntry[], baseUrl: string): string;
|
||||
declare function contentRss(entries: ContentEntry[], options: {
|
||||
title: string;
|
||||
baseUrl: string;
|
||||
description?: string;
|
||||
}): string;
|
||||
interface CmsAdapter {
|
||||
list(collection: string): Promise<Array<{
|
||||
id: string;
|
||||
content: string;
|
||||
source?: string;
|
||||
}>>;
|
||||
}
|
||||
declare function cmsContentLoader(adapter: CmsAdapter, collection: string): ContentLoader;
|
||||
|
||||
export { type CmsAdapter, type ContentCollection, type ContentCollectionOptions, type ContentEntry, type ContentHeading, type ContentLoader, type ContentLoaderResult, type ContentSchema, type MdxComponent, type SyntaxLanguageBundle, type VendorAdapterOptions, cmsContentLoader, contentRss, contentSitemap, contentfulAdapter, createIncrementalHighlighter, createSearchIndex, defineCollection, localContentLoader, paginateContent, parseFrontmatter, remoteContentLoader, renderMarkdown, renderMdxComponents, resolveContentReference, sanityAdapter, searchContent, strapiAdapter };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>preview, versions, references, headings, search indexes, pagination, RSS and sitemaps.</h3><pre data-language="ts"><code>const posts = defineCollection({
|
||||
name: "posts",
|
||||
schema: PostSchema,
|
||||
loader: localContentLoader("content/posts"),
|
||||
previewToken: process.env.CONTENT_PREVIEW_TOKEN,
|
||||
});
|
||||
|
||||
const published = await posts.load();
|
||||
const preview = await posts.load({ previewToken: request.headers.get("x-preview-token") ?? "" });</code></pre></article><article class="example-card"><h3>Install @wrnexus/content</h3><pre data-language="sh"><code>bun add @wrnexus/content</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
+225
-12
@@ -10,11 +10,11 @@ page wrnexuscore {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/core</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/core</h1><p>Contexts, middleware, security, sessions, caching, JSX, and realtime.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/core@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The framework core: the request <code>Context</code>, middleware contract, and the security, session, caching, streaming, realtime, and JSX primitives every other WRNexusJS package builds on.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/core</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/core</h1><p>Contexts, middleware, security, sessions, caching, JSX, and realtime.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/core@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The framework core: the request <code>Context</code>, middleware contract, and the security, session, caching, streaming, realtime, and JSX primitives every other WRNexusJS package builds on.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/core</code> is the shared foundation of WRNexusJS. It defines the <code>Context</code> object that flows through every middleware, page, and API route, plus the <code>Middleware</code>/<code>Next</code> contract they implement. On top of that it ships the building blocks a real app needs: cookie-backed sessions, password auth, CSRF protection, rate limiting, request logging, HTTP + in-memory caching, file uploads, streaming/SSE responses, WebSocket "rooms", security headers/CORS, and a server-side JSX runtime that renders to HTML strings. Everything here is <strong>server-side</strong> and Bun-native (it uses <code>Bun.password</code>, <code>Bun.write</code>, the web-standard <code>Request</code>/<code>Response</code>, and <code>crypto</code>). You depend on it directly and transitively through the rest of the framework.</p>
|
||||
@@ -57,6 +57,23 @@ page wrnexuscore {
|
||||
<thead><tr><th>Export</th><th>Signature</th><th>Notes</th></tr></thead>
|
||||
<tbody><tr><td><code>requestLogger(options?)</code></td><td><code>(RequestLoggerOptions?) => Middleware</code></td><td>One record per request with a request id (stored on <code>ctx.locals[requestIdKey]</code>).</td></tr></tbody></table></div>
|
||||
<p><code>RequestLoggerOptions</code>: <code>format</code> (<code>"pretty"</code> default \| <code>"json"</code>), <code>sink(line, record)</code> (default <code>console.log</code>), <code>requestIdKey</code> (default <code>"requestId"</code>), <code>now</code>. <code>RequestRecord</code> = <code>{ time, id, method, path, status, durationMs }</code>.</p>
|
||||
<h4 id="resilience-wrnexus-core">Resilience — <code>@wrnexus/core</code></h4>
|
||||
<p><code>resilientCall</code> standardizes cancellation-aware timeouts, controlled retries, fixed or exponential backoff, fallback responses, circuit breaking, and bounded concurrency. Reuse a declarative circuit/bulkhead options object, or an explicit <code>CircuitBreaker</code>/<code>Bulkhead</code> instance, wherever calls must share health and capacity state.</p>
|
||||
<pre data-language="ts"><code>import { resilientCall } from "@wrnexus/core";
|
||||
|
||||
const paymentCircuit = { failures: 5, resetAfter: "30s" } as const;
|
||||
|
||||
const status = await resilientCall({
|
||||
timeout: "5s",
|
||||
retries: 3,
|
||||
retryDelay: "100ms",
|
||||
backoff: "exponential",
|
||||
circuitBreaker: paymentCircuit,
|
||||
bulkhead: { concurrency: 20, queue: 100 },
|
||||
run: (signal) => paymentProvider.checkStatus({ signal }),
|
||||
fallback: () => ({ state: "unavailable" }),
|
||||
});</code></pre>
|
||||
<p><code>CircuitBreaker.snapshot()</code> reports <code>closed</code>, <code>open</code>, or <code>half-open</code>, failure and success counts, and the remaining retry delay for health endpoints and development tooling. Fail-fast conditions use stable <code>WRN-RESILIENCE-*</code> codes. Core's existing <code>HealthRegistry</code>, <code>withIdempotency</code>, and pluggable stores/locks cover health reporting, idempotent requests, and distributed coordination.</p>
|
||||
<h4 id="caching-wrnexus-core">Caching — <code>@wrnexus/core</code></h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Kind</th><th>Notes</th></tr></thead>
|
||||
@@ -217,6 +234,36 @@ interface Tenant {
|
||||
name?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
interface TenantResource {
|
||||
tenantId: string;
|
||||
}
|
||||
interface TenantMembership {
|
||||
tenantId: string;
|
||||
userId: string;
|
||||
roles?: string[];
|
||||
workspaceIds?: string[];
|
||||
}
|
||||
interface TenantAuditEvent {
|
||||
tenantId: string;
|
||||
action: string;
|
||||
actorId?: string;
|
||||
resource?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
createdAt: number;
|
||||
}
|
||||
interface TenantQuota {
|
||||
tenantId: string;
|
||||
resource: string;
|
||||
limit: number;
|
||||
usage: number;
|
||||
}
|
||||
interface TenantDirectoryStore {
|
||||
putMembership(value: TenantMembership): Promise<void>;
|
||||
getMembership(tenantId: string, userId: string): Promise<TenantMembership | null>;
|
||||
listMemberships(tenantId: string): Promise<TenantMembership[]>;
|
||||
putQuota(value: TenantQuota): Promise<void>;
|
||||
getQuota(tenantId: string, resource: string): Promise<TenantQuota | null>;
|
||||
}
|
||||
type TenantResolver = (ctx: Context) => Tenant | null | Promise<Tenant | null>;
|
||||
interface TenantMiddlewareOptions {
|
||||
required?: boolean;
|
||||
@@ -224,11 +271,68 @@ interface TenantMiddlewareOptions {
|
||||
}
|
||||
declare function tenantMiddleware(resolveTenant: TenantResolver, options?: TenantMiddlewareOptions): Middleware;
|
||||
declare function tenantFromSubdomain(lookup: (slug: string, ctx: Context) => Tenant | null | Promise<Tenant | null>, rootDomains?: string[]): TenantResolver;
|
||||
declare function tenantFromDomain(lookup: (domain: string, ctx: Context) => Tenant | null | Promise<Tenant | null>): TenantResolver;
|
||||
declare function tenantFromPath(lookup: (slug: string, ctx: Context) => Tenant | null | Promise<Tenant | null>, prefix?: string): TenantResolver;
|
||||
/** Header resolution is intentionally opt-in and must only be used behind a trusted proxy. */
|
||||
declare function tenantFromHeader(lookup: (id: string, ctx: Context) => Tenant | null | Promise<Tenant | null>, header?: string): TenantResolver;
|
||||
declare function tenantFromSession(resolveId: (ctx: Context) => string | null | Promise<string | null>, lookup: (id: string, ctx: Context) => Tenant | null | Promise<Tenant | null>): TenantResolver;
|
||||
declare function composeTenantResolvers(...resolvers: TenantResolver[]): TenantResolver;
|
||||
declare function requireTenant(ctx: Context): Tenant;
|
||||
/** Wrap a repository so every operation receives the current tenant id. */
|
||||
declare function tenantScope<T extends object>(tenant: Tenant, repository: T): T & {
|
||||
tenantId: string;
|
||||
};
|
||||
declare function assertTenantAccess(tenant: Tenant, resource: TenantResource): void;
|
||||
declare function tenantKey(tenant: Tenant | string, ...parts: Array<string | number>): string;
|
||||
declare function createTenantDirectory(options?: {
|
||||
audit?: (event: TenantAuditEvent) => void | Promise<void>;
|
||||
now?: () => number;
|
||||
}): {
|
||||
addMembership(membership: TenantMembership, actorId?: string): Promise<void>;
|
||||
membership(tenantId: string, userId: string): TenantMembership | null;
|
||||
switchWorkspace(tenantId: string, userId: string, workspaceId: string): Promise<{
|
||||
tenantId: string;
|
||||
workspaceId: string;
|
||||
}>;
|
||||
setQuota(tenantId: string, resource: string, limit: number): void;
|
||||
enforceQuota(tenantId: string, resource: string, usage: number, requested?: number): {
|
||||
usage: number;
|
||||
requested: number;
|
||||
limit: number | undefined;
|
||||
};
|
||||
};
|
||||
declare function memoryTenantDirectoryStore(): TenantDirectoryStore;
|
||||
declare function createPersistentTenantDirectory(store: TenantDirectoryStore, options?: {
|
||||
audit?: (event: TenantAuditEvent) => void | Promise<void>;
|
||||
now?: () => number;
|
||||
}): {
|
||||
addMembership(membership: TenantMembership, actorId?: string): Promise<void>;
|
||||
membership: (tenantId: string, userId: string) => Promise<TenantMembership | null>;
|
||||
memberships: (tenantId: string) => Promise<TenantMembership[]>;
|
||||
switchWorkspace(tenantId: string, userId: string, workspaceId: string): Promise<{
|
||||
tenantId: string;
|
||||
workspaceId: string;
|
||||
}>;
|
||||
setQuota(tenantId: string, resource: string, limit: number, usage?: number): Promise<void>;
|
||||
consumeQuota(tenantId: string, resource: string, requested: number): Promise<TenantQuota | null>;
|
||||
};
|
||||
interface TenantSqlClient {
|
||||
query<T = Record<string, unknown>>(sql: string, parameters?: unknown[]): Promise<{
|
||||
rows: T[];
|
||||
}>;
|
||||
}
|
||||
declare function postgresTenantDirectoryStore(db: TenantSqlClient): TenantDirectoryStore;
|
||||
declare const POSTGRES_TENANT_DIRECTORY_SCHEMA = "CREATE TABLE IF NOT EXISTS wrnexus_tenant_memberships (tenant_id text NOT NULL,user_id text NOT NULL,roles jsonb NOT NULL DEFAULT '[]',workspace_ids jsonb NOT NULL DEFAULT '[]',PRIMARY KEY (tenant_id,user_id)); CREATE TABLE IF NOT EXISTS wrnexus_tenant_quotas (tenant_id text NOT NULL,resource text NOT NULL,quota_limit bigint NOT NULL,usage bigint NOT NULL DEFAULT 0,PRIMARY KEY (tenant_id,resource));";
|
||||
declare function migrateTenants<T extends Tenant>(tenants: T[], migrate: (tenant: T) => void | Promise<void>, options?: {
|
||||
concurrency?: number;
|
||||
continueOnError?: boolean;
|
||||
}): Promise<{
|
||||
migrated: string[];
|
||||
failed: {
|
||||
tenantId: string;
|
||||
error: string;
|
||||
}[];
|
||||
}>;
|
||||
|
||||
interface SpanRecord {
|
||||
name: string;
|
||||
@@ -432,6 +536,47 @@ declare function createContext(req: Request, url: URL): Context;
|
||||
/** Apply headers accumulated on the context, such as Set-Cookie. */
|
||||
declare function withContextHeaders(ctx: Context, res: Response): Response;
|
||||
|
||||
type ExecutionKind = "http" | "api" | "action" | "loader" | "middleware" | "realtime" | "queue" | "cron" | "webhook";
|
||||
interface ResponseContext {
|
||||
status: number;
|
||||
headers: Headers;
|
||||
setStatus(status: number): void;
|
||||
}
|
||||
interface ExecutionContext {
|
||||
kind: ExecutionKind;
|
||||
id: string;
|
||||
request: Request;
|
||||
response: ResponseContext;
|
||||
user: unknown | null;
|
||||
session: unknown | null;
|
||||
tenant: Tenant | null;
|
||||
locale: string;
|
||||
timezone: string;
|
||||
db?: unknown;
|
||||
cache?: unknown;
|
||||
logger?: unknown;
|
||||
trace?: Tracer;
|
||||
signal: AbortSignal;
|
||||
deadline: Date | null;
|
||||
metadata: Record<string, unknown>;
|
||||
authorize(permission: string): void | Promise<void>;
|
||||
}
|
||||
interface ExecutionContextInput extends Partial<Omit<ExecutionContext, "kind" | "id" | "request" | "response" | "signal" | "deadline" | "metadata" | "authorize">> {
|
||||
kind: ExecutionKind;
|
||||
id?: string;
|
||||
request?: Request;
|
||||
response?: Partial<Pick<ResponseContext, "status">> & {
|
||||
headers?: HeadersInit;
|
||||
};
|
||||
signal?: AbortSignal;
|
||||
deadline?: Date | number | null;
|
||||
timeoutMs?: number;
|
||||
metadata?: Record<string, unknown>;
|
||||
authorize?: (permission: string) => void | Promise<void>;
|
||||
}
|
||||
declare function createExecutionContext(input: ExecutionContextInput): ExecutionContext;
|
||||
declare function executionContextFromHttp(context: Context, kind?: Extract<ExecutionKind, "http" | "api" | "action" | "loader" | "middleware" | "webhook">, input?: Omit<ExecutionContextInput, "kind" | "request" | "user" | "tenant" | "locale" | "trace">): ExecutionContext;
|
||||
|
||||
/**
|
||||
* Small, dependency-free security helpers shared across packages.
|
||||
*/
|
||||
@@ -861,7 +1006,7 @@ interface RealtimeSecurityOptions {
|
||||
/** Called when a connection is rejected or closed for a policy violation. */
|
||||
onViolation?(reason: string, client?: RoomClient): void;
|
||||
}
|
||||
interface RoomHandlers<TData = Record<string, unknown>> {
|
||||
interface RoomHandlers<TData = Record<string, unknown>, TMessage = any> {
|
||||
/** Per-room abuse and payload controls. */
|
||||
security?: RealtimeSecurityOptions;
|
||||
/**
|
||||
@@ -872,16 +1017,16 @@ interface RoomHandlers<TData = Record<string, unknown>> {
|
||||
/** A client connected (a new tab joined the room). */
|
||||
onConnect?(client: RoomClient<TData>): void | Promise<void>;
|
||||
/** A message arrived (JSON is parsed; non-JSON arrives as a string). */
|
||||
onMessage?(client: RoomClient<TData>, message: any): void | Promise<void>;
|
||||
onMessage?(client: RoomClient<TData>, message: TMessage): void | Promise<void>;
|
||||
/** A client disconnected. */
|
||||
onLeave?(client: RoomClient<TData>): void | Promise<void>;
|
||||
}
|
||||
interface RoomDefinition<TData = Record<string, unknown>> {
|
||||
interface RoomDefinition<TData = Record<string, unknown>, TMessage = any> {
|
||||
readonly __wrnexusRoom: true;
|
||||
readonly handlers: RoomHandlers<TData>;
|
||||
readonly handlers: RoomHandlers<TData, TMessage>;
|
||||
}
|
||||
/** Define a realtime room. Export the result as the `default` of a realtime file. */
|
||||
declare function defineRoom<TData = Record<string, unknown>>(handlers: RoomHandlers<TData>): RoomDefinition<TData>;
|
||||
declare function defineRoom<TData = Record<string, unknown>, TMessage = any>(handlers: RoomHandlers<TData, TMessage>): RoomDefinition<TData, TMessage>;
|
||||
declare function isRoomDefinition(value: unknown): value is RoomDefinition;
|
||||
interface RealtimeConnectMeta {
|
||||
room: string;
|
||||
@@ -1085,6 +1230,11 @@ declare function withSecurityHeaders(req: Request, res: Response, mode: Mode, se
|
||||
interface SchemaLike<T> {
|
||||
parse(input: unknown): T;
|
||||
}
|
||||
interface OutputSchemaLike<T> {
|
||||
readonly __output: T;
|
||||
parse(input: unknown): unknown;
|
||||
}
|
||||
type InferEndpointSchema<TSchema> = TSchema extends OutputSchemaLike<infer TValue> ? TValue : never;
|
||||
interface EndpointErrorBody {
|
||||
code: string;
|
||||
message: string;
|
||||
@@ -1097,8 +1247,8 @@ declare class EndpointError extends Error {
|
||||
constructor(status: number, code: string, message: string, details?: unknown | undefined);
|
||||
}
|
||||
interface EndpointDefinition<I, O> {
|
||||
input?: SchemaLike<I>;
|
||||
output?: SchemaLike<O>;
|
||||
input?: SchemaLike<I> | OutputSchemaLike<I>;
|
||||
output?: SchemaLike<O> | OutputSchemaLike<O>;
|
||||
auth?: "optional" | "required";
|
||||
description?: string;
|
||||
tags?: string[];
|
||||
@@ -1109,6 +1259,10 @@ interface DefinedEndpoint<I, O> {
|
||||
(ctx: Context, input?: unknown): Promise<Response>;
|
||||
}
|
||||
/** Define a validated, typed endpoint that can also drive SDK/OpenAPI generation. */
|
||||
declare function defineEndpoint<InputSchema extends OutputSchemaLike<unknown>, OutputSchema extends OutputSchemaLike<unknown>>(definition: Omit<EndpointDefinition<InferEndpointSchema<InputSchema>, InferEndpointSchema<OutputSchema>>, "input" | "output"> & {
|
||||
input: InputSchema;
|
||||
output: OutputSchema;
|
||||
}): DefinedEndpoint<InferEndpointSchema<InputSchema>, InferEndpointSchema<OutputSchema>>;
|
||||
declare function defineEndpoint<I = unknown, O = unknown>(definition: EndpointDefinition<I, O>): DefinedEndpoint<I, O>;
|
||||
interface RpcClientOptions {
|
||||
baseUrl?: string;
|
||||
@@ -1199,6 +1353,65 @@ interface BudgetViolation {
|
||||
declare const recommendedWebBudgets: Readonly<PerformanceBudgets>;
|
||||
declare function checkPerformanceBudgets(budgets: PerformanceBudgets, measurement: PerformanceMeasurement): BudgetViolation[];
|
||||
|
||||
type Duration = number | `${number}${"ms" | "s" | "m" | "h"}`;
|
||||
type BackoffStrategy = "fixed" | "exponential" | ((attempt: number) => Duration);
|
||||
interface CircuitBreakerOptions {
|
||||
failures: number;
|
||||
resetAfter: Duration;
|
||||
successesToClose?: number;
|
||||
}
|
||||
interface CircuitBreakerSnapshot {
|
||||
state: "closed" | "open" | "half-open";
|
||||
failures: number;
|
||||
successes: number;
|
||||
retryAfterMs: number;
|
||||
}
|
||||
declare class ResilienceError extends Error {
|
||||
readonly code: "WRN-RESILIENCE-TIMEOUT" | "WRN-RESILIENCE-ABORTED" | "WRN-RESILIENCE-CIRCUIT-OPEN" | "WRN-RESILIENCE-BULKHEAD-FULL";
|
||||
constructor(code: "WRN-RESILIENCE-TIMEOUT" | "WRN-RESILIENCE-ABORTED" | "WRN-RESILIENCE-CIRCUIT-OPEN" | "WRN-RESILIENCE-BULKHEAD-FULL", message: string, options?: ErrorOptions);
|
||||
}
|
||||
declare function durationMs(value: Duration): number;
|
||||
declare class CircuitBreaker {
|
||||
private readonly options;
|
||||
private failures;
|
||||
private successes;
|
||||
private openedAt;
|
||||
private probing;
|
||||
constructor(options: CircuitBreakerOptions);
|
||||
snapshot(now?: number): CircuitBreakerSnapshot;
|
||||
execute<T>(operation: () => Promise<T>): Promise<T>;
|
||||
}
|
||||
interface BulkheadOptions {
|
||||
concurrency: number;
|
||||
queue?: number;
|
||||
}
|
||||
declare class Bulkhead {
|
||||
private readonly options;
|
||||
private active;
|
||||
private readonly waiting;
|
||||
constructor(options: BulkheadOptions);
|
||||
get snapshot(): Readonly<{
|
||||
active: number;
|
||||
queued: number;
|
||||
capacity: number;
|
||||
}>;
|
||||
execute<T>(operation: () => Promise<T>): Promise<T>;
|
||||
}
|
||||
interface ResilientCallOptions<T> {
|
||||
run: (signal: AbortSignal, attempt: number) => Promise<T>;
|
||||
timeout?: Duration;
|
||||
retries?: number;
|
||||
retryDelay?: Duration;
|
||||
backoff?: BackoffStrategy;
|
||||
circuitBreaker?: CircuitBreaker | CircuitBreakerOptions;
|
||||
bulkhead?: Bulkhead | BulkheadOptions;
|
||||
signal?: AbortSignal;
|
||||
retryWhen?: (error: unknown, attempt: number) => boolean | Promise<boolean>;
|
||||
fallback?: (error: unknown, signal: AbortSignal) => T | Promise<T>;
|
||||
onRetry?: (error: unknown, attempt: number, delayMs: number) => void;
|
||||
}
|
||||
declare function resilientCall<T>(options: ResilientCallOptions<T>): Promise<T>;
|
||||
|
||||
interface ProblemDetails {
|
||||
type: string;
|
||||
title: string;
|
||||
@@ -1273,7 +1486,7 @@ declare function withIdempotency<T>(store: IdempotencyStore<T>, key:
|
||||
replayed: boolean;
|
||||
}>;
|
||||
|
||||
export { type ActionDefinition, ApplicationLifecycle, type AsyncSessionBackend, type Bucket, type BudgetViolation, CSRF_COOKIE, CSRF_HEADER, type CacheControlOptions, type CachePolicy, type ContentSecurityPolicyConfig, type Context, type CookieOptions, type CookieStore, type CorsConfig, type CorsOrigin, type CspDirectiveValue, type CsrfProtectionOptions, type DefinedAction, type DefinedEndpoint, type DefinedLoader, type EndpointDefinition, EndpointError, type EndpointErrorBody, type FeatureFlags, type FeatureRule, type FeatureValue, type HealthCheck, type HealthCheckResult, HealthRegistry, type HstsConfig, type IdempotencyRecord, type IdempotencyStore, type LifecycleHandler, type LifecyclePhase, type LoaderDefinition, type LocalStorageSnapshot, type Middleware, type Mode, type Next, type PageComponent, type PageMeta, type PerformanceBudgets, type PerformanceMeasurement, type PermissionsPolicyConfig, type ProblemDetails, type ProblemDetailsInput, type RateLimitOptions, type RateLimitStore, type RawSocket, type RealtimeBridge, type RealtimeBus, type RealtimeConnectMeta, type RealtimeEnvelope, type RealtimeHandler, type RealtimeRegistry, type RealtimeRegistryOptions, type RealtimeSecurityOptions, type RealtimeSocket, type RequestLimitsConfig, type RequestLoggerOptions, type RequestRecord, type RequireAuthOptions, type Room, type RoomAuthInfo, type RoomClient, type RoomDefinition, type RoomHandlers, type RpcClientOptions, SESSION_USER_KEY, type SaveUploadOptions, type SavedUpload, type SchemaLike, type SecureUploadOptions, type SecurityConfig, type SeoConfig, type ServerSentEvent, ServiceContainer, type ServiceToken, type SessionBackend, type SessionEntry, type SessionPolicy, type SessionStore, type Span, type SpanRecord, type StreamResponseInit, type TFunction, TTLCache, type Target, type Tenant, type TenantMiddlewareOptions, type TenantResolver, type Tracer, type TrustedTypesConfig, UploadError, type UploadInspectionResult, type UploadInspector, type UploadScanner, bridgeRealtime, cacheControl, checkPerformanceBudgets, collectUploads, createContext, createCorsPreflightResponse, createRealtimeRegistry, createRpcClient, createTracer, csrfProtection, csrfToken, dedupe, defaultKey, defineAction, defineEndpoint, defineFeatureFlags, defineLoader, defineRoom, escapeHtml, etag, getUser, hashPassword, isRoomDefinition, isSafeIslandName, isSafeRequestPath, isWebSocketOriginAllowed, loadSession, logIn, logOut, memoryIdempotencyStore, notModified, peerKey, problem, proxyKey, randomUploadFilename, rateLimit, recommendedWebBudgets, renderDevError, renderError, renderNotFound, renderProdError, renderStatusPage, requestId, requestLogger, requireAuth, requireTenant, resolveRequestUrl, sanitizeFilename, saveUpload, saveUploadSecure, secureDownloadHeaders, serviceToken, sessionAuth, setSessionBackend, setSessionPolicy, sse, streamResponse, tenantFromSubdomain, tenantMiddleware, tenantScope, tracingMiddleware, verifyCsrf, verifyPassword, withCacheControl, withContextHeaders, withIdempotency, withSecurityHeaders, withSpan };
|
||||
export { type ActionDefinition, ApplicationLifecycle, type AsyncSessionBackend, type BackoffStrategy, type Bucket, type BudgetViolation, Bulkhead, type BulkheadOptions, CSRF_COOKIE, CSRF_HEADER, type CacheControlOptions, type CachePolicy, CircuitBreaker, type CircuitBreakerOptions, type CircuitBreakerSnapshot, type ContentSecurityPolicyConfig, type Context, type CookieOptions, type CookieStore, type CorsConfig, type CorsOrigin, type CspDirectiveValue, type CsrfProtectionOptions, type DefinedAction, type DefinedEndpoint, type DefinedLoader, type Duration, type EndpointDefinition, EndpointError, type EndpointErrorBody, type ExecutionContext, type ExecutionContextInput, type ExecutionKind, type FeatureFlags, type FeatureRule, type FeatureValue, type HealthCheck, type HealthCheckResult, HealthRegistry, type HstsConfig, type IdempotencyRecord, type IdempotencyStore, type InferEndpointSchema, type LifecycleHandler, type LifecyclePhase, type LoaderDefinition, type LocalStorageSnapshot, type Middleware, type Mode, type Next, type OutputSchemaLike, POSTGRES_TENANT_DIRECTORY_SCHEMA, type PageComponent, type PageMeta, type PerformanceBudgets, type PerformanceMeasurement, type PermissionsPolicyConfig, type ProblemDetails, type ProblemDetailsInput, type RateLimitOptions, type RateLimitStore, type RawSocket, type RealtimeBridge, type RealtimeBus, type RealtimeConnectMeta, type RealtimeEnvelope, type RealtimeHandler, type RealtimeRegistry, type RealtimeRegistryOptions, type RealtimeSecurityOptions, type RealtimeSocket, type RequestLimitsConfig, type RequestLoggerOptions, type RequestRecord, type RequireAuthOptions, ResilienceError, type ResilientCallOptions, type ResponseContext, type Room, type RoomAuthInfo, type RoomClient, type RoomDefinition, type RoomHandlers, type RpcClientOptions, SESSION_USER_KEY, type SaveUploadOptions, type SavedUpload, type SchemaLike, type SecureUploadOptions, type SecurityConfig, type SeoConfig, type ServerSentEvent, ServiceContainer, type ServiceToken, type SessionBackend, type SessionEntry, type SessionPolicy, type SessionStore, type Span, type SpanRecord, type StreamResponseInit, type TFunction, TTLCache, type Target, type Tenant, type TenantAuditEvent, type TenantDirectoryStore, type TenantMembership, type TenantMiddlewareOptions, type TenantQuota, type TenantResolver, type TenantResource, type TenantSqlClient, type Tracer, type TrustedTypesConfig, UploadError, type UploadInspectionResult, type UploadInspector, type UploadScanner, assertTenantAccess, bridgeRealtime, cacheControl, checkPerformanceBudgets, collectUploads, composeTenantResolvers, createContext, createCorsPreflightResponse, createExecutionContext, createPersistentTenantDirectory, createRealtimeRegistry, createRpcClient, createTenantDirectory, createTracer, csrfProtection, csrfToken, dedupe, defaultKey, defineAction, defineEndpoint, defineFeatureFlags, defineLoader, defineRoom, durationMs, escapeHtml, etag, executionContextFromHttp, getUser, hashPassword, isRoomDefinition, isSafeIslandName, isSafeRequestPath, isWebSocketOriginAllowed, loadSession, logIn, logOut, memoryIdempotencyStore, memoryTenantDirectoryStore, migrateTenants, notModified, peerKey, postgresTenantDirectoryStore, problem, proxyKey, randomUploadFilename, rateLimit, recommendedWebBudgets, renderDevError, renderError, renderNotFound, renderProdError, renderStatusPage, requestId, requestLogger, requireAuth, requireTenant, resilientCall, resolveRequestUrl, sanitizeFilename, saveUpload, saveUploadSecure, secureDownloadHeaders, serviceToken, sessionAuth, setSessionBackend, setSessionPolicy, sse, streamResponse, tenantFromDomain, tenantFromHeader, tenantFromPath, tenantFromSession, tenantFromSubdomain, tenantKey, tenantMiddleware, tenantScope, tracingMiddleware, verifyCsrf, verifyPassword, withCacheControl, withContextHeaders, withIdempotency, withSecurityHeaders, withSpan };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>A minimal middleware chain</h3><pre data-language="ts"><code>import {
|
||||
createContext,
|
||||
withContextHeaders,
|
||||
@@ -1335,9 +1548,9 @@ import { redisDriver } from "@wrnexus/pubsub/redis";
|
||||
|
||||
const registry = createRealtimeRegistry();
|
||||
bridgeRealtime(registry, createPubSub(redisDriver(process.env.REDIS_URL)));</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#context-middleware-wrnexus-core">Context & middleware — @wrnexus/core</a><a class="toc-level-4" href="#authentication-wrnexus-core">Authentication — @wrnexus/core</a><a class="toc-level-4" href="#csrf-wrnexus-core">CSRF — @wrnexus/core</a><a class="toc-level-4" href="#rate-limiting-wrnexus-core">Rate limiting — @wrnexus/core</a><a class="toc-level-4" href="#request-logging-wrnexus-core">Request logging — @wrnexus/core</a><a class="toc-level-4" href="#caching-wrnexus-core">Caching — @wrnexus/core</a><a class="toc-level-4" href="#file-uploads-wrnexus-core">File uploads — @wrnexus/core</a><a class="toc-level-4" href="#streaming-sse-wrnexus-core">Streaming & SSE — @wrnexus/core</a><a class="toc-level-4" href="#realtime-rooms-wrnexus-core">Realtime rooms — @wrnexus/core</a><a class="toc-level-4" href="#error-pages-wrnexus-core">Error pages — @wrnexus/core</a><a class="toc-level-4" href="#security-headers-cors-wrnexus-core">Security headers & CORS — @wrnexus/core</a><a class="toc-level-4" href="#storage-cookies-sessions-localstorage-wrnexus-core">Storage: cookies, sessions, localStorage — @wrnexus/core</a><a class="toc-level-4" href="#low-level-security-helpers-wrnexus-core">Low-level security helpers — @wrnexus/core</a><a class="toc-level-4" href="#jsx-runtime-wrnexus-core-wrnexus-core-jsx-runtime-wrnexus-core-jsx-dev-runtime">JSX runtime — @wrnexus/core, @wrnexus/core/jsx-runtime, @wrnexus/core/jsx-dev-runtime</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#a-minimal-middleware-chain">A minimal middleware chain</a><a class="toc-level-4" href="#password-auth">Password auth</a><a class="toc-level-4" href="#http-caching-with-etags">HTTP caching with ETags</a><a class="toc-level-4" href="#streaming-sse">Streaming SSE</a><a class="toc-level-4" href="#a-realtime-room">A realtime room</a><a class="toc-level-4" href="#jsx-rendering">JSX rendering</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#context-middleware-wrnexus-core">Context & middleware — @wrnexus/core</a><a class="toc-level-4" href="#authentication-wrnexus-core">Authentication — @wrnexus/core</a><a class="toc-level-4" href="#csrf-wrnexus-core">CSRF — @wrnexus/core</a><a class="toc-level-4" href="#rate-limiting-wrnexus-core">Rate limiting — @wrnexus/core</a><a class="toc-level-4" href="#request-logging-wrnexus-core">Request logging — @wrnexus/core</a><a class="toc-level-4" href="#resilience-wrnexus-core">Resilience — @wrnexus/core</a><a class="toc-level-4" href="#caching-wrnexus-core">Caching — @wrnexus/core</a><a class="toc-level-4" href="#file-uploads-wrnexus-core">File uploads — @wrnexus/core</a><a class="toc-level-4" href="#streaming-sse-wrnexus-core">Streaming & SSE — @wrnexus/core</a><a class="toc-level-4" href="#realtime-rooms-wrnexus-core">Realtime rooms — @wrnexus/core</a><a class="toc-level-4" href="#error-pages-wrnexus-core">Error pages — @wrnexus/core</a><a class="toc-level-4" href="#security-headers-cors-wrnexus-core">Security headers & CORS — @wrnexus/core</a><a class="toc-level-4" href="#storage-cookies-sessions-localstorage-wrnexus-core">Storage: cookies, sessions, localStorage — @wrnexus/core</a><a class="toc-level-4" href="#low-level-security-helpers-wrnexus-core">Low-level security helpers — @wrnexus/core</a><a class="toc-level-4" href="#jsx-runtime-wrnexus-core-wrnexus-core-jsx-runtime-wrnexus-core-jsx-dev-runtime">JSX runtime — @wrnexus/core, @wrnexus/core/jsx-runtime, @wrnexus/core/jsx-dev-runtime</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#a-minimal-middleware-chain">A minimal middleware chain</a><a class="toc-level-4" href="#password-auth">Password auth</a><a class="toc-level-4" href="#http-caching-with-etags">HTTP caching with ETags</a><a class="toc-level-4" href="#streaming-sse">Streaming SSE</a><a class="toc-level-4" href="#a-realtime-room">A realtime room</a><a class="toc-level-4" href="#jsx-rendering">JSX rendering</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,21 @@ page wrnexuscsr {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/csr</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/csr</h1><p>Reactive, navigation, and realtime browser runtimes.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/csr@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The browser-side client runtime for WRNexusJS — generic, self-contained JS that hydrates server-rendered pages with reactivity, client-side navigation, and realtime rooms.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/csr</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/csr</h1><p>Reactive, navigation, and realtime browser runtimes.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/csr@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><h3 id="navigation-state-preservation">Navigation state preservation</h3>
|
||||
<p>Pages can opt into restoration across client navigation:</p>
|
||||
<pre data-language="wrn"><code>page Users {
|
||||
navigation {
|
||||
preserve = ["filters", "pagination", "scroll", "tabs", "expanded"]
|
||||
}
|
||||
}</code></pre>
|
||||
<p>Form-like categories restore named inputs, selects, and textareas. Password, file, hidden, CSRF/token/secret/credential fields, and elements marked <code>data-no-preserve</code> are never saved. For tab, expanded, or component UI state, mark stable elements with <code>data-wrn-preserve="key"</code>; their value and ARIA selected/expanded state are restored. State is scoped to pathname plus query.</p>
|
||||
<h3 id="typed-server-actions">Typed server actions</h3>
|
||||
<p><code>createActionClient<Input, Output>(route, name)</code> supports programmatic calls. Schema-backed WRN actions also export <code>__wrnexusActionClients</code>, whose input and output are inferred automatically. Enhanced forms expose <code>data-wrn-action-state="pending|success|error"</code> and dispatch bubbling <code>wrnexus:action:optimistic</code>, <code>:pending</code>, <code>:success</code>, and <code>:error</code> events. Success details contain returned data and invalidated cache tags; error details contain field errors. Without JavaScript, the same form posts to its page and receives a 303 redirect or accessible validation response.</p>
|
||||
<blockquote>The browser-side client runtime for WRNexusJS — generic, self-contained JS that hydrates server-rendered pages with reactivity, client-side navigation, and realtime rooms.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/csr</code> holds the three client runtimes that WRNexusJS serves to the browser. Components are authored as <code>.wrn</code> files and rendered on the <strong>server</strong>; this package provides the single, generic runtime that <strong>hydrates</strong> that HTML in the browser — there are no per-component browser bundles. Each runtime is exported as a plain-JS string (no build step, no imports) intended to be served verbatim from a well-known URL:</p>
|
||||
@@ -42,7 +52,10 @@ getRealtimeRuntime(): string // → REALTIME_RUNTIME</code></pre>
|
||||
<p>Applied to any subtree containing <code>data-scope</code>. Expressions are parsed by a tiny eval-free evaluator, so a strict CSP with no <code>unsafe-eval</code> works.</p>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Directive</th><th>Purpose</th></tr></thead>
|
||||
<tbody><tr><td><code>data-scope="count: 0, name: 'x'"</code></td><td>Declare reactive state on a subtree</td></tr><tr><td><code>data-on-<event>="count++"</code></td><td>Run a statement in scope on a DOM event</td></tr><tr><td><code>data-text="expr"</code></td><td>Bind an element's <code>textContent</code> to an expression</td></tr><tr><td><code>data-show="expr"</code></td><td>Toggle visibility (<code>display</code>) on truthiness</td></tr><tr><td><code>data-for="item in list"</code> (opt. index and <code>key item.id</code>)</td><td>Per-item rendering; stable keys preserve DOM identity during reorder</td></tr><tr><td><code>data-key="item.id"</code></td><td>Alternative key declaration for <code>data-for</code> templates</td></tr><tr><td><code>{{expr}}</code> or <code>{expr}</code></td><td>Interpolation inside text nodes and attribute values</td></tr><tr><td><code>data-wrnexus-csr="id"</code></td><td>Target for a generated CSR fetch binding (fetches <code>/__wrnexus/csr?...</code>)</td></tr></tbody></table></div>
|
||||
<tbody><tr><td><code>data-scope="count: 0, name: 'x'"</code></td><td>Declare reactive state on a subtree</td></tr><tr><td><code>data-on-<event>="count++"</code></td><td>Run a statement in scope on a DOM event</td></tr><tr><td><code>data-text="expr"</code></td><td>Bind an element's <code>textContent</code> to an expression</td></tr><tr><td><code>data-show="expr"</code></td><td>Toggle visibility while preserving interactive state</td></tr></tbody></table></div>
|
||||
<p>Compiled conditional rendering and dynamic component cases omit inactive elements from the live DOM. <code>data-show</code> is a visibility directive for stateful controls and keeps its element mounted. Neither mechanism is authorization: never place secrets in client-rendered branches. Authorize on the server and return only data the current request may access.</p>
|
||||
<div class="table-wrap"><table>
|
||||
<tbody><tr><td><code>data-for="item in list"</code> (opt. index and <code>key item.id</code>)</td><td>Per-item rendering; stable keys preserve DOM identity during reorder</td></tr><tr><td><code>data-key="item.id"</code></td><td>Alternative key declaration for <code>data-for</code> templates</td></tr><tr><td><code>{{expr}}</code> or <code>{expr}</code></td><td>Interpolation inside text nodes and attribute values</td></tr><tr><td><code>data-wrnexus-csr="id"</code></td><td>Target for a generated CSR fetch binding (fetches <code>/__wrnexus/csr?...</code>)</td></tr></tbody></table></div>
|
||||
<p>Supported expression features: literals, identifiers, member access (<code>a.b</code>, <code>a[b]</code>), function/method calls, arrays, objects, arithmetic, comparison, equality, logical (<code>&& ||</code>), unary (<code>! - +</code>), and ternary. Statements support <code>++</code>/<code>--</code>, assignment operators (<code>= += -= *= /= %=</code>), and bare expression/method calls. Rendering is dependency-tracked: a signal change only re-runs the renderers that actually read it.</p>
|
||||
<p>Browser globals installed: <code>window.__wrnexusHydrateScopes(root)</code> and <code>window.__wrnexusHydrateCsrFetches(root)</code> — both idempotent, so re-running after a DOM swap or HMR morph is safe. Both run automatically on <code>DOMContentLoaded</code>.</p>
|
||||
<h4 id="browser-navigation">Browser: navigation</h4>
|
||||
@@ -189,6 +202,8 @@ declare const NAV_RUNTIME: string;
|
||||
*/
|
||||
declare const REALTIME_RUNTIME: string;
|
||||
|
||||
declare const ACTION_RUNTIME: string;
|
||||
|
||||
type OutputHandler<T = unknown> = (payload: T) => void | Promise<void>;
|
||||
interface OutputHost extends HTMLElement {
|
||||
__wrnexusOutputHandlers?: Map<string, Set<OutputHandler>>;
|
||||
@@ -223,6 +238,23 @@ interface ClientModuleScope {
|
||||
declare function loadClientFunctions(url: string, scope: ClientModuleScope): Promise<Record<string, (...args: unknown[]) => unknown>>;
|
||||
declare function invalidateClientModule(url: string): void;
|
||||
|
||||
interface ActionClientOptions<I> {
|
||||
signal?: AbortSignal;
|
||||
csrfToken?: string;
|
||||
headers?: HeadersInit;
|
||||
serialize?: (input: I) => BodyInit;
|
||||
}
|
||||
interface ActionResult<O> {
|
||||
data: O;
|
||||
invalidated: string[];
|
||||
}
|
||||
declare class ActionClientError extends Error {
|
||||
readonly status: number;
|
||||
readonly errors?: Record<string, string> | undefined;
|
||||
constructor(status: number, errors?: Record<string, string> | undefined);
|
||||
}
|
||||
declare function createActionClient<I, O>(route: string, name: string): (input: I, options?: ActionClientOptions<I>) => Promise<ActionResult<O>>;
|
||||
|
||||
interface HydrationScopeApi {
|
||||
get(name: string): unknown;
|
||||
set(name: string, value: unknown): void;
|
||||
@@ -250,8 +282,9 @@ declare function getReactiveRuntime(): string;
|
||||
declare function getNavRuntime(): string;
|
||||
/** The realtime client runtime served at `/__wrnexus/realtime.js`. */
|
||||
declare function getRealtimeRuntime(): string;
|
||||
declare function getActionRuntime(): string;
|
||||
|
||||
export { type ClientModuleScope, type HydrationScopeApi, NAV_RUNTIME, type OutputHandler, type OutputHost, REACTIVE_RUNTIME, REALTIME_RUNTIME, type ServerCallOptions, WrnServerCallError, type WrnexusBrowserGlobals, callServerFunction, collectRefs, createOutputProxy, createServerProxy, getNavRuntime, getReactiveRuntime, getRealtimeRuntime, invalidateClientModule, invokeOutput, loadClientFunctions, registerOutputHandler };
|
||||
export { ACTION_RUNTIME, ActionClientError, type ActionClientOptions, type ActionResult, type ClientModuleScope, type HydrationScopeApi, NAV_RUNTIME, type OutputHandler, type OutputHost, REACTIVE_RUNTIME, REALTIME_RUNTIME, type ServerCallOptions, WrnServerCallError, type WrnexusBrowserGlobals, callServerFunction, collectRefs, createActionClient, createOutputProxy, createServerProxy, getActionRuntime, getNavRuntime, getReactiveRuntime, getRealtimeRuntime, invalidateClientModule, invokeOutput, loadClientFunctions, registerOutputHandler };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Server side — serve the runtime strings from your router (example with Bun.serve)</h3><pre data-language="ts"><code>import { getReactiveRuntime, getNavRuntime, getRealtimeRuntime } from "@wrnexus/csr";
|
||||
|
||||
const routes: Record<string, string> = {
|
||||
@@ -295,9 +328,9 @@ Bun.serve({
|
||||
<script src="/__wrnexus/realtime.js"></script></code></pre></article><article class="example-card"><h3>Or drive a room from code</h3><pre data-language="ts"><code>const room = wire.room("lobby");
|
||||
room.on("chat", (msg) => console.log(msg.user, msg.text));
|
||||
room.send({ type: "chat", user: "ada", text: "hi" });</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#runtime-strings">Runtime strings</a><a class="toc-level-4" href="#accessor-functions">Accessor functions</a><a class="toc-level-4" href="#browser-reactive-directives">Browser: reactive directives</a><a class="toc-level-4" href="#browser-navigation">Browser: navigation</a><a class="toc-level-4" href="#browser-realtime-rooms">Browser: realtime rooms</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#navigation-state-preservation">Navigation state preservation</a><a class="toc-level-3" href="#typed-server-actions">Typed server actions</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#runtime-strings">Runtime strings</a><a class="toc-level-4" href="#accessor-functions">Accessor functions</a><a class="toc-level-4" href="#browser-reactive-directives">Browser: reactive directives</a><a class="toc-level-4" href="#browser-navigation">Browser: navigation</a><a class="toc-level-4" href="#browser-realtime-rooms">Browser: realtime rooms</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+135
-16
@@ -10,11 +10,13 @@ page wrnexusdb {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/db</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/db</h1><p>Database adapters, typed queries, models, migrations, and sessions.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/db@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The database layer for WRNexusJS: TS models as the single source of truth for DDL, validation, and result typing, plus a driver-based <code>Db</code> client, migrations, and a sqlc-style query generator.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/db</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/db</h1><p>Database adapters, typed queries, models, migrations, and sessions.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/db@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><h3 id="rollout-safe-migrations">Rollout-safe migrations</h3>
|
||||
<p>Run <code>wrnexus db check</code> in CI before deployment. The analyzer reports stable diagnostics for drops, renames, type changes, new/enforced required columns, and potentially blocking index creation, with an expand/backfill/switch/contract recommendation. <code>wrnexus db migrate</code> blocks critical issues in pending migrations. <code>--allow-breaking</code> is an explicit operator override; already-applied migrations do not block later releases.</p>
|
||||
<blockquote>The database layer for WRNexusJS: TS models as the single source of truth for DDL, validation, and result typing, plus a driver-based <code>Db</code> client, migrations, and a sqlc-style query generator.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/db</code> is the server-side data layer. You describe tables as TypeScript models (the <code>v</code> column builder + <code>table()</code>); those models drive migrations, coerce raw DB rows into typed objects, and feed the query generator. A thin <code>Driver</code> interface is implemented by adapters for SQLite (<code>bun:sqlite</code>), Postgres/MySQL (<code>Bun.SQL</code>), and MongoDB. The <code>Db</code> client adds ergonomics — model-mapped <code>all</code>/<code>one</code>, transactions, <code>createTable</code>, pagination, and batched relation loading. A process-wide registry (<code>getDb</code>/<code>setDb</code>) exposes configured connections to pages and API routes. Reach for it whenever a WRNexusJS app needs persistence.</p>
|
||||
@@ -50,7 +52,8 @@ const users = table("users", {
|
||||
<li><code>exec(sql, params?)</code> — <code>Promise<ExecResult></code> (<code>{ changes, lastInsertId? }</code>).</li>
|
||||
<li><code>tx(fn)</code> — run <code>fn(db)</code> in a transaction; rolls back on throw. Nested <code>tx</code> reuses the current transaction.</li>
|
||||
<li><code>createTable(model)</code> — runs the model's <code>CREATE TABLE IF NOT EXISTS</code> DDL.</li>
|
||||
<li><code>close()</code>.</li>
|
||||
<li><code>close()</code> — idempotently rejects new top-level work, drains active queries and</li>
|
||||
<p>transactions, then closes the underlying pool.</p>
|
||||
</ul>
|
||||
<p>Every query is parameterized (positional params). <code>createTableSql(model, dialect, ifNotExists?)</code> renders <code>CREATE TABLE</code> directly; <code>Dialect</code> is <code>"sqlite" | "postgres" | "mysql"</code>.</p>
|
||||
<h4 id="client-registry-getdb-setdb">Client registry — <code>getDb</code> / <code>setDb</code></h4>
|
||||
@@ -59,7 +62,8 @@ const users = table("users", {
|
||||
<li><code>setDb(db)</code> / <code>setDb(name, db)</code> — set the default or a named connection.</li>
|
||||
<li><code>registerDb(name, db)</code> — alias of <code>setDb(name, db)</code>.</li>
|
||||
<li><code>getDb(name = "default")</code> — the default or a named <code>Db</code> (throws if unconfigured).</li>
|
||||
<li><code>hasDb(name?)</code>, <code>databaseNames()</code>, <code>closeDatabases()</code>.</li>
|
||||
<li><code>hasDb(name?)</code>, <code>databaseNames()</code>, <code>closeDatabases()</code>. Registry shutdown clears</li>
|
||||
<p>registrations first, attempts every open database, and reports close failures together with <code>AggregateError</code> instead of leaking later pools.</p>
|
||||
</ul>
|
||||
<pre data-language="ts"><code>const users = await getDb().all("SELECT * FROM users");
|
||||
const events = await getDb("analytics").all("SELECT * FROM hits");</code></pre>
|
||||
@@ -76,8 +80,8 @@ const events = await getDb("analytics").all("SELECT * FROM hits&q
|
||||
<li><code>parseMigration(name, content)</code> → <code>Migration</code> (<code>{ name, up, down }</code>).</li>
|
||||
<li><code>loadMigrations(dir)</code> — parse all <code>.sql</code> files, sorted by filename.</li>
|
||||
<li><code>appliedMigrations(db)</code> — applied names, oldest first.</li>
|
||||
<li><code>migrate(db, dir)</code> — apply all pending (each in a transaction); returns applied names.</li>
|
||||
<li><code>rollback(db, dir)</code> — roll back the most recent; returns its name or <code>null</code>.</li>
|
||||
<li><code>migrate(db, dir, options?)</code> — apply all pending (each in a transaction); returns applied names.</li>
|
||||
<li><code>rollback(db, dir, options?)</code> — roll back the most recent; returns its name or <code>null</code>.</li>
|
||||
<li><code>status(db, dir)</code> — <code>{ name, applied }[]</code> for every migration file.</li>
|
||||
<li><code>scaffoldMigration(dir, name, dialect, models?)</code> — write a new numbered migration; with <code>models</code> it generates <code>CREATE</code>/<code>DROP</code> for every table (referenced tables first via topological sort). Returns the file path.</li>
|
||||
</ul>
|
||||
@@ -132,6 +136,12 @@ const pageTwo = await paginate(
|
||||
{ sql: "SELECT * FROM users ORDER BY id", model: users },
|
||||
{ page: 2 },
|
||||
);</code></pre>
|
||||
<p>For deployments, <code>{ dryRun: true }</code> reports pending names without applying their SQL, <code>signal</code> cancels safely between migrations, and the default database-backed lock prevents concurrent deploy runners. A live lock produces <code>WRN-DB-MIGRATION-LOCKED</code>; crash-stale locks expire after <code>lockTimeoutMs</code> (five minutes by default). Disable it with <code>lock: false</code> only when an external deploy coordinator already guarantees exclusivity.</p>
|
||||
<pre data-language="ts"><code>const pending = await migrate(db, "app/db/migrations", { dryRun: true });
|
||||
await migrate(db, "app/db/migrations", {
|
||||
signal: shutdownController.signal,
|
||||
lockTimeoutMs: 10 * 60_000,
|
||||
});</code></pre>
|
||||
<p>MongoDB (document API):</p>
|
||||
<pre data-language="ts"><code>import { mongo } from "@wrnexus/db/mongo";
|
||||
|
||||
@@ -149,10 +159,39 @@ const active = await repo.find({ active: true });</code></pre>
|
||||
<p><code>SessionBackend</code>; <code>getDb</code>/<code>setDb</code> are wired by the WRNexusJS runtime from <code>wrnexus.config.ts</code>.</p>
|
||||
<li>The <code>mongodb</code> npm package is an optional, lazily-imported peer — install it</li>
|
||||
<p>only if you use <code>@wrnexus/db/mongo</code>. The core package stays dependency-free.</p>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { M as Model } from './schema-tVurYsbL.js';
|
||||
</ul>
|
||||
<h3 id="repository-and-transaction-helpers">Repository and transaction helpers</h3>
|
||||
<p>Repositories accept an immutable equality <code>scope</code>, normally <code>{ column: "tenant_id", value: ctx.tenant.id }</code>. The scope is injected into every read, count, update and delete, while create overwrites any caller-supplied tenant value. This makes accidental cross-tenant CRUD through the repository API fail closed.</p>
|
||||
<pre data-language="ts"><code>import { createRepository, retryTransaction, databaseHealth, batch } from "@wrnexus/db";
|
||||
|
||||
const users = createRepository<User>(db, {
|
||||
table: "users",
|
||||
allowedColumns: ["email", "name", "active"],
|
||||
});
|
||||
|
||||
const user = await users.require(42);
|
||||
await users.update(42, { active: true });</code></pre>
|
||||
<p>Repository identifiers are validated, writes may be restricted to an allowlist, and values always use query parameters. Infrastructure packages remain helper-only and do not add UI dependencies to server code.</p>
|
||||
<h3 id="0-8-repository-and-transaction-helpers">0.8 repository and transaction helpers</h3>
|
||||
<pre data-language="ts"><code>import { createRepository, databaseHealth, firstOrThrow, retryTransaction } from "@wrnexus/db";
|
||||
|
||||
const usersRepo = createRepository<User>(db, {
|
||||
table: "users",
|
||||
allowedColumns: ["email", "name", "active"],
|
||||
maxListLimit: 250,
|
||||
});
|
||||
|
||||
const users = await usersRepo.all({
|
||||
orderBy: "name",
|
||||
direction: "asc",
|
||||
limit: 50,
|
||||
offset: 0,
|
||||
});</code></pre>
|
||||
<p>Repository SQL identifiers are validated and values remain parameterized. Placeholder generation is dialect-aware: PostgreSQL uses <code>$1</code>, <code>$2</code>, and SQLite/MySQL use <code>?</code>. List limits are bounded.</p>
|
||||
<p><code>retryTransaction()</code> retries recognized serialization, deadlock, and database-lock errors by default. Supply <code>shouldRetry</code> for application-specific retryable errors; ordinary validation or business errors are not retried automatically.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { M as Model } from './schema-tVurYsbL.js';
|
||||
export { B as BaseType, C as Column, a as ColumnDef, b as Columns, t as table, v } from './schema-tVurYsbL.js';
|
||||
import { a as Db, b as Dialect, R as Row } from './driver-DA53QHkO.js';
|
||||
export { D as Driver, E as ExecResult, T as TxHandle, c as createDb, d as createTableSql } from './driver-DA53QHkO.js';
|
||||
import { a as Db, b as Dialect, R as Row, E as ExecResult } from './driver-DA53QHkO.js';
|
||||
export { D as Driver, T as TxHandle, c as createDb, d as createTableSql } from './driver-DA53QHkO.js';
|
||||
|
||||
/**
|
||||
* A process-wide database registry. The framework configures it at server
|
||||
@@ -200,6 +239,16 @@ interface Migration {
|
||||
up: string;
|
||||
down: string;
|
||||
}
|
||||
interface MigrationRunOptions {
|
||||
/** Return pending migration names without executing their SQL. */
|
||||
dryRun?: boolean;
|
||||
/** Stop safely between migrations. Active database statements cannot be interrupted portably. */
|
||||
signal?: AbortSignal;
|
||||
/** Coordinate migration runners through the database. Default true. */
|
||||
lock?: boolean;
|
||||
/** Allow recovery of a lock left by a crashed process. Default 5 minutes. */
|
||||
lockTimeoutMs?: number;
|
||||
}
|
||||
/** Split a migration file into its `up` and `down` SQL sections. */
|
||||
declare function parseMigration(name: string, content: string): Migration;
|
||||
/** Load and parse all migration files in a directory, sorted by filename. */
|
||||
@@ -207,11 +256,13 @@ declare function loadMigrations(dir: string): Migration[];
|
||||
/** Names of already-applied migrations, oldest first. */
|
||||
declare function appliedMigrations(db: Db): Promise<string[]>;
|
||||
/** Apply an ordered migration list (each in a transaction). Returns applied names. */
|
||||
declare function applyMigrations(db: Db, migrations: readonly Migration[]): Promise<string[]>;
|
||||
declare function applyMigrations(db: Db, migrations: readonly Migration[], options?: MigrationRunOptions): Promise<string[]>;
|
||||
/** Apply all pending migrations from a directory. */
|
||||
declare function migrate(db: Db, dir: string): Promise<string[]>;
|
||||
declare function migrate(db: Db, dir: string, options?: MigrationRunOptions): Promise<string[]>;
|
||||
/** Roll back the most recently applied migration. Returns its name, or null. */
|
||||
declare function rollback(db: Db, dir: string): Promise<string | null>;
|
||||
declare function rollback(db: Db, dir: string, options?: Omit<MigrationRunOptions, "dryRun"> & {
|
||||
dryRun?: boolean;
|
||||
}): Promise<string | null>;
|
||||
/** Full status: every migration file with whether it has been applied. */
|
||||
declare function status(db: Db, dir: string): Promise<{
|
||||
name: string;
|
||||
@@ -224,6 +275,16 @@ declare function status(db: Db, dir: string): Promise<{
|
||||
*/
|
||||
declare function scaffoldMigration(dir: string, name: string, dialect: Dialect, models?: Model[]): string;
|
||||
|
||||
interface MigrationSafetyIssue {
|
||||
code: "WRN-DB-DROP-TABLE" | "WRN-DB-DROP-COLUMN" | "WRN-DB-RENAME" | "WRN-DB-TYPE-CHANGE" | "WRN-DB-SET-NOT-NULL" | "WRN-DB-ADD-REQUIRED" | "WRN-DB-BLOCKING-INDEX";
|
||||
severity: "error" | "warning";
|
||||
migration: string;
|
||||
statement: string;
|
||||
recommendation: string;
|
||||
}
|
||||
declare function analyzeMigrationSafety(migration: Migration): MigrationSafetyIssue[];
|
||||
declare function analyzeMigrations(migrations: readonly Migration[]): MigrationSafetyIssue[];
|
||||
|
||||
/**
|
||||
* sqlc-style query generator. Annotated SQL in `app/db/queries/*.sql` becomes
|
||||
* typed TS functions whose params + results are inferred from the TS models and
|
||||
@@ -366,10 +427,64 @@ interface QueryPolicy {
|
||||
onQuery?: (record: QueryRecord) => void | Promise<void>;
|
||||
onIssue?: (issue: QueryIssue) => void | Promise<void>;
|
||||
}
|
||||
declare function getDbPerformanceSnapshot(): {
|
||||
queries: QueryRecord[];
|
||||
issues: QueryIssue[];
|
||||
};
|
||||
declare function resetDbPerformanceSnapshot(): void;
|
||||
declare function instrumentDb(db: Db, policy?: QueryPolicy): Db;
|
||||
declare function queryOperation(sql: string): string;
|
||||
|
||||
export { type CursorPage, type CursorPageOptions, Db, Dialect, type Migration, Model, type ModelRef, type PageOptions, type Paginated, type QueryDef, type QueryIssue, type QueryKind, type QueryPolicy, type QueryRecord, type RelationOptions, Row, appliedMigrations, applyMigrations, closeDatabases, cursorPaginate, databaseNames, generateQueriesFile, getDb, hasDb, instrumentDb, loadMigrations, loadRelated, migrate, optimisticUpdate, paginate, parseMigration, parseQueries, queryOperation, registerDb, registerLazyDb, rollback, scaffoldMigration, setDb, softDeleteClause, status, tenantScope };
|
||||
declare class RecordNotFoundError extends Error {
|
||||
constructor(message?: string);
|
||||
}
|
||||
declare function firstOrThrow<T>(db: Db, sql: string, params?: unknown[], model?: Model<T>, message?: string): Promise<T>;
|
||||
declare function exists(db: Db, sql: string, params?: unknown[]): Promise<boolean>;
|
||||
declare function countRows(db: Db, table: string, where?: string, params?: unknown[]): Promise<number>;
|
||||
declare function withTransaction<T>(db: Db, callback: (tx: Db) => Promise<T>): Promise<T>;
|
||||
declare function retryTransaction<T>(db: Db, callback: (tx: Db, attempt: number) => Promise<T>, options?: {
|
||||
attempts?: number;
|
||||
baseDelayMs?: number;
|
||||
maxDelayMs?: number;
|
||||
jitter?: boolean;
|
||||
shouldRetry?: (error: unknown) => boolean;
|
||||
}): Promise<T>;
|
||||
declare function batch<T>(values: readonly T[], size?: number): T[][];
|
||||
declare function databaseHealth(db: Db): Promise<{
|
||||
ok: boolean;
|
||||
latencyMs: number;
|
||||
error?: string;
|
||||
}>;
|
||||
interface RepositoryListOptions<T extends Row> {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
orderBy?: keyof T & string;
|
||||
direction?: "asc" | "desc";
|
||||
}
|
||||
interface Repository<T extends Row> {
|
||||
all(options?: RepositoryListOptions<T>): Promise<T[]>;
|
||||
find(id: string | number): Promise<T | null>;
|
||||
require(id: string | number): Promise<T>;
|
||||
create(values: Partial<T>): Promise<ExecResult>;
|
||||
update(id: string | number, values: Partial<T>): Promise<ExecResult>;
|
||||
remove(id: string | number): Promise<ExecResult>;
|
||||
exists(id: string | number): Promise<boolean>;
|
||||
count(): Promise<number>;
|
||||
}
|
||||
declare function createRepository<T extends Row>(db: Db, input: {
|
||||
table: string;
|
||||
idColumn?: string;
|
||||
model?: Model<T>;
|
||||
allowedColumns?: readonly (keyof T & string)[];
|
||||
maxListLimit?: number;
|
||||
/** Immutable equality scope (normally tenant_id) applied to every operation. */
|
||||
scope?: {
|
||||
column: keyof T & string;
|
||||
value: unknown;
|
||||
};
|
||||
}): Repository<T>;
|
||||
|
||||
export { type CursorPage, type CursorPageOptions, Db, Dialect, ExecResult, type Migration, type MigrationRunOptions, type MigrationSafetyIssue, Model, type ModelRef, type PageOptions, type Paginated, type QueryDef, type QueryIssue, type QueryKind, type QueryPolicy, type QueryRecord, RecordNotFoundError, type RelationOptions, type Repository, Row, analyzeMigrationSafety, analyzeMigrations, appliedMigrations, applyMigrations, batch, closeDatabases, countRows, createRepository, cursorPaginate, databaseHealth, databaseNames, exists, firstOrThrow, generateQueriesFile, getDb, getDbPerformanceSnapshot, hasDb, instrumentDb, loadMigrations, loadRelated, migrate, optimisticUpdate, paginate, parseMigration, parseQueries, queryOperation, registerDb, registerLazyDb, resetDbPerformanceSnapshot, retryTransaction, rollback, scaffoldMigration, setDb, softDeleteClause, status, tenantScope, withTransaction };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Define models, connect, create tables, and query with typed results</h3><pre data-language="ts"><code>import { v, table, createDb } from "@wrnexus/db";
|
||||
import { sqlite } from "@wrnexus/db/sqlite";
|
||||
|
||||
@@ -400,15 +515,19 @@ const pageTwo = await paginate(
|
||||
db,
|
||||
{ sql: "SELECT * FROM users ORDER BY id", model: users },
|
||||
{ page: 2 },
|
||||
);</code></pre></article><article class="example-card"><h3>MongoDB (document API)</h3><pre data-language="ts"><code>import { mongo } from "@wrnexus/db/mongo";
|
||||
);</code></pre></article><article class="example-card"><h3>coordinator already guarantees exclusivity.</h3><pre data-language="ts"><code>const pending = await migrate(db, "app/db/migrations", { dryRun: true });
|
||||
await migrate(db, "app/db/migrations", {
|
||||
signal: shutdownController.signal,
|
||||
lockTimeoutMs: 10 * 60_000,
|
||||
});</code></pre></article><article class="example-card"><h3>MongoDB (document API)</h3><pre data-language="ts"><code>import { mongo } from "@wrnexus/db/mongo";
|
||||
|
||||
const mdb = await mongo(process.env.MONGO_URL!, "app");
|
||||
const repo = mdb.collection(users);
|
||||
await repo.insert({ email: "a@b.com" });
|
||||
const active = await repo.find({ active: true });</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#schema-v-table-column">Schema — v, table, Column</a><a class="toc-level-4" href="#driver-client-createdb-db-driver">Driver & client — createDb, Db, Driver</a><a class="toc-level-4" href="#client-registry-getdb-setdb">Client registry — getDb / setDb</a><a class="toc-level-4" href="#adapters">Adapters</a><a class="toc-level-4" href="#migrations">Migrations</a><a class="toc-level-4" href="#query-generator-sqlc-style">Query generator (sqlc-style)</a><a class="toc-level-4" href="#query-helpers">Query helpers</a><a class="toc-level-4" href="#session-store">Session store</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#configuration">Configuration</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#rollout-safe-migrations">Rollout-safe migrations</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#schema-v-table-column">Schema — v, table, Column</a><a class="toc-level-4" href="#driver-client-createdb-db-driver">Driver & client — createDb, Db, Driver</a><a class="toc-level-4" href="#client-registry-getdb-setdb">Client registry — getDb / setDb</a><a class="toc-level-4" href="#adapters">Adapters</a><a class="toc-level-4" href="#migrations">Migrations</a><a class="toc-level-4" href="#query-generator-sqlc-style">Query generator (sqlc-style)</a><a class="toc-level-4" href="#query-helpers">Query helpers</a><a class="toc-level-4" href="#session-store">Session store</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#configuration">Configuration</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-3" href="#repository-and-transaction-helpers">Repository and transaction helpers</a><a class="toc-level-3" href="#0-8-repository-and-transaction-helpers">0.8 repository and transaction helpers</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusdevserver {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/dev-server</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/dev-server</h1><p>Development and production servers, HMR, assets, and gateways.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/dev-server@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The WRNexusJS HTTP + WebSocket server runtime — request dispatch, SSR document assembly, live-reload (HMR), and the portable production handler.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/dev-server</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/dev-server</h1><p>Development and production servers, HMR, assets, and gateways.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/dev-server@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>The WRNexusJS HTTP + WebSocket server runtime — request dispatch, SSR document assembly, live-reload (HMR), and the portable production handler.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p>This package is the server runtime that powers a WRNexusJS app in both development and production. A single <strong>request runtime</strong> (<code>createHandlers</code>) owns HTTP/WebSocket dispatch and SSR document assembly; it knows nothing about _how_ modules and assets are produced, so the dev and prod entry points wire in different backends: dev uses dynamic module loading plus on-the-fly bundling and injects a live-reload client; prod uses a static, pre-built manifest with cache-immutable assets. The package also ships a multi-app <strong>gateway</strong> (route several apps by <code>Host</code> header behind one port) and a portable <code>node:http</code> adapter for WinterCG hosts. It is entirely server-side and Bun-native (<code>Bun.serve</code>, <code>Bun.file</code>, <code>Bun.gzipSync</code>).</p>
|
||||
@@ -54,6 +54,7 @@ interface RunningServer {
|
||||
stop(): void;
|
||||
}</code></pre>
|
||||
<p>In development, <code>startServer</code> also connects <code>app/db/migrations</code> (and <code>app/db/<name>/migrations</code>) and auto-applies migrations, then starts an in-process file watcher. CSS edits hot-swap live. Page, component, layout, API, middleware, realtime, schema, locale, and public-asset edits invalidate only their cached modules, rescan routes where necessary, and morph fresh HTML through the existing HMR WebSocket. The server process and active gateway stay running.</p>
|
||||
<p><code>getWrnCompileMetrics()</code> exposes cumulative content-addressed compiler cache <code>hits</code>, <code>misses</code>, successful <code>compilations</code>, <code>errors</code>, <code>totalDurationMs</code>, and <code>lastDurationMs</code> for the DevToolbar or custom diagnostics. Tests and embedded servers can call <code>resetWrnCompileMetrics()</code> to establish a fresh measurement window.</p>
|
||||
<h4 id="createhandlers-deps"><code>createHandlers(deps)</code></h4>
|
||||
<p>The core runtime shared by dev and prod. It handles CORS preflight, <code>/healthz</code> and <code>/__wrnexus/health</code>, request-body size limits (413), HMR socket upgrades (<code>/__wrnexus/hmr</code>), realtime WebSocket upgrades (<code>defineRoom</code> default export or a raw <code>websocket</code> export), the middleware pipeline, API routes (<code>/api/*</code>), framework assets (<code>/__wrnexus/*</code>), public assets, and full SSR page rendering (component mounts, layouts, slots, i18n markers, per-page script selection, ETag/304, gzip).</p>
|
||||
<pre data-language="ts"><code>interface RuntimeDeps {
|
||||
@@ -222,23 +223,63 @@ await startGateway({
|
||||
<ul>
|
||||
<li><strong>Bun-only.</strong> Uses <code>Bun.serve</code> (HTTP + WebSocket), <code>Bun.file</code>, and <code>Bun.gzipSync</code>. The full app also relies on <code>bun:sqlite</code> / <code>Bun.SQL</code> via <code>@wrnexus/db</code>.</li>
|
||||
<li>Orchestrates the whole framework: <code>@wrnexus/core</code> (context, security, realtime registry), <code>@wrnexus/router</code>, <code>@wrnexus/ssr</code> (<code>renderDocument</code>), <code>@wrnexus/csr</code> (client runtimes), <code>@wrnexus/compiler</code> (<code>.wrn</code> → TS), <code>@wrnexus/styles</code>, <code>@wrnexus/ui</code>, <code>@wrnexus/validation</code>, <code>@wrnexus/i18n</code>, <code>@wrnexus/db</code>, and <code>@wrnexus/pubsub</code> (Redis-backed cross-process realtime).</li>
|
||||
<li><code>.wrn</code> files are compiled to TypeScript into a hidden sibling <code>.wrnexus/</code> cache dir and dynamically imported; the module cache means each edited server module needs a fresh process (dev) — hence the restart-on-change model.</li>
|
||||
<li><code>.wrn</code> files compile into a content-addressed hidden <code>.wrnexus/</code> cache. Targeted</li>
|
||||
<p>invalidation gives changed modules a fresh import identity without restarting the development server.</p>
|
||||
<li>Responses are gzipped when the client accepts it and the body is a buffered, compressible payload ≥ 1 KB; streaming/SSE responses opt out via <code>Cache-Control: no-transform</code>.</li>
|
||||
<p></content></p>
|
||||
</ul>
|
||||
<p></invoke></p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Mode, Middleware, SeoConfig, SecurityConfig, RealtimeBus, RealtimeConnectMeta } from '@wrnexus/core';
|
||||
<p></invoke></p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Mode, Middleware, SeoConfig, SecurityConfig, HealthRegistry, RealtimeBus, RealtimeConnectMeta } from '@wrnexus/core';
|
||||
import { Router } from '@wrnexus/router';
|
||||
import { ResolvedTheme, MobileConfig, PwaConfig, ObservabilityConfig, TenancyConfig, NavigationConfig, StylesConfig, ThemeConfig } from '@wrnexus/styles';
|
||||
import { ResolvedI18n, I18nConfig } from '@wrnexus/i18n';
|
||||
import { StorageConfig } from '@wrnexus/uploader';
|
||||
import { DevToolbarConfig, DevToolbarPlatformSnapshot, DevToolbarPanel } from '@wrnexus/dev-toolbar/types';
|
||||
import { ClientRuntimeDefinition, PluginInput } from '@wrnexus/plugin';
|
||||
import { CacheCoordinator } from '@wrnexus/cache';
|
||||
import { DevToolbarCollector } from '@wrnexus/dev-toolbar/server';
|
||||
import { IncomingMessage, ServerResponse, Server } from 'node:http';
|
||||
|
||||
/** Exit code a dev-server child uses to request a clean supervisor restart. */
|
||||
declare const RESTART_EXIT_CODE = 97;
|
||||
|
||||
interface PartialBuildModule {
|
||||
default?: unknown;
|
||||
render?: (props?: Record<string, unknown>) => string | Promise<string>;
|
||||
layout?: string | {
|
||||
name?: string;
|
||||
render?: (props?: Record<string, unknown>) => string;
|
||||
};
|
||||
__wrnexusBuildStaticShell?: (ctx?: Record<string, unknown>) => string | Promise<string>;
|
||||
}
|
||||
interface PartialBuildEntry {
|
||||
name: string;
|
||||
mod: PartialBuildModule;
|
||||
}
|
||||
/** Expand compiler component mounts at build time using only their pure render exports. */
|
||||
declare function expandStaticComponents(html: string, components: readonly PartialBuildEntry[], depth?: number): Promise<string>;
|
||||
/** Produce the body shell stored in dist; dynamic region bodies are never evaluated here. */
|
||||
declare function precomputePartialStaticShell(page: PartialBuildModule, components: readonly PartialBuildEntry[]): Promise<{
|
||||
shell: string;
|
||||
regions: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Request pipeline helpers: middleware execution and safe module loading.
|
||||
* These are deliberately runtime-agnostic (no Bun APIs) so they could run on
|
||||
* Node too.
|
||||
*/
|
||||
|
||||
interface WrnCompileMetrics {
|
||||
hits: number;
|
||||
misses: number;
|
||||
compilations: number;
|
||||
errors: number;
|
||||
totalDurationMs: number;
|
||||
lastDurationMs: number;
|
||||
}
|
||||
declare function getWrnCompileMetrics(): Readonly<WrnCompileMetrics>;
|
||||
declare function resetWrnCompileMetrics(): void;
|
||||
|
||||
/**
|
||||
* HMR hub — tracks connected browser HMR sockets and broadcasts update events.
|
||||
*
|
||||
@@ -349,6 +390,8 @@ interface RuntimeDeps {
|
||||
security?: SecurityConfig;
|
||||
/** Built-in request tracing and Server-Timing policy. */
|
||||
observability?: ObservabilityConfig;
|
||||
/** Dependency health checks used by `/readyz` and `/__wrnexus/ready`. */
|
||||
health?: HealthRegistry;
|
||||
/** Built-in tenant identity resolution. */
|
||||
tenancy?: TenancyConfig;
|
||||
/** Max request body size in bytes (413 above this). Default 10 MB. */
|
||||
@@ -361,12 +404,16 @@ interface RuntimeDeps {
|
||||
* bus (use the Redis pub/sub driver). Enables realtime across multiple apps.
|
||||
*/
|
||||
realtimeBus?: RealtimeBus;
|
||||
/** Shared first-class data/component/page caches. */
|
||||
cache?: CacheCoordinator;
|
||||
/** Final document transform supplied by the plugin render lifecycle. */
|
||||
renderHtml?: (html: string) => string | Promise<string>;
|
||||
devToolbar?: {
|
||||
config: DevToolbarConfig;
|
||||
collector: DevToolbarCollector;
|
||||
root: string;
|
||||
platform?: DevToolbarPlatformSnapshot;
|
||||
panels?: DevToolbarPanel[];
|
||||
panels?: DevToolbarPanel[] | (() => DevToolbarPanel[] | Promise<DevToolbarPanel[]>);
|
||||
};
|
||||
}
|
||||
interface UpgradeServer {
|
||||
@@ -500,7 +547,8 @@ declare function startGateway(opts: GatewayOptions): Promise<RunningGateway&g
|
||||
* `wrnexus build` generates an entry that statically imports every route and
|
||||
* component module and hands them here as a manifest. We rebuild the (cheap)
|
||||
* route-matching tables from the raw patterns and run the exact same request
|
||||
* runtime as dev — just with production error pages and no live-reload client.
|
||||
* runtime as dev. Normal preview/deploy output has no live-reload client; the
|
||||
* supervised `dev --production-runtime` mode can explicitly enable it.
|
||||
*/
|
||||
|
||||
type RouteModule = Record<string, unknown>;
|
||||
@@ -509,6 +557,8 @@ interface ManifestRoute {
|
||||
raw: string;
|
||||
/** The statically-imported route module. */
|
||||
mod: RouteModule;
|
||||
/** Body shell precomputed by `wrnexus build` for a partial-static page. */
|
||||
staticShell?: string;
|
||||
}
|
||||
interface ProdManifest {
|
||||
pages: ManifestRoute[];
|
||||
@@ -609,6 +659,8 @@ interface ProdOptions {
|
||||
port?: number;
|
||||
hostname?: string;
|
||||
maxBodyBytes?: number;
|
||||
/** Enable only for the CLI's supervised exact-production development mode. */
|
||||
developmentRuntime?: boolean;
|
||||
}
|
||||
/**
|
||||
* Build the portable request handler from a precompiled manifest — a
|
||||
@@ -663,6 +715,11 @@ interface ServeOptions {
|
||||
appDir: string;
|
||||
port?: number;
|
||||
hostname?: string;
|
||||
/** Development TLS material. Production TLS is normally terminated by the deployment proxy. */
|
||||
tls?: {
|
||||
cert: string;
|
||||
key: string;
|
||||
};
|
||||
mode?: Mode;
|
||||
/** Inject the live-reload client (defaults to true in development). */
|
||||
hmr?: boolean;
|
||||
@@ -715,7 +772,7 @@ interface RunningServer {
|
||||
}
|
||||
declare function startServer(opts: ServeOptions): Promise<RunningServer>;
|
||||
|
||||
export { type AssetServer, type FetchHandler, type GatewayApp, type GatewayAuth, type GatewayOptions, type GatewaySecurity, RESTART_EXIT_CODE, type RunningGateway, type RunningServer, type RuntimeDeps, type ServeOptions, type WsData, createHandlers, createProductionHandlers, createProductionServer, nodeListener, serveNode, startGateway, startServer, toRequest, writeResponse };
|
||||
export { type AssetServer, type FetchHandler, type GatewayApp, type GatewayAuth, type GatewayOptions, type GatewaySecurity, RESTART_EXIT_CODE, type RunningGateway, type RunningServer, type RuntimeDeps, type ServeOptions, type WrnCompileMetrics, type WsData, createHandlers, createProductionHandlers, createProductionServer, expandStaticComponents, getWrnCompileMetrics, nodeListener, precomputePartialStaticShell, resetWrnCompileMetrics, serveNode, startGateway, startServer, toRequest, writeResponse };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Programmatic dev server</h3><pre data-language="ts"><code>import { startServer } from "@wrnexus/dev-server";
|
||||
|
||||
const server = await startServer({
|
||||
@@ -756,7 +813,7 @@ await startGateway({
|
||||
});</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#main-entry-wrnexus-dev-server">Main entry (@wrnexus/dev-server)</a><a class="toc-level-4" href="#startserver-opts">startServer(opts)</a><a class="toc-level-4" href="#createhandlers-deps">createHandlers(deps)</a><a class="toc-level-4" href="#createproductionserver-manifest-opts-createproductionhandlers-manifest-opts">createProductionServer(manifest, opts) / createProductionHandlers(manifest, opts)</a><a class="toc-level-4" href="#startgateway-opts-multi-app-gateway">startGateway(opts) — multi-app gateway</a><a class="toc-level-4" href="#node-http-adapter-from-adapters-node-ts">node:http adapter (from ./adapters/node.ts)</a><a class="toc-level-4" href="#subpath-export-wrnexus-dev-server-serve-entry">Subpath export: @wrnexus/dev-server/serve-entry</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#programmatic-dev-server">Programmatic dev server</a><a class="toc-level-4" href="#production-server-from-a-build-manifest">Production server from a build manifest</a><a class="toc-level-4" href="#embedding-the-handler-on-node-http">Embedding the handler on node:http</a><a class="toc-level-4" href="#multi-app-gateway">Multi-app gateway</a><a class="toc-level-3" href="#framework-asset-routes">Framework asset routes</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,16 +10,19 @@ page wrnexusdevtoolbar {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/dev-toolbar</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/dev-toolbar</h1><p>Development toolbar diagnostics, inspection, and runtime status.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/dev-toolbar@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Development-only page quality toolbar for WRNexusJS.</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/dev-toolbar</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/dev-toolbar</h1><p>Development toolbar diagnostics, inspection, and runtime status.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/dev-toolbar@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Development-only page quality toolbar for WRNexusJS.</p>
|
||||
<h3 id="features">Features</h3>
|
||||
<ul>
|
||||
<li>Runtime, resource and unhandled promise error capture</li>
|
||||
<li>Accessibility, SEO, image, media, color, HTML, form, link, responsive and security checks</li>
|
||||
<li>Performance and network observations</li>
|
||||
<li>First-class application tabs for runtime, stores, cache, accessibility, SEO, performance,</li>
|
||||
<p>security, images, links, and JavaScript</p>
|
||||
<li>Plugin-contributed applications with badges, descriptions, issue feeds, and structured data</li>
|
||||
<li>Element highlighting and issue filtering</li>
|
||||
<li>Server-side issue collector</li>
|
||||
<li>Development-only asset strings for direct serving by <code>@wrnexus/dev-server</code></li>
|
||||
@@ -28,16 +31,17 @@ page wrnexusdevtoolbar {
|
||||
<h3 id="dev-server-integration">Dev-server integration</h3>
|
||||
<p>Serve <code>DEV_TOOLBAR_RUNTIME</code> at <code>/__wrnexus/dev-toolbar.js</code> and <code>DEV_TOOLBAR_CSS</code> at <code>/__wrnexus/dev-toolbar.css</code>, then inject this before <code></body></code> in development:</p>
|
||||
<pre data-language="html"><code><script type="module" src="/__wrnexus/dev-toolbar.js" data-wrnexus-dev-toolbar></script></code></pre>
|
||||
<p>The browser runtime exposes <code>window.__wrnexusDevToolbar</code>.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { DevToolbarCategory, DevToolbarClientApi, DevToolbarConfig, DevToolbarElementTarget, DevToolbarFix, DevToolbarIssue, DevToolbarMetrics, DevToolbarPageReport, DevToolbarPanel, DevToolbarPlatformSnapshot, DevToolbarServerMessage, DevToolbarSeverity, DevToolbarSourceLocation } from './types.js';
|
||||
<p>The browser runtime exposes <code>window.__wrnexusDevToolbar</code>.</p>
|
||||
<p>Plugin panels returned through <code>devToolbarPanels()</code> are automatically added to the application strip. Their issue category is filterable, and structured <code>data</code> is rendered as escaped diagnostic content so a plugin never needs to inject toolbar HTML.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { DevToolbarCategory, DevToolbarClientApi, DevToolbarConfig, DevToolbarElementTarget, DevToolbarFix, DevToolbarIssue, DevToolbarMetrics, DevToolbarPageReport, DevToolbarPanel, DevToolbarPlatformSnapshot, DevToolbarServerMessage, DevToolbarSeverity, DevToolbarSourceLocation } from './types.js';
|
||||
export { DEV_TOOLBAR_RULES, DevToolbarRule, DevToolbarRuleContext, accessibilityRules, accessibleName, colorRules, contrastRatio, createFingerprint, createIssue, effectiveBackground, formRules, getStableSelector, htmlRules, imageRules, isVisible, linkRules, luminance, mediaRules, parseRgb, parseSource, performanceRules, responsiveRules, runDevToolbarRules, securityRules, seoRules } from './rules/index.js';
|
||||
export { DevToolbarApp, DevToolbarCollector, DevToolbarIssueListener, DevToolbarRegistry, DevToolbarRouteOptions, OpenEditorOptions, OpenEditorRequest, buildEditorCommand, createDevToolbarCollector, createDevToolbarRegistry, createServerIssue, handleDevToolbarRoute, issueFromError, openInEditor, resolveEditorFile, serializeDevToolbarJson } from './server/index.js';
|
||||
export { BuiltinPanelOptions, DevToolbarApp, DevToolbarCollector, DevToolbarIssueListener, DevToolbarRegistry, DevToolbarRouteOptions, OpenEditorOptions, OpenEditorRequest, buildEditorCommand, builtinDevToolbarPanels, createDevToolbarCollector, createDevToolbarRegistry, createServerIssue, handleDevToolbarRoute, issueFromError, openInEditor, resolveEditorFile, serializeDevToolbarJson } from './server/index.js';
|
||||
export { DEV_TOOLBAR_CSS, DEV_TOOLBAR_RUNTIME } from './client/index.js';
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Serve DEVTOOLBARRUNTIME at /wrnexus/dev-toolbar.js and DEVTOOLBARCSS at /wrnexus/dev-toolbar.css, then inject this before </body> in development</h3><pre data-language="html"><code><script type="module" src="/__wrnexus/dev-toolbar.js" data-wrnexus-dev-toolbar></script></code></pre></article><article class="example-card"><h3>Run development-toolbar rules</h3><pre data-language="ts"><code>import { runDevToolbarRules } from "@wrnexus/dev-toolbar";
|
||||
|
||||
const issues = runDevToolbarRules(context);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#features">Features</a><a class="toc-level-3" href="#dev-server-integration">Dev-server integration</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,57 +10,68 @@ page wrnexusencryption {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/encryption</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/encryption</h1><p>Hashing, HMAC, authenticated encryption, and key derivation.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/encryption@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Dependency-free crypto helpers for WRNexusJS: authenticated symmetric encryption (AES-256-GCM), hashing, and HMAC signing.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p>This package provides small, focused cryptographic primitives for server-side use: encrypting secrets/tokens/database fields at rest with AES-256-GCM, deriving keys from passwords via PBKDF2, computing SHA-256 digests, and signing/verifying payloads with HMAC-SHA256. It is built entirely on the standard <strong>Web Crypto API</strong> (<code>crypto.subtle</code>) plus <code>btoa</code>/<code>atob</code> and <code>TextEncoder</code>/<code>TextDecoder</code> — no third-party dependencies. Reach for it whenever you need to protect sensitive values or verify webhook signatures. All functions are <code>async</code> (Web Crypto is promise-based).</p>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/encryption</code></pre>
|
||||
<blockquote>Private package — the machine must be authenticated to the <code>wrnexus</code> npm org</blockquote>
|
||||
<blockquote>(a read token in <code>~/.npmrc</code>). Requires <strong>Bun</strong> (Node is not supported).</blockquote>
|
||||
<h3 id="api">API</h3>
|
||||
<p>All keys are exchanged as <strong>base64 strings</strong> and all digests/signatures as <strong>hex strings</strong>.</p>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Signature</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>generateKey</code></td><td><code>() => Promise<string></code></td><td>Generate a random 256-bit AES key, base64-encoded. Store it as a secret.</td></tr><tr><td><code>deriveKey</code></td><td><code>(password: string, salt: string) => Promise<string></code></td><td>Derive a base64 AES-256 key from a password + salt using PBKDF2 (100,000 iterations, SHA-256).</td></tr><tr><td><code>encrypt</code></td><td><code>(plaintext: string, key: string) => Promise<string></code></td><td>AES-256-GCM encrypt a string. Returns base64 of <code>iv(12 bytes) ‖ ciphertext+tag</code>. A fresh random IV is used each call.</td></tr><tr><td><code>decrypt</code></td><td><code>(payload: string, key: string) => Promise<string></code></td><td>Decrypt a value produced by <code>encrypt</code>. Throws if the key is wrong or the data was tampered with.</td></tr><tr><td><code>sha256</code></td><td><code>(data: string) => Promise<string></code></td><td>SHA-256 hex digest of a string (e.g. content hashing, dedup keys).</td></tr><tr><td><code>hmacSign</code></td><td><code>(data: string, secret: string) => Promise<string></code></td><td>HMAC-SHA256 hex signature of <code>data</code> with <code>secret</code> (e.g. signing webhooks).</td></tr><tr><td><code>hmacVerify</code></td><td><code>(data: string, secret: string, signature: string) => Promise<boolean></code></td><td>Constant-time verify of an HMAC-SHA256 hex signature.</td></tr></tbody></table></div>
|
||||
<p>Notes:</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/encryption</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/encryption</h1><p>Hashing, HMAC, authenticated encryption, and key derivation.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/encryption@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Authenticated encryption, hashing, HMAC, key rotation, and optional encrypted HTTP exchanges for WRNexusJS.</p>
|
||||
<h3 id="core-helpers">Core helpers</h3>
|
||||
<ul>
|
||||
<li><code>generateKey</code> produces a 32-byte (256-bit) key via <code>crypto.getRandomValues</code>.</li>
|
||||
<li><code>encrypt</code>/<code>decrypt</code> require a base64-encoded 256-bit key; anything else throws <code>"Encryption key must be a base64 256-bit key"</code>.</li>
|
||||
<li><code>decrypt</code> throws <code>"Invalid ciphertext"</code> if the payload is shorter than the 12-byte IV, and the underlying Web Crypto call throws on any authentication (tag) mismatch.</li>
|
||||
<li><code>hmacVerify</code> compares in constant time (length check plus XOR accumulation) to avoid timing leaks.</li>
|
||||
<li><code>generateKey()</code> — random 256-bit AES key encoded as base64.</li>
|
||||
<li><code>deriveKey(password, salt)</code> — PBKDF2-derived AES key.</li>
|
||||
<li><code>encrypt(plaintext, key)</code> / <code>decrypt(payload, key)</code> — AES-256-GCM.</li>
|
||||
<li><code>sha256(data)</code> — SHA-256 digest.</li>
|
||||
<li><code>hmacSign(data, secret)</code> / <code>hmacVerify(...)</code> — HMAC-SHA256.</li>
|
||||
<li><code>createKeyring(keys)</code> — active/previous key management.</li>
|
||||
<li><code>seal()</code> / <code>open()</code> — versioned ciphertext with key ID.</li>
|
||||
</ul>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<p>Symmetric encryption of a secret at rest:</p>
|
||||
<pre data-language="ts"><code>import { generateKey, encrypt, decrypt } from "@wrnexus/encryption";
|
||||
<h3 id="encrypted-http-envelope">Encrypted HTTP envelope</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createEncryptedRequest,
|
||||
createKeyring,
|
||||
createMemoryReplayStore,
|
||||
decryptEncryptedResponse,
|
||||
encryptedExchange,
|
||||
} from "@wrnexus/encryption";
|
||||
|
||||
const key = await generateKey(); // store this safely (env/secret manager)
|
||||
const keyring = createKeyring([{ id: "2026-08", secret: process.env.API_BODY_KEY!, active: true }]);
|
||||
|
||||
const box = await encrypt("card #1234", key); // opaque base64 string, safe to persist
|
||||
const plain = await decrypt(box, key); // "card #1234"</code></pre>
|
||||
<p>Deriving a key from a user password instead of a random key:</p>
|
||||
<pre data-language="ts"><code>import { deriveKey, encrypt } from "@wrnexus/encryption";
|
||||
const replayStore = createMemoryReplayStore();
|
||||
|
||||
const key = await deriveKey("correct horse battery staple", "per-user-salt");
|
||||
const box = await encrypt("secret note", key);</code></pre>
|
||||
<p>Hashing and webhook signature verification:</p>
|
||||
<pre data-language="ts"><code>import { sha256, hmacSign, hmacVerify } from "@wrnexus/encryption";
|
||||
// Server middleware.
|
||||
app.use(
|
||||
encryptedExchange({
|
||||
keyring,
|
||||
replayStore,
|
||||
maxAgeMs: 60_000,
|
||||
maxBodyBytes: 1_048_576,
|
||||
}),
|
||||
);
|
||||
|
||||
const digest = await sha256("some content"); // 64-char hex string
|
||||
|
||||
const signature = await hmacSign(rawBody, webhookSecret);
|
||||
const ok = await hmacVerify(rawBody, webhookSecret, incomingSignatureHeader);
|
||||
if (!ok) throw new Error("Invalid webhook signature");</code></pre>
|
||||
<h3 id="requirements-notes">Requirements / Notes</h3>
|
||||
// Controlled service/native client.
|
||||
const request = await createEncryptedRequest(
|
||||
"https://api.example.com/private/report",
|
||||
{ reportId: "report-1" },
|
||||
{ method: "POST", keyring },
|
||||
);
|
||||
const response = await fetch(request);
|
||||
const result = await decryptEncryptedResponse(response, request, { keyring });</code></pre>
|
||||
<p>The envelope binds authenticated ciphertext to:</p>
|
||||
<ul>
|
||||
<li><strong>Bun-only.</strong> Relies on the Web Crypto API (<code>crypto.subtle</code>, <code>crypto.getRandomValues</code>) and the global <code>btoa</code>/<code>atob</code>, <code>TextEncoder</code>/<code>TextDecoder</code> — all available in Bun's runtime.</li>
|
||||
<li><strong>No dependencies.</strong> The package has an empty dependency set; nothing is bundled beyond standard runtime APIs.</li>
|
||||
<li>Algorithms: AES-256-GCM (encryption), PBKDF2 with 100k SHA-256 iterations (key derivation), SHA-256 (digest), HMAC-SHA256 (signing).</li>
|
||||
<li>Keep generated/derived keys and HMAC secrets out of source control; treat them as first-class secrets.</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface EncryptionKey {
|
||||
<li>HTTP method</li>
|
||||
<li>URL path and query</li>
|
||||
<li>request ID</li>
|
||||
<li>timestamp and expiry window</li>
|
||||
<li>encryption key ID</li>
|
||||
<li>optional replay-store consumption</li>
|
||||
</ul>
|
||||
<p><code>encryptedBody()</code> decrypts request bodies only. <code>encryptedExchange()</code> also encrypts successful downstream responses while allowing application exceptions to propagate normally. <code>encryptedFetch()</code> provides a convenient controlled-client call.</p>
|
||||
<h3 id="security-boundary">Security boundary</h3>
|
||||
<p>Encrypted HTTP bodies <strong>do not replace TLS/HTTPS</strong>. Always use HTTPS.</p>
|
||||
<p>This layer is appropriate for service-to-service traffic, native/mobile applications, controlled agents, and selected fields protected with server-managed keys. It cannot conceal data from an end user when browser JavaScript receives the decryption key. Never ship a long-lived server encryption key to a browser.</p>
|
||||
<p>Use a shared replay store such as Redis in multi-instance deployments. The memory replay store is process-local.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Middleware } from '@wrnexus/core';
|
||||
|
||||
interface EncryptionKey {
|
||||
id: string;
|
||||
secret: string;
|
||||
active?: boolean;
|
||||
@@ -80,6 +91,66 @@ declare function open(sealed: string, keyring: EncryptionKeyring): Promise<st
|
||||
declare function sealedKeyId(sealed: string): string | null;
|
||||
declare function needsRotation(sealed: string, keyring: EncryptionKeyring): boolean;
|
||||
|
||||
declare const ENCRYPTED_HTTP_CONTENT_TYPE = "application/wrn+json";
|
||||
declare const ENCRYPTED_HTTP_VERSION = "wrn-http-1";
|
||||
interface EncryptedHttpEnvelope {
|
||||
version: typeof ENCRYPTED_HTTP_VERSION;
|
||||
keyId: string;
|
||||
requestId: string;
|
||||
timestamp: number;
|
||||
ciphertext: string;
|
||||
}
|
||||
interface ReplayStore {
|
||||
consume(id: string, expiresAt: number): boolean | Promise<boolean>;
|
||||
}
|
||||
interface EncryptedHttpOptions {
|
||||
keyring: EncryptionKeyring;
|
||||
maxAgeMs?: number;
|
||||
maxBodyBytes?: number;
|
||||
replayStore?: ReplayStore;
|
||||
now?: () => number;
|
||||
/** Require the clear request-id header used to bind encrypted responses. Default true. */
|
||||
requireRequestIdHeader?: boolean;
|
||||
}
|
||||
interface DecryptedHttpBody<T> {
|
||||
body: T;
|
||||
requestId: string;
|
||||
timestamp: number;
|
||||
keyId: string;
|
||||
}
|
||||
declare function createMemoryReplayStore(now?: () => number): ReplayStore;
|
||||
declare function encryptHttpBody<T>(body: T, input: {
|
||||
keyring: EncryptionKeyring;
|
||||
method?: string;
|
||||
url: string | URL;
|
||||
requestId?: string;
|
||||
timestamp?: number;
|
||||
}): Promise<EncryptedHttpEnvelope>;
|
||||
declare function decryptHttpBody<T>(value: unknown, input: {
|
||||
keyring: EncryptionKeyring;
|
||||
method?: string;
|
||||
url: string | URL;
|
||||
maxAgeMs?: number;
|
||||
replayStore?: ReplayStore;
|
||||
now?: () => number;
|
||||
expectedRequestId?: string;
|
||||
}): Promise<DecryptedHttpBody<T>>;
|
||||
declare function createEncryptedRequest<T>(url: string | URL, body: T, input: Omit<RequestInit, "body"> & {
|
||||
keyring: EncryptionKeyring;
|
||||
requestId?: string;
|
||||
}): Promise<Request>;
|
||||
declare function decryptRequest<T>(request: Request, options: EncryptedHttpOptions): Promise<DecryptedHttpBody<T>>;
|
||||
declare function encryptResponse<T>(body: T, request: Request, options: EncryptedHttpOptions & {
|
||||
status?: number;
|
||||
headers?: HeadersInit;
|
||||
}): Promise<Response>;
|
||||
declare function decryptEncryptedResponse<T>(response: Response, request: Request, options: EncryptedHttpOptions): Promise<DecryptedHttpBody<T>>;
|
||||
declare function encryptedFetch<TRequest, TResponse>(url: string | URL, body: TRequest, input: Omit<RequestInit, "body"> & EncryptedHttpOptions): Promise<TResponse>;
|
||||
declare function encryptedBody(options: EncryptedHttpOptions): Middleware;
|
||||
declare function encryptedExchange(options: EncryptedHttpOptions & {
|
||||
encryptResponses?: boolean;
|
||||
}): Middleware;
|
||||
|
||||
/**
|
||||
* @wrnexus/encryption — authenticated symmetric encryption (AES-256-GCM) via
|
||||
* WebCrypto, dependency-free. Use it to encrypt secrets, tokens, or database
|
||||
@@ -109,25 +180,40 @@ declare function decrypt(payload: string, key: string): Promise<string>;
|
||||
/** Derive a base64 AES key from a password + salt (PBKDF2, 100k iterations). */
|
||||
declare function deriveKey(password: string, salt: string): Promise<string>;
|
||||
|
||||
export { type EncryptionKey, type EncryptionKeyring, createKeyring, decrypt, deriveKey, encrypt, generateKey, hmacSign, hmacVerify, needsRotation, open, seal, sealedKeyId, sha256 };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Symmetric encryption of a secret at rest</h3><pre data-language="ts"><code>import { generateKey, encrypt, decrypt } from "@wrnexus/encryption";
|
||||
export { type DecryptedHttpBody, ENCRYPTED_HTTP_CONTENT_TYPE, ENCRYPTED_HTTP_VERSION, type EncryptedHttpEnvelope, type EncryptedHttpOptions, type EncryptionKey, type EncryptionKeyring, type ReplayStore, createEncryptedRequest, createKeyring, createMemoryReplayStore, decrypt, decryptEncryptedResponse, decryptHttpBody, decryptRequest, deriveKey, encrypt, encryptHttpBody, encryptResponse, encryptedBody, encryptedExchange, encryptedFetch, generateKey, hmacSign, hmacVerify, needsRotation, open, seal, sealedKeyId, sha256 };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>## Encrypted HTTP envelope</h3><pre data-language="ts"><code>import {
|
||||
createEncryptedRequest,
|
||||
createKeyring,
|
||||
createMemoryReplayStore,
|
||||
decryptEncryptedResponse,
|
||||
encryptedExchange,
|
||||
} from "@wrnexus/encryption";
|
||||
|
||||
const key = await generateKey(); // store this safely (env/secret manager)
|
||||
const keyring = createKeyring([{ id: "2026-08", secret: process.env.API_BODY_KEY!, active: true }]);
|
||||
|
||||
const box = await encrypt("card #1234", key); // opaque base64 string, safe to persist
|
||||
const plain = await decrypt(box, key); // "card #1234"</code></pre></article><article class="example-card"><h3>Deriving a key from a user password instead of a random key</h3><pre data-language="ts"><code>import { deriveKey, encrypt } from "@wrnexus/encryption";
|
||||
const replayStore = createMemoryReplayStore();
|
||||
|
||||
const key = await deriveKey("correct horse battery staple", "per-user-salt");
|
||||
const box = await encrypt("secret note", key);</code></pre></article><article class="example-card"><h3>Hashing and webhook signature verification</h3><pre data-language="ts"><code>import { sha256, hmacSign, hmacVerify } from "@wrnexus/encryption";
|
||||
// Server middleware.
|
||||
app.use(
|
||||
encryptedExchange({
|
||||
keyring,
|
||||
replayStore,
|
||||
maxAgeMs: 60_000,
|
||||
maxBodyBytes: 1_048_576,
|
||||
}),
|
||||
);
|
||||
|
||||
const digest = await sha256("some content"); // 64-char hex string
|
||||
|
||||
const signature = await hmacSign(rawBody, webhookSecret);
|
||||
const ok = await hmacVerify(rawBody, webhookSecret, incomingSignatureHeader);
|
||||
if (!ok) throw new Error("Invalid webhook signature");</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
// Controlled service/native client.
|
||||
const request = await createEncryptedRequest(
|
||||
"https://api.example.com/private/report",
|
||||
{ reportId: "report-1" },
|
||||
{ method: "POST", keyring },
|
||||
);
|
||||
const response = await fetch(request);
|
||||
const result = await decryptEncryptedResponse(response, request, { keyring });</code></pre></article><article class="example-card"><h3>Install @wrnexus/encryption</h3><pre data-language="sh"><code>bun add @wrnexus/encryption</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#core-helpers">Core helpers</a><a class="toc-level-3" href="#encrypted-http-envelope">Encrypted HTTP envelope</a><a class="toc-level-3" href="#security-boundary">Security boundary</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
page wrnexusgraphql {
|
||||
seo {
|
||||
title = "@wrnexus/graphql"
|
||||
description = "GraphQL schemas, routes, and framework plugin integration."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/graphql</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/graphql</h1><p>GraphQL schemas, routes, and framework plugin integration.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/graphql@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Optional GraphQL endpoint plugin. Supply the executor from GraphQL.js, GraphQL Yoga, Mercurius, or another maintained engine; WRNexus owns bounded HTTP input, depth/alias limits, introspection policy, generic production errors and plugin route integration.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { G as GraphqlExecutionResult, a as GraphqlOptions, b as GraphqlRequest, c as createGraphqlHandler, default as graphqlPlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/graphql</h3><pre data-language="sh"><code>bun add @wrnexus/graphql</code></pre></article><article class="example-card"><h3>Import @wrnexus/graphql</h3><pre data-language="ts"><code>import * as graphql from "@wrnexus/graphql";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexushelpers {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/helpers</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/helpers</h1><p>Safe Context URL helpers and forward-auth login redirects.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/helpers@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Safe convenience helpers for common WRNexusJS application flows. The package uses standard <code>Context</code>, <code>URL</code>, and <code>Response</code> values and has no runtime dependency beyond <code>@wrnexus/core</code>.</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/helpers</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/helpers</h1><p>Safe Context URL helpers and forward-auth login redirects.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/helpers@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Safe convenience helpers for common WRNexusJS application flows. The package uses standard <code>Context</code>, <code>URL</code>, and <code>Response</code> values and has no runtime dependency beyond <code>@wrnexus/core</code>.</p>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/helpers</code></pre>
|
||||
<p>The package is private, so the machine must be authenticated to the <code>wrnexus</code> npm organization.</p>
|
||||
<h3 id="usage">Usage</h3>
|
||||
@@ -156,7 +156,7 @@ export const GET = async (ctx: Context) => {
|
||||
};</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#redirect-an-unauthenticated-forward-auth-request">Redirect an unauthenticated forward-auth request</a><a class="toc-level-4" href="#support-dynamic-tenant-domains">Support dynamic tenant domains</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
+146
-166
@@ -10,110 +10,76 @@ page wrnexusi18n {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/i18n</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/i18n</h1><p>Translation loading, locale resolution, and Intl formatting.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/i18n@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Per-request translations plus locale-aware number, date, and currency formatting for WRNexusJS apps.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/i18n</code> loads locale files from <code>app/locales/<lang>.json</code>, resolves the active language for each request (cookie → <code>Accept-Language</code> → default), and builds a <code>t(key, params)</code> translator used both in server code and in <code>.wrn</code> views. It also ships Intl-based formatting helpers and a tiny client runtime that wires up a language switcher. Translation lookup, language resolution, and HTML marker rewriting run server-side; only the small <code>I18N_RUNTIME</code> snippet runs in the browser.</p>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/i18n</code></pre>
|
||||
<blockquote>Private package — the machine must be authenticated to the <code>wrnexus</code> npm org</blockquote>
|
||||
<blockquote>(a read token in <code>~/.npmrc</code>). Requires <strong>Bun</strong> (Node is not supported).</blockquote>
|
||||
<h3 id="api">API</h3>
|
||||
<h4 id="loading-resolving">Loading & resolving</h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Signature</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>loadLocales</code></td><td><code>(dir: string) => Record<string, Messages></code></td><td>Reads every <code><lang>.json</code> in <code>dir</code> into a <code>{ lang: messages }</code> map. Missing dir → <code>{}</code>; a bad file is warned and skipped.</td></tr><tr><td><code>resolveI18n</code></td><td><code>(messages: Record<string, Messages>, config?: I18nConfig) => ResolvedI18n</code></td><td>Merges loaded messages + config into a resolved bundle (default lang, supported langs, messages).</td></tr><tr><td><code>resolveLang</code></td><td>`(i18n: ResolvedI18n, cookieValue: string \</td><td>undefined, acceptLanguage: string \</td><td>null) => string`</td><td>Picks the active language: matching cookie → best <code>Accept-Language</code> tag (falls back to base tag, e.g. <code>en-US</code> → <code>en</code>) → <code>i18n.default</code>.</td></tr><tr><td><code>makeT</code></td><td><code>(i18n: ResolvedI18n, lang: string) => TFunction</code></td><td>Builds a translator resolving current language → default → the key itself, with <code>{param}</code> interpolation.</td></tr></tbody></table></div>
|
||||
<h4 id="types-constants">Types & constants</h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Kind</th><th>Notes</th></tr></thead>
|
||||
<tbody><tr><td><code>Messages</code></td><td><code>type</code></td><td><code>Record<string, unknown></code> — a locale's messages (supports nested/dotted keys).</td></tr><tr><td><code>I18nConfig</code></td><td><code>interface</code></td><td><code>{ default?: string; locales?: string[] }</code>.</td></tr><tr><td><code>ResolvedI18n</code></td><td><code>interface</code></td><td><code>{ default: string; langs: string[]; messages: Record<string, Messages> }</code>.</td></tr><tr><td><code>LANG_COOKIE</code></td><td><code>const</code></td><td><code>"wire-lang"</code> — the cookie the language is read from / written to.</td></tr><tr><td><code>I18N_JS_HREF</code></td><td><code>const</code></td><td><code>"/__wrnexus/i18n.js"</code> — URL the client runtime is served at.</td></tr></tbody></table></div>
|
||||
<h4 id="html-client-runtime">HTML & client runtime</h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Signature</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>translateHtml</code></td><td><code>(html: string, t: TFunction) => string</code></td><td>Rewrites markers in rendered HTML: <code>t:<attr>="key"</code> → <code><attr>="<translation>"</code> (attribute-escaped) and <code><tag data-t="key">…</tag></code> → element text becomes the translation (HTML-escaped). No-op unless a marker is present.</td></tr><tr><td><code>renderI18nData</code></td><td><code>(i18n: ResolvedI18n, lang: string) => string</code></td><td>JS snippet setting <code>window.__wireI18n = { lang, langs, default }</code> for the client switcher.</td></tr><tr><td><code>I18N_RUNTIME</code></td><td><code>const string</code></td><td>Browser IIFE that binds <code>[data-wire-lang-set="es"]</code> clicks and <code>select[data-wire-lang]</code> changes to set the <code>wire-lang</code> cookie and reload. Exposes <code>window.__wireLang.set(lang)</code>.</td></tr></tbody></table></div>
|
||||
<h4 id="formatting-helpers-re-exported-from-format-ts">Formatting helpers (re-exported from <code>./format.ts</code>)</h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>Signature</th><th>Example</th></tr></thead>
|
||||
<tbody><tr><td><code>formatNumber</code></td><td><code>(value: number, lang: string, options?: Intl.NumberFormatOptions) => string</code></td><td><code>1234.5 → "1,234.5"</code></td></tr><tr><td><code>formatCurrency</code></td><td><code>(value: number, currency: string, lang: string) => string</code></td><td><code>9.99, "USD" → "$9.99"</code></td></tr><tr><td><code>formatDate</code></td><td>`(value: Date \</td><td>number \</td><td>string, lang: string, options?: Intl.DateTimeFormatOptions) => string`</td><td>defaults to <code>{ dateStyle: "medium" }</code></td></tr><tr><td><code>formatRelativeTime</code></td><td><code>(value: number, unit: Intl.RelativeTimeFormatUnit, lang: string) => string</code></td><td><code>-3, "day" → "3 days ago"</code> (<code>numeric: "auto"</code>)</td></tr><tr><td><code>plural</code></td><td><code>(count: number, forms: Partial<Record<Intl.LDMLPluralRule, string>>, lang: string) => string</code></td><td>picks CLDR form; <code>#</code> is replaced by <code>count</code></td></tr></tbody></table></div>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<h4 id="server-load-resolve-translate">Server: load, resolve, translate</h4>
|
||||
<pre data-language="ts"><code>import {
|
||||
loadLocales,
|
||||
resolveI18n,
|
||||
resolveLang,
|
||||
makeT,
|
||||
translateHtml,
|
||||
LANG_COOKIE,
|
||||
} from "@wrnexus/i18n";
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/i18n</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/i18n</h1><p>Translation loading, locale resolution, and Intl formatting.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/i18n@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Recursive locale loading, fallback resolution, SSR/browser translations, locale formatting, and language UI blocks for WRNexusJS.</p>
|
||||
<h3 id="locale-files">Locale files</h3>
|
||||
<p>Both layouts can be used together:</p>
|
||||
<pre data-language="text"><code>app/locales/en.json
|
||||
app/locales/en/common.json
|
||||
app/locales/en/auth.json
|
||||
app/locales/mr/common.json</code></pre>
|
||||
<p>Namespaced files become keys such as <code>common.save</code> and <code>auth.signIn</code>.</p>
|
||||
<pre data-language="ts"><code>import { loadLocales, makeT, resolveI18n, resolveLang } from "@wrnexus/i18n";
|
||||
|
||||
// app/locales/en.json, app/locales/es.json
|
||||
const messages = loadLocales("app/locales");
|
||||
const i18n = resolveI18n(messages, { default: "en", locales: ["en", "es"] });
|
||||
const i18n = resolveI18n(loadLocales("app/locales", { strict: true }), {
|
||||
default: "en",
|
||||
locales: ["en", "mr", "hi"],
|
||||
fallbacks: { "mr-IN": ["mr", "en"] },
|
||||
cookie: { name: "wire-lang", sameSite: "Lax", secure: true },
|
||||
});
|
||||
|
||||
// Per request:
|
||||
const lang = resolveLang(i18n, req.cookies?.[LANG_COOKIE], req.headers.get("accept-language"));
|
||||
const lang = resolveLang(i18n, cookieValue, request.headers.get("accept-language"));
|
||||
const t = makeT(i18n, lang);
|
||||
|
||||
t("nav.home"); // dotted key → "Home"
|
||||
t("greeting", { name: "Ada" }); // "Hello, {name}" → "Hello, Ada"
|
||||
|
||||
// After rendering a .wrn view, resolve translation markers in the HTML:
|
||||
const finalHtml = translateHtml(renderedHtml, t);</code></pre>
|
||||
<p><code>app/locales/en.json</code>:</p>
|
||||
<pre data-language="json"><code>{
|
||||
"nav": { "home": "Home" },
|
||||
"greeting": "Hello, {name}"
|
||||
}</code></pre>
|
||||
<h4 id="views-translation-markers">Views: translation markers</h4>
|
||||
<pre data-language="html"><code><h1 data-t="nav.home">Home</h1>
|
||||
t("common.hello", { name: "Ajay" });</code></pre>
|
||||
<h3 id="resolution-behavior">Resolution behavior</h3>
|
||||
<ul>
|
||||
<li>normalized BCP-47-style locale names</li>
|
||||
<li>cookie preference</li>
|
||||
<li>weighted <code>Accept-Language</code></li>
|
||||
<li>wildcard language ranges</li>
|
||||
<li>regional base fallback</li>
|
||||
<li>explicit fallback chains</li>
|
||||
<li>configured default language</li>
|
||||
<li>automatic RTL for Arabic, Hebrew, Persian, Urdu, and related languages</li>
|
||||
</ul>
|
||||
<p>Locale JSON is size-limited and rejects prototype-pollution keys. Recursive namespace collisions are resolved safely.</p>
|
||||
<h3 id="views-and-runtime">Views and runtime</h3>
|
||||
<pre data-language="html"><code><h1 data-t="dashboard.title">Dashboard</h1>
|
||||
<input t:placeholder="search.placeholder" /></code></pre>
|
||||
<p><code>translateHtml</code> replaces the element text for <code>data-t</code> and the attribute value for any <code>t:<attr></code> (e.g. <code>t:placeholder</code>, <code>t:aria-label</code>).</p>
|
||||
<h4 id="client-language-switcher">Client: language switcher</h4>
|
||||
<pre data-language="ts"><code>import { renderI18nData, I18N_RUNTIME, I18N_JS_HREF } from "@wrnexus/i18n";
|
||||
|
||||
// In the document <head>:
|
||||
const head = `
|
||||
<script>${renderI18nData(i18n, lang)}</script>
|
||||
<script src="${I18N_JS_HREF}"></script>
|
||||
`;
|
||||
|
||||
// Serve I18N_RUNTIME at I18N_JS_HREF; then in markup:
|
||||
// <button data-wire-lang-set="es">Español</button>
|
||||
// <select data-wire-lang>…</select></code></pre>
|
||||
<h4 id="formatting">Formatting</h4>
|
||||
<p>Text and translated attributes are resolved during SSR. Active/fallback messages are serialized safely for the language runtime, which rebinds <code>data-t</code> markers after client navigation.</p>
|
||||
<p>Enable <code>i18nPlugin()</code> to use:</p>
|
||||
<ul>
|
||||
<li><code><LanguageSwitcher /></code></li>
|
||||
<li><code><LocaleStatus /></code></li>
|
||||
</ul>
|
||||
<p><code>LanguageSwitcher</code> renders a native <code>select[data-wire-lang]</code>. The packaged runtime validates the selection against the configured locales, writes the configured language cookie, updates the document <code>lang</code>/<code>dir</code> attributes, emits <code>wrnexus:language-change</code>, and reloads so the next SSR request uses the same cookie. No application-owned browser script is required.</p>
|
||||
<h3 id="formatting">Formatting</h3>
|
||||
<ul>
|
||||
<li><code>formatNumber</code></li>
|
||||
<li><code>formatCurrency</code></li>
|
||||
<li><code>formatDate</code></li>
|
||||
<li><code>formatRelativeTime</code></li>
|
||||
<li><code>plural</code></li>
|
||||
<li><code>createLocaleFormatter</code></li>
|
||||
<li><code>translationCoverage</code></li>
|
||||
<p>Localization tooling can extract statically discoverable <code>t("key")</code>, <code>i18n.t("key")</code>, and <code>data-i18n="key"</code> usage, compare every locale with a reference, and create layout-stressing pseudo-locales:</p>
|
||||
</ul>
|
||||
<pre data-language="ts"><code>import {
|
||||
formatNumber,
|
||||
formatCurrency,
|
||||
formatDate,
|
||||
formatRelativeTime,
|
||||
plural,
|
||||
auditLocaleKeys,
|
||||
createPseudoLocale,
|
||||
extractTranslationKeysFromFiles,
|
||||
} from "@wrnexus/i18n";
|
||||
|
||||
formatNumber(1234.5, lang); // "1,234.5"
|
||||
formatCurrency(9.99, "USD", lang); // "$9.99"
|
||||
formatDate(Date.now(), lang); // "Jul 4, 2026"
|
||||
formatRelativeTime(-3, "day", lang); // "3 days ago"
|
||||
plural(2, { one: "# item", other: "# items" }, lang); // "2 items"</code></pre>
|
||||
<h3 id="configuration">Configuration</h3>
|
||||
<p><code>resolveI18n</code> accepts an <code>I18nConfig</code>:</p>
|
||||
<ul>
|
||||
<li><code>default</code> — fallback language; used when nothing else matches. Ignored if it has</li>
|
||||
<p>no loaded messages, in which case the first supported language is used.</p>
|
||||
<li><code>locales</code> — explicit supported-language list; defaults to the loaded locale names.</li>
|
||||
</ul>
|
||||
<p>Language resolution order at request time (<code>resolveLang</code>): a supported <code>wire-lang</code> cookie value → the first matching <code>Accept-Language</code> tag (or its base subtag) → the resolved default.</p>
|
||||
<h3 id="requirements-notes">Requirements / Notes</h3>
|
||||
<ul>
|
||||
<li><strong>Bun-only.</strong> Locale loading uses <code>node:fs</code> (<code>existsSync</code>, <code>readdirSync</code>,</li>
|
||||
<p><code>readFileSync</code>) and <code>node:path</code>; formatting relies on the platform <code>Intl</code> APIs.</p>
|
||||
<li>Works with [<code>@wrnexus/core</code>](../core) — <code>TFunction</code> (the <code>t(key, params)</code> type)</li>
|
||||
<p>comes from core, and the resolved translator is exposed as <code>ctx.t</code> / <code>ctx.lang</code> in request handling.</p>
|
||||
<li>Nested message objects are supported: keys are looked up whole first, then split</li>
|
||||
<p>on <code>.</code> to walk the object tree.</p>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { TFunction } from '@wrnexus/core';
|
||||
const used = extractTranslationKeysFromFiles(sourceFiles);
|
||||
const coverage = auditLocaleKeys(messages, "en");
|
||||
const enXA = createPseudoLocale(messages.en);
|
||||
const arXB = createPseudoLocale(messages.en, { rtl: true });</code></pre>
|
||||
<p>Pseudo-localization preserves interpolation placeholders and markup tags. RTL pseudo output uses Unicode direction controls, while runtime direction detection continues to derive <code>rtl</code> from Arabic and other RTL language subtags.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { TFunction } from '@wrnexus/core';
|
||||
export { I18nPluginOptions, i18nComponentsDir, default as i18nPlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
/**
|
||||
* Locale-aware formatting helpers (Intl-based) + pluralization. Pair with the
|
||||
@@ -134,6 +100,25 @@ declare function formatRelativeTime(value: number, unit: Intl.RelativeTimeFormat
|
||||
*/
|
||||
declare function plural(count: number, forms: Partial<Record<Intl.LDMLPluralRule, string>>, lang: string): string;
|
||||
|
||||
interface ExtractedTranslationKey {
|
||||
key: string;
|
||||
file?: string;
|
||||
offset: number;
|
||||
}
|
||||
declare function extractTranslationKeys(source: string, file?: string): ExtractedTranslationKey[];
|
||||
declare function extractTranslationKeysFromFiles(files: Iterable<string>): ExtractedTranslationKey[];
|
||||
declare function flattenMessageKeys(messages: Messages, prefix?: string): string[];
|
||||
declare function auditLocaleKeys(messages: Record<string, Messages>, referenceLocale: string): Record<string, {
|
||||
missing: string[];
|
||||
extra: string[];
|
||||
}>;
|
||||
declare function pseudoLocalize(value: string, options?: {
|
||||
rtl?: boolean;
|
||||
}): string;
|
||||
declare function createPseudoLocale(messages: Messages, options?: {
|
||||
rtl?: boolean;
|
||||
}): Messages;
|
||||
|
||||
declare function flattenMessages(messages: Messages, prefix?: string, output?: Record<string, string>): Record<string, string>;
|
||||
declare function localeFallbacks(locale: string, fallback?: string): string[];
|
||||
declare function translationCoverage(i18n: ResolvedI18n): Record<string, {
|
||||
@@ -150,108 +135,103 @@ interface LocaleFormatter {
|
||||
relative(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
|
||||
list(values: string[], options?: Intl.ListFormatOptions): string;
|
||||
}
|
||||
declare function createLocaleFormatter(locale: string, timeZone?: string): LocaleFormatter;
|
||||
/** Lightweight plural templates: `{count, plural, one {# item} other {# items}}`. */
|
||||
declare function createLocaleFormatter(locale: string, timeZone?: string, calendar?: string): LocaleFormatter;
|
||||
/** ICU-style plural/select templates with exact values and recursive interpolation. */
|
||||
declare function formatMessage(template: string, params: Record<string, string | number>, locale: string): string;
|
||||
|
||||
/**
|
||||
* @wrnexus/i18n — translations for pages and API responses.
|
||||
*
|
||||
* Locales live in `app/locales/<lang>.json`. Per request the active language is
|
||||
* resolved from the `wire-lang` cookie, then Accept-Language, then the default.
|
||||
* `ctx.t(key, params)` translates on the server; in `.wrn` views `{t:key}` and
|
||||
* `t:attr="key"` markers are resolved by `translateHtml` before the HTML is sent.
|
||||
* @wrnexus/i18n — deterministic locale loading, fallback resolution, SSR
|
||||
* translation markers, browser translation helpers, and UI language controls.
|
||||
*/
|
||||
|
||||
type Messages = Record<string, unknown>;
|
||||
/** Load `<dir>/<lang>.json` files into a `{ lang: messages }` map. */
|
||||
declare function loadLocales(dir: string): Record<string, Messages>;
|
||||
interface LocaleLoadOptions {
|
||||
/** Throw on invalid JSON instead of warning and continuing. */
|
||||
strict?: boolean;
|
||||
/** Maximum JSON file size. Default 1 MiB. */
|
||||
maxFileBytes?: number;
|
||||
}
|
||||
interface I18nCookieConfig {
|
||||
name?: string;
|
||||
maxAge?: number;
|
||||
path?: string;
|
||||
sameSite?: "Strict" | "Lax" | "None";
|
||||
secure?: boolean;
|
||||
}
|
||||
interface I18nConfig {
|
||||
/** Default language, used as the fallback and when nothing else matches. */
|
||||
default?: string;
|
||||
/** Explicit set of supported languages (defaults to the loaded locale names). */
|
||||
locales?: string[];
|
||||
/** Human-readable locale names used by package language controls. */
|
||||
labels?: Record<string, string>;
|
||||
/** Per-locale fallback override. Example: `{ "fr-CA": ["fr", "en"] }`. */
|
||||
fallbacks?: Record<string, string[]>;
|
||||
/** Locale direction overrides. Arabic/Hebrew/Persian/Urdu are RTL automatically. */
|
||||
direction?: Record<string, "ltr" | "rtl">;
|
||||
cookie?: I18nCookieConfig;
|
||||
strict?: boolean;
|
||||
}
|
||||
interface ResolvedI18n {
|
||||
default: string;
|
||||
langs: string[];
|
||||
messages: Record<string, Messages>;
|
||||
fallbacks: Record<string, string[]>;
|
||||
direction: Record<string, "ltr" | "rtl">;
|
||||
labels: Record<string, string>;
|
||||
cookie: Required<I18nCookieConfig>;
|
||||
}
|
||||
declare const LANG_COOKIE = "wire-lang";
|
||||
declare const I18N_JS_HREF = "/__wrnexus/i18n.js";
|
||||
/** Merge loaded locale messages + config into a resolved i18n bundle. */
|
||||
declare function normalizeLocale(locale: string): string;
|
||||
/**
|
||||
* Load both supported layouts:
|
||||
* - `locales/en.json`
|
||||
* - `locales/en/common.json`, `locales/en/auth.json`
|
||||
*
|
||||
* Namespaced files become `messages.en.common` and `messages.en.auth`.
|
||||
*/
|
||||
declare function loadLocales(dir: string, options?: LocaleLoadOptions): Record<string, Messages>;
|
||||
declare function localeDirection(locale: string, overrides?: Record<string, "ltr" | "rtl">): "ltr" | "rtl";
|
||||
declare function resolveI18n(messages: Record<string, Messages>, config?: I18nConfig): ResolvedI18n;
|
||||
/** Build a `t()` for a language: current → default → the key itself. */
|
||||
declare function lookupMessage(messages: Messages | undefined, key: string): string | undefined;
|
||||
declare function interpolate(message: string, params?: Record<string, string | number>): string;
|
||||
declare function translationChain(i18n: ResolvedI18n, locale: string): string[];
|
||||
declare function makeT(i18n: ResolvedI18n, lang: string): TFunction;
|
||||
/** Resolve the active language from a cookie, Accept-Language, then default. */
|
||||
/** Deeply apply tenant-specific translations without mutating the shared locale bundle. */
|
||||
declare function withTenantMessages(i18n: ResolvedI18n, overrides: Record<string, Messages>): ResolvedI18n;
|
||||
/** Load only common and route-specific messages for one locale. */
|
||||
declare function loadRouteMessages(directory: string, locale: string, route: string): Messages;
|
||||
declare function parseAcceptLanguage(value: string | null): string[];
|
||||
declare function resolveLang(i18n: ResolvedI18n, cookieValue: string | undefined, acceptLanguage: string | null): string;
|
||||
/**
|
||||
* Resolve translation markers in rendered HTML:
|
||||
* t:<attr>="key" → <attr>="<translation>" (e.g. t:placeholder, t:aria-label)
|
||||
* <tag data-t="key">…</tag> → element text becomes the translation
|
||||
* Only runs when the HTML actually contains a marker.
|
||||
*/
|
||||
declare function translateHtml(html: string, t: TFunction): string;
|
||||
/** `window.__wireI18n = { lang, langs }` for the client language switcher. */
|
||||
declare function renderI18nData(i18n: ResolvedI18n, lang: string): string;
|
||||
/**
|
||||
* Client runtime: binds `[data-wire-lang-set="es"]` elements to set the
|
||||
* `wire-lang` cookie and reload, so the server re-renders in the new language.
|
||||
*/
|
||||
declare const I18N_RUNTIME: string;
|
||||
|
||||
export { I18N_JS_HREF, I18N_RUNTIME, type I18nConfig, LANG_COOKIE, type LocaleFormatter, type Messages, type ResolvedI18n, createLocaleFormatter, flattenMessages, formatCurrency, formatDate, formatMessage, formatNumber, formatRelativeTime, loadLocales, localeFallbacks, makeT, plural, renderI18nData, resolveI18n, resolveLang, translateHtml, translationCoverage };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Server: load, resolve, translate</h3><pre data-language="ts"><code>import {
|
||||
loadLocales,
|
||||
resolveI18n,
|
||||
resolveLang,
|
||||
makeT,
|
||||
translateHtml,
|
||||
LANG_COOKIE,
|
||||
} from "@wrnexus/i18n";
|
||||
export { type ExtractedTranslationKey, I18N_JS_HREF, I18N_RUNTIME, type I18nConfig, type I18nCookieConfig, LANG_COOKIE, type LocaleFormatter, type LocaleLoadOptions, type Messages, type ResolvedI18n, auditLocaleKeys, createLocaleFormatter, createPseudoLocale, extractTranslationKeys, extractTranslationKeysFromFiles, flattenMessageKeys, flattenMessages, formatCurrency, formatDate, formatMessage, formatNumber, formatRelativeTime, interpolate, loadLocales, loadRouteMessages, localeDirection, localeFallbacks, lookupMessage, makeT, normalizeLocale, parseAcceptLanguage, plural, pseudoLocalize, renderI18nData, resolveI18n, resolveLang, translateHtml, translationChain, translationCoverage, withTenantMessages };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Namespaced files become keys such as common.save and auth.signIn.</h3><pre data-language="ts"><code>import { loadLocales, makeT, resolveI18n, resolveLang } from "@wrnexus/i18n";
|
||||
|
||||
// app/locales/en.json, app/locales/es.json
|
||||
const messages = loadLocales("app/locales");
|
||||
const i18n = resolveI18n(messages, { default: "en", locales: ["en", "es"] });
|
||||
const i18n = resolveI18n(loadLocales("app/locales", { strict: true }), {
|
||||
default: "en",
|
||||
locales: ["en", "mr", "hi"],
|
||||
fallbacks: { "mr-IN": ["mr", "en"] },
|
||||
cookie: { name: "wire-lang", sameSite: "Lax", secure: true },
|
||||
});
|
||||
|
||||
// Per request:
|
||||
const lang = resolveLang(i18n, req.cookies?.[LANG_COOKIE], req.headers.get("accept-language"));
|
||||
const lang = resolveLang(i18n, cookieValue, request.headers.get("accept-language"));
|
||||
const t = makeT(i18n, lang);
|
||||
|
||||
t("nav.home"); // dotted key → "Home"
|
||||
t("greeting", { name: "Ada" }); // "Hello, {name}" → "Hello, Ada"
|
||||
|
||||
// After rendering a .wrn view, resolve translation markers in the HTML:
|
||||
const finalHtml = translateHtml(renderedHtml, t);</code></pre></article><article class="example-card"><h3>Server: load, resolve, translate</h3><pre data-language="json"><code>{
|
||||
"nav": { "home": "Home" },
|
||||
"greeting": "Hello, {name}"
|
||||
}</code></pre></article><article class="example-card"><h3>Views: translation markers</h3><pre data-language="html"><code><h1 data-t="nav.home">Home</h1>
|
||||
<input t:placeholder="search.placeholder" /></code></pre></article><article class="example-card"><h3>Client: language switcher</h3><pre data-language="ts"><code>import { renderI18nData, I18N_RUNTIME, I18N_JS_HREF } from "@wrnexus/i18n";
|
||||
|
||||
// In the document <head>:
|
||||
const head = `
|
||||
<script>${renderI18nData(i18n, lang)}</script>
|
||||
<script src="${I18N_JS_HREF}"></script>
|
||||
`;
|
||||
|
||||
// Serve I18N_RUNTIME at I18N_JS_HREF; then in markup:
|
||||
// <button data-wire-lang-set="es">Español</button>
|
||||
// <select data-wire-lang>…</select></code></pre></article><article class="example-card"><h3>Formatting</h3><pre data-language="ts"><code>import {
|
||||
formatNumber,
|
||||
formatCurrency,
|
||||
formatDate,
|
||||
formatRelativeTime,
|
||||
plural,
|
||||
t("common.hello", { name: "Ajay" });</code></pre></article><article class="example-card"><h3>## Views and runtime</h3><pre data-language="html"><code><h1 data-t="dashboard.title">Dashboard</h1>
|
||||
<input t:placeholder="search.placeholder" /></code></pre></article><article class="example-card"><h3>reference, and create layout-stressing pseudo-locales</h3><pre data-language="ts"><code>import {
|
||||
auditLocaleKeys,
|
||||
createPseudoLocale,
|
||||
extractTranslationKeysFromFiles,
|
||||
} from "@wrnexus/i18n";
|
||||
|
||||
formatNumber(1234.5, lang); // "1,234.5"
|
||||
formatCurrency(9.99, "USD", lang); // "$9.99"
|
||||
formatDate(Date.now(), lang); // "Jul 4, 2026"
|
||||
formatRelativeTime(-3, "day", lang); // "3 days ago"
|
||||
plural(2, { one: "# item", other: "# items" }, lang); // "2 items"</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#loading-resolving">Loading & resolving</a><a class="toc-level-4" href="#types-constants">Types & constants</a><a class="toc-level-4" href="#html-client-runtime">HTML & client runtime</a><a class="toc-level-4" href="#formatting-helpers-re-exported-from-format-ts">Formatting helpers (re-exported from ./format.ts)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#server-load-resolve-translate">Server: load, resolve, translate</a><a class="toc-level-4" href="#views-translation-markers">Views: translation markers</a><a class="toc-level-4" href="#client-language-switcher">Client: language switcher</a><a class="toc-level-4" href="#formatting">Formatting</a><a class="toc-level-3" href="#configuration">Configuration</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
const used = extractTranslationKeysFromFiles(sourceFiles);
|
||||
const coverage = auditLocaleKeys(messages, "en");
|
||||
const enXA = createPseudoLocale(messages.en);
|
||||
const arXB = createPseudoLocale(messages.en, { rtl: true });</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#locale-files">Locale files</a><a class="toc-level-3" href="#resolution-behavior">Resolution behavior</a><a class="toc-level-3" href="#views-and-runtime">Views and runtime</a><a class="toc-level-3" href="#formatting">Formatting</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
page wrnexusidentity {
|
||||
seo {
|
||||
title = "@wrnexus/identity"
|
||||
description = "Portable identity records, claims, and account linking."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/identity</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/identity</h1><p>Portable identity records, claims, and account linking.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/identity@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Enterprise identity and governance for WRNexusJS: OIDC discovery, signed SAML adapter flows, LDAP/Active Directory synchronization adapters, SCIM provisioning, scoped API keys, service accounts, approval workflows, consent history, retention, subject export/deletion and audit.</p>
|
||||
<p>The package complements <code>@wrnexus/auth</code> (passkeys, MFA, devices, sessions, OAuth and audited impersonation) and <code>@wrnexus/authz</code> (RBAC, ABAC and policy decisions). Protocol-specific SAML and directory parsing is supplied through adapters so applications can select a maintained vendor SDK without weakening framework validation, replay protection or governance auditing.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface OidcMetadata {
|
||||
issuer: string;
|
||||
authorization_endpoint: string;
|
||||
token_endpoint: string;
|
||||
userinfo_endpoint?: string;
|
||||
jwks_uri: string;
|
||||
scopes_supported?: string[];
|
||||
}
|
||||
declare function discoverOidc(issuer: string, options?: {
|
||||
fetch?: typeof fetch;
|
||||
}): Promise<OidcMetadata>;
|
||||
declare function oidcAuthorizationUrl(metadata: OidcMetadata, input: {
|
||||
clientId: string;
|
||||
redirectUri: string;
|
||||
state: string;
|
||||
nonce: string;
|
||||
codeChallenge: string;
|
||||
scopes?: string[];
|
||||
}): string;
|
||||
interface EnterpriseIdentity {
|
||||
externalId: string;
|
||||
username: string;
|
||||
displayName?: string;
|
||||
email?: string;
|
||||
groups: string[];
|
||||
active: boolean;
|
||||
attributes?: Record<string, unknown>;
|
||||
}
|
||||
interface SamlAssertion {
|
||||
id: string;
|
||||
issuer: string;
|
||||
audience: string;
|
||||
recipient: string;
|
||||
expiresAt: number;
|
||||
identity: EnterpriseIdentity;
|
||||
}
|
||||
interface SamlAdapter {
|
||||
createLoginRequest(input: {
|
||||
requestId: string;
|
||||
callbackUrl: string;
|
||||
relayState: string;
|
||||
}): Promise<string> | string;
|
||||
verifySignedResponse(response: string): Promise<SamlAssertion>;
|
||||
}
|
||||
interface ReplayStore {
|
||||
consume(id: string, expiresAt: number): Promise<boolean>;
|
||||
}
|
||||
declare function memoryReplayStore(now?: () => number): ReplayStore;
|
||||
declare function createSamlFederation(options: {
|
||||
adapter: SamlAdapter;
|
||||
issuer: string;
|
||||
audience: string;
|
||||
recipient: string;
|
||||
replayStore?: ReplayStore;
|
||||
now?: () => number;
|
||||
}): {
|
||||
login: (input: {
|
||||
requestId: string;
|
||||
callbackUrl: string;
|
||||
relayState: string;
|
||||
}) => Promise<string> | string;
|
||||
callback(encodedResponse: string): Promise<EnterpriseIdentity>;
|
||||
};
|
||||
interface DirectoryAdapter {
|
||||
kind: "ldap" | "active-directory";
|
||||
search(input: {
|
||||
baseDn: string;
|
||||
filter: string;
|
||||
attributes: string[];
|
||||
signal?: AbortSignal;
|
||||
}): Promise<EnterpriseIdentity[]>;
|
||||
authenticate?(username: string, password: string, signal?: AbortSignal): Promise<EnterpriseIdentity | null>;
|
||||
}
|
||||
declare function syncDirectory(adapter: DirectoryAdapter, options: {
|
||||
baseDn: string;
|
||||
filter?: string;
|
||||
attributes?: string[];
|
||||
signal?: AbortSignal;
|
||||
upsert: (identity: EnterpriseIdentity) => void | Promise<void>;
|
||||
disableMissing?: (externalIds: string[]) => void | Promise<void>;
|
||||
}): Promise<{
|
||||
provider: "ldap" | "active-directory";
|
||||
synchronized: number;
|
||||
}>;
|
||||
interface ScimUser extends EnterpriseIdentity {
|
||||
id: string;
|
||||
/** RFC 7643 field accepted at the HTTP boundary. */
|
||||
userName?: string;
|
||||
schemas?: string[];
|
||||
}
|
||||
interface ScimStore {
|
||||
list(): Promise<ScimUser[]>;
|
||||
get(id: string): Promise<ScimUser | null>;
|
||||
create(user: Omit<ScimUser, "id">): Promise<ScimUser>;
|
||||
update(id: string, user: Partial<ScimUser>): Promise<ScimUser | null>;
|
||||
delete(id: string): Promise<boolean>;
|
||||
}
|
||||
declare function memoryScimStore(): ScimStore;
|
||||
declare function createScimHandler(options: {
|
||||
store: ScimStore;
|
||||
bearerToken: string;
|
||||
basePath?: string;
|
||||
maxBodyBytes?: number;
|
||||
}): (request: Request) => Promise<Response>;
|
||||
interface MachineCredential {
|
||||
id: string;
|
||||
ownerId: string;
|
||||
kind: "api-key" | "service-account";
|
||||
name: string;
|
||||
scopes: string[];
|
||||
secretHash: string;
|
||||
createdAt: number;
|
||||
expiresAt?: number;
|
||||
revokedAt?: number;
|
||||
}
|
||||
declare function createMachineIdentityManager(now?: () => number): {
|
||||
issue(input: {
|
||||
ownerId: string;
|
||||
name: string;
|
||||
scopes: string[];
|
||||
kind?: MachineCredential["kind"];
|
||||
expiresAt?: number;
|
||||
}): Promise<{
|
||||
secret: string;
|
||||
credential: {
|
||||
secretHash: string;
|
||||
id: string;
|
||||
ownerId: string;
|
||||
kind: "api-key" | "service-account";
|
||||
name: string;
|
||||
scopes: string[];
|
||||
createdAt: number;
|
||||
expiresAt?: number;
|
||||
revokedAt?: number;
|
||||
};
|
||||
}>;
|
||||
authenticate(secret: string, requiredScope?: string): Promise<{
|
||||
secretHash: string;
|
||||
id: string;
|
||||
ownerId: string;
|
||||
kind: "api-key" | "service-account";
|
||||
name: string;
|
||||
scopes: string[];
|
||||
createdAt: number;
|
||||
expiresAt?: number;
|
||||
revokedAt?: number;
|
||||
} | null>;
|
||||
revoke(id: string): boolean;
|
||||
list(ownerId: string): {
|
||||
secretHash: string;
|
||||
id: string;
|
||||
ownerId: string;
|
||||
kind: "api-key" | "service-account";
|
||||
name: string;
|
||||
scopes: string[];
|
||||
createdAt: number;
|
||||
expiresAt?: number;
|
||||
revokedAt?: number;
|
||||
}[];
|
||||
};
|
||||
interface GovernanceEvent {
|
||||
id: string;
|
||||
type: string;
|
||||
subjectId: string;
|
||||
actorId?: string;
|
||||
createdAt: number;
|
||||
data?: Record<string, unknown>;
|
||||
}
|
||||
declare function createGovernance(options?: {
|
||||
now?: () => number;
|
||||
audit?: (event: GovernanceEvent) => void | Promise<void>;
|
||||
exportSubject?: (subjectId: string) => unknown | Promise<unknown>;
|
||||
deleteSubject?: (subjectId: string) => void | Promise<void>;
|
||||
}): {
|
||||
consent(subjectId: string, purpose: string, granted: boolean, version: string): Promise<{
|
||||
granted: boolean;
|
||||
version: string;
|
||||
at: number;
|
||||
}>;
|
||||
consents(subjectId: string): {
|
||||
[k: string]: {
|
||||
granted: boolean;
|
||||
version: string;
|
||||
at: number;
|
||||
};
|
||||
};
|
||||
request(subjectId: string, action: "export" | "delete"): Promise<{
|
||||
id: `${string}-${string}-${string}-${string}-${string}`;
|
||||
subjectId: string;
|
||||
action: "export" | "delete";
|
||||
status: "pending";
|
||||
requestedAt: number;
|
||||
}>;
|
||||
decide(id: string, actorId: string, approved: boolean): Promise<{
|
||||
decision: {
|
||||
status: "approved" | "rejected";
|
||||
decidedAt: number;
|
||||
decidedBy: string;
|
||||
id: string;
|
||||
subjectId: string;
|
||||
action: "export" | "delete";
|
||||
requestedAt: number;
|
||||
};
|
||||
result: unknown;
|
||||
}>;
|
||||
enforceRetention(records: Array<{
|
||||
subjectId: string;
|
||||
createdAt: number;
|
||||
}>, maxAgeMs: number, remove: (record: {
|
||||
subjectId: string;
|
||||
createdAt: number;
|
||||
}) => void | Promise<void>): Promise<number>;
|
||||
};
|
||||
|
||||
export { type DirectoryAdapter, type EnterpriseIdentity, type GovernanceEvent, type MachineCredential, type OidcMetadata, type ReplayStore, type SamlAdapter, type SamlAssertion, type ScimStore, type ScimUser, createGovernance, createMachineIdentityManager, createSamlFederation, createScimHandler, discoverOidc, memoryReplayStore, memoryScimStore, oidcAuthorizationUrl, syncDirectory };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/identity</h3><pre data-language="sh"><code>bun add @wrnexus/identity</code></pre></article><article class="example-card"><h3>Import @wrnexus/identity</h3><pre data-language="ts"><code>import * as identity from "@wrnexus/identity";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
page wrnexusimage {
|
||||
seo {
|
||||
title = "@wrnexus/image"
|
||||
description = "Responsive image optimization, loaders, placeholders, and components."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/image</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/image</h1><p>Responsive image optimization, loaders, placeholders, and components.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/image@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Secure responsive-image planning, loader adapters, picture sources, preload hints, placeholders, and performance auditing for WRNexusJS.</p>
|
||||
<p>Build-time conversion is available through <code>optimizeImage</code>. It normalizes and bounds width/format variants, prevents variant explosions, writes deterministic filenames, and returns a manifest with dimensions and byte sizes:</p>
|
||||
<pre data-language="ts"><code>import { optimizeImage } from "@wrnexus/image";
|
||||
|
||||
const manifest = await optimizeImage("public/hero.jpg", {
|
||||
outputDir: "public/generated/images",
|
||||
widths: [480, 960, 1440],
|
||||
formats: ["avif", "webp"],
|
||||
quality: 80,
|
||||
});</code></pre>
|
||||
<p>Install the optional <code>sharp</code> peer (<code>bun add sharp</code>) for the default AVIF/WebP processor. Build systems can instead supply an <code>ImageProcessor</code> adapter, which also makes transformation pipelines deterministic in tests.</p>
|
||||
<h3 id="helper-api">Helper API</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createResponsiveImage,
|
||||
createPicture,
|
||||
createCdnImageLoader,
|
||||
createPathImageLoader,
|
||||
createBlurPlaceholder,
|
||||
imagePreload,
|
||||
auditImage,
|
||||
} from "@wrnexus/image";
|
||||
|
||||
const loader = createCdnImageLoader("https://images.example.com/transform");
|
||||
const picture = createPicture({
|
||||
src: "/hero.jpg",
|
||||
alt: "Product dashboard",
|
||||
width: 1600,
|
||||
height: 900,
|
||||
widths: [480, 768, 1200, 1600],
|
||||
formats: ["avif", "webp"],
|
||||
sizes: "(max-width: 768px) 100vw, 1200px",
|
||||
fetchPriority: "high",
|
||||
loader,
|
||||
});</code></pre>
|
||||
<p>Remote loaders require HTTPS. Source URLs are validated, dimensions and quality are bounded, placeholder colors are restricted to safe CSS colors, and preload attributes are escaped.</p>
|
||||
<h3 id="components">Components</h3>
|
||||
<p>Enable <code>imagePlugin()</code> and use:</p>
|
||||
<ul>
|
||||
<li><code><OptimizedImage /></code></li>
|
||||
<li><code><Picture /></code></li>
|
||||
<li><code><ImageCard /></code></li>
|
||||
</ul>
|
||||
<p>The package-owned blocks compose <code>@wrnexus/ui</code> where a complete UI block is appropriate while keeping the low-level image element lightweight.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { ImagePluginOptions, imageComponentsDir, default as imagePlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
interface ImageProcessorResult {
|
||||
data: Uint8Array;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
interface ImageProcessor {
|
||||
transform(input: string, options: {
|
||||
width: number;
|
||||
format: Exclude<ImageFormat, "original">;
|
||||
quality: number;
|
||||
}): Promise<ImageProcessorResult>;
|
||||
}
|
||||
interface OptimizeImageOptions {
|
||||
outputDir: string;
|
||||
widths: number[];
|
||||
formats?: Array<Exclude<ImageFormat, "original">>;
|
||||
quality?: number;
|
||||
maxVariants?: number;
|
||||
processor?: ImageProcessor;
|
||||
}
|
||||
interface OptimizedImageVariant {
|
||||
path: string;
|
||||
width: number;
|
||||
height: number;
|
||||
format: Exclude<ImageFormat, "original">;
|
||||
bytes: number;
|
||||
}
|
||||
interface OptimizedImageManifest {
|
||||
source: string;
|
||||
variants: OptimizedImageVariant[];
|
||||
}
|
||||
declare function optimizeImage(input: string, options: OptimizeImageOptions): Promise<OptimizedImageManifest>;
|
||||
|
||||
type ImageFormat = "avif" | "webp" | "jpeg" | "png" | "original";
|
||||
interface ImageLoaderInput {
|
||||
src: string;
|
||||
width: number;
|
||||
quality?: number;
|
||||
format?: ImageFormat;
|
||||
}
|
||||
type ImageLoader = (input: ImageLoaderInput) => string;
|
||||
interface ImagePolicy {
|
||||
remoteHosts?: string[];
|
||||
allowedProtocols?: string[];
|
||||
maxWidth?: number;
|
||||
maxQuality?: number;
|
||||
}
|
||||
interface ResponsiveImageOptions extends ImagePolicy {
|
||||
src: string;
|
||||
alt: string;
|
||||
width: number;
|
||||
height: number;
|
||||
widths?: number[];
|
||||
sizes?: string;
|
||||
quality?: number;
|
||||
format?: ImageFormat;
|
||||
loading?: "eager" | "lazy";
|
||||
fetchPriority?: "high" | "low" | "auto";
|
||||
decoding?: "async" | "sync" | "auto";
|
||||
loader?: ImageLoader;
|
||||
class?: string;
|
||||
}
|
||||
interface ResponsiveImageAttributes {
|
||||
src: string;
|
||||
srcset?: string;
|
||||
sizes?: string;
|
||||
alt: string;
|
||||
width: string;
|
||||
height: string;
|
||||
loading: "eager" | "lazy";
|
||||
decoding: "async" | "sync" | "auto";
|
||||
fetchpriority?: "high" | "low" | "auto";
|
||||
class?: string;
|
||||
}
|
||||
interface ImageAuditInput {
|
||||
src: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
renderedWidth?: number;
|
||||
bytes?: number;
|
||||
loading?: string;
|
||||
fetchPriority?: string;
|
||||
isLcp?: boolean;
|
||||
}
|
||||
interface ImageAuditIssue {
|
||||
code: string;
|
||||
severity: "error" | "warning" | "info";
|
||||
message: string;
|
||||
}
|
||||
declare const defaultImageLoader: ImageLoader;
|
||||
declare function createResponsiveImage(options: ResponsiveImageOptions): ResponsiveImageAttributes;
|
||||
declare function auditImage(input: ImageAuditInput): ImageAuditIssue[];
|
||||
interface PictureSource {
|
||||
type: string;
|
||||
srcset: string;
|
||||
sizes?: string;
|
||||
}
|
||||
interface PicturePlan {
|
||||
image: ResponsiveImageAttributes;
|
||||
sources: PictureSource[];
|
||||
}
|
||||
declare function normalizeImageWidths(widths: readonly number[], options?: {
|
||||
min?: number;
|
||||
max?: number;
|
||||
}): number[];
|
||||
declare function createCdnImageLoader(baseUrl: string, options?: {
|
||||
sourceParam?: string;
|
||||
widthParam?: string;
|
||||
qualityParam?: string;
|
||||
formatParam?: string;
|
||||
}): ImageLoader;
|
||||
declare function createPathImageLoader(prefix?: string): ImageLoader;
|
||||
declare function createPicture(options: ResponsiveImageOptions & {
|
||||
formats?: ImageFormat[];
|
||||
}): PicturePlan;
|
||||
declare function createBlurPlaceholder(options?: {
|
||||
width?: number;
|
||||
height?: number;
|
||||
color?: string;
|
||||
accent?: string;
|
||||
}): string;
|
||||
declare function imagePreload(image: ResponsiveImageAttributes, options?: {
|
||||
as?: string;
|
||||
type?: string;
|
||||
crossOrigin?: "anonymous" | "use-credentials";
|
||||
}): string;
|
||||
declare function imageCacheKey(input: ImageLoaderInput): string;
|
||||
|
||||
export { type ImageAuditInput, type ImageAuditIssue, type ImageFormat, type ImageLoader, type ImageLoaderInput, type ImagePolicy, type ImageProcessor, type ImageProcessorResult, type OptimizeImageOptions, type OptimizedImageManifest, type OptimizedImageVariant, type PicturePlan, type PictureSource, type ResponsiveImageAttributes, type ResponsiveImageOptions, auditImage, createBlurPlaceholder, createCdnImageLoader, createPathImageLoader, createPicture, createResponsiveImage, defaultImageLoader, imageCacheKey, imagePreload, normalizeImageWidths, optimizeImage };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>filenames, and returns a manifest with dimensions and byte sizes</h3><pre data-language="ts"><code>import { optimizeImage } from "@wrnexus/image";
|
||||
|
||||
const manifest = await optimizeImage("public/hero.jpg", {
|
||||
outputDir: "public/generated/images",
|
||||
widths: [480, 960, 1440],
|
||||
formats: ["avif", "webp"],
|
||||
quality: 80,
|
||||
});</code></pre></article><article class="example-card"><h3>## Helper API</h3><pre data-language="ts"><code>import {
|
||||
createResponsiveImage,
|
||||
createPicture,
|
||||
createCdnImageLoader,
|
||||
createPathImageLoader,
|
||||
createBlurPlaceholder,
|
||||
imagePreload,
|
||||
auditImage,
|
||||
} from "@wrnexus/image";
|
||||
|
||||
const loader = createCdnImageLoader("https://images.example.com/transform");
|
||||
const picture = createPicture({
|
||||
src: "/hero.jpg",
|
||||
alt: "Product dashboard",
|
||||
width: 1600,
|
||||
height: 900,
|
||||
widths: [480, 768, 1200, 1600],
|
||||
formats: ["avif", "webp"],
|
||||
sizes: "(max-width: 768px) 100vw, 1200px",
|
||||
fetchPriority: "high",
|
||||
loader,
|
||||
});</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#helper-api">Helper API</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
+130
-6
@@ -10,11 +10,11 @@ page wrnexusjwt {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/jwt</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/jwt</h1><p>HS256 JWT signing, verification, and bearer authentication.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/jwt@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Dependency-free JSON Web Tokens (HS256) via Web Crypto, plus a bearer-token auth middleware for WRNexusJS.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/jwt</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/jwt</h1><p>HS256 JWT signing, verification, and bearer authentication.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/jwt@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Dependency-free JSON Web Tokens (HS256) via Web Crypto, plus a bearer-token auth middleware for WRNexusJS.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/jwt</code> signs and verifies stateless JSON Web Tokens using the <strong>HS256</strong> (HMAC-SHA-256) algorithm. It has no runtime dependencies — signing and verification are implemented directly on the standard <strong>Web Crypto</strong> API (<code>crypto.subtle</code>), which Bun provides natively. It runs server-side and pairs with the session-based auth in <code>@wrnexus/core</code>, giving you a stateless option for API and mobile clients. Reach for it when you need bearer-token auth rather than cookie sessions.</p>
|
||||
@@ -87,7 +87,46 @@ app.use(jwtAuth({ secret: process.env.JWT_SECRET!, required: false }))
|
||||
<p>are not supported.</p>
|
||||
<li>Integrates with [<code>@wrnexus/core</code>](../core) for <code>Context</code>, <code>Middleware</code>, and</li>
|
||||
<p><code>ctx.user</code>; it complements the framework's cookie/session auth with a stateless bearer-token flow for API and mobile clients.</p>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Context, Middleware } from '@wrnexus/core';
|
||||
</ul>
|
||||
<h3 id="access-refresh-scope-and-cookie-helpers">Access, refresh, scope, and cookie helpers</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createAccessToken,
|
||||
createRefreshToken,
|
||||
verifyAccessToken,
|
||||
verifyRefreshToken,
|
||||
extractBearerToken,
|
||||
requireScopes,
|
||||
jwtCookie,
|
||||
} from "@wrnexus/jwt";</code></pre>
|
||||
<p>The helpers add explicit <code>type: "access" | "refresh"</code> claims, scope checks, refresh-token family metadata, no-store token responses, and secure cookie defaults. <code>__Host-</code> cookies are rejected unless they use <code>Path=/</code> and <code>Secure</code>; <code>SameSite=None</code> is rejected without <code>Secure</code>.</p>
|
||||
<h3 id="0-8-helper-kit">0.8 helper kit</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createTokenPair,
|
||||
verifyAccessToken,
|
||||
verifyRefreshToken,
|
||||
extractBearerToken,
|
||||
readJwtCookie,
|
||||
jwtCookie,
|
||||
clearJwtCookie,
|
||||
requireScopes,
|
||||
} from "@wrnexus/jwt";
|
||||
|
||||
const pair = await createTokenPair(user.id, {
|
||||
accessSecret: process.env.JWT_ACCESS_SECRET!,
|
||||
refreshSecret: process.env.JWT_REFRESH_SECRET!,
|
||||
scopes: ["profile:read"],
|
||||
family: sessionFamily,
|
||||
});</code></pre>
|
||||
<p>The helper kit validates <code>__Host-</code> cookie invariants, cookie names and paths, <code>SameSite=None</code> security, typed access/refresh token types, scope requirements, and no-store token responses. In addition to local HS256 secrets/keyrings, the package verifies standards-based RS256 tokens through bounded remote JWKS caches:</p>
|
||||
<pre data-language="ts"><code>import { createRemoteJwks, verifyJwtWithJwks } from "@wrnexus/jwt";
|
||||
|
||||
const jwks = createRemoteJwks("https://issuer.example/.well-known/jwks.json");
|
||||
const claims = await verifyJwtWithJwks(token, jwks, {
|
||||
issuer: "https://issuer.example",
|
||||
audience: "my-api",
|
||||
maxAge: 300,
|
||||
});</code></pre>
|
||||
<p>JWKS URLs must use HTTPS. Responses have key-count/byte limits, accept only RS256 signing RSA keys, deduplicate concurrent refreshes, cache imported public keys, and force an immediate refresh for an unknown <code>kid</code> so issuer rotation does not wait for cache expiry. Never use decoded-but-unverified claims for an authorization decision.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Context, Middleware } from '@wrnexus/core';
|
||||
|
||||
interface JwtKey {
|
||||
id: string;
|
||||
@@ -107,6 +146,91 @@ declare function createJwtKeyring(keys: JwtKey[]): JwtKeyring;
|
||||
declare function signWithKeyring(claims: JwtClaims, keyring: JwtKeyring, options?: SignOptions): Promise<string>;
|
||||
declare function verifyWithKeyring<T extends JwtClaims = JwtClaims>(token: string, keyring: JwtKeyring, options?: VerifyOptions): Promise<T>;
|
||||
|
||||
interface AccessTokenClaims extends JwtClaims {
|
||||
sub: string;
|
||||
type: "access";
|
||||
scopes?: string[];
|
||||
}
|
||||
interface RefreshTokenClaims extends JwtClaims {
|
||||
sub: string;
|
||||
type: "refresh";
|
||||
family?: string;
|
||||
}
|
||||
declare function extractBearerToken(value: Headers | Request | Context | string | null | undefined): string | undefined;
|
||||
declare function tryVerifyJwt<T extends JwtClaims = JwtClaims>(token: string | undefined, secret: string, options?: VerifyOptions): Promise<T | null>;
|
||||
declare function assertJwtClaims<T extends JwtClaims>(claims: T, requirements?: {
|
||||
subject?: boolean;
|
||||
type?: string;
|
||||
required?: string[];
|
||||
}): T;
|
||||
declare function tokenScopes(claims: JwtClaims): string[];
|
||||
declare function hasScopes(claims: JwtClaims, required: readonly string[], mode?: "all" | "any"): boolean;
|
||||
declare function requireScopes(required: readonly string[], mode?: "all" | "any"): Middleware;
|
||||
declare function createAccessToken(subject: string, secret: string, options?: Omit<SignOptions, "expiresIn"> & {
|
||||
expiresIn?: number;
|
||||
scopes?: string[];
|
||||
claims?: JwtClaims;
|
||||
}): Promise<string>;
|
||||
declare function createRefreshToken(subject: string, secret: string, options?: Omit<SignOptions, "expiresIn"> & {
|
||||
expiresIn?: number;
|
||||
family?: string;
|
||||
claims?: JwtClaims;
|
||||
}): Promise<string>;
|
||||
declare function verifyAccessToken(token: string, secret: string, options?: VerifyOptions): Promise<AccessTokenClaims>;
|
||||
declare function verifyRefreshToken(token: string, secret: string, options?: VerifyOptions): Promise<RefreshTokenClaims>;
|
||||
declare function readJwtCookie(value: Headers | Request | string | null | undefined, name?: string): string | undefined;
|
||||
declare function jwtCookie(token: string, options?: {
|
||||
name?: string;
|
||||
maxAge?: number;
|
||||
secure?: boolean;
|
||||
sameSite?: "Strict" | "Lax" | "None";
|
||||
path?: string;
|
||||
}): string;
|
||||
declare function clearJwtCookie(options?: Omit<Parameters<typeof jwtCookie>[1], "maxAge">): string;
|
||||
interface JwtTokenPair {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
tokenType: "Bearer";
|
||||
expiresIn: number;
|
||||
}
|
||||
declare function createTokenPair(subject: string, input: {
|
||||
accessSecret: string;
|
||||
refreshSecret?: string;
|
||||
accessExpiresIn?: number;
|
||||
refreshExpiresIn?: number;
|
||||
scopes?: string[];
|
||||
family?: string;
|
||||
accessOptions?: Omit<SignOptions, "expiresIn">;
|
||||
refreshOptions?: Omit<SignOptions, "expiresIn">;
|
||||
}): Promise<JwtTokenPair>;
|
||||
declare function jwtResponse(accessToken: string, input?: {
|
||||
refreshToken?: string;
|
||||
expiresIn?: number;
|
||||
tokenType?: string;
|
||||
scope?: string[];
|
||||
}): Response;
|
||||
|
||||
interface RemoteJwksOptions {
|
||||
fetch?: typeof fetch;
|
||||
cacheTtlMs?: number;
|
||||
maxKeys?: number;
|
||||
maxBytes?: number;
|
||||
now?: () => number;
|
||||
}
|
||||
interface RemoteJwks {
|
||||
resolve(kid: string, alg: string): Promise<CryptoKey>;
|
||||
refresh(): Promise<void>;
|
||||
clear(): void;
|
||||
stats(): {
|
||||
fetches: number;
|
||||
hits: number;
|
||||
keys: number;
|
||||
expiresAt: number;
|
||||
};
|
||||
}
|
||||
declare function createRemoteJwks(url: string, options?: RemoteJwksOptions): RemoteJwks;
|
||||
declare function verifyJwtWithJwks<T extends JwtClaims = JwtClaims>(token: string, jwks: RemoteJwks, options?: VerifyOptions): Promise<T>;
|
||||
|
||||
/**
|
||||
* @wrnexus/jwt — dependency-free JSON Web Tokens (HS256) via WebCrypto, plus a
|
||||
* bearer-token auth middleware. Pairs with the session auth in @wrnexus/core for
|
||||
@@ -165,7 +289,7 @@ interface JwtAuthOptions {
|
||||
*/
|
||||
declare function jwtAuth(options: JwtAuthOptions): Middleware;
|
||||
|
||||
export { type JwtAuthOptions, type JwtClaims, JwtError, type JwtKey, type JwtKeyring, type SignOptions, type VerifyOptions, createJwtKeyring, decodeJwt, jwtAuth, signJwt, signWithKeyring, verifyJwt, verifyWithKeyring };
|
||||
export { type AccessTokenClaims, type JwtAuthOptions, type JwtClaims, JwtError, type JwtKey, type JwtKeyring, type JwtTokenPair, type RefreshTokenClaims, type RemoteJwks, type RemoteJwksOptions, type SignOptions, type VerifyOptions, assertJwtClaims, clearJwtCookie, createAccessToken, createJwtKeyring, createRefreshToken, createRemoteJwks, createTokenPair, decodeJwt, extractBearerToken, hasScopes, jwtAuth, jwtCookie, jwtResponse, readJwtCookie, requireScopes, signJwt, signWithKeyring, tokenScopes, tryVerifyJwt, verifyAccessToken, verifyJwt, verifyJwtWithJwks, verifyRefreshToken, verifyWithKeyring };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Typical usage</h3><pre data-language="ts"><code>import { signJwt, verifyJwt, jwtAuth, JwtError } from "@wrnexus/jwt";
|
||||
|
||||
const secret = process.env.JWT_SECRET!;
|
||||
@@ -190,9 +314,9 @@ app.use(jwtAuth({ secret: process.env.JWT_SECRET! }));
|
||||
|
||||
// Optional auth — populate ctx.user when present, but don't 401
|
||||
app.use(jwtAuth({ secret: process.env.JWT_SECRET!, required: false }));</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#signjwt-payload-secret-options">signJwt(payload, secret, options?)</a><a class="toc-level-4" href="#verifyjwt-t-token-secret-options">verifyJwt<T>(token, secret, options?)</a><a class="toc-level-4" href="#jwtauth-options">jwtAuth(options)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#signjwt-payload-secret-options">signJwt(payload, secret, options?)</a><a class="toc-level-4" href="#verifyjwt-t-token-secret-options">verifyJwt<T>(token, secret, options?)</a><a class="toc-level-4" href="#jwtauth-options">jwtAuth(options)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-3" href="#access-refresh-scope-and-cookie-helpers">Access, refresh, scope, and cookie helpers</a><a class="toc-level-3" href="#0-8-helper-kit">0.8 helper kit</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
page wrnexuslanguageserver {
|
||||
seo {
|
||||
title = "@wrnexus/language-server"
|
||||
description = "Editor-neutral language intelligence for WRN files."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/language-server</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/language-server</h1><p>Editor-neutral language intelligence for WRN files.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/language-server@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Editor-neutral Language Server Protocol support for <code>.wrn</code> files. It uses the canonical <code>@wrnexus/syntax</code> parser, diagnostics, accessibility rules, and formatter.</p>
|
||||
<pre data-language="bash"><code>bunx wrnexus-language-server --stdio</code></pre>
|
||||
<p>Capabilities include syntax, accessibility and TypeScript expression diagnostics, formatting, completion, hover, document symbols, go-to-definition, references, rename, and quick fixes. The custom <code>wrnexus/virtualDocument</code> request returns the mapped TypeScript representation of an open <code>.wrn</code> document for editor TypeScript plugins and safe refactoring tools. Any LSP 3.x client can launch the stdio command. Example Neovim configuration:</p>
|
||||
<pre data-language="lua"><code>vim.lsp.start({
|
||||
name = "wrnexus",
|
||||
cmd = { "bunx", "wrnexus-language-server", "--stdio" },
|
||||
root_dir = vim.fs.root(0, { "wrnexus.config.ts", "package.json", ".git" }),
|
||||
})</code></pre>
|
||||
<p>JetBrains users can register the same command through an LSP client/plugin. The server does not require VS Code and never reads environment secrets or sends source over a network.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface WorkspaceCompletionItem {
|
||||
label: string;
|
||||
kind: number;
|
||||
detail: string;
|
||||
insertText?: string;
|
||||
data?: Record<string, unknown>;
|
||||
}
|
||||
declare function workspaceCompletionItems(root: string): WorkspaceCompletionItem[];
|
||||
declare function clearWorkspaceIndexCache(root?: string): void;
|
||||
declare function extractComponentRefactor(document: TextDocument, range: Range, name: string): {
|
||||
documentChanges: ({
|
||||
kind: string;
|
||||
uri: string;
|
||||
textDocument?: undefined;
|
||||
edits?: undefined;
|
||||
} | {
|
||||
textDocument: {
|
||||
uri: string;
|
||||
version: number | null;
|
||||
};
|
||||
edits: {
|
||||
range: Range;
|
||||
newText: string;
|
||||
}[];
|
||||
kind?: undefined;
|
||||
uri?: undefined;
|
||||
})[];
|
||||
};
|
||||
declare function htmlToWrn(html: string, name?: string): string;
|
||||
|
||||
interface Position {
|
||||
line: number;
|
||||
character: number;
|
||||
}
|
||||
interface Range {
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
interface TextDocument {
|
||||
uri: string;
|
||||
text: string;
|
||||
version?: number;
|
||||
}
|
||||
declare const WRN_COMPLETIONS: readonly ["page", "component", "layout", "props", "outputs", "state", "computed", "effect", "watch", "lifecycle", "load", "action", "api", "realtime", "view", "style", "runtime", "hydrate"];
|
||||
declare function offsetAt(text: string, position: Position): number;
|
||||
declare function positionAt(text: string, requestedOffset: number): Position;
|
||||
declare function wordAt(text: string, position: Position): {
|
||||
word: string;
|
||||
range: Range;
|
||||
} | null;
|
||||
declare function documentDiagnostics(document: TextDocument): {
|
||||
range: {
|
||||
start: {
|
||||
line: number;
|
||||
character: number;
|
||||
};
|
||||
end: {
|
||||
line: number;
|
||||
character: number;
|
||||
};
|
||||
};
|
||||
severity: number;
|
||||
code: string;
|
||||
source: string;
|
||||
message: string;
|
||||
}[];
|
||||
/** TypeScript representation consumed by editor TypeScript plugins and safe refactoring tools. */
|
||||
declare function virtualTypeScriptDocument(document: TextDocument): {
|
||||
uri: string;
|
||||
languageId: "typescript";
|
||||
text: string;
|
||||
mappings: Array<{
|
||||
virtualStartLine: number;
|
||||
virtualEndLine: number;
|
||||
sourceStartLine: number;
|
||||
sourceStartColumn: number;
|
||||
}>;
|
||||
};
|
||||
declare function formatDocument(document: TextDocument, tabSize?: number, insertSpaces?: boolean): {
|
||||
range: {
|
||||
start: {
|
||||
line: number;
|
||||
character: number;
|
||||
};
|
||||
end: Position;
|
||||
};
|
||||
newText: string;
|
||||
}[];
|
||||
declare function documentSymbols(document: TextDocument): {
|
||||
name: string;
|
||||
kind: number;
|
||||
range: {
|
||||
start: Position;
|
||||
end: Position;
|
||||
};
|
||||
selectionRange: {
|
||||
start: Position;
|
||||
end: Position;
|
||||
};
|
||||
}[];
|
||||
declare function symbolLocations(document: TextDocument, position: Position): {
|
||||
uri: string;
|
||||
range: {
|
||||
start: Position;
|
||||
end: Position;
|
||||
};
|
||||
}[];
|
||||
declare function definitionLocation(document: TextDocument, position: Position): {
|
||||
uri: string;
|
||||
range: {
|
||||
start: Position;
|
||||
end: Position;
|
||||
};
|
||||
} | null;
|
||||
declare function hover(document: TextDocument, position: Position): {
|
||||
contents: {
|
||||
kind: string;
|
||||
value: string;
|
||||
};
|
||||
range: Range;
|
||||
} | null;
|
||||
declare function completionItems(): {
|
||||
label: "page" | "component" | "layout" | "props" | "outputs" | "state" | "computed" | "effect" | "watch" | "lifecycle" | "load" | "action" | "api" | "realtime" | "view" | "style" | "runtime" | "hydrate";
|
||||
kind: number;
|
||||
detail: string;
|
||||
}[];
|
||||
|
||||
export { type Position, type Range, type TextDocument, WRN_COMPLETIONS, type WorkspaceCompletionItem, clearWorkspaceIndexCache, completionItems, definitionLocation, documentDiagnostics, documentSymbols, extractComponentRefactor, formatDocument, hover, htmlToWrn, offsetAt, positionAt, symbolLocations, virtualTypeScriptDocument, wordAt, workspaceCompletionItems };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>@wrnexus/syntax parser, diagnostics, accessibility rules, and formatter.</h3><pre data-language="bash"><code>bunx wrnexus-language-server --stdio</code></pre></article><article class="example-card"><h3>stdio command. Example Neovim configuration</h3><pre data-language="lua"><code>vim.lsp.start({
|
||||
name = "wrnexus",
|
||||
cmd = { "bunx", "wrnexus-language-server", "--stdio" },
|
||||
root_dir = vim.fs.root(0, { "wrnexus.config.ts", "package.json", ".git" }),
|
||||
})</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
page wrnexusmcp {
|
||||
seo {
|
||||
title = "@wrnexus/mcp"
|
||||
description = "Model Context Protocol tools for WRNexus projects."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/mcp</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/mcp</h1><p>Model Context Protocol tools for WRNexus projects.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/mcp@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Editor-neutral Model Context Protocol server for AI development tools.</p>
|
||||
<pre data-language="bash"><code>bunx wrnexus-mcp --root=.</code></pre>
|
||||
<p>It exposes current routes, components with props/events, database schema files, compiler diagnostics, runtime errors, dev-server health, framework documentation and installed packages. Files are resolved inside the configured application root and returned as bounded structured JSON.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface McpTool {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: {
|
||||
type: "object";
|
||||
properties?: Record<string, unknown>;
|
||||
additionalProperties?: boolean;
|
||||
};
|
||||
}
|
||||
interface McpServerOptions {
|
||||
maxFiles?: number;
|
||||
maxFileBytes?: number;
|
||||
fetch?: typeof fetch;
|
||||
devServerUrl?: string;
|
||||
runtimeErrors?: () => unknown[] | Promise<unknown[]>;
|
||||
}
|
||||
interface McpServer {
|
||||
tools(): McpTool[];
|
||||
call(name: string, args?: Record<string, unknown>): Promise<unknown>;
|
||||
handle(message: unknown): Promise<Record<string, unknown> | null>;
|
||||
}
|
||||
declare function createFrameworkMcpServer(appRoot: string, options?: McpServerOptions): McpServer;
|
||||
|
||||
export { type McpServer, type McpServerOptions, type McpTool, createFrameworkMcpServer };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Editor-neutral Model Context Protocol server for AI development tools.</h3><pre data-language="bash"><code>bunx wrnexus-mcp --root=.</code></pre></article><article class="example-card"><h3>Install @wrnexus/mcp</h3><pre data-language="sh"><code>bun add @wrnexus/mcp</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexusmobile {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/mobile</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/mobile</h1><p>SSR-safe compatibility access to Capacitor plugins.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/mobile@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>SSR-safe access to Capacitor plugins from WRNexusJS browser code.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/mobile</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/mobile</h1><p>SSR-safe compatibility access to Capacitor plugins.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/mobile@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>SSR-safe access to Capacitor plugins from WRNexusJS browser code.</blockquote>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/mobile</code> keeps optional native imports out of server rendering while giving browser-owned modules one consistent registry for Capacitor plugins. During SSR, <code>mobile.isNative()</code> is <code>false</code> and <code>mobile.platform()</code> is <code>"web"</code>.</p>
|
||||
<p>Install a plugin through the WRNexusJS CLI so the web and native projects stay aligned:</p>
|
||||
@@ -61,6 +61,14 @@ const status = network ? await network.getStatus() : { connected: true, con
|
||||
<li><code>isNative()</code> and <code>platform()</code> report the current Capacitor environment.</li>
|
||||
</ul>
|
||||
<p>Unavailable required plugins throw <code>MobileUnavailableError</code> with an actionable message.</p>
|
||||
<p>The package also provides portable application-facing primitives:</p>
|
||||
<ul>
|
||||
<li><code>listenDeepLinks</code> normalizes initial and live links with an allowed-scheme list.</li>
|
||||
<li><code>PushNotifications</code> performs permission gating and validates registrations.</li>
|
||||
<li><code>SecureStorage</code> namespaces and validates keys over an application-supplied encrypted</li>
|
||||
<p>Keychain/Keystore adapter; it does not mislabel browser <code>localStorage</code> as secure.</p>
|
||||
<li><code>OfflineQueue</code> persists bounded sync batches through a pluggable durable store.</li>
|
||||
</ul>
|
||||
<h3 id="requirements-notes">Requirements / Notes</h3>
|
||||
<ul>
|
||||
<li>Capacitor plugin imports must remain in browser-owned modules.</li>
|
||||
@@ -74,6 +82,42 @@ interface DeepLink {
|
||||
query: URLSearchParams;
|
||||
}
|
||||
declare function parseDeepLink(value: string, schemes?: string[]): DeepLink | null;
|
||||
interface DeepLinkSource {
|
||||
current?(): Promise<string | undefined>;
|
||||
subscribe(listener: (url: string) => void): void | (() => void);
|
||||
}
|
||||
/** Normalize initial and live native links and ignore malformed/unapproved schemes. */
|
||||
declare function listenDeepLinks(source: DeepLinkSource, listener: (link: DeepLink) => void, schemes?: string[]): () => void;
|
||||
interface PushRegistration {
|
||||
token: string;
|
||||
platform?: string;
|
||||
}
|
||||
interface PushAdapter {
|
||||
permission(): Promise<"granted" | "denied" | "prompt" | "unavailable">;
|
||||
requestPermission?(): Promise<"granted" | "denied">;
|
||||
register(): Promise<PushRegistration>;
|
||||
subscribe?(listener: (notification: unknown) => void): () => void;
|
||||
}
|
||||
declare class PushNotifications {
|
||||
private readonly adapter;
|
||||
constructor(adapter: PushAdapter);
|
||||
register(): Promise<PushRegistration>;
|
||||
subscribe(listener: (notification: unknown) => void): () => void;
|
||||
}
|
||||
interface SecureStorageAdapter {
|
||||
get(key: string): Promise<string | null>;
|
||||
set(key: string, value: string): Promise<void>;
|
||||
remove(key: string): Promise<void>;
|
||||
}
|
||||
declare class SecureStorage {
|
||||
#private;
|
||||
private readonly adapter;
|
||||
private readonly namespace;
|
||||
constructor(adapter: SecureStorageAdapter, namespace?: string);
|
||||
get(key: string): Promise<string | null>;
|
||||
set(key: string, value: string): Promise<void>;
|
||||
remove(key: string): Promise<void>;
|
||||
}
|
||||
interface OfflineTask<T = unknown> {
|
||||
id: string;
|
||||
type: string;
|
||||
@@ -141,7 +185,7 @@ declare const mobile: {
|
||||
whenNative: typeof whenNative;
|
||||
};
|
||||
|
||||
export { type CapacitorBridge, type DeepLink, type MobileEnvironment, type MobilePlatform, MobileUnavailableError, OfflineQueue, type OfflineTask, type OfflineTaskStore, invoke, isNative, memoryOfflineTaskStore, mobile, mobileEnvironment, parseDeepLink, platform, plugin, registerPlugin, requirePlugin, whenNative };
|
||||
export { type CapacitorBridge, type DeepLink, type DeepLinkSource, type MobileEnvironment, type MobilePlatform, MobileUnavailableError, OfflineQueue, type OfflineTask, type OfflineTaskStore, type PushAdapter, PushNotifications, type PushRegistration, SecureStorage, type SecureStorageAdapter, invoke, isNative, listenDeepLinks, memoryOfflineTaskStore, mobile, mobileEnvironment, parseDeepLink, platform, plugin, registerPlugin, requirePlugin, whenNative };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Register and invoke a Capacitor plugin</h3><pre data-language="ts"><code>import { Camera, CameraResultType } from "@capacitor/camera";
|
||||
import { mobile } from "@wrnexus/mobile";
|
||||
|
||||
@@ -169,7 +213,7 @@ const network = mobile.plugin<NetworkPlugin>("Network");
|
||||
const status = network ? await network.getStatus() : { connected: true, connectionType: "unknown" };</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#register-and-invoke-a-capacitor-plugin">Register and invoke a Capacitor plugin</a><a class="toc-level-4" href="#provide-a-browser-fallback">Provide a browser fallback</a><a class="toc-level-4" href="#read-an-optional-plugin-without-throwing">Read an optional plugin without throwing</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusnative {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/native</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/native</h1><p>Cross-platform browser and Capacitor capability registry.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/native@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Cross-platform capabilities for browsers, Capacitor WebViews, and compiled native apps.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/native</span></nav><section class="doc-intro"><span class="eyebrow">Native · Package reference</span><h1>@wrnexus/native</h1><p>Cross-platform browser and Capacitor capability registry.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Native</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/native@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Cross-platform capabilities for browsers, Capacitor WebViews, and compiled native apps.</blockquote>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/native</code> exposes capabilities by name so application code can ask what the current platform supports before presenting an action. Browser capabilities use Web APIs; mobile capabilities use installed Capacitor plugins. <code>platform()</code> returns <code>"server"</code> during SSR, <code>"browser"</code> on the web, and the Capacitor platform in a native WebView.</p>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/native</code></pre>
|
||||
@@ -64,6 +64,7 @@ const position = await native.run(
|
||||
<li><code>isMobile()</code> and <code>platform()</code> report the current target safely during SSR.</li>
|
||||
</ul>
|
||||
<p>Built-ins include <code>camera</code>, <code>clipboard.write</code>, <code>share</code>, <code>geolocation</code>, <code>network</code>, <code>haptics</code>, storage, filesystem, notifications, and device information.</p>
|
||||
<p><code>defineNativeManifest</code> declares required capabilities and typed permissions, while <code>PermissionManager</code> normalizes permission query/request flows across platform adapters.</p>
|
||||
<h3 id="requirements-notes">Requirements / Notes</h3>
|
||||
<p>Use <code>supports()</code> before showing optional controls. Mobile capabilities require their matching Capacitor plugins to be installed and registered by the application.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { N as NativePlatform, a as NativeCapability, b as NativeRunOptions, c as NativeTarget } from './types-CDShWg0i.js';
|
||||
export { d as NativeAdapter, e as NativeBrowserRuntime } from './types-CDShWg0i.js';
|
||||
@@ -81,10 +82,11 @@ declare function supports(name: string, target?: NativeTarget): boolean;
|
||||
declare function run<TResult = unknown>(name: string, options?: unknown, runOptions?: NativeRunOptions): Promise<TResult>;
|
||||
declare function clearRegistry(): void;
|
||||
|
||||
type NativePermission = "camera" | "geolocation" | "microphone" | "notifications" | "photos" | "storage" | (string & {});
|
||||
interface NativeCapabilityManifestEntry {
|
||||
name: string;
|
||||
description?: string;
|
||||
permissions?: string[];
|
||||
permissions?: NativePermission[];
|
||||
targets?: NativeTarget[];
|
||||
optional?: boolean;
|
||||
}
|
||||
@@ -100,14 +102,14 @@ declare function inspectNativeCapabilities(target?: NativeTarget): Array<
|
||||
}>;
|
||||
declare function missingNativeCapabilities(manifest: NativeCapabilityManifest, target?: NativeTarget): NativeCapabilityManifestEntry[];
|
||||
interface PermissionAdapter {
|
||||
query(name: string): Promise<"granted" | "denied" | "prompt" | "unavailable">;
|
||||
request?(name: string): Promise<"granted" | "denied">;
|
||||
query(name: NativePermission): Promise<"granted" | "denied" | "prompt" | "unavailable">;
|
||||
request?(name: NativePermission): Promise<"granted" | "denied">;
|
||||
}
|
||||
declare class PermissionManager {
|
||||
private readonly adapter;
|
||||
constructor(adapter: PermissionAdapter);
|
||||
query(name: string): Promise<"denied" | "granted" | "prompt" | "unavailable">;
|
||||
ensure(name: string): Promise<boolean>;
|
||||
query(name: NativePermission): Promise<"denied" | "granted" | "prompt" | "unavailable">;
|
||||
ensure(name: NativePermission): Promise<boolean>;
|
||||
}
|
||||
|
||||
declare const native: {
|
||||
@@ -119,7 +121,7 @@ declare const native: {
|
||||
supports: typeof supports;
|
||||
};
|
||||
|
||||
export { NativeCapability, type NativeCapabilityManifest, type NativeCapabilityManifestEntry, NativePlatform, NativeRunOptions, NativeTarget, NativeUnavailableError, type PermissionAdapter, PermissionManager, clearRegistry, defineNativeManifest, inspectNativeCapabilities, isMobile, missingNativeCapabilities, native, platform, register, registered, run, supports };
|
||||
export { NativeCapability, type NativeCapabilityManifest, type NativeCapabilityManifestEntry, type NativePermission, NativePlatform, NativeRunOptions, NativeTarget, NativeUnavailableError, type PermissionAdapter, PermissionManager, clearRegistry, defineNativeManifest, inspectNativeCapabilities, isMobile, missingNativeCapabilities, native, platform, register, registered, run, supports };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Share a page when the platform supports it</h3><pre data-language="ts"><code>import { native } from "@wrnexus/native";
|
||||
|
||||
export async function shareCurrentPage() {
|
||||
@@ -152,7 +154,7 @@ const position = await native.run(
|
||||
);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#share-a-page-when-the-platform-supports-it">Share a page when the platform supports it</a><a class="toc-level-4" href="#register-an-application-specific-capability">Register an application-specific capability</a><a class="toc-level-4" href="#target-browser-or-mobile-behavior-explicitly">Target browser or mobile behavior explicitly</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusoauth {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/oauth</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/oauth</h1><p>OAuth 2.0, PKCE, provider presets, and profile mapping.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/oauth@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Dependency-free OAuth 2.0 sign-in for any provider, with PKCE and presets for Google, GitHub, and Discord.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/oauth</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/oauth</h1><p>OAuth 2.0, PKCE, provider presets, and profile mapping.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/oauth@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Dependency-free OAuth 2.0 sign-in for any provider, with PKCE and presets for Google, GitHub, and Discord.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/oauth</code> implements the OAuth 2.0 Authorization Code flow (with PKCE) for server-side sign-in. It ships ready-made provider presets and a <code>defineProvider</code> helper for custom providers, then gives you two flow functions — <code>startAuth</code> (build the redirect) and <code>completeAuth</code> (exchange the code and fetch the user's profile). It has no runtime dependencies: it uses the platform <code>fetch</code> and WebCrypto only. Pairs naturally with <code>@wrnexus/core</code>'s <code>logIn</code> to establish a session once you have a normalized profile.</p>
|
||||
@@ -145,8 +145,23 @@ const gitlab = defineProvider({
|
||||
<li>The flow is stateless by design: you are responsible for storing <code>state</code> and</li>
|
||||
<p><code>verifier</code> between <code>startAuth</code> and <code>completeAuth</code> (session or signed cookie).</p>
|
||||
<li>Pairs with [<code>@wrnexus/core</code>](../core) — feed the normalized <code>OAuthProfile</code> into</li>
|
||||
<p><code>logIn</code> to establish a session.</p>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface OAuthStateRecord {
|
||||
<p><code>logIn</code> to establish a session. OIDC integrations can combine strict discovery with the rotating JWKS verifier:</p>
|
||||
</ul>
|
||||
<pre data-language="ts"><code>import { createRemoteJwks } from "@wrnexus/jwt";
|
||||
import { discoverOidc, verifyOidcIdToken } from "@wrnexus/oauth";
|
||||
|
||||
const metadata = await discoverOidc("https://issuer.example");
|
||||
const jwks = createRemoteJwks(metadata.jwks_uri);
|
||||
const claims = await verifyOidcIdToken(idToken, {
|
||||
issuer: metadata.issuer,
|
||||
clientId: "client-id",
|
||||
jwks,
|
||||
nonce: expectedNonce,
|
||||
accessToken,
|
||||
});</code></pre>
|
||||
<p>Discovery requires an exact normalized issuer and HTTPS endpoints without URL credentials/fragments. ID-token verification checks the RS256 signature, expiry/not-before, issuer, audience, required OIDC claims, nonce, multi-audience <code>azp</code>, optional token age, and optional <code>at_hash</code> binding.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { JwtClaims, RemoteJwks } from '@wrnexus/jwt';
|
||||
|
||||
interface OAuthStateRecord {
|
||||
state: string;
|
||||
verifier: string;
|
||||
redirectUri: string;
|
||||
@@ -171,6 +186,28 @@ interface OidcDiscovery {
|
||||
revocation_endpoint?: string;
|
||||
}
|
||||
declare function discoverOidc(issuer: string, fetchImpl?: typeof fetch): Promise<OidcDiscovery>;
|
||||
interface OidcIdTokenClaims extends JwtClaims {
|
||||
sub: string;
|
||||
iss: string;
|
||||
aud: string | string[];
|
||||
exp: number;
|
||||
iat: number;
|
||||
nonce?: string;
|
||||
azp?: string;
|
||||
at_hash?: string;
|
||||
}
|
||||
interface VerifyOidcIdTokenOptions {
|
||||
issuer: string;
|
||||
clientId: string;
|
||||
jwks: RemoteJwks;
|
||||
nonce?: string;
|
||||
accessToken?: string;
|
||||
now?: number;
|
||||
clockTolerance?: number;
|
||||
maxAge?: number;
|
||||
}
|
||||
declare function validateOidcClaims(claims: JwtClaims, options: Pick<VerifyOidcIdTokenOptions, "clientId" | "nonce">): asserts claims is OidcIdTokenClaims;
|
||||
declare function verifyOidcIdToken(token: string, options: VerifyOidcIdTokenOptions): Promise<OidcIdTokenClaims>;
|
||||
declare function validateOAuthReturnTo(value: string | undefined, origin: string, fallback?: string): string;
|
||||
|
||||
/**
|
||||
@@ -262,7 +299,7 @@ declare function exchangeCode(provider: OAuthProvider, options: CompleteAuthOpti
|
||||
/** Fetch + normalize the user's profile from the provider. */
|
||||
declare function fetchProfile(provider: OAuthProvider, tokens: OAuthTokens, fetchImpl?: FetchLike): Promise<OAuthProfile>;
|
||||
|
||||
export { type CompleteAuthOptions, type OAuthProfile, type OAuthProvider, type OAuthStateRecord, type OAuthStateStore, type OAuthTokens, type OidcDiscovery, type ProviderCredentials, type StartAuthOptions, type StartAuthResult, completeAuth, createOAuthState, defineProvider, discord, discoverOidc, exchangeCode, fetchProfile, github, google, memoryOAuthStateStore, randomToken, refreshOAuthTokens, startAuth, validateOAuthReturnTo };
|
||||
export { type CompleteAuthOptions, type OAuthProfile, type OAuthProvider, type OAuthStateRecord, type OAuthStateStore, type OAuthTokens, type OidcDiscovery, type OidcIdTokenClaims, type ProviderCredentials, type StartAuthOptions, type StartAuthResult, type VerifyOidcIdTokenOptions, completeAuth, createOAuthState, defineProvider, discord, discoverOidc, exchangeCode, fetchProfile, github, google, memoryOAuthStateStore, randomToken, refreshOAuthTokens, startAuth, validateOAuthReturnTo, validateOidcClaims, verifyOidcIdToken };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Typical usage</h3><pre data-language="ts"><code>import { google, startAuth, completeAuth } from "@wrnexus/oauth";
|
||||
import { logIn } from "@wrnexus/core";
|
||||
|
||||
@@ -313,7 +350,7 @@ const gitlab = defineProvider({
|
||||
});</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#providers">Providers</a><a class="toc-level-4" href="#flow">Flow</a><a class="toc-level-4" href="#startauth-provider-options-promise-startauthresult">startAuth(provider, options): Promise<StartAuthResult></a><a class="toc-level-4" href="#completeauth-provider-options-promise-tokens-profile">completeAuth(provider, options): Promise<{ tokens, profile }></a><a class="toc-level-4" href="#lower-level-helpers">Lower-level helpers</a><a class="toc-level-4" href="#types">Types</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
page wrnexusobservability {
|
||||
seo {
|
||||
title = "@wrnexus/observability"
|
||||
description = "Structured logging, tracing, health, and integration adapters."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/observability</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/observability</h1><p>Structured logging, tracing, health, and integration adapters.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/observability@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Open-standard traces, metrics, logs, health checks, Web Vitals, error reporting and profiling.</p>
|
||||
<p>Use <code>createOperationTracer()</code> for <code>database</code>, <code>cache</code>, <code>queue</code>, <code>realtime</code>, <code>server-action</code> or custom <code>application</code> spans. Export through OTLP, Prometheus, Zipkin/Jaeger, or the Sentry-compatible error reporter; Grafana can consume the Prometheus or OTLP signals.</p>
|
||||
<p>Privacy-conscious counters, gauges, histograms, HTTP middleware, Web Vitals ingestion, browser collection, and exporter adapters. Request bodies and user identifiers are not collected by default.</p>
|
||||
<pre data-language="ts"><code>export default {
|
||||
observability: { enabled: true, serverTiming: true, sampleRate: 0.1, webVitals: true },
|
||||
};</code></pre>
|
||||
<h3 id="traces-correlated-logs-and-otlp">Traces, correlated logs, and OTLP</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createOtlpMetricExporter,
|
||||
createOtlpTraceExporter,
|
||||
createStructuredLogger,
|
||||
metricsMiddleware,
|
||||
traceMiddleware,
|
||||
} from "@wrnexus/observability";
|
||||
|
||||
const traces = createOtlpTraceExporter("https://collector.example/v1/traces", {
|
||||
serviceName: "checkout",
|
||||
headers: { authorization: `Bearer ${process.env.OTLP_TOKEN}` },
|
||||
});
|
||||
|
||||
export const tracing = traceMiddleware({
|
||||
serviceName: "checkout",
|
||||
sampleRate: 0.1,
|
||||
exporter: traces,
|
||||
onExportError(error) {
|
||||
console.error("trace export failed", error);
|
||||
},
|
||||
});
|
||||
|
||||
export const metrics = metricsMiddleware();
|
||||
export const metricExporter = createOtlpMetricExporter("https://collector.example/v1/metrics", {
|
||||
serviceName: "checkout",
|
||||
});
|
||||
|
||||
export const logger = createStructuredLogger({ service: "checkout" });
|
||||
// Request middleware can create a correlated child from ctx.locals.
|
||||
logger
|
||||
.child({
|
||||
traceId: ctx.locals.traceId,
|
||||
spanId: ctx.locals.spanId,
|
||||
requestId: ctx.locals.requestId,
|
||||
})
|
||||
.info("order accepted", { orderId });</code></pre>
|
||||
<p>The tracing middleware accepts and validates W3C <code>traceparent</code>, creates a child server span, stores correlation identifiers in <code>ctx.locals</code>, installs the framework tracer on <code>ctx.tracer</code>, and returns <code>traceparent</code> plus <code>x-request-id</code>. Export failures are isolated from application responses when <code>onExportError</code> is configured.</p>
|
||||
<h3 id="liveness-and-readiness">Liveness and readiness</h3>
|
||||
<pre data-language="ts"><code>import { HealthRegistry } from "@wrnexus/core";
|
||||
import { createLivenessHandler, createReadinessHandler } from "@wrnexus/observability";
|
||||
|
||||
const health = new HealthRegistry();
|
||||
health.register("database", async () =>
|
||||
(await db.ping()) ? { status: "up" } : { status: "down" },
|
||||
);
|
||||
|
||||
export const live = createLivenessHandler();
|
||||
export const ready = createReadinessHandler(health);</code></pre>
|
||||
<p>Liveness reports whether the process can answer requests. Readiness returns HTTP 503 when a registered dependency is down. Dependency messages and details are hidden unless <code>exposeDetails: true</code> is explicitly selected for a trusted endpoint.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { MetricLabels, MetricPoint, MetricsRegistry } from './metrics.js';
|
||||
export { MetricExporter, MetricsMiddlewareOptions, WebVitalRecord, WebVitalsHandlerOptions, createHttpMetricExporter, createOtlpMetricExporter, createWebVitalsHandler, defaultMetrics, metricsMiddleware } from './server.js';
|
||||
export { WebVitalsClientOptions, webVitalsClient } from './client.js';
|
||||
export { SpanExporter, SpanRecord, TraceContext, TraceMiddlewareOptions, createOtlpTraceExporter, formatTraceparent, parseTraceparent, traceMiddleware } from './trace.js';
|
||||
export { HealthHandlerOptions, createLivenessHandler, createReadinessHandler } from './health.js';
|
||||
export { LogLevel, LogRecord, StructuredLogger, StructuredLoggerOptions, createStructuredLogger } from './logging.js';
|
||||
export { ErrorReporter, FrameworkSpanKind, LogExporter, OperationTracer, createJaegerExporter, createOperationTracer, createOtlpLogExporter, createPerformanceProfiler, createPrometheusPushExporter, createSentryCompatibleReporter, createZipkinExporter, renderPrometheus } from './integrations.js';
|
||||
import '@wrnexus/core';
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Privacy-conscious counters, gauges, histograms, HTTP middleware, Web Vitals ingestion, browser collection, and exporter adapters. Request bodies and user identifiers are not collected by default.</h3><pre data-language="ts"><code>export default {
|
||||
observability: { enabled: true, serverTiming: true, sampleRate: 0.1, webVitals: true },
|
||||
};</code></pre></article><article class="example-card"><h3>## Traces, correlated logs, and OTLP</h3><pre data-language="ts"><code>import {
|
||||
createOtlpMetricExporter,
|
||||
createOtlpTraceExporter,
|
||||
createStructuredLogger,
|
||||
metricsMiddleware,
|
||||
traceMiddleware,
|
||||
} from "@wrnexus/observability";
|
||||
|
||||
const traces = createOtlpTraceExporter("https://collector.example/v1/traces", {
|
||||
serviceName: "checkout",
|
||||
headers: { authorization: `Bearer ${process.env.OTLP_TOKEN}` },
|
||||
});
|
||||
|
||||
export const tracing = traceMiddleware({
|
||||
serviceName: "checkout",
|
||||
sampleRate: 0.1,
|
||||
exporter: traces,
|
||||
onExportError(error) {
|
||||
console.error("trace export failed", error);
|
||||
},
|
||||
});
|
||||
|
||||
export const metrics = metricsMiddleware();
|
||||
export const metricExporter = createOtlpMetricExporter("https://collector.example/v1/metrics", {
|
||||
serviceName: "checkout",
|
||||
});
|
||||
|
||||
export const logger = createStructuredLogger({ service: "checkout" });
|
||||
// Request middleware can create a correlated child from ctx.locals.
|
||||
logger
|
||||
.child({
|
||||
traceId: ctx.locals.traceId,
|
||||
spanId: ctx.locals.spanId,
|
||||
requestId: ctx.locals.requestId,
|
||||
})
|
||||
.info("order accepted", { orderId });</code></pre></article><article class="example-card"><h3>## Liveness and readiness</h3><pre data-language="ts"><code>import { HealthRegistry } from "@wrnexus/core";
|
||||
import { createLivenessHandler, createReadinessHandler } from "@wrnexus/observability";
|
||||
|
||||
const health = new HealthRegistry();
|
||||
health.register("database", async () =>
|
||||
(await db.ping()) ? { status: "up" } : { status: "down" },
|
||||
);
|
||||
|
||||
export const live = createLivenessHandler();
|
||||
export const ready = createReadinessHandler(health);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#traces-correlated-logs-and-otlp">Traces, correlated logs, and OTLP</a><a class="toc-level-3" href="#liveness-and-readiness">Liveness and readiness</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
page wrnexusplayground {
|
||||
seo {
|
||||
title = "@wrnexus/playground"
|
||||
description = "Interactive framework examples and executable playground utilities."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/playground</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/playground</h1><p>Interactive framework examples and executable playground utilities.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/playground@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>A deployable, shareable <code>.wrn</code> playground with diagnostics, generated JavaScript, safe SSR-shaped HTML, sandboxed preview, reactive/UI examples, and version adapters.</p>
|
||||
<p>Run <code>wrnexus playground</code>, or deploy <code>createPlaygroundHandler()</code>.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface PlaygroundCompilation {
|
||||
source: string;
|
||||
generated: string;
|
||||
client: string;
|
||||
html: string;
|
||||
interactiveHtml: string;
|
||||
diagnostics: Array<{
|
||||
code: string;
|
||||
message: string;
|
||||
severity: string;
|
||||
}>;
|
||||
version: string;
|
||||
}
|
||||
interface PlaygroundVersionAdapter {
|
||||
version: string;
|
||||
compile(source: string): Promise<Omit<PlaygroundCompilation, "source" | "version">>;
|
||||
}
|
||||
declare function compilePlayground(source: string, version?: string): PlaygroundCompilation;
|
||||
declare function encodePlaygroundShare(source: string): string;
|
||||
declare function decodePlaygroundShare(value: string): string;
|
||||
declare function comparePlaygroundVersions(source: string, adapters: PlaygroundVersionAdapter[]): Promise<{
|
||||
current: PlaygroundCompilation;
|
||||
comparisons: {
|
||||
generated: string;
|
||||
client: string;
|
||||
html: string;
|
||||
interactiveHtml: string;
|
||||
diagnostics: Array<{
|
||||
code: string;
|
||||
message: string;
|
||||
severity: string;
|
||||
}>;
|
||||
version: string;
|
||||
}[];
|
||||
}>;
|
||||
declare function createPlaygroundHandler(options?: {
|
||||
versions?: PlaygroundVersionAdapter[];
|
||||
examples?: Record<string, string>;
|
||||
}): (request: Request) => Promise<Response>;
|
||||
|
||||
export { type PlaygroundCompilation, type PlaygroundVersionAdapter, comparePlaygroundVersions, compilePlayground, createPlaygroundHandler, decodePlaygroundShare, encodePlaygroundShare };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/playground</h3><pre data-language="sh"><code>bun add @wrnexus/playground</code></pre></article><article class="example-card"><h3>Import @wrnexus/playground</h3><pre data-language="ts"><code>import * as playground from "@wrnexus/playground";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,17 +10,54 @@ page wrnexusplugin {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/plugin</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/plugin</h1><p>Plugin contracts, lifecycle hooks, composition, and framework integration.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/plugin@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Deterministic WRNexusJS plugin contracts for configuration, AST/code transforms, diagnostics, development servers, production builds, and DevToolbar extensions.</p>
|
||||
<p>Use <code>definePlugin()</code> and declare <code>enforce</code>, <code>before</code>, or <code>after</code> when ordering matters. Duplicate names and dependency cycles are rejected.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { PageAst, WrnDiagnostic } from '@wrnexus/syntax';
|
||||
import { WrnexusPlugin, PluginInput, PluginContext, PluginRunner } from './types.js';
|
||||
export { ClientRuntimeDefinition, ClientRuntimeInject, ClientRuntimeLoad, ClientRuntimeType, PackageAssetDefinition, PackageMigrationDefinition, PackagePluginManifest, PackageRouteDefinition, PackageStyleDefinition, PluginCommand, PluginContributions, PluginDevToolbarPanel, PluginOrder, TransformContext, WrnexusPackageManifest } from './types.js';
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/plugin</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/plugin</h1><p>Plugin contracts, lifecycle hooks, composition, and framework integration.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/plugin@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><h3 id="least-privilege-package-permissions">Least-privilege package permissions</h3>
|
||||
<p>Package manifests declare every framework capability they register:</p>
|
||||
<pre data-language="json"><code>{
|
||||
"wrnexus": {
|
||||
"permissions": ["routes", "migrations"],
|
||||
"routes": [{ "kind": "api", "path": "/api/example", "entry": "./route.ts" }]
|
||||
}
|
||||
}</code></pre>
|
||||
<p>Applications can enable fail-closed grants:</p>
|
||||
<pre data-language="ts"><code>export default {
|
||||
pluginPermissions: {
|
||||
enforce: true,
|
||||
grants: { "example-plugin": ["routes"] },
|
||||
},
|
||||
};</code></pre>
|
||||
<p>Discovery rejects used-but-undeclared capabilities with <code>WRN-PLUGIN-PERMISSION-UNDECLARED</code> and ungranted capabilities with <code>WRN-PLUGIN-PERMISSION-DENIED</code>. Permissions cover components, browser runtime, assets, styles, routes, middleware, migrations, config, transforms, diagnostics/tooling, and server/build hooks.</p>
|
||||
<h3 id="compatibility-matrices">Compatibility matrices</h3>
|
||||
<p>Manifests can add <code>compatibility: { bunMin: "1.3.0", os: ["linux", "darwin"] }</code> alongside <code>runtimes</code> and <code>requires</code>. Use <code>testPluginCompatibility(manifest, targets)</code> in a package test to exercise the complete support matrix. Runtime discovery enforces the same Bun minimum, OS, runtime, and capability declarations used by the test kit.</p>
|
||||
<p>Deterministic WRNexusJS plugin contracts for configuration, AST/code transforms, diagnostics, development servers, production builds, and DevToolbar extensions.</p>
|
||||
<p>Use <code>definePlugin()</code> and declare <code>enforce</code>, <code>before</code>, or <code>after</code> when ordering matters. Duplicate names and dependency cycles are rejected.</p>
|
||||
<h3 id="complete-lifecycle-and-contributions">Complete lifecycle and contributions</h3>
|
||||
<p>Plugins may implement <code>setup</code>, <code>configure</code>, <code>configResolved</code>, <code>transformAst</code>, <code>transformCode</code>, <code>diagnostics</code>, <code>routes</code>, <code>configureServer</code>, <code>buildStart</code>, <code>buildEnd</code>, <code>render</code>, <code>deploy</code>, <code>shutdown</code>, and <code>hmrUpdate</code>. The runner preserves resolved plugin order for every hook and executes <code>setup</code> exactly once.</p>
|
||||
<p>In addition to components, routes, middleware, assets, styles, runtimes, and migrations, plugins can contribute <code>directives</code>, <code>cliCommands</code>, <code>virtualModules</code>, <code>deploymentAdapters</code>, <code>configSchemas</code>, <code>documentation</code>, and <code>typeDefinitions</code>. Names are collision checked. Configuration schemas run after configuration resolution, CLI commands are callable as normal <code>wrnexus</code> commands, directives participate in AST transformation, and production builds materialize virtual modules and invoke matching contributed adapters.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { PageAst, WrnDiagnostic } from '@wrnexus/syntax';
|
||||
import { WrnexusPackageManifest, WrnexusPlugin, PluginInput, PluginContext, PluginRunner } from './types.js';
|
||||
export { ClientRuntimeDefinition, ClientRuntimeInject, ClientRuntimeLoad, ClientRuntimeType, PackageAssetDefinition, PackageMigrationDefinition, PackagePluginManifest, PackageRouteDefinition, PackageStyleDefinition, PluginCliCommand, PluginCommand, PluginConfigSchema, PluginContributions, PluginDeploymentAdapter, PluginDevToolbarPanel, PluginDirective, PluginOrder, PluginPermission, PluginVirtualModule, TransformContext } from './types.js';
|
||||
export { assertContributionId, contentTypeForPath, defaultClientRuntimePath, defaultPackageAssetPath, definePackageManifest, normalizeClientRuntime, normalizePackageAsset, validateStyleIds } from './manifest.js';
|
||||
export { DiscoverPluginOptions, discoverPlugins } from './discovery.js';
|
||||
|
||||
interface PluginCompatibilityTarget {
|
||||
runtime: "bun" | "node" | "edge" | "worker" | "service-worker" | "browser";
|
||||
version?: string;
|
||||
os?: "win32" | "linux" | "darwin" | string;
|
||||
capabilities?: readonly string[];
|
||||
}
|
||||
interface PluginCompatibilityResult {
|
||||
target: PluginCompatibilityTarget;
|
||||
ok: boolean;
|
||||
issues: Array<{
|
||||
code: "WRN-PLUGIN-MATRIX-RUNTIME" | "WRN-PLUGIN-MATRIX-VERSION" | "WRN-PLUGIN-MATRIX-OS" | "WRN-PLUGIN-MATRIX-CAPABILITY";
|
||||
message: string;
|
||||
}>;
|
||||
}
|
||||
declare function testPluginCompatibility(manifest: WrnexusPackageManifest, targets: readonly PluginCompatibilityTarget[]): PluginCompatibilityResult[];
|
||||
|
||||
declare function definePlugin(plugin: WrnexusPlugin): WrnexusPlugin;
|
||||
declare function flattenPlugins(input: PluginInput, output?: WrnexusPlugin[]): WrnexusPlugin[];
|
||||
|
||||
@@ -28,18 +65,21 @@ declare function flattenPlugins(input: PluginInput, output?: WrnexusPlugin[]): W
|
||||
declare function resolvePlugins(input: PluginInput): WrnexusPlugin[];
|
||||
declare function createPluginRunner(input: PluginInput, context: PluginContext): PluginRunner;
|
||||
|
||||
export { PluginContext, PluginInput, PluginRunner, WrnexusPlugin, createPluginRunner, definePlugin, flattenPlugins, resolvePlugins };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Define an ordered plugin</h3><pre data-language="ts"><code>import { definePlugin } from "@wrnexus/plugin";
|
||||
|
||||
export default definePlugin({
|
||||
name: "analytics",
|
||||
enforce: "post",
|
||||
});</code></pre></article><article class="example-card"><h3>Resolve plugin execution order</h3><pre data-language="ts"><code>import { resolvePlugins } from "@wrnexus/plugin";
|
||||
|
||||
const ordered = resolvePlugins([corePlugin, analyticsPlugin]);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
export { type PluginCompatibilityResult, type PluginCompatibilityTarget, PluginContext, PluginInput, PluginRunner, WrnexusPackageManifest, WrnexusPlugin, createPluginRunner, definePlugin, flattenPlugins, resolvePlugins, testPluginCompatibility };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Package manifests declare every framework capability they register</h3><pre data-language="json"><code>{
|
||||
"wrnexus": {
|
||||
"permissions": ["routes", "migrations"],
|
||||
"routes": [{ "kind": "api", "path": "/api/example", "entry": "./route.ts" }]
|
||||
}
|
||||
}</code></pre></article><article class="example-card"><h3>Applications can enable fail-closed grants</h3><pre data-language="ts"><code>export default {
|
||||
pluginPermissions: {
|
||||
enforce: true,
|
||||
grants: { "example-plugin": ["routes"] },
|
||||
},
|
||||
};</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#least-privilege-package-permissions">Least-privilege package permissions</a><a class="toc-level-3" href="#compatibility-matrices">Compatibility matrices</a><a class="toc-level-3" href="#complete-lifecycle-and-contributions">Complete lifecycle and contributions</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexuspubsub {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/pubsub</span></nav><section class="doc-intro"><span class="eyebrow">Realtime · Package reference</span><h1>@wrnexus/pubsub</h1><p>In-process and Redis-backed publish/subscribe.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Realtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/pubsub@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Topic-based publish/subscribe with a pluggable driver — in-process by default, Redis for cross-process messaging.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/pubsub</span></nav><section class="doc-intro"><span class="eyebrow">Realtime · Package reference</span><h1>@wrnexus/pubsub</h1><p>In-process and Redis-backed publish/subscribe.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Realtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/pubsub@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Topic-based publish/subscribe with a pluggable driver — in-process by default, Redis for cross-process messaging.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/pubsub</code> is a small server-side pub/sub bus. You publish messages to a topic and subscribe with topic patterns; handlers fire for matching topics. The default driver keeps everything in-process, and you can swap in the Redis driver (<code>@wrnexus/pubsub/redis</code>) to fan messages out across processes or hosts. It also backs <code>@wrnexus/core</code>'s realtime bridge for horizontal scaling.</p>
|
||||
@@ -27,12 +27,14 @@ page wrnexuspubsub {
|
||||
<pre data-language="ts"><code>interface PubSub {
|
||||
publish<T = unknown>(topic: string, message: T): Promise<void>;
|
||||
subscribe<T = unknown>(pattern: string, handler: Handler<T>): () => void;
|
||||
close(): Promise<void>;
|
||||
}
|
||||
|
||||
type Handler<T = unknown> = (message: T, topic: string) => void | Promise<void>;</code></pre>
|
||||
<ul>
|
||||
<li><code>publish(topic, message)</code> — resolves once the driver has dispatched the message.</li>
|
||||
<li><code>publish(topic, message)</code> — resolves once the driver and in-memory async handlers finish.</li>
|
||||
<li><code>subscribe(pattern, handler)</code> — returns an unsubscribe function.</li>
|
||||
<li><code>close()</code> — idempotently rejects new work, clears local subscriptions, and closes the driver.</li>
|
||||
</ul>
|
||||
<h4 id="pattern-matching">Pattern matching</h4>
|
||||
<p>Subscription patterns match in three ways:</p>
|
||||
@@ -49,13 +51,15 @@ type Handler<T = unknown> = (message: T, topic: string) => void | Promi
|
||||
}</code></pre>
|
||||
<h4 id="wrnexus-pubsub-redis-redisdriver-url"><code>@wrnexus/pubsub/redis</code> — <code>redisDriver(url?)</code></h4>
|
||||
<p>A cross-process driver backed by Redis. It speaks RESP over a raw TCP socket via <code>Bun.connect</code>, so it adds <strong>no npm dependency</strong>. <code>url</code> defaults to <code>$REDIS_URL</code>, then <code>redis://localhost:6379</code>. The URL may carry a password and a database index (e.g. <code>redis://:secret@host:6379/2</code>).</p>
|
||||
<pre data-language="ts"><code>function redisDriver(url?: string): PubSubDriver & { close(): void };</code></pre>
|
||||
<pre data-language="ts"><code>function redisDriver(url?: string, options?: RedisDriverOptions): PubSubDriver & { close(): void };</code></pre>
|
||||
<ul>
|
||||
<li>Exact topics use Redis <code>SUBSCRIBE</code>; wildcard patterns (<code>ns:*</code>, <code>*</code>) use</li>
|
||||
<p><code>PSUBSCRIBE</code>, whose glob semantics line up with this library's matching.</p>
|
||||
<li>Messages are JSON-stringified on publish and <code>JSON.parse</code>d on receipt; a payload</li>
|
||||
<p>that isn't valid JSON is delivered as the raw string.</p>
|
||||
<li><code>close()</code> tears down both the subscriber and publisher connections.</li>
|
||||
<li>Lost sockets reconnect with bounded exponential backoff and active subscriptions</li>
|
||||
<p>are replayed. <code>maxPending</code> bounds unavailable-connection writes (default 1000); <code>reconnectDelayMs</code> and <code>reconnectMaxDelayMs</code> tune recovery (100ms/5000ms).</p>
|
||||
</ul>
|
||||
<h4 id="resp-codec-internal">RESP codec (internal)</h4>
|
||||
<p><code>redis.ts</code> uses a minimal RESP implementation exported from <code>resp.ts</code> (<code>encodeCommand</code>, <code>parseReply</code>, <code>concat</code>, and the <code>RespValue</code> type). These are implementation details of the Redis driver, not part of the public package entry.</p>
|
||||
@@ -85,8 +89,8 @@ bus.subscribe("order:*", (msg, topic) => {
|
||||
|
||||
await bus.publish("order:created", { id: 7 });
|
||||
|
||||
// on shutdown
|
||||
driver.close();</code></pre>
|
||||
// on shutdown (also closes the driver)
|
||||
await bus.close();</code></pre>
|
||||
<h3 id="requirements-notes">Requirements / Notes</h3>
|
||||
<ul>
|
||||
<li><strong>Bun-only.</strong> The Redis driver depends on <code>Bun.connect</code>; it throws</li>
|
||||
@@ -139,17 +143,34 @@ type Handler<T = unknown> = (message: T, topic: string) => void | Promi
|
||||
interface PubSubDriver {
|
||||
publish(topic: string, message: unknown): void | Promise<void>;
|
||||
subscribe(pattern: string, handler: Handler): () => void;
|
||||
close?(): void | Promise<void>;
|
||||
}
|
||||
interface PubSub {
|
||||
publish<T = unknown>(topic: string, message: T): Promise<void>;
|
||||
subscribe<T = unknown>(pattern: string, handler: Handler<T>): () => void;
|
||||
/** Stop new work, remove subscriptions, and close the backing driver. */
|
||||
close(): Promise<void>;
|
||||
}
|
||||
/** In-process pub/sub driver (default). */
|
||||
declare function memoryDriver(): PubSubDriver;
|
||||
/** Create a pub/sub bus over a driver (in-memory by default). */
|
||||
declare function createPubSub(driver?: PubSubDriver): PubSub;
|
||||
|
||||
export { type Handler, type MessageEnvelope, PresenceChannel, type PresenceMember, type PubSub, type PubSubDriver, type ResilientPubSubOptions, createPubSub, createResilientPubSub, memoryDriver };
|
||||
interface NatsClient {
|
||||
publish(subject: string, data: Uint8Array): void | Promise<void>;
|
||||
subscribe(subject: string, handler: (data: Uint8Array, subject: string) => void): () => void;
|
||||
close?(): void | Promise<void>;
|
||||
}
|
||||
declare function natsDriver(client: NatsClient): PubSubDriver;
|
||||
interface KafkaClient {
|
||||
publish(topic: string, value: string): void | Promise<void>;
|
||||
subscribe(pattern: string, handler: (value: string, topic: string) => void): () => void;
|
||||
close?(): void | Promise<void>;
|
||||
}
|
||||
/** Kafka adapter contract; consumer-group/rebalance policy remains owned by the selected client. */
|
||||
declare function kafkaDriver(client: KafkaClient): PubSubDriver;
|
||||
|
||||
export { type Handler, type KafkaClient, type MessageEnvelope, type NatsClient, PresenceChannel, type PresenceMember, type PubSub, type PubSubDriver, type ResilientPubSubOptions, createPubSub, createResilientPubSub, kafkaDriver, memoryDriver, natsDriver };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>In-process (default)</h3><pre data-language="ts"><code>import { createPubSub } from "@wrnexus/pubsub";
|
||||
|
||||
const bus = createPubSub();
|
||||
@@ -172,11 +193,11 @@ bus.subscribe("order:*", (msg, topic) => {
|
||||
|
||||
await bus.publish("order:created", { id: 7 });
|
||||
|
||||
// on shutdown
|
||||
driver.close();</code></pre></article></div></section></article>
|
||||
// on shutdown (also closes the driver)
|
||||
await bus.close();</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createpubsub-driver-pubsub">createPubSub(driver?): PubSub</a><a class="toc-level-4" href="#pattern-matching">Pattern matching</a><a class="toc-level-4" href="#memorydriver-pubsubdriver">memoryDriver(): PubSubDriver</a><a class="toc-level-4" href="#wrnexus-pubsub-redis-redisdriver-url">@wrnexus/pubsub/redis — redisDriver(url?)</a><a class="toc-level-4" href="#resp-codec-internal">RESP codec (internal)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
page wrnexuspwa {
|
||||
seo {
|
||||
title = "@wrnexus/pwa"
|
||||
description = "Progressive Web App manifests, service workers, and offline strategies."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/pwa</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/pwa</h1><p>Progressive Web App manifests, service workers, and offline strategies.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/pwa@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Official PWA primitives for manifests, service workers, offline pages and precaching, runtime caching, background synchronization, push notifications, install/update events, offline mutation stores, and conflict resolution. <code>createOfflineQueue()</code> accepts a durable IndexedDB-style store and retries requests with stable idempotency headers.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>interface IndexedDbMigration {
|
||||
version: number;
|
||||
migrate(db: IDBDatabase, transaction: IDBTransaction): void;
|
||||
}
|
||||
declare function openPwaDatabase(name: string, migrations: IndexedDbMigration[], factory?: IDBFactory): Promise<IDBDatabase>;
|
||||
declare function indexedDbOfflineQueueStore(db: IDBDatabase, storeName?: string): OfflineQueueStore;
|
||||
declare const offlineQueueMigration: IndexedDbMigration;
|
||||
interface StoredPushSubscription {
|
||||
id: string;
|
||||
userId: string;
|
||||
endpoint: string;
|
||||
expirationTime?: number | null;
|
||||
keys: {
|
||||
p256dh: string;
|
||||
auth: string;
|
||||
};
|
||||
createdAt: number;
|
||||
}
|
||||
interface PushSubscriptionStore {
|
||||
put(value: StoredPushSubscription): Promise<void>;
|
||||
remove(id: string): Promise<void>;
|
||||
list(userId: string): Promise<StoredPushSubscription[]>;
|
||||
}
|
||||
declare function memoryPushSubscriptionStore(): PushSubscriptionStore;
|
||||
interface PushSqlClient {
|
||||
query<T = Record<string, unknown>>(sql: string, parameters?: unknown[]): Promise<{
|
||||
rows: T[];
|
||||
}>;
|
||||
}
|
||||
declare function postgresPushSubscriptionStore(db: PushSqlClient): PushSubscriptionStore;
|
||||
declare const POSTGRES_PUSH_SUBSCRIPTION_SCHEMA = "CREATE TABLE IF NOT EXISTS wrnexus_push_subscriptions (id text PRIMARY KEY,user_id text NOT NULL,endpoint text NOT NULL,expiration_time bigint,p256dh text NOT NULL,auth text NOT NULL,created_at bigint NOT NULL); CREATE INDEX IF NOT EXISTS wrnexus_push_user ON wrnexus_push_subscriptions (user_id);";
|
||||
declare function createPushSubscriptionService(store: PushSubscriptionStore, options?: {
|
||||
now?: () => number;
|
||||
maxPerUser?: number;
|
||||
}): {
|
||||
subscribe(userId: string, value: {
|
||||
endpoint: string;
|
||||
expirationTime?: number | null;
|
||||
keys: {
|
||||
p256dh: string;
|
||||
auth: string;
|
||||
};
|
||||
}): Promise<{
|
||||
keys: {
|
||||
p256dh: string;
|
||||
auth: string;
|
||||
};
|
||||
createdAt: number;
|
||||
endpoint: string;
|
||||
expirationTime?: number | null;
|
||||
id: string;
|
||||
userId: string;
|
||||
}>;
|
||||
unsubscribe: (id: string) => Promise<void>;
|
||||
list: (userId: string) => Promise<StoredPushSubscription[]>;
|
||||
};
|
||||
declare function renderOfflineQueueReview(items: OfflineMutation[], conflicts?: Array<{
|
||||
id: string;
|
||||
message: string;
|
||||
}>): string;
|
||||
declare const PWA_REVIEW_RUNTIME = "document.addEventListener(\"click\",event=>{const button=event.target.closest(\"[data-pwa-retry],[data-pwa-remove],[data-pwa-client],[data-pwa-server]\");if(!button)return;const action=button.hasAttribute(\"data-pwa-retry\")?\"retry\":button.hasAttribute(\"data-pwa-remove\")?\"remove\":button.hasAttribute(\"data-pwa-client\")?\"client\":\"server\";const id=button.getAttribute(\"data-pwa-\"+action);dispatchEvent(new CustomEvent(\"wrnexus:pwa-review\",{detail:{action,id}}))});";
|
||||
|
||||
type RuntimeCacheStrategy = "network-first" | "cache-first" | "stale-while-revalidate";
|
||||
interface RuntimeCacheRule {
|
||||
pattern: string;
|
||||
strategy: RuntimeCacheStrategy;
|
||||
cacheName?: string;
|
||||
methods?: string[];
|
||||
}
|
||||
interface ServiceWorkerOptions {
|
||||
cacheName?: string;
|
||||
offlineUrl?: string;
|
||||
startUrl?: string;
|
||||
cacheUrls?: string[];
|
||||
runtimeCaching?: RuntimeCacheRule[];
|
||||
backgroundSyncTag?: string;
|
||||
}
|
||||
interface WebManifestOptions {
|
||||
name: string;
|
||||
shortName?: string;
|
||||
description?: string;
|
||||
id?: string;
|
||||
startUrl?: string;
|
||||
scope?: string;
|
||||
display?: "standalone" | "fullscreen" | "minimal-ui" | "browser";
|
||||
themeColor?: string;
|
||||
backgroundColor?: string;
|
||||
icons?: Array<{
|
||||
src: string;
|
||||
sizes: string;
|
||||
type?: string;
|
||||
purpose?: string;
|
||||
}>;
|
||||
shortcuts?: unknown[];
|
||||
screenshots?: unknown[];
|
||||
categories?: string[];
|
||||
lang?: string;
|
||||
}
|
||||
declare function createWebManifest(options: WebManifestOptions): {
|
||||
id: string;
|
||||
name: string;
|
||||
short_name: string;
|
||||
description: string | undefined;
|
||||
start_url: string;
|
||||
scope: string;
|
||||
display: "standalone" | "fullscreen" | "minimal-ui" | "browser";
|
||||
theme_color: string;
|
||||
background_color: string;
|
||||
icons: {
|
||||
src: string;
|
||||
sizes: string;
|
||||
type?: string;
|
||||
purpose?: string;
|
||||
}[];
|
||||
shortcuts: unknown[];
|
||||
screenshots: unknown[];
|
||||
categories: string[];
|
||||
lang: string;
|
||||
};
|
||||
declare function generateServiceWorker(options?: ServiceWorkerOptions): string;
|
||||
interface OfflineMutation<T = unknown> {
|
||||
id: string;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
endpoint: string;
|
||||
method: string;
|
||||
payload: T;
|
||||
attempts: number;
|
||||
}
|
||||
interface OfflineQueueStore {
|
||||
list(): Promise<OfflineMutation[]>;
|
||||
put(item: OfflineMutation): Promise<void>;
|
||||
remove(id: string): Promise<void>;
|
||||
}
|
||||
declare function memoryOfflineQueueStore(): OfflineQueueStore;
|
||||
type ConflictResolution<T> = {
|
||||
action: "client" | "server" | "merge";
|
||||
value: T;
|
||||
};
|
||||
declare function resolveOfflineConflict<T extends object>(client: T, server: T, strategy?: "client-wins" | "server-wins" | "last-write-wins" | ((client: T, server: T) => T)): ConflictResolution<T>;
|
||||
declare function createOfflineQueue(options?: {
|
||||
store?: OfflineQueueStore;
|
||||
fetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
||||
maxItems?: number;
|
||||
now?: () => number;
|
||||
}): {
|
||||
enqueue<T>(input: Omit<OfflineMutation<T>, "id" | "createdAt" | "updatedAt" | "attempts">): Promise<OfflineMutation<T>>;
|
||||
list: () => Promise<OfflineMutation<unknown>[]>;
|
||||
sync(): Promise<{
|
||||
id: string;
|
||||
ok: boolean;
|
||||
status?: number;
|
||||
}[]>;
|
||||
remove: (id: string) => Promise<void>;
|
||||
};
|
||||
declare function pwaClientRuntime(serviceWorkerUrl?: string): string;
|
||||
declare function subscribeToPush(registration: ServiceWorkerRegistration, publicKey: Uint8Array): Promise<PushSubscription>;
|
||||
|
||||
export { type ConflictResolution, type IndexedDbMigration, type OfflineMutation, type OfflineQueueStore, POSTGRES_PUSH_SUBSCRIPTION_SCHEMA, PWA_REVIEW_RUNTIME, type PushSqlClient, type PushSubscriptionStore, type RuntimeCacheRule, type RuntimeCacheStrategy, type ServiceWorkerOptions, type StoredPushSubscription, type WebManifestOptions, createOfflineQueue, createPushSubscriptionService, createWebManifest, generateServiceWorker, indexedDbOfflineQueueStore, memoryOfflineQueueStore, memoryPushSubscriptionStore, offlineQueueMigration, openPwaDatabase, postgresPushSubscriptionStore, pwaClientRuntime, renderOfflineQueueReview, resolveOfflineConflict, subscribeToPush };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/pwa</h3><pre data-language="sh"><code>bun add @wrnexus/pwa</code></pre></article><article class="example-card"><h3>Import @wrnexus/pwa</h3><pre data-language="ts"><code>import * as pwa from "@wrnexus/pwa";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
+181
-12
@@ -10,11 +10,11 @@ page wrnexusqueue {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/queue</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/queue</h1><p>Background jobs with delay, concurrency, retry, and repetition.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/queue@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>A background job queue with delays, retries + exponential backoff, recurring jobs, and concurrent workers.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/queue</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/queue</h1><p>Background jobs with delay, concurrency, retry, and repetition.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/queue@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>A background job queue with delays, retries + exponential backoff, recurring jobs, and concurrent workers.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/queue</code> is a server-side in-process job queue. You register named workers, enqueue jobs (optionally delayed or recurring), and let the queue poll and run them on a timer — with per-job retry limits and doubling backoff between attempts. The default store lives in memory; the design allows a pluggable driver to back it with Redis/SQL for durability across restarts. Reach for it when you need to defer work (emails, webhooks, cleanup) off the request path without a heavyweight external broker. Tests can drive it deterministically via <code>drain()</code>.</p>
|
||||
@@ -29,18 +29,21 @@ page wrnexusqueue {
|
||||
<h4 id="queueoptions"><code>QueueOptions</code></h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Option</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>maxAttempts</code></td><td><code>number</code></td><td><code>3</code></td><td>Default max attempts per job before it is dead-lettered.</td></tr><tr><td><code>backoffMs</code></td><td><code>number</code></td><td><code>1000</code></td><td>Base retry backoff in ms; doubles per attempt.</td></tr><tr><td><code>pollMs</code></td><td><code>number</code></td><td><code>250</code></td><td>Poll interval used once <code>start()</code> is called (ms).</td></tr><tr><td><code>onFailed</code></td><td><code>(job: Job, error: unknown) => void</code></td><td>—</td><td>Called when a job exhausts its attempts.</td></tr><tr><td><code>now</code></td><td><code>() => number</code></td><td><code>Date.now</code></td><td>Clock injection for deterministic tests.</td></tr></tbody></table></div>
|
||||
<tbody><tr><td><code>maxAttempts</code></td><td><code>number</code></td><td><code>3</code></td><td>Default max attempts per job before it is dead-lettered.</td></tr><tr><td><code>backoffMs</code></td><td><code>number</code></td><td><code>1000</code></td><td>Base retry backoff in ms; doubles per attempt.</td></tr><tr><td><code>pollMs</code></td><td><code>number</code></td><td><code>250</code></td><td>Poll interval used once <code>start()</code> is called (ms).</td></tr><tr><td><code>onFailed</code></td><td><code>(job: Job, error: unknown) => void</code></td><td>—</td><td>Called when a job exhausts its attempts.</td></tr><tr><td><code>concurrency</code></td><td><code>number</code></td><td>unlimited</td><td>Maximum jobs claimed by one <code>drain()</code> call.</td></tr><tr><td><code>capacity</code></td><td><code>number</code></td><td>unlimited</td><td>Maximum queued plus active jobs before adds reject.</td></tr><tr><td><code>now</code></td><td><code>() => number</code></td><td><code>Date.now</code></td><td>Clock injection for deterministic tests.</td></tr></tbody></table></div>
|
||||
<h4 id="queue"><code>Queue</code></h4>
|
||||
<p>The object returned by <code>createQueue</code>.</p>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Method</th><th>Signature</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>add</code></td><td><code>add<T>(name, data: T, options?: AddOptions): Promise<Job<T>></code></td><td>Enqueue a job under a worker name. Returns the created job.</td></tr><tr><td><code>process</code></td><td><code>process<T>(name, handler: JobHandler<T>): void</code></td><td>Register the worker that runs jobs of the given name.</td></tr><tr><td><code>drain</code></td><td><code>drain(now?: number): Promise<number></code></td><td>Run every job whose <code>runAt ≤ now</code>, once. Returns how many ran.</td></tr><tr><td><code>start</code></td><td><code>start(): void</code></td><td>Begin polling every <code>pollMs</code>. No-op if already started.</td></tr><tr><td><code>stop</code></td><td><code>stop(): void</code></td><td>Stop the poll timer.</td></tr><tr><td><code>size</code></td><td><code>size(): number</code></td><td>Number of jobs currently queued.</td></tr></tbody></table></div>
|
||||
<tbody><tr><td><code>add</code></td><td><code>add<T>(name, data: T, options?: AddOptions): Promise<Job<T>></code></td><td>Enqueue a job under a worker name. Returns the created job.</td></tr><tr><td><code>process</code></td><td><code>process<T>(name, handler: JobHandler<T>): void</code></td><td>Register the worker that runs jobs of the given name.</td></tr><tr><td><code>drain</code></td><td><code>drain(now?: number): Promise<number></code></td><td>Run every job whose <code>runAt ≤ now</code>, once. Returns how many ran.</td></tr><tr><td><code>start</code></td><td><code>start(): void</code></td><td>Begin polling every <code>pollMs</code>. No-op if already started.</td></tr><tr><td><code>stop</code></td><td><code>stop(): void</code></td><td>Stop the poll timer.</td></tr><tr><td><code>shutdown</code></td><td><code>shutdown({ force? }): Promise<void></code></td><td>Stop accepting jobs and await active work; force aborts it.</td></tr><tr><td><code>size</code></td><td><code>size(): number</code></td><td>Number of jobs currently queued.</td></tr><tr><td><code>get/list</code></td><td><code>get(id)</code> / <code>list(name?)</code></td><td>Inspect defensive copies of pending jobs.</td></tr><tr><td><code>cancel</code></td><td><code>cancel(id): boolean</code></td><td>Remove queued work or abort an active handler.</td></tr><tr><td><code>failed</code></td><td><code>failed(): Job[]</code></td><td>Inspect exhausted jobs in the dead-letter collection.</td></tr><tr><td><code>retry</code></td><td><code>retry(id): Promise<boolean></code></td><td>Reset and requeue a dead-lettered job.</td></tr></tbody></table></div>
|
||||
<h4 id="addoptions"><code>AddOptions</code></h4>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Option</th><th>Type</th><th>Description</th></tr></thead>
|
||||
<tbody><tr><td><code>delayMs</code></td><td><code>number</code></td><td>Delay before the job becomes runnable (ms).</td></tr><tr><td><code>maxAttempts</code></td><td><code>number</code></td><td>Max attempts before dead-lettering. Defaults to the queue's <code>maxAttempts</code>.</td></tr><tr><td><code>repeat</code></td><td><code>number</code></td><td>Re-enqueue this job this many ms after each successful run (recurring).</td></tr></tbody></table></div>
|
||||
<tbody><tr><td><code>delayMs</code></td><td><code>number</code></td><td>Delay before the job becomes runnable (ms).</td></tr><tr><td><code>maxAttempts</code></td><td><code>number</code></td><td>Max attempts before dead-lettering. Defaults to the queue's <code>maxAttempts</code>.</td></tr><tr><td><code>repeat</code></td><td><code>number</code></td><td>Re-enqueue this job this many ms after each successful run (recurring).</td></tr><tr><td><code>priority</code></td><td><code>number</code></td><td>Higher values are selected first among due jobs.</td></tr><tr><td><code>idempotencyKey</code></td><td><code>string</code></td><td>Return the matching pending job instead of enqueueing a duplicate.</td></tr></tbody></table></div>
|
||||
<h4 id="jobhandler-t"><code>JobHandler<T></code></h4>
|
||||
<pre data-language="ts"><code>type JobHandler<T = unknown> = (job: Job<T>) => void | Promise<void>;</code></pre>
|
||||
<pre data-language="ts"><code>type JobHandler<T = unknown> = (
|
||||
job: Job<T>,
|
||||
context: { signal: AbortSignal },
|
||||
) => void | Promise<void>;</code></pre>
|
||||
<h4 id="job-t"><code>Job<T></code></h4>
|
||||
<pre data-language="ts"><code>interface Job<T = unknown> {
|
||||
id: string; // e.g. "job_1"
|
||||
@@ -66,6 +69,9 @@ queue.process<{ to: string }>("email", async (job) =&g
|
||||
await queue.add("email", { to: "a@b.com" }, { delayMs: 5000, maxAttempts: 3 });
|
||||
|
||||
queue.start(); // begin polling; queue.stop() to halt</code></pre>
|
||||
<p>Use <code>context.signal</code> in network/database calls so forced shutdown and active cancellation finish promptly. For process termination, prefer <code>await queue.shutdown()</code>; use <code>{ force: true }</code> only after your grace period.</p>
|
||||
<h4 id="durable-queue">Durable queue</h4>
|
||||
<p><code>createDurableQueue({ store })</code> retains jobs until their handler succeeds and supports atomic leases when a driver implements <code>QueueStore.claim</code>. It exposes the same cancellation/shutdown behavior plus <code>list</code>, <code>failed</code>, and <code>retry</code>. The included <code>memoryQueueStore()</code> is useful for tests; production Redis/SQL drivers should make <code>claim()</code> atomic to prevent two workers executing one job.</p>
|
||||
<h4 id="recurring-jobs">Recurring jobs</h4>
|
||||
<p>Pass <code>repeat</code> to re-enqueue a job a fixed interval after each successful run:</p>
|
||||
<pre data-language="ts"><code>queue.process("heartbeat", async () => ping());
|
||||
@@ -89,6 +95,20 @@ await queue.add("task", {}, { delayMs: 5000 });
|
||||
|
||||
clock = 5000;
|
||||
const ran = await queue.drain(); // => 1</code></pre>
|
||||
<h4 id="durable-workflows-and-approvals">Durable workflows and approvals</h4>
|
||||
<p><code>createWorkflowEngine(store)</code> executes dependency-ordered steps and persists every transition, result, progress update, failure, cancellation, and approval record. Approval steps pause safely and can resume after a process restart because the snapshot lives in the supplied <code>WorkflowStore</code>.</p>
|
||||
<pre data-language="ts"><code>const workflow = defineDurableWorkflow({
|
||||
name: "publish-report",
|
||||
steps: [
|
||||
{ name: "build", run: buildReport },
|
||||
{ name: "approve", dependsOn: ["build"], approval: true, run: (report) => report },
|
||||
{ name: "publish", dependsOn: ["approve"], run: publishReport },
|
||||
],
|
||||
});
|
||||
|
||||
const run = await engine.start(workflow, input);
|
||||
await engine.approve(workflow, run.id, "approve", currentUser.id);</code></pre>
|
||||
<p>Use <code>memoryWorkflowStore()</code> for tests. Production stores implement the small <code>get</code>, <code>put</code>, and <code>list</code> contract using the same transactional database or durable service as the application.</p>
|
||||
<h3 id="retry-backoff-behavior">Retry & backoff behavior</h3>
|
||||
<ul>
|
||||
<li>On a thrown handler error, the job is retried while <code>attempts < maxAttempts</code>.</li>
|
||||
@@ -105,7 +125,9 @@ const ran = await queue.drain(); // => 1</code></pre>
|
||||
<li>The default store is in-process, so queued jobs do not survive a restart; a</li>
|
||||
<p>pluggable driver is intended for backing it with Redis/SQL for durability.</p>
|
||||
<li>Works alongside <code>@wrnexus/core</code> for offloading work from the request path.</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>/**
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { ExecutionContext } from '@wrnexus/core';
|
||||
|
||||
/**
|
||||
* Persistence contract for the durable queue.
|
||||
*
|
||||
* Distributed drivers should implement `claim()` atomically and exclude leased
|
||||
@@ -126,20 +148,142 @@ interface DurableQueueOptions {
|
||||
workerId?: string;
|
||||
maxAttempts?: number;
|
||||
concurrency?: number;
|
||||
capacity?: number;
|
||||
leaseMs?: number;
|
||||
backoff?: (attempt: number) => number;
|
||||
now?: () => number;
|
||||
onDeadLetter?: (job: Job, error: unknown) => void | Promise<void>;
|
||||
context?: (job: Job, signal: AbortSignal) => ExecutionContext;
|
||||
}
|
||||
interface DurableQueue {
|
||||
add<T>(name: string, data: T, options?: AddOptions): Promise<Job<T>>;
|
||||
process<T>(name: string, handler: JobHandler<T>): void;
|
||||
drain(): Promise<number>;
|
||||
cancel(id: string): Promise<boolean>;
|
||||
shutdown(options?: {
|
||||
force?: boolean;
|
||||
}): Promise<void>;
|
||||
list(name?: string): Promise<Job[]>;
|
||||
failed(): Job[];
|
||||
retry(id: string): Promise<boolean>;
|
||||
}
|
||||
declare function createDurableQueue(options?: DurableQueueOptions): DurableQueue;
|
||||
|
||||
interface RedisQueueClient {
|
||||
get(key: string): Promise<string | null>;
|
||||
set(key: string, value: string, options?: {
|
||||
NX?: boolean;
|
||||
PX?: number;
|
||||
}): Promise<unknown>;
|
||||
del(...keys: string[]): Promise<unknown>;
|
||||
zadd(key: string, score: number, member: string): Promise<unknown>;
|
||||
zrem(key: string, member: string): Promise<unknown>;
|
||||
zrangebyscore(key: string, min: number, max: number, options?: {
|
||||
limit: [number, number];
|
||||
}): Promise<string[]>;
|
||||
smembers(key: string): Promise<string[]>;
|
||||
sadd(key: string, member: string): Promise<unknown>;
|
||||
srem(key: string, member: string): Promise<unknown>;
|
||||
}
|
||||
/** Redis-backed queue store using only the common client command surface. */
|
||||
declare function redisQueueStore(client: RedisQueueClient, prefix?: string): QueueStore;
|
||||
interface SqlQueueClient {
|
||||
query<T = Record<string, unknown>>(sql: string, parameters?: unknown[]): Promise<{
|
||||
rows: T[];
|
||||
}>;
|
||||
}
|
||||
/** PostgreSQL store with atomic SKIP LOCKED leasing and JSON payloads. */
|
||||
declare function postgresQueueStore(db: SqlQueueClient, table?: string): QueueStore;
|
||||
declare const POSTGRES_QUEUE_SCHEMA = "CREATE TABLE IF NOT EXISTS wrnexus_jobs (\n id text PRIMARY KEY, name text NOT NULL, payload jsonb NOT NULL, run_at bigint NOT NULL,\n priority integer NOT NULL DEFAULT 0, lease_owner text, lease_until bigint\n); CREATE INDEX IF NOT EXISTS wrnexus_jobs_due ON wrnexus_jobs (run_at, priority DESC);";
|
||||
|
||||
interface ScheduledJob<T = unknown> {
|
||||
name: string;
|
||||
data: T;
|
||||
everyMs: number;
|
||||
options?: AddOptions;
|
||||
}
|
||||
interface QueueScheduler {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
tick(now?: number): Promise<number>;
|
||||
snapshot(): {
|
||||
running: boolean;
|
||||
schedules: number;
|
||||
nextRuns: Record<string, number>;
|
||||
};
|
||||
}
|
||||
/** Restart-safe scheduler when used with a durable queue and stable idempotency buckets. */
|
||||
declare function createQueueScheduler(queue: DurableQueue, schedules: ScheduledJob[], options?: {
|
||||
pollMs?: number;
|
||||
now?: () => number;
|
||||
}): QueueScheduler;
|
||||
declare function addBatch<T>(queue: DurableQueue, name: string, values: T[], options?: AddOptions): Promise<Job<T>[]>;
|
||||
interface QueueDashboardSnapshot {
|
||||
generatedAt: number;
|
||||
pending: number;
|
||||
failed: number;
|
||||
byName: Record<string, number>;
|
||||
oldestRunAt?: number;
|
||||
}
|
||||
declare function queueDashboardSnapshot(queue: DurableQueue): Promise<QueueDashboardSnapshot>;
|
||||
declare function renderQueueDashboard(snapshot: QueueDashboardSnapshot): string;
|
||||
/** Long-running scheduler/worker loop suitable for a dedicated process or container. */
|
||||
declare function runQueueDaemon(queue: DurableQueue, scheduler: QueueScheduler, options?: {
|
||||
signal?: AbortSignal;
|
||||
pollMs?: number;
|
||||
onError?: (error: unknown) => void;
|
||||
}): Promise<void>;
|
||||
|
||||
type WorkflowStatus = "pending" | "running" | "waiting-approval" | "completed" | "failed" | "cancelled";
|
||||
interface WorkflowStep$1<I = unknown, O = unknown> {
|
||||
name: string;
|
||||
dependsOn?: string[];
|
||||
approval?: boolean;
|
||||
run(input: I, context: WorkflowRunContext): O | Promise<O>;
|
||||
}
|
||||
interface WorkflowRunContext {
|
||||
workflowId: string;
|
||||
step: string;
|
||||
results: Readonly<Record<string, unknown>>;
|
||||
signal: AbortSignal;
|
||||
progress(value: number, message?: string): void;
|
||||
}
|
||||
interface WorkflowSnapshot {
|
||||
id: string;
|
||||
name: string;
|
||||
status: WorkflowStatus;
|
||||
input: unknown;
|
||||
results: Record<string, unknown>;
|
||||
completed: string[];
|
||||
waitingFor?: string;
|
||||
progress: number;
|
||||
message?: string;
|
||||
error?: string;
|
||||
updatedAt: number;
|
||||
}
|
||||
interface WorkflowStore {
|
||||
get(id: string): Promise<WorkflowSnapshot | null>;
|
||||
put(snapshot: WorkflowSnapshot): Promise<void>;
|
||||
list(): Promise<WorkflowSnapshot[]>;
|
||||
}
|
||||
declare function memoryWorkflowStore(): WorkflowStore;
|
||||
interface WorkflowDefinition<I = unknown> {
|
||||
name: string;
|
||||
steps: WorkflowStep$1<any, any>[];
|
||||
/** Compile-time input marker; definitions do not store runtime input values. */
|
||||
readonly __input?: I;
|
||||
}
|
||||
interface WorkflowEngine {
|
||||
start<I>(definition: WorkflowDefinition<I>, input: I, id?: string): Promise<WorkflowSnapshot>;
|
||||
resume<I>(definition: WorkflowDefinition<I>, id: string): Promise<WorkflowSnapshot>;
|
||||
approve<I>(definition: WorkflowDefinition<I>, id: string, step: string, actor: string): Promise<WorkflowSnapshot>;
|
||||
cancel(id: string): Promise<boolean>;
|
||||
get(id: string): Promise<WorkflowSnapshot | null>;
|
||||
list(): Promise<WorkflowSnapshot[]>;
|
||||
}
|
||||
declare function createWorkflowEngine(store?: WorkflowStore): WorkflowEngine;
|
||||
declare function defineDurableWorkflow<I>(definition: WorkflowDefinition<I>): WorkflowDefinition<I>;
|
||||
|
||||
/**
|
||||
* @wrnexus/queue — a background job queue with delays, retries + backoff, and
|
||||
* concurrent workers. The default store is in-process; a pluggable driver lets
|
||||
@@ -165,7 +309,13 @@ interface Job<T = unknown> {
|
||||
idempotencyKey?: string;
|
||||
createdAt: number;
|
||||
}
|
||||
type JobHandler<T = unknown> = (job: Job<T>) => void | Promise<void>;
|
||||
interface JobContext {
|
||||
/** Aborted when an active job is cancelled or the queue is force-stopped. */
|
||||
signal: AbortSignal;
|
||||
/** The same trusted context shape used by HTTP, actions, realtime and webhooks. */
|
||||
execution: ExecutionContext;
|
||||
}
|
||||
type JobHandler<T = unknown> = (job: Job<T>, context: JobContext) => void | Promise<void>;
|
||||
interface AddOptions {
|
||||
/** Delay before the job becomes runnable (ms). */
|
||||
delayMs?: number;
|
||||
@@ -189,8 +339,11 @@ interface QueueOptions {
|
||||
onFailed?: (job: Job, error: unknown) => void;
|
||||
/** Maximum jobs executed in one drain. Default: unlimited. */
|
||||
concurrency?: number;
|
||||
/** Maximum queued + active jobs. Adds reject once this limit is reached. */
|
||||
capacity?: number;
|
||||
/** Clock injection (tests). Default Date.now. */
|
||||
now?: () => number;
|
||||
context?: (job: Job, signal: AbortSignal) => ExecutionContext;
|
||||
}
|
||||
interface Queue {
|
||||
add<T>(name: string, data: T, options?: AddOptions): Promise<Job<T>>;
|
||||
@@ -199,10 +352,16 @@ interface Queue {
|
||||
drain(now?: number): Promise<number>;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
/** Stop accepting work and wait for active handlers (or abort them). */
|
||||
shutdown(options?: {
|
||||
force?: boolean;
|
||||
}): Promise<void>;
|
||||
size(): number;
|
||||
get(id: string): Job | undefined;
|
||||
list(name?: string): Job[];
|
||||
cancel(id: string): boolean;
|
||||
failed(): Job[];
|
||||
retry(id: string): Promise<boolean>;
|
||||
}
|
||||
interface JobDefinition<I> {
|
||||
name: string;
|
||||
@@ -222,7 +381,7 @@ declare function defineWorkflow<T>(name: string, steps: Array<WorkflowS
|
||||
declare function cronToInterval(cron: string): number;
|
||||
declare function createQueue(options?: QueueOptions): Queue;
|
||||
|
||||
export { type AddOptions, type DurableQueue, type DurableQueueOptions, type Job, type JobDefinition, type JobHandler, type Queue, type QueueOptions, type QueueStore, type WorkflowStep, createDurableQueue, createQueue, cronToInterval, defineJob, defineWorkflow, memoryQueueStore };
|
||||
export { type AddOptions, type DurableQueue, type DurableQueueOptions, type Job, type JobContext, type JobDefinition, type JobHandler, POSTGRES_QUEUE_SCHEMA, type Queue, type QueueDashboardSnapshot, type QueueOptions, type QueueScheduler, type QueueStore, type RedisQueueClient, type ScheduledJob, type SqlQueueClient, type WorkflowDefinition, type WorkflowEngine, type WorkflowRunContext, type WorkflowSnapshot, type WorkflowStatus, type WorkflowStep, type WorkflowStore, addBatch, createDurableQueue, createQueue, createQueueScheduler, createWorkflowEngine, cronToInterval, defineDurableWorkflow, defineJob, defineWorkflow, memoryQueueStore, memoryWorkflowStore, postgresQueueStore, queueDashboardSnapshot, redisQueueStore, renderQueueDashboard, runQueueDaemon };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Register workers, enqueue jobs, then start the poller</h3><pre data-language="ts"><code>import { createQueue } from "@wrnexus/queue";
|
||||
|
||||
const queue = createQueue({ maxAttempts: 3, backoffMs: 1000 });
|
||||
@@ -249,10 +408,20 @@ queue.process("task", async () => {
|
||||
await queue.add("task", {}, { delayMs: 5000 });
|
||||
|
||||
clock = 5000;
|
||||
const ran = await queue.drain(); // => 1</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createqueue-options-queue">createQueue(options?): Queue</a><a class="toc-level-4" href="#queueoptions">QueueOptions</a><a class="toc-level-4" href="#queue">Queue</a><a class="toc-level-4" href="#addoptions">AddOptions</a><a class="toc-level-4" href="#jobhandler-t">JobHandler<T></a><a class="toc-level-4" href="#job-t">Job<T></a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#recurring-jobs">Recurring jobs</a><a class="toc-level-4" href="#handling-permanent-failures">Handling permanent failures</a><a class="toc-level-4" href="#deterministic-testing">Deterministic testing</a><a class="toc-level-3" href="#retry-backoff-behavior">Retry & backoff behavior</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
const ran = await queue.drain(); // => 1</code></pre></article><article class="example-card"><h3>Durable workflows and approvals</h3><pre data-language="ts"><code>const workflow = defineDurableWorkflow({
|
||||
name: "publish-report",
|
||||
steps: [
|
||||
{ name: "build", run: buildReport },
|
||||
{ name: "approve", dependsOn: ["build"], approval: true, run: (report) => report },
|
||||
{ name: "publish", dependsOn: ["approve"], run: publishReport },
|
||||
],
|
||||
});
|
||||
|
||||
const run = await engine.start(workflow, input);
|
||||
await engine.approve(workflow, run.id, "approve", currentUser.id);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createqueue-options-queue">createQueue(options?): Queue</a><a class="toc-level-4" href="#queueoptions">QueueOptions</a><a class="toc-level-4" href="#queue">Queue</a><a class="toc-level-4" href="#addoptions">AddOptions</a><a class="toc-level-4" href="#jobhandler-t">JobHandler<T></a><a class="toc-level-4" href="#job-t">Job<T></a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#durable-queue">Durable queue</a><a class="toc-level-4" href="#recurring-jobs">Recurring jobs</a><a class="toc-level-4" href="#handling-permanent-failures">Handling permanent failures</a><a class="toc-level-4" href="#deterministic-testing">Deterministic testing</a><a class="toc-level-4" href="#durable-workflows-and-approvals">Durable workflows and approvals</a><a class="toc-level-3" href="#retry-backoff-behavior">Retry & backoff behavior</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusreactive {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/reactive</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/reactive</h1><p>Small type-safe reactive signal primitives.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/reactive@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Tiny, type-safe reactive primitives (signals) with zero dependencies.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/reactive</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/reactive</h1><p>Small type-safe reactive signal primitives.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/reactive@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Tiny, type-safe reactive primitives (signals) with zero dependencies.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/reactive</code> is the seed of WRNexusJS's reactivity layer: a minimal <code>signal</code> primitive that holds a value, notifies subscribers when it changes, and hands back an unsubscribe function. It is deliberately small and framework-agnostic — it powers nothing on its own, but is shaped so client islands (and later the <code>.wrn</code> compiler's <code>state</code> blocks) can build reactive bindings on top of it. Reach for it when you need observable state without pulling in a full reactivity library.</p>
|
||||
@@ -133,7 +133,57 @@ interface ReactiveScope {
|
||||
}
|
||||
declare function createScope(): ReactiveScope;
|
||||
|
||||
export { type Cleanup, type ReactiveScope, type ReadonlySignal, type Resource, type ResourceOptions, type ResourceStatus, type Signal, type Subscriber, type Unsubscribe, type WatchOptions, batch, computed, createScope, effect, resource, signal, untrack, watch };
|
||||
interface HistorySignal<T> extends Signal<T> {
|
||||
undo(): boolean;
|
||||
redo(): boolean;
|
||||
canUndo(): boolean;
|
||||
canRedo(): boolean;
|
||||
clearHistory(): void;
|
||||
}
|
||||
declare function historySignal<T>(initial: T, options?: {
|
||||
limit?: number;
|
||||
equals?: (left: T, right: T) => boolean;
|
||||
}): HistorySignal<T>;
|
||||
interface UrlStateOptions<T> {
|
||||
url?: URL;
|
||||
parameter: string;
|
||||
parse?: (value: string | null) => T;
|
||||
serialize?: (value: T) => string | null;
|
||||
replace?: (url: URL) => void;
|
||||
}
|
||||
declare function urlSignal<T>(initial: T, options: UrlStateOptions<T>): Signal<T>;
|
||||
interface ReactiveContext<T> {
|
||||
provide<R>(value: T, run: () => R): R;
|
||||
use(): T;
|
||||
}
|
||||
declare function createContextProvider<T>(defaultValue?: T): ReactiveContext<T>;
|
||||
declare function mountPortal(content: Node | string, target: Element): () => void;
|
||||
declare function transition(update: () => void, options?: {
|
||||
className?: string;
|
||||
target?: Element;
|
||||
durationMs?: number;
|
||||
signal?: AbortSignal;
|
||||
}): Promise<void>;
|
||||
interface TimelineStep {
|
||||
durationMs: number;
|
||||
delayMs?: number;
|
||||
easing?: (progress: number) => number;
|
||||
update(progress: number): void;
|
||||
}
|
||||
interface AnimationTimeline {
|
||||
play(options?: {
|
||||
reverse?: boolean;
|
||||
signal?: AbortSignal;
|
||||
}): Promise<void>;
|
||||
cancel(reason?: unknown): void;
|
||||
readonly running: boolean;
|
||||
}
|
||||
declare function createTimeline(steps: TimelineStep[], options?: {
|
||||
now?: () => number;
|
||||
frame?: (callback: () => void) => unknown;
|
||||
}): AnimationTimeline;
|
||||
|
||||
export { type AnimationTimeline, type Cleanup, type HistorySignal, type ReactiveContext, type ReactiveScope, type ReadonlySignal, type Resource, type ResourceOptions, type ResourceStatus, type Signal, type Subscriber, type TimelineStep, type Unsubscribe, type UrlStateOptions, type WatchOptions, batch, computed, createContextProvider, createScope, createTimeline, effect, historySignal, mountPortal, resource, signal, transition, untrack, urlSignal, watch };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Typical usage</h3><pre data-language="ts"><code>import { signal } from "@wrnexus/reactive";
|
||||
|
||||
const count = signal(0);
|
||||
@@ -156,7 +206,7 @@ const user: Signal<{ name: string } | null> = signal(null);
|
||||
user.set({ name: "Ada" });</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#signal-t-initial-t-signal-t">signal<T>(initial: T): Signal<T></a><a class="toc-level-4" href="#types">Types</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
page wrnexusrealtime {
|
||||
seo {
|
||||
title = "@wrnexus/realtime"
|
||||
description = "Rooms, presence, messaging, history, streams, and UI components."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/realtime</span></nav><section class="doc-intro"><span class="eyebrow">Realtime · Package reference</span><h1>@wrnexus/realtime</h1><p>Rooms, presence, messaging, history, streams, and UI components.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Realtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/realtime@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Typed rooms, secure message envelopes, browser room helpers, presence utilities, and complete realtime UI blocks for WRNexusJS.</p>
|
||||
<h3 id="server-rooms">Server rooms</h3>
|
||||
<pre data-language="ts"><code>import { defineRoom } from "@wrnexus/realtime";
|
||||
|
||||
export default defineRoom("support", {
|
||||
async authorize(context) {
|
||||
return Boolean(context.user);
|
||||
},
|
||||
message(client, message) {
|
||||
client.broadcast(message);
|
||||
},
|
||||
});</code></pre>
|
||||
<p>The package re-exports the hardened realtime registry from <code>@wrnexus/core</code>, including authentication, origin checks, quotas, message-size limits, schema validation hooks, and room authorization.</p>
|
||||
<h3 id="messages-and-browser-helpers">Messages and browser helpers</h3>
|
||||
<pre data-language="ts"><code>import {
|
||||
createRealtimeMessage,
|
||||
createPresenceEvent,
|
||||
createTypingEvent,
|
||||
connectRoom,
|
||||
sendRoomMessage,
|
||||
} from "@wrnexus/realtime";
|
||||
|
||||
const room = connectRoom("support", { query: { ticket: "T-100" } });
|
||||
sendRoomMessage(
|
||||
room,
|
||||
createRealtimeMessage({
|
||||
type: "message",
|
||||
room: "support",
|
||||
data: { text: "Hello" },
|
||||
}),
|
||||
);</code></pre>
|
||||
<p>Message IDs use Web Crypto. A runtime without secure randomness must provide an explicit message ID.</p>
|
||||
<h3 id="components">Components</h3>
|
||||
<p>Enable <code>realtimePlugin()</code> and use:</p>
|
||||
<ul>
|
||||
<li><code><RealtimeRoom /></code></li>
|
||||
<li><code><RealtimeMessageBubble /></code></li>
|
||||
<li><code><MessageComposer /></code></li>
|
||||
<li><code><RoomStatus /></code></li>
|
||||
<li><code><RoomMeta /></code></li>
|
||||
<li><code><PresenceList /></code></li>
|
||||
<li><code><TypingIndicator /></code></li>
|
||||
</ul>
|
||||
<p>These package-owned blocks compose existing <code>@wrnexus/ui</code> components such as <code>Card</code>, <code>Alert</code>, <code>Avatar</code>, <code>Badge</code>, <code>Button</code>, <code>Input</code>, and <code>ChatBubble</code>.</p>
|
||||
<p>Incoming messages can be bounded and constrained:</p>
|
||||
<pre data-language="ts"><code>const message = parseRealtimeMessage(rawMessage, {
|
||||
maxBytes: 64 * 1024,
|
||||
maxDepth: 12,
|
||||
allowedTypes: ["message", "typing", "presence"],
|
||||
room: "support",
|
||||
});</code></pre>
|
||||
<p>The parser rejects oversized payloads, circular/unsupported values, unsafe object keys, invalid message types, invalid room names, and room mismatches.</p>
|
||||
<h3 id="replay-acknowledgements-sse-and-monitoring">Replay, acknowledgements, SSE, and monitoring</h3>
|
||||
<p><code>createRealtimeHistory()</code> keeps a bounded sequenced log per room. Clients acknowledge a sequence and <code>resume(room, clientId)</code> returns only missed events. A snapshot exposes room, message, acknowledgement, and sequence counts for monitoring without exposing payloads.</p>
|
||||
<pre data-language="ts"><code>const history = createRealtimeHistory({ limitPerRoom: 100 });
|
||||
const entry = history.publish("support", message);
|
||||
history.acknowledge("support", clientId, entry.sequence);
|
||||
const missed = history.resume("support", clientId);</code></pre>
|
||||
<p><code>realtimeSseResponse(stream, signal)</code> converts the same sequenced envelope into standards-based Server-Sent Events with event IDs, event types, JSON data, cancellation, and no-cache headers.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { RawSocket, RealtimeBridge, RealtimeBus, RealtimeConnectMeta, RealtimeEnvelope, RealtimeHandler, RealtimeRegistry, RealtimeRegistryOptions, RealtimeSecurityOptions, RealtimeSocket, Room, RoomAuthInfo, RoomClient, RoomDefinition, RoomHandlers, Target, bridgeRealtime, createRealtimeRegistry, defineRoom, isRoomDefinition } from '@wrnexus/core';
|
||||
export { RealtimePluginOptions, realtimeComponentsDir, default as realtimePlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
type RealtimeMessageType = string;
|
||||
interface RealtimeMessage<T = unknown> {
|
||||
id: string;
|
||||
type: RealtimeMessageType;
|
||||
room?: string;
|
||||
senderId?: string;
|
||||
senderName?: string;
|
||||
sentAt: string;
|
||||
data: T;
|
||||
meta?: Record<string, string | number | boolean | null>;
|
||||
}
|
||||
interface CreateRealtimeMessageOptions<T> {
|
||||
id?: string;
|
||||
type: string;
|
||||
room?: string;
|
||||
senderId?: string;
|
||||
senderName?: string;
|
||||
sentAt?: string | Date;
|
||||
data: T;
|
||||
meta?: Record<string, string | number | boolean | null>;
|
||||
}
|
||||
interface ParseRealtimeMessageOptions {
|
||||
maxBytes?: number;
|
||||
maxDepth?: number;
|
||||
allowedTypes?: readonly string[];
|
||||
room?: string;
|
||||
}
|
||||
interface RealtimePresence {
|
||||
userId: string;
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
status?: "online" | "away" | "busy" | "offline";
|
||||
joinedAt?: string;
|
||||
lastSeenAt?: string;
|
||||
meta?: Record<string, string | number | boolean | null>;
|
||||
}
|
||||
interface RealtimeRoomMeta {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
memberCount?: number;
|
||||
onlineCount?: number;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
private?: boolean;
|
||||
tags?: string[];
|
||||
}
|
||||
declare function assertRealtimeRoomName(name: string): string;
|
||||
declare function createRealtimeMessage<T>(options: CreateRealtimeMessageOptions<T>): RealtimeMessage<T>;
|
||||
declare function isRealtimeMessage(value: unknown): value is RealtimeMessage;
|
||||
declare function parseRealtimeMessage<T = unknown>(value: string | unknown, options?: ParseRealtimeMessageOptions): RealtimeMessage<T>;
|
||||
declare function createPresenceEvent(action: "join" | "leave" | "update", presence: RealtimePresence, room?: string): RealtimeMessage<{
|
||||
action: "join" | "leave" | "update";
|
||||
presence: RealtimePresence;
|
||||
}>;
|
||||
declare function createTypingEvent(userId: string, typing: boolean, options?: {
|
||||
room?: string;
|
||||
name?: string;
|
||||
}): RealtimeMessage<{
|
||||
userId: string;
|
||||
name?: string;
|
||||
typing: boolean;
|
||||
}>;
|
||||
declare function roomMemberSummary(members: readonly RealtimePresence[]): {
|
||||
total: number;
|
||||
online: number;
|
||||
away: number;
|
||||
busy: number;
|
||||
};
|
||||
|
||||
interface BrowserRoomConnection {
|
||||
readonly name: string;
|
||||
send(message: unknown): BrowserRoomConnection;
|
||||
on(type: string | ((message: unknown) => void), callback?: (message: unknown) => void): BrowserRoomConnection;
|
||||
close(): void;
|
||||
}
|
||||
interface WrnexusRealtimeWindow extends Window {
|
||||
wire?: {
|
||||
room?: (name: string, query?: string) => BrowserRoomConnection;
|
||||
};
|
||||
}
|
||||
declare function roomQuery(params: Record<string, string | number | boolean | null | undefined>): string;
|
||||
declare function connectRoom(name: string, options?: {
|
||||
query?: Record<string, string | number | boolean | null | undefined>;
|
||||
window?: WrnexusRealtimeWindow;
|
||||
}): BrowserRoomConnection;
|
||||
declare function sendRoomMessage<T>(room: BrowserRoomConnection, message: RealtimeMessage<T> | T): BrowserRoomConnection;
|
||||
|
||||
interface SequencedRealtimeMessage<T = unknown> {
|
||||
sequence: number;
|
||||
message: RealtimeMessage<T>;
|
||||
}
|
||||
interface RealtimeHistorySnapshot {
|
||||
rooms: number;
|
||||
messages: number;
|
||||
acknowledgements: number;
|
||||
oldestSequence?: number;
|
||||
latestSequence?: number;
|
||||
}
|
||||
interface RealtimeHistoryOptions {
|
||||
limitPerRoom?: number;
|
||||
maxClients?: number;
|
||||
}
|
||||
interface RealtimeHistory {
|
||||
publish<T>(room: string, message: RealtimeMessage<T>): SequencedRealtimeMessage<T>;
|
||||
replay(room: string, afterSequence?: number, limit?: number): SequencedRealtimeMessage[];
|
||||
acknowledge(room: string, clientId: string, sequence: number): void;
|
||||
acknowledged(room: string, clientId: string): number;
|
||||
resume(room: string, clientId: string, limit?: number): SequencedRealtimeMessage[];
|
||||
snapshot(): RealtimeHistorySnapshot;
|
||||
clear(room?: string): void;
|
||||
}
|
||||
declare function createRealtimeHistory(options?: RealtimeHistoryOptions): RealtimeHistory;
|
||||
declare function createAcknowledgement(room: string, sequence: number, clientId: string): RealtimeMessage<{
|
||||
sequence: number;
|
||||
clientId: string;
|
||||
}>;
|
||||
declare function realtimeSseResponse(stream: ReadableStream<SequencedRealtimeMessage>, signal?: AbortSignal): Response;
|
||||
|
||||
interface DatabaseChange<T = unknown> {
|
||||
table: string;
|
||||
operation: "insert" | "update" | "delete";
|
||||
key?: string | number;
|
||||
record?: T;
|
||||
occurredAt: number;
|
||||
}
|
||||
interface DatabaseChangeSource {
|
||||
subscribe(handler: (change: DatabaseChange) => void | Promise<void>): () => void;
|
||||
}
|
||||
declare function databaseChangeFeed(source: DatabaseChangeSource, publish: (topic: string, change: DatabaseChange) => void | Promise<void>, options?: {
|
||||
prefix?: string;
|
||||
allowTables?: string[];
|
||||
}): () => void;
|
||||
interface FileStreamFrame {
|
||||
streamId: string;
|
||||
index: number;
|
||||
total: number;
|
||||
bytes: Uint8Array;
|
||||
}
|
||||
declare function frameFileStream(streamId: string, bytes: Uint8Array, options?: {
|
||||
chunkBytes?: number;
|
||||
maxBytes?: number;
|
||||
}): FileStreamFrame[];
|
||||
declare function createFileStreamReceiver(options?: {
|
||||
maxBytes?: number;
|
||||
maxStreams?: number;
|
||||
}): {
|
||||
accept(frame: FileStreamFrame): Uint8Array | null;
|
||||
snapshot: () => {
|
||||
activeStreams: number;
|
||||
bufferedBytes: number;
|
||||
};
|
||||
};
|
||||
|
||||
export { type BrowserRoomConnection, type CreateRealtimeMessageOptions, type DatabaseChange, type DatabaseChangeSource, type FileStreamFrame, type ParseRealtimeMessageOptions, type RealtimeHistory, type RealtimeHistoryOptions, type RealtimeHistorySnapshot, type RealtimeMessage, type RealtimeMessageType, type RealtimePresence, type RealtimeRoomMeta, type SequencedRealtimeMessage, type WrnexusRealtimeWindow, assertRealtimeRoomName, connectRoom, createAcknowledgement, createFileStreamReceiver, createPresenceEvent, createRealtimeHistory, createRealtimeMessage, createTypingEvent, databaseChangeFeed, frameFileStream, isRealtimeMessage, parseRealtimeMessage, realtimeSseResponse, roomMemberSummary, roomQuery, sendRoomMessage };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>## Server rooms</h3><pre data-language="ts"><code>import { defineRoom } from "@wrnexus/realtime";
|
||||
|
||||
export default defineRoom("support", {
|
||||
async authorize(context) {
|
||||
return Boolean(context.user);
|
||||
},
|
||||
message(client, message) {
|
||||
client.broadcast(message);
|
||||
},
|
||||
});</code></pre></article><article class="example-card"><h3>## Messages and browser helpers</h3><pre data-language="ts"><code>import {
|
||||
createRealtimeMessage,
|
||||
createPresenceEvent,
|
||||
createTypingEvent,
|
||||
connectRoom,
|
||||
sendRoomMessage,
|
||||
} from "@wrnexus/realtime";
|
||||
|
||||
const room = connectRoom("support", { query: { ticket: "T-100" } });
|
||||
sendRoomMessage(
|
||||
room,
|
||||
createRealtimeMessage({
|
||||
type: "message",
|
||||
room: "support",
|
||||
data: { text: "Hello" },
|
||||
}),
|
||||
);</code></pre></article><article class="example-card"><h3>Incoming messages can be bounded and constrained</h3><pre data-language="ts"><code>const message = parseRealtimeMessage(rawMessage, {
|
||||
maxBytes: 64 * 1024,
|
||||
maxDepth: 12,
|
||||
allowedTypes: ["message", "typing", "presence"],
|
||||
room: "support",
|
||||
});</code></pre></article><article class="example-card"><h3>message, acknowledgement, and sequence counts for monitoring without exposing payloads.</h3><pre data-language="ts"><code>const history = createRealtimeHistory({ limitPerRoom: 100 });
|
||||
const entry = history.publish("support", message);
|
||||
history.acknowledge("support", clientId, entry.sequence);
|
||||
const missed = history.resume("support", clientId);</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#server-rooms">Server rooms</a><a class="toc-level-3" href="#messages-and-browser-helpers">Messages and browser helpers</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-3" href="#replay-acknowledgements-sse-and-monitoring">Replay, acknowledgements, SSE, and monitoring</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexusrouter {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/router</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/router</h1><p>Filesystem discovery, route matching, and typed route generation.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/router@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>File-based router that maps an <code>app/</code> directory onto route tables and matches request paths against them.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/router</span></nav><section class="doc-intro"><span class="eyebrow">Core · Package reference</span><h1>@wrnexus/router</h1><p>Filesystem discovery, route matching, and typed route generation.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Core</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/router@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>File-based router that maps an <code>app/</code> directory onto route tables and matches request paths against them.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/router</code> scans an application's <code>app/</code> directory once at startup and builds route tables for pages, API endpoints, realtime channels, middleware, server-rendered <code>.wrn</code> components, layouts, and validation schemas. It also compiles URL patterns (<code>/users/[id]</code>) into RegExps and matches request paths against them. Request input is never turned into a file path, which makes the router immune to path traversal. This is a server-side package used by the WRNexusJS runtime to resolve incoming requests, plus a codegen helper for compile-time typed links.</p>
|
||||
@@ -302,7 +302,7 @@ const routes = sortRoutes([{ raw: "/posts/[slug]", file: "
|
||||
const m = matchRoute(routes, "/posts/hello"); // { route, params: { slug: "hello" } }</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#directory-conventions">Directory conventions</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#buildrouter-appdir-opts-router">buildRouter(appDir, opts?): Router</a><a class="toc-level-4" href="#route-matching">Route matching</a><a class="toc-level-4" href="#typed-routes-codegen">Typed-routes codegen</a><a class="toc-level-4" href="#re-exports">Re-exports</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
page wrnexussecurity {
|
||||
seo {
|
||||
title = "@wrnexus/security"
|
||||
description = "Security headers, CSRF protection, rate limits, and safe rendering."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/security</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/security</h1><p>Security headers, CSRF protection, rate limits, and safe rendering.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/security@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Secure-by-default utilities for WRNexusJS: bounded HTML-safe serialization, prototype-pollution rejection, URL policy, secure cookies, request hardening, security presets, and SSRF-safe remote fetches.</p>
|
||||
<pre data-language="ts"><code>import { safeFetch, securityPreset, setSecureCookie } from "@wrnexus/security";
|
||||
|
||||
export default { security: securityPreset("strict") };
|
||||
const response = await safeFetch(remoteUrl, { allowedHosts: ["api.example.com"] });
|
||||
setSecureCookie(ctx, "__Host-session", sessionId);</code></pre></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { S as SafeFetchOptions, a as SafeUrlPolicy, i as isPrivateAddress, b as isSafeUrl, s as safeFetch, c as sanitizeUrl, v as validateUrl } from './fetch-DNyX0J_D.js';
|
||||
export { SecureSerializeOptions, secureJsonStringify, serializeForHtml } from './serialization.js';
|
||||
import { CookieOptions, Context, RequestLimitsConfig, Middleware, SecurityConfig } from '@wrnexus/core';
|
||||
export { TrustedHtmlPolicy, TrustedHtmlValue, createTrustedHtml, isTrustedHtml, unwrapTrustedHtml } from './trusted-html.js';
|
||||
|
||||
declare class SecurityError extends Error {
|
||||
readonly code: string;
|
||||
readonly status: number;
|
||||
constructor(code: string, message: string, status?: number, options?: ErrorOptions);
|
||||
}
|
||||
|
||||
interface SafeObjectOptions {
|
||||
maxDepth?: number;
|
||||
maxKeys?: number;
|
||||
allowInstances?: boolean;
|
||||
}
|
||||
declare function isDangerousObjectKey(key: string): boolean;
|
||||
declare function assertSafeObject(value: unknown, options?: SafeObjectOptions): void;
|
||||
declare function safeMerge<T extends Record<string, unknown>>(target: T, ...sources: Array<Record<string, unknown> | undefined | null>): T;
|
||||
|
||||
interface SecureCookieOptions extends CookieOptions {
|
||||
hostOnly?: boolean;
|
||||
}
|
||||
declare function secureCookieOptions(ctx: Pick<Context, "url">, options?: SecureCookieOptions): CookieOptions;
|
||||
declare function setSecureCookie(ctx: Pick<Context, "url" | "cookies">, name: string, value: string, options?: SecureCookieOptions): void;
|
||||
|
||||
type RequestHardeningOptions = RequestLimitsConfig;
|
||||
declare function requestHardening(options?: RequestHardeningOptions): Middleware;
|
||||
|
||||
type SecurityPreset = "balanced" | "strict" | "api";
|
||||
declare function securityPreset(preset?: SecurityPreset): SecurityConfig;
|
||||
|
||||
export { type RequestHardeningOptions, type SafeObjectOptions, type SecureCookieOptions, SecurityError, type SecurityPreset, assertSafeObject, isDangerousObjectKey, requestHardening, safeMerge, secureCookieOptions, securityPreset, setSecureCookie };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Secure-by-default utilities for WRNexusJS: bounded HTML-safe serialization, prototype-pollution rejection, URL policy, secure cookies, request hardening, security presets, and SSRF-safe remote fetches.</h3><pre data-language="ts"><code>import { safeFetch, securityPreset, setSecureCookie } from "@wrnexus/security";
|
||||
|
||||
export default { security: securityPreset("strict") };
|
||||
const response = await safeFetch(remoteUrl, { allowedHosts: ["api.example.com"] });
|
||||
setSecureCookie(ctx, "__Host-session", sessionId);</code></pre></article><article class="example-card"><h3>Install @wrnexus/security</h3><pre data-language="sh"><code>bun add @wrnexus/security</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexusssr {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ssr</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/ssr</h1><p>Secure HTML document rendering and SEO metadata.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ssr@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Server-side rendering: wraps a page's HTML body in a complete HTML document with a metadata-driven <code><head></code>.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ssr</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/ssr</h1><p>Secure HTML document rendering and SEO metadata.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ssr@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Server-side rendering: wraps a page's HTML body in a complete HTML document with a metadata-driven <code><head></code>.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p>Pages in WRNexusJS return an HTML string for the body. <code>@wrnexus/ssr</code> takes that body and produces a full HTML document — building the <code><head></code> from page metadata and global SEO defaults, resolving canonical/Open Graph/Twitter tags, and injecting module preloads and <code><script type="module"></code> tags. It is deliberately server-only: nothing in this package touches the DOM or ships to the browser, keeping server code genuinely server-only. Reach for it on the server when turning a rendered page body into a response document.</p>
|
||||
@@ -121,6 +121,17 @@ interface ScriptAsset {
|
||||
attributes?: Record<string, string | boolean>;
|
||||
}
|
||||
type RenderScript = string | ScriptAsset;
|
||||
interface PartialPrerenderResult {
|
||||
shell: string;
|
||||
regions: Array<{
|
||||
id: string;
|
||||
html: string;
|
||||
}>;
|
||||
}
|
||||
/** Extract compiler-emitted dynamic regions into a cacheable static shell. */
|
||||
declare function partialPrerender(html: string, startIndex?: number): PartialPrerenderResult;
|
||||
/** Stream the static shell first, followed by inert region templates for client insertion. */
|
||||
declare function streamPartialDocument(result: PartialPrerenderResult, nonce?: string): ReadableStream<Uint8Array>;
|
||||
interface RenderOptions {
|
||||
/** Page metadata for the document head. */
|
||||
meta: PageMeta;
|
||||
@@ -180,7 +191,7 @@ interface StreamRenderOptions extends Omit<RenderOptions, "body">
|
||||
declare function renderDocumentStream(opts: StreamRenderOptions): ReadableStream<Uint8Array>;
|
||||
declare function streamDocumentResponse(opts: StreamRenderOptions, init?: ResponseInit): Response;
|
||||
|
||||
export { type RenderOptions, type RenderScript, type ScriptAsset, type StreamRenderOptions, extractWrnexusStyles, renderDocument, renderDocumentStream, streamDocumentResponse };
|
||||
export { type PartialPrerenderResult, type RenderOptions, type RenderScript, type ScriptAsset, type StreamRenderOptions, extractWrnexusStyles, partialPrerender, renderDocument, renderDocumentStream, streamDocumentResponse, streamPartialDocument };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Render an SEO-ready application page</h3><pre data-language="ts"><code>import { renderDocument } from "@wrnexus/ssr";
|
||||
|
||||
const html = renderDocument({
|
||||
@@ -213,7 +224,7 @@ return new Response(html, {
|
||||
return new Response(html, { headers: { "content-type": "text/html; charset=utf-8" } });</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#renderdocument-opts-renderoptions-string">renderDocument(opts: RenderOptions): string</a><a class="toc-level-4" href="#renderoptions">RenderOptions</a><a class="toc-level-4" href="#metadata-resolution">Metadata resolution</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#render-an-seo-ready-application-page">Render an SEO-ready application page</a><a class="toc-level-4" href="#add-trusted-framework-assets-and-boot-data">Add trusted framework assets and boot data</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
page wrnexusstore {
|
||||
seo {
|
||||
title = "@wrnexus/store"
|
||||
description = "Application state stores shared across server and browser runtimes."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/store</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/store</h1><p>Application state stores shared across server and browser runtimes.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/store@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Typed global and page-scoped WRNexusJS stores with runtime-specific state, computed values, actions, lifecycle hooks, persistence, SSR isolation, and HMR support.</p>
|
||||
<p>Use <code>defineStore()</code> to declare a store and <code>createStoreContainer()</code> to create an isolated request or browser container. Store definitions are framework helpers and do not require UI components.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { StoreMutation, StoreFunction, StoreDefinition, StoreInstance, StoreCombinedState } from './types.js';
|
||||
export { PersistenceStorage, StoreActionContext, StoreActionDefinition, StoreInstanceCore, StoreKind, StoreLifecycleContext, StorePersistenceConfig, StoreRuntime } from './types.js';
|
||||
|
||||
declare function defineStore<S extends object, C extends object = Record<string, never>, A extends Record<string, StoreFunction> = Record<string, StoreFunction>, CS extends object = Record<string, never>, SS extends object = Record<string, never>>(definition: StoreDefinition<S, C, A, CS, SS>): StoreDefinition<S, C, A, CS, SS>;
|
||||
interface StoreContainerOptions {
|
||||
runtime: "server" | "client";
|
||||
request?: unknown;
|
||||
routeId?: string;
|
||||
hydration?: Record<string, unknown>;
|
||||
onMutation?: (mutation: StoreMutation) => void;
|
||||
}
|
||||
declare class StoreContainer {
|
||||
readonly runtime: "server" | "client";
|
||||
readonly request?: unknown;
|
||||
readonly routeId?: string;
|
||||
private readonly instances;
|
||||
private readonly hydration;
|
||||
private readonly onMutation?;
|
||||
private readonly lastMutations;
|
||||
constructor(options: StoreContainerOptions);
|
||||
use<S extends object, C extends object, A extends Record<string, StoreFunction>, CS extends object, SS extends object>(definition: StoreDefinition<S, C, A, CS, SS>): Promise<StoreInstance<StoreCombinedState<S, CS, SS>, C, A>>;
|
||||
serialize(): Record<string, unknown>;
|
||||
inspect(): Array<{
|
||||
name: string;
|
||||
kind: "global" | "page";
|
||||
state: Readonly<Record<string, unknown>>;
|
||||
computed: Readonly<Record<string, unknown>>;
|
||||
lastAction?: string;
|
||||
changed: string[];
|
||||
hydrationSource: "server" | "persistence" | "initial";
|
||||
}>;
|
||||
hotUpdate<S extends object, C extends object, A extends Record<string, StoreFunction>, CS extends object, SS extends object>(definition: StoreDefinition<S, C, A, CS, SS>): Promise<{
|
||||
preserved: string[];
|
||||
reset: string[];
|
||||
}>;
|
||||
disposePageStores(): Promise<void>;
|
||||
dispose(): Promise<void>;
|
||||
}
|
||||
declare function createStoreContainer(options: StoreContainerOptions): StoreContainer;
|
||||
declare function createStoreInstance<S extends object, C extends object, A extends Record<string, StoreFunction>, CS extends object, SS extends object>(definition: StoreDefinition<S, C, A, CS, SS>, options: Omit<StoreContainerOptions, "hydration"> & {
|
||||
hydration?: unknown;
|
||||
}): StoreInstance<StoreCombinedState<S, CS, SS>, C, A>;
|
||||
|
||||
export { StoreCombinedState, StoreContainer, type StoreContainerOptions, StoreDefinition, StoreFunction, StoreInstance, StoreMutation, createStoreContainer, createStoreInstance, defineStore };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/store</h3><pre data-language="sh"><code>bun add @wrnexus/store</code></pre></article><article class="example-card"><h3>Import @wrnexus/store</h3><pre data-language="ts"><code>import * as store from "@wrnexus/store";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,18 @@ page wrnexusstyles {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/styles</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/styles</h1><p>CSS pipeline, themes, fonts, profiles, and application config.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/styles@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Global CSS bundling, the <code>--wire-*</code> design-token theme system, and the <code>wrnexus.config.ts</code> app-config loader for WRNexusJS apps.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/styles</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/styles</h1><p>CSS pipeline, themes, fonts, profiles, and application config.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/styles@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><h3 id="reusable-layers-and-presets">Reusable layers and presets</h3>
|
||||
<p>Compose local or package foundations in order; later layers override earlier ones and the application has final base-config precedence:</p>
|
||||
<pre data-language="ts"><code>export default defineConfig({
|
||||
extends: ["@workroot/wrnexus-enterprise", "./layers/company"],
|
||||
profiles: { production: { port: 8080 } },
|
||||
});</code></pre>
|
||||
<p>A directory layer exports <code>wrnexus.layer.ts</code> (JavaScript/MJS are supported). A package can provide that conventional file or declare <code>wrnexus.layer</code> in its <code>package.json</code>. Layers may extend other layers and carry the complete app configuration, including plugins that contribute layouts, components, routes, middleware, and migrations. <code>plugins</code> and <code>head</code> compose; other arrays intentionally replace earlier values. Cycles and missing/invalid entries fail with stable <code>WRN-CONFIG-LAYER-*</code> diagnostics. <code>wrnexus config --explain</code> lists every resolved layer source.</p>
|
||||
<blockquote>Global CSS bundling, the <code>--wire-*</code> design-token theme system, and the <code>wrnexus.config.ts</code> app-config loader for WRNexusJS apps.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p>This package owns three server-side concerns that shape every page a WRNexusJS app renders:</p>
|
||||
@@ -176,7 +183,7 @@ const themeJs = renderThemeRuntime(theme); // served at THEME_JS_HREF</code></pr
|
||||
<li>Peer package: <code>@wrnexus/core</code> supplies the <code>SeoConfig</code> and <code>SecurityConfig</code> types referenced by <code>AppConfig</code>.</li>
|
||||
<li>The bundled global stylesheet, the theme stylesheet (<code>THEME_CSS_HREF</code>), and the theme runtime (<code>THEME_JS_HREF</code>) are wired into pages by the framework's server; this package only produces their contents.</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { PerformanceBudgets, SeoConfig, SecurityConfig } from '@wrnexus/core';
|
||||
import { PluginInput } from '@wrnexus/plugin';
|
||||
import { PluginInput, PluginPermission } from '@wrnexus/plugin';
|
||||
import { StorageConfig } from '@wrnexus/uploader';
|
||||
|
||||
/**
|
||||
@@ -191,7 +198,12 @@ import { StorageConfig } from '@wrnexus/uploader';
|
||||
* present before the first paint. The reserved token key `color-scheme` is
|
||||
* emitted as the native CSS property instead of a custom property.
|
||||
*/
|
||||
type ThemeTokens = Record<string, string>;
|
||||
type ThemeSemanticColor = "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "error";
|
||||
type ThemeToken = "color-scheme" | "color-bg" | "color-background" | "color-foreground" | "color-surface" | "color-surface-2" | "color-surface-raised" | "color-surface-muted" | "color-text" | "color-text-muted" | "color-text-subtle" | "color-muted" | "color-border" | "color-border-strong" | "color-code-background" | "color-code-surface" | "color-code-text" | "color-code-muted" | "color-code-border" | `color-${ThemeSemanticColor}` | `color-${ThemeSemanticColor}-${"hover" | "active" | "contrast" | "soft" | "muted" | "text"}` | `color-on-${"primary" | "secondary"}` | "radius" | "radius-sm" | "shadow-1" | "shadow-sm" | "shadow-md" | "shadow-lg" | "space-section" | "space-section-sm" | "container-max" | "font-sans";
|
||||
/** Known tokens get autocomplete while applications may add namespaced custom tokens. */
|
||||
type ThemeTokens = Partial<Record<ThemeToken, string>> & Record<string, string>;
|
||||
declare function defineThemeTokens<T extends ThemeTokens>(tokens: T): T;
|
||||
declare function themeVar(token: ThemeToken, fallback?: string): string;
|
||||
declare const THEME_PALETTE_NAMES: readonly ["blue", "indigo", "violet", "emerald", "cyan", "rose", "amber", "slate"];
|
||||
type ThemePaletteName = (typeof THEME_PALETTE_NAMES)[number];
|
||||
/** Required semantic colors for a custom application palette. */
|
||||
@@ -345,6 +357,26 @@ declare function fontCspSources(fonts?: FontConfig): {
|
||||
font: string[];
|
||||
};
|
||||
|
||||
declare const CURRENT_COMPATIBILITY_DATE = "2026-08-02";
|
||||
declare const CURRENT_FRAMEWORK_BEHAVIOUR = 1;
|
||||
interface CompatibilityPolicy {
|
||||
compatibilityDate?: string;
|
||||
frameworkBehaviour?: number;
|
||||
}
|
||||
interface CompatibilityReport {
|
||||
configuredDate?: string;
|
||||
effectiveDate: string;
|
||||
currentDate: string;
|
||||
configuredBehaviour?: number;
|
||||
effectiveBehaviour: number;
|
||||
currentBehaviour: number;
|
||||
needsUpgrade: boolean;
|
||||
future: boolean;
|
||||
messages: string[];
|
||||
}
|
||||
declare function isCompatibilityDate(value: string): boolean;
|
||||
declare function resolveCompatibility(policy: CompatibilityPolicy): CompatibilityReport;
|
||||
|
||||
/**
|
||||
* App configuration loader (`wrnexus.config.ts`).
|
||||
*
|
||||
@@ -453,6 +485,15 @@ interface PwaConfig {
|
||||
cacheUrls?: string[];
|
||||
/** Service-worker cache key. Change it to invalidate existing PWA caches. */
|
||||
cacheName?: string;
|
||||
/** Ordered URL rules for runtime caching. Patterns are regular-expression source strings. */
|
||||
runtimeCaching?: Array<{
|
||||
pattern: string;
|
||||
strategy: "network-first" | "cache-first" | "stale-while-revalidate";
|
||||
cacheName?: string;
|
||||
methods?: string[];
|
||||
}>;
|
||||
/** Background Sync tag used by the offline mutation queue. */
|
||||
backgroundSyncTag?: string;
|
||||
}
|
||||
type DevToolbarPosition = "bottom-center" | "bottom-left" | "bottom-right";
|
||||
interface DevToolbarConfig {
|
||||
@@ -548,9 +589,16 @@ interface CompatibilityConfig {
|
||||
legacyComponentDiscovery?: boolean;
|
||||
stringLayouts?: boolean;
|
||||
}
|
||||
interface AppConfig {
|
||||
interface AppConfig extends CompatibilityPolicy {
|
||||
/** Ordered reusable configuration layers; the application always has final precedence. */
|
||||
extends?: string | string[];
|
||||
/** Compiler/dev/build plugins, resolved in deterministic pre/normal/post order. */
|
||||
plugins?: PluginInput;
|
||||
/** Optional least-privilege enforcement for automatically discovered packages. */
|
||||
pluginPermissions?: {
|
||||
enforce?: boolean;
|
||||
grants?: Record<string, PluginPermission[]>;
|
||||
};
|
||||
/** WRN v0.6 explicit import and compatibility resolution. */
|
||||
imports?: ImportsConfig;
|
||||
/** TypeScript-backed .wrn type checking and declaration generation. */
|
||||
@@ -598,6 +646,17 @@ interface AppConfig {
|
||||
i18n?: {
|
||||
default?: string;
|
||||
locales?: string[];
|
||||
labels?: Record<string, string>;
|
||||
fallbacks?: Record<string, string[]>;
|
||||
direction?: Record<string, "ltr" | "rtl">;
|
||||
cookie?: {
|
||||
name?: string;
|
||||
maxAge?: number;
|
||||
path?: string;
|
||||
sameSite?: "Strict" | "Lax" | "None";
|
||||
secure?: boolean;
|
||||
};
|
||||
strict?: boolean;
|
||||
};
|
||||
/** Default database connection (driver + url); reached with `getDb()`. */
|
||||
db?: {
|
||||
@@ -647,6 +706,11 @@ declare function resolveProfile(options?: {
|
||||
explicit?: string;
|
||||
mode?: Mode;
|
||||
}): string;
|
||||
interface ResolvedConfigLayers {
|
||||
config: AppConfig;
|
||||
sources: string[];
|
||||
}
|
||||
declare function resolveConfigLayers(appRoot: string, application: AppConfig): Promise<ResolvedConfigLayers>;
|
||||
/** Load the raw `wrnexus.config.*` (with the `profiles` map intact), or `{}`. */
|
||||
declare function loadRawConfig(appRoot: string): Promise<AppConfig>;
|
||||
/** Load `wrnexus.config.*`, applying the active profile's overrides. */
|
||||
@@ -746,7 +810,7 @@ declare function auditCssPerformance(source: string): CssPerformanceAuditIssue[]
|
||||
*/
|
||||
declare function renderStyles(ctx: StyleProcessContext, styles?: StylesConfig): Promise<string>;
|
||||
|
||||
export { ACCENT_COOKIE, type AppConfig, type BuildConfig, type ConfigIssue, type ContrastResult, type CssPerformanceAuditIssue, type CssTokenAudit, type CustomThemePalette, DEFAULT_THEMES, type DevToolbarConfig, type ExperimentalConfig, type ExplainedConfig, type FontConfig, type FontDisplay, type GoogleFont, type LocalFontFace, type MobileConfig, type Mode, type NavigationConfig, type ObservabilityConfig, type PerformanceConfig, type PwaConfig, type ResolvedTheme, type StyleProcessContext, type StyleSource, type StylesConfig, type Mode as StylesMode, THEME_COOKIE, THEME_CSS_HREF, THEME_JS_HREF, THEME_PALETTES, THEME_PALETTE_NAMES, type TenancyConfig, type ThemeAccentConfig, type ThemeConfig, type ThemePaletteName, type ThemeTokens, auditCssPerformance, auditWireTokens, bundleCss, contrast, defineConfig, explainAppConfig, findStyleEntry, fontCspSources, headToString, loadAppConfig, loadEnv, loadRawConfig, normalizeStyleSources, renderFontHead, renderProductionFontHead, renderStyles, renderThemeCss, renderThemeRuntime, resolveAccentName, resolveProfile, resolveThemeConfig, resolveThemeName, tailwindSourceDirectives, validateAppConfig };
|
||||
export { ACCENT_COOKIE, type AppConfig, type BuildConfig, CURRENT_COMPATIBILITY_DATE, CURRENT_FRAMEWORK_BEHAVIOUR, type CompatibilityPolicy, type CompatibilityReport, type ConfigIssue, type ContrastResult, type CssPerformanceAuditIssue, type CssTokenAudit, type CustomThemePalette, DEFAULT_THEMES, type DevToolbarConfig, type ExperimentalConfig, type ExplainedConfig, type FontConfig, type FontDisplay, type GoogleFont, type LocalFontFace, type MobileConfig, type Mode, type NavigationConfig, type ObservabilityConfig, type PerformanceConfig, type PwaConfig, type ResolvedConfigLayers, type ResolvedTheme, type StyleProcessContext, type StyleSource, type StylesConfig, type Mode as StylesMode, THEME_COOKIE, THEME_CSS_HREF, THEME_JS_HREF, THEME_PALETTES, THEME_PALETTE_NAMES, type TenancyConfig, type ThemeAccentConfig, type ThemeConfig, type ThemePaletteName, type ThemeSemanticColor, type ThemeToken, type ThemeTokens, auditCssPerformance, auditWireTokens, bundleCss, contrast, defineConfig, defineThemeTokens, explainAppConfig, findStyleEntry, fontCspSources, headToString, isCompatibilityDate, loadAppConfig, loadEnv, loadRawConfig, normalizeStyleSources, renderFontHead, renderProductionFontHead, renderStyles, renderThemeCss, renderThemeRuntime, resolveAccentName, resolveCompatibility, resolveConfigLayers, resolveProfile, resolveThemeConfig, resolveThemeName, tailwindSourceDirectives, themeVar, validateAppConfig };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>wrnexus.config.ts</h3><pre data-language="ts"><code>import type { AppConfig } from "@wrnexus/styles";
|
||||
|
||||
export default {
|
||||
@@ -817,9 +881,9 @@ const themeJs = renderThemeRuntime(theme); // served at THEME_JS_HREF</code></pr
|
||||
box-shadow: var(--wire-shadow-1);
|
||||
}</code></pre></article><article class="example-card"><h3>Rendering the theme</h3><pre data-language="html"><code><button data-wire-theme-toggle>Toggle theme</button>
|
||||
<button data-wire-theme-set="brand">Brand theme</button></code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#config-loading">Config loading</a><a class="toc-level-4" href="#appconfig">AppConfig</a><a class="toc-level-4" href="#styles-pipeline">Styles pipeline</a><a class="toc-level-4" href="#theme-system">Theme system</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#wrnexus-config-ts">wrnexus.config.ts</a><a class="toc-level-4" href="#loading-config-producing-css">Loading config + producing CSS</a><a class="toc-level-4" href="#rendering-the-theme">Rendering the theme</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#reusable-layers-and-presets">Reusable layers and presets</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#config-loading">Config loading</a><a class="toc-level-4" href="#appconfig">AppConfig</a><a class="toc-level-4" href="#styles-pipeline">Styles pipeline</a><a class="toc-level-4" href="#theme-system">Theme system</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#wrnexus-config-ts">wrnexus.config.ts</a><a class="toc-level-4" href="#loading-config-producing-css">Loading config + producing CSS</a><a class="toc-level-4" href="#rendering-the-theme">Rendering the theme</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,13 +10,14 @@ page wrnexussyntax {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/syntax</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/syntax</h1><p>Editor syntax definitions and language tooling for .wrn files.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/syntax@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Canonical WRN lexer, parser, AST, language metadata, source positions, and stable diagnostics. Framework tooling should import this package instead of implementing a separate <code>.wrn</code> parser.</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/syntax</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/syntax</h1><p>Editor syntax definitions and language tooling for .wrn files.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/syntax@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Canonical WRN lexer, parser, AST, language metadata, source positions, and stable diagnostics. Framework tooling should import this package instead of implementing a separate <code>.wrn</code> parser.</p>
|
||||
<p>See <code>docs/WRN-LANGUAGE-SPEC-1.0.md</code> in the WRNexusJS repository.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { LexError, Lexer } from './tokenizer.js';
|
||||
export { A as ActionBlock, a as ApiBlock, b as Attr, C as ComputedDecl, D as DataApiBlock, c as DataMode, E as EffectBlock, d as EventDecl, F as FunctionParameterDecl, e as FunctionRuntime, L as LifecycleBlock, f as LoadBlock, M as ModeFunctionsBlock, O as OutputDecl, P as PageAst, g as ParseError, h as PersistDecl, i as PropDecl, R as RealtimeBlock, j as RealtimeHandler, k as RuntimeFunctionDecl, S as SeoBlock, l as StateDecl, m as StateRuntime, n as StoreKind, o as StoreLifecycleDecl, p as StructuredImportDecl, V as VOID_ELEMENTS, q as ViewNode, W as WatchBlock, r as parse, s as parseComputedDeclarations, t as parseHtmlView, u as parseOutputs, v as parsePersist, w as parseRuntimeFunctions, x as parseStateDeclarations, y as parseStoreLifecycle, z as parseStructuredImports, B as stripRuntimeFunctionModifiers } from './parser-BGaF5Zdu.js';
|
||||
export { FormatWrnOptions, formatWrn } from './formatter.js';
|
||||
export { A as ActionBlock, a as ApiBlock, b as Attr, C as ComputedDecl, D as DataApiBlock, c as DataMode, E as EffectBlock, d as EventDecl, F as FunctionParameterDecl, e as FunctionRuntime, L as LifecycleBlock, f as LoadBlock, M as ModeFunctionsBlock, O as OutputDecl, P as PageAst, g as ParseError, h as PersistDecl, i as PropDecl, R as RealtimeBlock, j as RealtimeHandler, k as RuntimeFunctionDecl, S as SeoBlock, l as StateDecl, m as StateRuntime, n as StoreKind, o as StoreLifecycleDecl, p as StructuredImportDecl, V as VOID_ELEMENTS, q as ViewNode, W as WatchBlock, r as parse, s as parseComputedDeclarations, t as parseHtmlView, u as parseOutputs, v as parsePersist, w as parseRuntimeFunctions, x as parseStateDeclarations, y as parseStoreLifecycle, z as parseStructuredImports, B as stripRuntimeFunctionModifiers } from './parser-CTLO4mcT.js';
|
||||
export { RuntimeType, eraseFunctionTypes, inferredRuntimeType, runtimeTypeOf, validateTypedInitializer } from './types.js';
|
||||
import { WrnDiagnostic } from './diagnostics.js';
|
||||
export { DiagnoseOptions, WrnDiagnosticSeverity, WrnSourcePosition, assertValidAst, classifyParseError, containsReadonlyPropMutation, diagnose, diagnosticFromError, formatDiagnostic, isHydrationStrategy, isRuntimeTarget, positionAt } from './diagnostics.js';
|
||||
@@ -48,7 +49,7 @@ const ast = parse('component Greeting { view { <p>Hello</p>
|
||||
const summary = diagnosticSummary(diagnose(source));</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexustest {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/test</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/test</h1><p>WRNexusJS-aware component, route, and browser testing utilities.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/test@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Testing utilities for WRNexusJS apps — component rendering, reactive-DOM mounting, route handler calls, and a full in-process app harness, plus a one-import re-export of <code>bun:test</code>.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/test</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/test</h1><p>WRNexusJS-aware component, route, and browser testing utilities.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/test@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Testing utilities for WRNexusJS apps — component rendering, reactive-DOM mounting, route handler calls, and a full in-process app harness, plus a one-import re-export of <code>bun:test</code>.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/test</code> is the server-side test toolkit you reach for when writing tests for a WRNexusJS app. It runs under <code>bun test</code> (invoked via <code>wrnexus test</code>) and gives you a single import surface: the <code>bun:test</code> primitives (<code>test</code>, <code>expect</code>, <code>mock</code>, …) re-exported alongside WRNexusJS-aware helpers that compile <code>.wrn</code> components, hydrate server HTML in a DOM, invoke API route handlers, and boot the real app on an ephemeral port for integration tests.</p>
|
||||
@@ -65,6 +65,15 @@ interface Harness {
|
||||
}</code></pre>
|
||||
<p>Boots the app at <code>projectRoot</code> on an ephemeral port (<code>port: 0</code>) for integration tests covering pages, API routes, middleware, and the full request pipeline. Loads env and app config for the given <code>profile</code> (default <code>"test"</code>) so it picks up your test database/env. The server runs in <code>development</code> mode with HMR disabled. Remember to <code>await app.close()</code> when done.</p>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<p>The CLI supports focused suites by file or directory convention:</p>
|
||||
<pre data-language="bash"><code>wrnexus test unit # *.unit.test.ts or test/unit/**
|
||||
wrnexus test component # *.component.test.ts or test/component/**
|
||||
wrnexus test api # *.api.test.ts or test/api/**
|
||||
wrnexus test accessibility # *.a11y.test.ts / *.accessibility.test.ts
|
||||
wrnexus test performance # *.performance.test.ts / *.benchmark.test.ts
|
||||
wrnexus test browser # Playwright project when configured
|
||||
wrnexus test visual # Playwright tests tagged @visual</code></pre>
|
||||
<p>Pass the application directory after the level, for example <code>wrnexus test component examples/basic-app</code>. A focused command fails clearly when no matching suite exists instead of silently running unrelated tests.</p>
|
||||
<pre data-language="ts"><code>import { test, expect, renderComponent, mountHtml, createHarness } from "@wrnexus/test";
|
||||
|
||||
test("counter renders its label", async () => {
|
||||
@@ -138,6 +147,38 @@ declare class MemoryCookieJar {
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
interface TransactionalDatabase {
|
||||
tx<T>(callback: (transaction: TransactionalDatabase) => Promise<T>): Promise<T>;
|
||||
}
|
||||
/** Run test work in a real transaction and always force rollback. */
|
||||
declare function withDatabaseRollback<T>(db: TransactionalDatabase, run: (transaction: TransactionalDatabase) => T | Promise<T>): Promise<T>;
|
||||
declare function createFactory<T extends Record<string, unknown>>(build: (sequence: number) => T): {
|
||||
build(overrides?: Partial<T>): T;
|
||||
buildMany(count: number, overrides?: Partial<T>): T[];
|
||||
reset(): void;
|
||||
};
|
||||
interface BrowserArtifactPage {
|
||||
screenshot(options: {
|
||||
path: string;
|
||||
fullPage?: boolean;
|
||||
}): Promise<unknown>;
|
||||
context(): {
|
||||
tracing?: {
|
||||
stop(options: {
|
||||
path: string;
|
||||
}): Promise<unknown>;
|
||||
};
|
||||
};
|
||||
}
|
||||
declare function captureBrowserArtifacts(page: BrowserArtifactPage, testName: string, options?: {
|
||||
root?: string;
|
||||
screenshot?: boolean;
|
||||
trace?: boolean;
|
||||
}): Promise<{
|
||||
screenshot?: string;
|
||||
trace?: string;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* @wrnexus/test — testing utilities for WRNexusJS apps. Runs on `bun test` (via
|
||||
* `wrnexus test`). Import everything from one place:
|
||||
@@ -193,8 +234,14 @@ interface HarnessOptions {
|
||||
*/
|
||||
declare function createHarness(projectRoot: string, options?: HarnessOptions): Promise<Harness>;
|
||||
|
||||
export { type Deferred, type Harness, type HarnessOptions, type JsonResponse, MemoryCookieJar, type TestRequestOptions, type WaitForOptions, callRoute, createHarness, deferred, expectProblem, mountHtml, readJsonResponse, renderComponent, testContext, testRequest, waitFor };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Typical usage</h3><pre data-language="ts"><code>import { test, expect, renderComponent, mountHtml, createHarness } from "@wrnexus/test";
|
||||
export { type BrowserArtifactPage, type Deferred, type Harness, type HarnessOptions, type JsonResponse, MemoryCookieJar, type TestRequestOptions, type TransactionalDatabase, type WaitForOptions, callRoute, captureBrowserArtifacts, createFactory, createHarness, deferred, expectProblem, mountHtml, readJsonResponse, renderComponent, testContext, testRequest, waitFor, withDatabaseRollback };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>The CLI supports focused suites by file or directory convention</h3><pre data-language="bash"><code>wrnexus test unit # *.unit.test.ts or test/unit/**
|
||||
wrnexus test component # *.component.test.ts or test/component/**
|
||||
wrnexus test api # *.api.test.ts or test/api/**
|
||||
wrnexus test accessibility # *.a11y.test.ts / *.accessibility.test.ts
|
||||
wrnexus test performance # *.performance.test.ts / *.benchmark.test.ts
|
||||
wrnexus test browser # Playwright project when configured
|
||||
wrnexus test visual # Playwright tests tagged @visual</code></pre></article><article class="example-card"><h3>suite exists instead of silently running unrelated tests.</h3><pre data-language="ts"><code>import { test, expect, renderComponent, mountHtml, createHarness } from "@wrnexus/test";
|
||||
|
||||
test("counter renders its label", async () => {
|
||||
const html = await renderComponent(SRC, { start: 3, label: "Hits" });
|
||||
@@ -220,7 +267,7 @@ test("health endpoint", async () => {
|
||||
});</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#re-exported-test-primitives">Re-exported test primitives</a><a class="toc-level-4" href="#rendercomponent-source-props">renderComponent(source, props?)</a><a class="toc-level-4" href="#mounthtml-html">mountHtml(html)</a><a class="toc-level-4" href="#callroute-handler-request">callRoute(handler, request)</a><a class="toc-level-4" href="#createharness-projectroot-options">createHarness(projectRoot, options?)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexustracking {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/tracking</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/tracking</h1><p>Error/event capture, middleware, filtering, and sinks.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/tracking@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Error tracking for WRNexusJS apps: capture exceptions manually or via middleware and fan them out to pluggable sinks.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/tracking</span></nav><section class="doc-intro"><span class="eyebrow">Runtime · Package reference</span><h1>@wrnexus/tracking</h1><p>Error/event capture, middleware, filtering, and sinks.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Runtime</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/tracking@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>Error tracking for WRNexusJS apps: capture exceptions manually or via middleware and fan them out to pluggable sinks.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/tracking</code> is a small, server-side error-capture layer. You create a tracker with one or more <strong>sinks</strong>, then feed it errors — either manually with <code>tracker.capture(err, context)</code> or automatically by mounting <code>tracker.middleware()</code> in your request pipeline. A <code>consoleSink</code> is included; forwarding to Sentry, Datadog, or any other backend is just a matter of writing a tiny sink. Reach for it when you want a single, sink-agnostic place to route application errors. Sinks run best-effort — a throwing sink never breaks the request.</p>
|
||||
@@ -199,7 +199,7 @@ const tracker = createTracker({
|
||||
tracker.addSink(anotherSink); // add more sinks later</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#createtracker-options-tracker">createTracker(options?): Tracker</a><a class="toc-level-4" href="#consolesink-errorsink">consoleSink: ErrorSink</a><a class="toc-level-4" href="#types">Types</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
page wrnexustypecheck {
|
||||
seo {
|
||||
title = "@wrnexus/typecheck"
|
||||
description = "WRN-aware TypeScript diagnostics and virtual documents."
|
||||
}
|
||||
|
||||
view {
|
||||
<div class="docs-shell">
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/typecheck</span></nav><section class="doc-intro"><span class="eyebrow">Tooling · Package reference</span><h1>@wrnexus/typecheck</h1><p>WRN-aware TypeScript diagnostics and virtual documents.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Tooling</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/typecheck@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Static type checking for <code>.wrn</code> declarations, props, state, outputs, functions, stores, and generated virtual TypeScript files.</p>
|
||||
<p>The package is compiler tooling rather than a browser UI package, so its public kit consists of programmatic typecheck helpers and diagnostics.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { PageAst } from '@wrnexus/syntax';
|
||||
export { componentContract, storeContract } from './contracts.js';
|
||||
export { findAppRoot, loadApplicationTypes } from './project.js';
|
||||
|
||||
interface WrnTypeDiagnostic {
|
||||
code: string;
|
||||
category: "error" | "warning" | "info";
|
||||
message: string;
|
||||
file: string;
|
||||
line: number;
|
||||
column: number;
|
||||
length: number;
|
||||
expected?: string;
|
||||
received?: string;
|
||||
hint?: string;
|
||||
related?: {
|
||||
file: string;
|
||||
line: number;
|
||||
column: number;
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
interface TypecheckOptions {
|
||||
filePath?: string;
|
||||
appRoot?: string;
|
||||
strict?: boolean;
|
||||
noImplicitAny?: boolean;
|
||||
strictNullChecks?: boolean;
|
||||
checkRuntimeBoundaries?: boolean;
|
||||
}
|
||||
interface SourceMapping {
|
||||
virtualStartLine: number;
|
||||
virtualEndLine: number;
|
||||
sourceStartLine: number;
|
||||
sourceStartColumn: number;
|
||||
}
|
||||
interface VirtualTypeScriptModule {
|
||||
ast: PageAst;
|
||||
fileName: string;
|
||||
code: string;
|
||||
mappings: SourceMapping[];
|
||||
}
|
||||
declare function virtualTypeScriptModule(source: string, filePath?: string, appRoot?: string): VirtualTypeScriptModule;
|
||||
declare function checkWrnSource(source: string, options?: TypecheckOptions): WrnTypeDiagnostic[];
|
||||
declare function checkWrnFile(filePath: string, options?: Omit<TypecheckOptions, "filePath">): WrnTypeDiagnostic[];
|
||||
|
||||
export { type TypecheckOptions, type VirtualTypeScriptModule, type WrnTypeDiagnostic, checkWrnFile, checkWrnSource, virtualTypeScriptModule };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Install @wrnexus/typecheck</h3><pre data-language="sh"><code>bun add @wrnexus/typecheck</code></pre></article><article class="example-card"><h3>Import @wrnexus/typecheck</h3><pre data-language="ts"><code>import * as typecheck from "@wrnexus/typecheck";</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ page wrnexusui {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ui</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/ui</h1><p>Themeable server-rendered UI components and CSS.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ui@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>First-party Wire UI component library — a set of themeable <code>.wrn</code> components plus a single tokenized stylesheet.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/ui</span></nav><section class="doc-intro"><span class="eyebrow">Frontend · Package reference</span><h1>@wrnexus/ui</h1><p>Themeable server-rendered UI components and CSS.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Frontend</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/ui@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>First-party Wire UI component library — a set of themeable <code>.wrn</code> components plus a single tokenized stylesheet.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p><code>@wrnexus/ui</code> ships a library of server-rendered <code>.wrn</code> components (layout, form controls, and feedback UI) together with one themeable stylesheet, <code>ui.css</code>. The components are <strong>auto-discovered</strong> by the framework router — you don't import them in code. Once the package's component directory is on the router's scan path, you mount any component in a page with <code>data-component="<name>"</code>. Every visual is driven by <code>var(--wire-*)</code> theme tokens, so components restyle instantly when the theme changes. The tiny JS surface (<code>src/index.ts</code>) exists only so the toolchain (CLI build + dev server) can locate the component directory and stylesheet.</p>
|
||||
@@ -155,7 +155,7 @@ const router = buildRouter(appDir, { componentDirs: [uiComponentsDir()] 
|
||||
</div></code></pre></article></div></section><section class="prose component-catalog-callout"><h2>Explore the component library</h2><p>Browse interactive examples and complete component usage in the dedicated WRNexusJS component showcase.</p><p><a class="primary" href="https://component.wrnexusjs.dev/">Browse all 108 components →</a></p></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#components">Components</a><a class="toc-level-4" href="#layout">Layout</a><a class="toc-level-4" href="#core-feedback">Core / feedback</a><a class="toc-level-4" href="#additional-controls-data-display">Additional controls & data display</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#ui-css-asset-export">./ui.css asset export</a><a class="toc-level-4" href="#tailwind-and-motion">Tailwind and motion</a><a class="toc-level-4" href="#using-the-selected-theme-in-application-ui">Using the selected theme in application UI</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#auto-discovery">Auto-discovery</a><a class="toc-level-4" href="#mounting-components-in-a-page">Mounting components in a page</a><a class="toc-level-3" href="#overrides">Overrides</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ page wrnexusuploader {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/uploader</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/uploader</h1><p>Validated local/S3 uploads and secure file serving.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/uploader@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Config-driven file uploads + serving for <a href="https://www.npmjs.com/org/wrnexus" rel="noreferrer">WRNexusJS</a>. Declare named <strong>storage stores</strong> (local disk or any S3-compatible backend) in <code>wrnexus.config.ts</code>, upload with one function call, drop a drag-and-drop widget on a page, and serve files back — public or private. Zero external dependencies (S3 is signed with a built-in AWS SigV4 implementation, like the rest of the framework).</p>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/uploader</span></nav><section class="doc-intro"><span class="eyebrow">Data · Package reference</span><h1>@wrnexus/uploader</h1><p>Validated local/S3 uploads and secure file serving.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Data</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/uploader@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><p>Config-driven file uploads + serving for <a href="https://www.npmjs.com/org/wrnexus" rel="noreferrer">WRNexusJS</a>. Declare named <strong>storage stores</strong> (local disk or any S3-compatible backend) in <code>wrnexus.config.ts</code>, upload with one function call, drop a drag-and-drop widget on a page, and serve files back — public or private. Zero external dependencies (S3 is signed with a built-in AWS SigV4 implementation, like the rest of the framework).</p>
|
||||
<h3 id="usage">Usage</h3>
|
||||
<h4 id="configure-local-and-s3-stores">Configure local and S3 stores</h4>
|
||||
<pre data-language="ts"><code>// wrnexus.config.ts
|
||||
@@ -88,6 +88,7 @@ await getStore("docs").driver.delete(files[0].key);</code></pre>
|
||||
import { serveFromStore } from "@wrnexus/uploader";
|
||||
export const GET = serveFromStore("docs"); // your middleware decides who gets in</code></pre>
|
||||
<h3 id="api">API</h3>
|
||||
<p>Uploads can participate in security and media pipelines without changing storage drivers. Pass a <code>scan</code> hook to reject malware/DLP findings before storage, and <code>afterStore</code> to enqueue image/video processing or indexing. If post-processing throws, WRNexus deletes the newly written object so a partially accepted upload is never left behind.</p>
|
||||
<div class="table-wrap"><table>
|
||||
<thead><tr><th>Export</th><th>What</th></tr></thead>
|
||||
<tbody><tr><td><code>handleUpload(opts)</code></td><td>POST route handler → JSON <code>{ ok, files }</code></td></tr><tr><td><code>upload(store, req, opts)</code></td><td>Parse + validate + store; returns <code>{ files }</code></td></tr><tr><td><code>serveFromStore(store)</code></td><td>Route handler that streams an object back (gate it for private)</td></tr><tr><td><code>getStore(name?)</code> / <code>hasStorage(name?)</code></td><td>Reach a store's <code>driver</code> (<code>put</code>/<code>get</code>/<code>delete</code>/<code>publicUrl</code>)</td></tr><tr><td><code>configureStorage(config, root)</code></td><td>Build the registry (the framework calls this at startup)</td></tr><tr><td><code>s3Driver</code> / <code>localDriver</code> / <code>signS3</code></td><td>Lower-level building blocks</td></tr></tbody></table></div>
|
||||
@@ -97,7 +98,28 @@ export const GET = serveFromStore("docs"); // your middleware decides
|
||||
<li>SigV4 signing is implemented from scratch (no <code>@aws-sdk</code>); tested against local S3 semantics.</li>
|
||||
<p>Live AWS/R2 connectivity depends on your credentials + bucket policy.</p>
|
||||
<li>v1 buffers each file in memory up to its size cap (fine for images/docs up to tens of MB).</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Context } from '@wrnexus/core';
|
||||
</ul>
|
||||
<h3 id="helper-and-component-kit">Helper and component kit</h3>
|
||||
<p>Use <code>formatFileSize</code>, <code>uploadAccept</code>, <code>uploadedFileMap</code>, <code>uploaderAttributes</code>, and <code>assertUploadedFiles</code> to keep upload forms and server validation consistent.</p>
|
||||
<p>Enable <code>uploaderPlugin()</code> for:</p>
|
||||
<ul>
|
||||
<li><code><UploadDropzone /></code></li>
|
||||
<li><code><UploadStatus /></code></li>
|
||||
</ul>
|
||||
<p>The complete blocks compose <code>Card</code>, <code>Alert</code>, and <code>Badge</code> from <code>@wrnexus/ui</code>; the specialized upload runtime remains responsible for the native file input and secure transport behavior. Large files can use <code>createResumableUploadManager</code>. Sessions are bounded and expiring; chunks may arrive out of order, carry SHA-256 checksums, and are idempotent when retried. Conflicting retries reject, and the object is assembled only after every exact-sized chunk is present.</p>
|
||||
<pre data-language="ts"><code>const uploads = createResumableUploadManager({
|
||||
driver: getStore("documents").driver,
|
||||
sessions: redisUploadSessionStore,
|
||||
chunkSize: 5 * 1024 * 1024,
|
||||
maxBytes: 500 * 1024 * 1024,
|
||||
accept: ["application/pdf"],
|
||||
});
|
||||
|
||||
const session = await uploads.create({ name: "report.pdf", size, type });
|
||||
await uploads.uploadChunk(session.id, index, bytes, sha256);</code></pre>
|
||||
<p>The included memory session store is intended for one-process apps and tests. Multi-instance production deployments should implement <code>ResumableSessionStore</code> with shared durable storage and atomic session updates, and periodically call <code>prune()</code> for abandoned uploads.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>import { Context } from '@wrnexus/core';
|
||||
export { UploaderPluginOptions, uploaderComponentsDir, default as uploaderPlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
/**
|
||||
* Storage driver contract + config types.
|
||||
@@ -227,6 +249,25 @@ interface UploadOptions {
|
||||
accept?: string[];
|
||||
/** Key prefix, e.g. `"avatars"` → keys become `avatars/<yyyy>/<mm>/<rand>.<ext>`. */
|
||||
prefix?: string;
|
||||
/** Virus/DLP/content scanner invoked before bytes enter storage. Throw or return unsafe to reject. */
|
||||
scan?: (file: UploadScanInput) => UploadScanResult | Promise<UploadScanResult>;
|
||||
/** Image/video/indexing hook invoked after storage. Failure removes the just-written object. */
|
||||
afterStore?: (file: UploadedFile & {
|
||||
bytes: Uint8Array;
|
||||
store: Store;
|
||||
}) => void | Promise<void>;
|
||||
}
|
||||
interface UploadScanInput {
|
||||
name: string;
|
||||
type: string;
|
||||
size: number;
|
||||
bytes: Uint8Array;
|
||||
store: Store;
|
||||
}
|
||||
interface UploadScanResult {
|
||||
safe: boolean;
|
||||
reason?: string;
|
||||
scanner?: string;
|
||||
}
|
||||
/** A 4xx-carrying error so `handleUpload` can map it to a status. */
|
||||
declare class UploadError extends Error {
|
||||
@@ -401,7 +442,145 @@ interface SignedFileToken {
|
||||
declare function createSignedFileToken(input: SignedFileToken, secret: string): Promise<string>;
|
||||
declare function verifySignedFileToken(token: string, secret: string, now?: number): Promise<SignedFileToken | null>;
|
||||
|
||||
export { type LocalStoreConfig, type PutMeta, type S3StoreConfig, type SignedFileToken, type StorageConfig, type StorageDriver, type Store, type StoreAccess, type StoreConfig, type StoredObject, UPLOADS_PREFIX, UPLOAD_JS_HREF, UPLOAD_RUNTIME, UploadError, type UploadInspection, type UploadOptions, type UploadPolicy, UploadPolicyError, type UploadedFile, accepts, configureStorage, contentTypeOf, createSignedFileToken, encodeKey, enforceUploadPolicy, extForType, extOf, getStore, handleUpload, hasStorage, inspectUpload, localDriver, s3Driver, safeObjectKey, serveFromStore, serveStoredFile, sha256Hex, signS3, sniffContentType, storeNames, storedUrl, upload, verifySignedFileToken };
|
||||
declare function formatFileSize(bytes: number, locale?: string): string;
|
||||
declare function uploadAccept(value: string | readonly string[]): string;
|
||||
declare function uploadedFileMap(files: readonly UploadedFile[]): Record<string, UploadedFile>;
|
||||
declare function uploaderAttributes(options?: {
|
||||
store?: string;
|
||||
endpoint?: string;
|
||||
accept?: string | readonly string[];
|
||||
maxBytes?: number;
|
||||
multiple?: boolean;
|
||||
field?: string;
|
||||
label?: string;
|
||||
}): Record<string, string | boolean>;
|
||||
declare function assertUploadedFiles(files: readonly UploadedFile[], options?: {
|
||||
min?: number;
|
||||
max?: number;
|
||||
}): readonly UploadedFile[];
|
||||
|
||||
interface ResumableUploadSession {
|
||||
id: string;
|
||||
key: string;
|
||||
name: string;
|
||||
type: string;
|
||||
size: number;
|
||||
chunkSize: number;
|
||||
totalChunks: number;
|
||||
createdAt: number;
|
||||
expiresAt: number;
|
||||
chunks: Record<number, Uint8Array>;
|
||||
digests: Record<number, string>;
|
||||
}
|
||||
interface ResumableSessionStore {
|
||||
get(id: string): Promise<ResumableUploadSession | null>;
|
||||
put(session: ResumableUploadSession): Promise<void>;
|
||||
delete(id: string): Promise<void>;
|
||||
list(): Promise<ResumableUploadSession[]>;
|
||||
}
|
||||
declare function memoryResumableSessionStore(): ResumableSessionStore;
|
||||
interface ResumableUploadManagerOptions {
|
||||
driver: StorageDriver;
|
||||
sessions?: ResumableSessionStore;
|
||||
maxBytes?: number;
|
||||
chunkSize?: number;
|
||||
maxSessions?: number;
|
||||
ttlMs?: number;
|
||||
accept?: string[];
|
||||
prefix?: string;
|
||||
publicUrl?: (key: string) => string | null;
|
||||
now?: () => number;
|
||||
}
|
||||
interface CreateResumableUpload {
|
||||
name: string;
|
||||
type?: string;
|
||||
size: number;
|
||||
chunkSize?: number;
|
||||
}
|
||||
interface ResumableChunkResult {
|
||||
receivedChunks: number;
|
||||
totalChunks: number;
|
||||
complete: boolean;
|
||||
file?: UploadedFile;
|
||||
}
|
||||
interface ResumableUploadManager {
|
||||
create(input: CreateResumableUpload): Promise<ResumableUploadSession>;
|
||||
uploadChunk(id: string, index: number, data: Uint8Array, sha256?: string): Promise<ResumableChunkResult>;
|
||||
status(id: string): Promise<{
|
||||
received: number[];
|
||||
totalChunks: number;
|
||||
expiresAt: number;
|
||||
} | null>;
|
||||
cancel(id: string): Promise<boolean>;
|
||||
prune(): Promise<number>;
|
||||
}
|
||||
declare function createResumableUploadManager(options: ResumableUploadManagerOptions): ResumableUploadManager;
|
||||
|
||||
interface QuotaUsage {
|
||||
owner: string;
|
||||
bytes: number;
|
||||
objects: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
interface QuotaStore {
|
||||
get(owner: string): Promise<QuotaUsage>;
|
||||
reserve(owner: string, bytes: number, limits: {
|
||||
bytes: number;
|
||||
objects?: number;
|
||||
}): Promise<boolean>;
|
||||
release(owner: string, bytes: number): Promise<void>;
|
||||
}
|
||||
declare function memoryQuotaStore(): QuotaStore;
|
||||
interface QuotaSqlClient {
|
||||
query<T = any>(sql: string, parameters?: unknown[]): Promise<{
|
||||
rows: T[];
|
||||
}>;
|
||||
}
|
||||
/** PostgreSQL quota accounting using a single atomic conditional upsert. */
|
||||
declare function postgresQuotaStore(db: QuotaSqlClient, table?: string): QuotaStore;
|
||||
declare const POSTGRES_QUOTA_SCHEMA = "CREATE TABLE IF NOT EXISTS wrnexus_storage_quota (owner text PRIMARY KEY, bytes bigint NOT NULL DEFAULT 0, objects integer NOT NULL DEFAULT 0, updated_at bigint NOT NULL);";
|
||||
interface MultipartObjectClient {
|
||||
create(key: string, meta: PutMeta): Promise<string>;
|
||||
uploadPart(uploadId: string, key: string, part: number, bytes: Uint8Array): Promise<string>;
|
||||
complete(uploadId: string, key: string, parts: Array<{
|
||||
part: number;
|
||||
etag: string;
|
||||
}>): Promise<void>;
|
||||
abort(uploadId: string, key: string): Promise<void>;
|
||||
}
|
||||
declare function multipartUpload(client: MultipartObjectClient, key: string, bytes: Uint8Array, meta: PutMeta, options?: {
|
||||
partBytes?: number;
|
||||
concurrency?: number;
|
||||
}): Promise<void>;
|
||||
interface TemporaryObject {
|
||||
key: string;
|
||||
expiresAt: number;
|
||||
}
|
||||
declare function createTemporaryObjectCleaner(driver: StorageDriver, options?: {
|
||||
now?: () => number;
|
||||
limit?: number;
|
||||
}): {
|
||||
track(key: string, ttlMs: number): void;
|
||||
cleanup(at?: number): Promise<number>;
|
||||
snapshot: () => {
|
||||
tracked: number;
|
||||
nextExpiry: number | undefined;
|
||||
};
|
||||
};
|
||||
interface VideoTranscodeOptions {
|
||||
format: "mp4" | "webm";
|
||||
width?: number;
|
||||
height?: number;
|
||||
videoBitrateKbps?: number;
|
||||
}
|
||||
declare function ffmpegVideoTranscoder(options?: {
|
||||
executable?: string;
|
||||
spawn?: (args: string[]) => {
|
||||
exited: Promise<number>;
|
||||
};
|
||||
}): (input: string, output: string, config: VideoTranscodeOptions) => Promise<void>;
|
||||
|
||||
export { type CreateResumableUpload, type LocalStoreConfig, type MultipartObjectClient, POSTGRES_QUOTA_SCHEMA, type PutMeta, type QuotaSqlClient, type QuotaStore, type QuotaUsage, type ResumableChunkResult, type ResumableSessionStore, type ResumableUploadManager, type ResumableUploadManagerOptions, type ResumableUploadSession, type S3StoreConfig, type SignedFileToken, type StorageConfig, type StorageDriver, type Store, type StoreAccess, type StoreConfig, type StoredObject, type TemporaryObject, UPLOADS_PREFIX, UPLOAD_JS_HREF, UPLOAD_RUNTIME, UploadError, type UploadInspection, type UploadOptions, type UploadPolicy, UploadPolicyError, type UploadScanInput, type UploadScanResult, type UploadedFile, type VideoTranscodeOptions, accepts, assertUploadedFiles, configureStorage, contentTypeOf, createResumableUploadManager, createSignedFileToken, createTemporaryObjectCleaner, encodeKey, enforceUploadPolicy, extForType, extOf, ffmpegVideoTranscoder, formatFileSize, getStore, handleUpload, hasStorage, inspectUpload, localDriver, memoryQuotaStore, memoryResumableSessionStore, multipartUpload, postgresQuotaStore, s3Driver, safeObjectKey, serveFromStore, serveStoredFile, sha256Hex, signS3, sniffContentType, storeNames, storedUrl, upload, uploadAccept, uploadedFileMap, uploaderAttributes, verifySignedFileToken };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Configure local and S3 stores</h3><pre data-language="ts"><code>// wrnexus.config.ts
|
||||
import type { AppConfig } from "@wrnexus/styles";
|
||||
|
||||
@@ -451,9 +630,9 @@ await getStore("docs").driver.delete(files[0].key);</code></pre></arti
|
||||
></div></code></pre></article><article class="example-card"><h3>Serve private files behind application authentication</h3><pre data-language="ts"><code>// app/api/files/[key].ts
|
||||
import { serveFromStore } from "@wrnexus/uploader";
|
||||
export const GET = serveFromStore("docs"); // your middleware decides who gets in</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#configure-local-and-s3-stores">Configure local and S3 stores</a><a class="toc-level-4" href="#upload-from-an-api-route-or-server-function">Upload from an API route or server function</a><a class="toc-level-4" href="#add-a-client-upload-widget">Add a client upload widget</a><a class="toc-level-4" href="#serve-private-files-behind-application-authentication">Serve private files behind application authentication</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#notes">Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-4" href="#configure-local-and-s3-stores">Configure local and S3 stores</a><a class="toc-level-4" href="#upload-from-an-api-route-or-server-function">Upload from an API route or server function</a><a class="toc-level-4" href="#add-a-client-upload-widget">Add a client upload widget</a><a class="toc-level-4" href="#serve-private-files-behind-application-authentication">Serve private files behind application authentication</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-3" href="#notes">Notes</a><a class="toc-level-3" href="#helper-and-component-kit">Helper and component kit</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -10,12 +10,25 @@ page wrnexusvalidation {
|
||||
<header class="topbar">
|
||||
<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="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.7.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.8.0</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="https://component.wrnexusjs.dev/">Components</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main class="portal-main docs-layout">
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/validation</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/validation</h1><p>Typed schemas, coercion, validation, and browser descriptors.</p><div class="doc-meta"><span>v0.7.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/validation@0.7.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>One fluent schema, validated on the server (API bodies, env vars) and mirrored to an eval-free browser validator for forms.</blockquote>
|
||||
<article id="main" class="documentation prose standalone package-document"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span>/</span><a href="/packages">Packages</a><span>/</span><span aria-current="page">@wrnexus/validation</span></nav><section class="doc-intro"><span class="eyebrow">Security · Package reference</span><h1>@wrnexus/validation</h1><p>Typed schemas, coercion, validation, and browser descriptors.</p><div class="doc-meta"><span>v0.8.0</span><span>Private registry</span><span>Security</span></div><section id="access" class="access-callout"><h2>Install the package</h2><p>After WorkRoot approves private registry access, install the release-aligned package:</p><pre><code>bun add @wrnexus/validation@0.8.0</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide"><blockquote>One fluent schema, validated on the server (API bodies, env vars) and mirrored to an eval-free browser validator for forms.</blockquote>
|
||||
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
|
||||
<h3 id="boundary-contracts">Boundary contracts</h3>
|
||||
<p>Use <code>ContractRegistry</code> with <code>defineContract</code> or <code>defineEvent</code> to publish the same schema descriptors for APIs, actions, webhooks, realtime, queues, cron, pub/sub, plugins, configuration, and environment variables.</p>
|
||||
<pre data-language="ts"><code>import { ContractRegistry, defineEvent, v } from "@wrnexus/validation";
|
||||
|
||||
export const contracts = new ContractRegistry().register(
|
||||
defineEvent({
|
||||
name: "user.created",
|
||||
version: 1,
|
||||
consumers: ["notification-worker", "audit-service"],
|
||||
payload: v.object({ userId: v.string().uuid(), createdAt: v.string().date() }),
|
||||
}),
|
||||
);</code></pre>
|
||||
<p>Export the registry from <code>app/contracts.ts</code>, then accept a baseline with <code>wrnexus contracts snapshot</code>. CI can run <code>wrnexus contracts check</code>; removed contracts/fields, required-field additions, type changes, narrowed enums, and tighter validation fail with stable <code>WRN-CONTRACT-*</code> diagnostics and list known consumers. A generated <code>wrnexus.contracts.json</code> can be used instead of a module.</p>
|
||||
<h3 id="overview">Overview</h3>
|
||||
<p>Define a schema once with the fluent <code>v</code> builder, then reuse it in three places: <code>.parse()</code> runs server-side and returns coerced values plus per-field errors; <code>.describe()</code> emits a plain-JSON <code>SchemaDescriptor</code> that the browser runtime interprets (no <code>eval</code>, no bundled validator); and helpers like <code>parseBody</code> and <code>parseEnv</code> wire schemas straight into API routes and startup config. The server rule logic (<code>applyRule</code>/<code>checkField</code>) and the client runtime (<code>VALIDATE_RUNTIME</code>) mirror each other exactly, so a form validates identically in both places. Schemas are conventionally kept in <code>app/schemas/</code>.</p>
|
||||
<pre data-language="bash"><code>bun add @wrnexus/validation</code></pre>
|
||||
@@ -128,7 +141,46 @@ const head = `<script>${renderSchemasScript({ signup: signupSche
|
||||
<li>Refinements (<code>refine</code>) run only server-side and are never serialized — client and server agree on every other rule because both interpret the same <code>RuleDescriptor</code> list.</li>
|
||||
<li>No runtime dependencies. Ships as TypeScript source (<code>src/index.ts</code>) executed directly by Bun.</li>
|
||||
<li>Pairs with the WRNexusJS server (<code>@wrnexus/core</code>) for route handlers and the SSR layer that injects <code>renderSchemasScript</code> / <code>VALIDATE_RUNTIME</code>.</li>
|
||||
</ul></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>/**
|
||||
</ul>
|
||||
<h3 id="helper-and-component-kit">Helper and component kit</h3>
|
||||
<p>The public helper API includes <code>parseOrThrow</code>, <code>ValidationError</code>, <code>validationResponse</code>, <code>firstValidationError</code>, <code>validationSummary</code>, and <code>schemaFieldNames</code>.</p>
|
||||
<p>Schema output is inferred automatically by <code>ObjectSchema</code>, <code>parseOrThrow</code>, <code>parseBody</code>, <code>parseEnv</code>, and <code>asyncSchema</code>. Use <code>InferSchema<typeof schema></code> when a named output type is useful:</p>
|
||||
<pre data-language="ts"><code>const accountSchema = v.object({
|
||||
email: v.string().email(),
|
||||
attempts: v.number().integer(),
|
||||
});
|
||||
|
||||
type AccountInput = InferSchema<typeof accountSchema>;
|
||||
const account = parseOrThrow(accountSchema, input);
|
||||
// account.email: string
|
||||
// account.attempts: number</code></pre>
|
||||
<p>Enable <code>validationPlugin()</code> for:</p>
|
||||
<ul>
|
||||
<li><code><ValidationSummary /></code></li>
|
||||
<li><code><FieldError /></code></li>
|
||||
</ul>
|
||||
<p>The summary block composes <code>Alert</code> from <code>@wrnexus/ui</code>, while <code>FieldError</code> remains a lightweight accessible field-level primitive. Schemas can drive external contracts without maintaining a second definition:</p>
|
||||
<pre data-language="ts"><code>import {
|
||||
localizeDescriptor,
|
||||
openApiRequestBody,
|
||||
parseDescriptor,
|
||||
toJsonSchema,
|
||||
} from "@wrnexus/validation";
|
||||
|
||||
const jsonSchema = toJsonSchema(contactSchema, {
|
||||
id: "urn:example:contact",
|
||||
title: "Contact request",
|
||||
});
|
||||
const requestBody = openApiRequestBody(contactSchema);
|
||||
|
||||
const mr = localizeDescriptor(contactSchema, (key, params) =>
|
||||
translations.t(`validation.${key}`, params),
|
||||
);
|
||||
const result = parseDescriptor(mr, input);</code></pre>
|
||||
<p>JSON Schema output targets draft 2020-12, closes unknown object properties, and maps lengths/ranges/formats/enums/patterns/integer rules. OpenAPI request bodies reuse the same properties. Localized descriptors preserve explicit custom messages and fill default required, type-coercion, and rule messages; the same descriptor is consumable by server parsing and the eval-free browser runtime.</p></section><section id="api" class="api"><h2>Complete TypeScript API</h2><p>Generated from the exact installed package declarations.</p><pre data-language="typescript"><code>export { ValidationPluginOptions, validationComponentsDir, default as validationPlugin } from './plugin.js';
|
||||
import '@wrnexus/plugin';
|
||||
|
||||
/**
|
||||
* Client-side validation. `renderSchemasScript` bakes the discovered schema
|
||||
* descriptors into `window.__wireSchemas`; `VALIDATE_RUNTIME` is a generic,
|
||||
* eval-free validator that reads them and validates every `form[data-schema]`
|
||||
@@ -146,16 +198,16 @@ interface AsyncValidationContext<T> {
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
type AsyncRefinement<T> = (context: AsyncValidationContext<T>) => void | Promise<void>;
|
||||
declare class AsyncObjectSchema<T extends Record<string, unknown> = Record<string, unknown>> {
|
||||
declare class AsyncObjectSchema<T extends object = Record<string, unknown>> {
|
||||
#private;
|
||||
readonly base: ObjectSchema;
|
||||
constructor(base: ObjectSchema);
|
||||
readonly base: ObjectSchema<T>;
|
||||
constructor(base: ObjectSchema<T>);
|
||||
refine(refinement: AsyncRefinement<T>): this;
|
||||
describe(): SchemaDescriptor;
|
||||
parse(input: unknown, signal?: AbortSignal): Promise<ParseResult<T>>;
|
||||
}
|
||||
declare function asyncSchema<T extends Record<string, unknown> = Record<string, unknown>>(schema: ObjectSchema): AsyncObjectSchema<T>;
|
||||
declare function parseBodyAsync<T extends Record<string, unknown>>(schema: AsyncObjectSchema<T>, request: Request, signal?: AbortSignal): Promise<{
|
||||
declare function asyncSchema<T extends object>(schema: ObjectSchema<T>): AsyncObjectSchema<T>;
|
||||
declare function parseBodyAsync<T extends object>(schema: AsyncObjectSchema<T>, request: Request, signal?: AbortSignal): Promise<{
|
||||
ok: true;
|
||||
value: T;
|
||||
} | {
|
||||
@@ -170,6 +222,99 @@ interface OpenApiSchema {
|
||||
declare function schemaToOpenApi(schema: ObjectSchema | AsyncObjectSchema): OpenApiSchema;
|
||||
declare function mergeValidationResults<T>(...results: ParseResult<T>[]): ParseResult<T>;
|
||||
|
||||
declare class ValidationError<T = Record<string, unknown>> extends Error {
|
||||
readonly result: ParseResult<T>;
|
||||
constructor(result: ParseResult<T>);
|
||||
}
|
||||
declare function parseOrThrow<T extends object>(schema: ObjectSchema<T>, input: unknown): T;
|
||||
declare function validationResponse(result: ParseResult, options?: {
|
||||
successStatus?: number;
|
||||
failureStatus?: number;
|
||||
}): Response;
|
||||
declare function firstValidationError(errors: Record<string, string>): string | null;
|
||||
declare function validationSummary(errors: Record<string, string>): Array<{
|
||||
field: string;
|
||||
message: string;
|
||||
}>;
|
||||
declare function schemaFieldNames(schema: ObjectSchema | SchemaDescriptor): string[];
|
||||
|
||||
interface JsonSchemaDocument {
|
||||
$schema: "https://json-schema.org/draft/2020-12/schema";
|
||||
$id?: string;
|
||||
title?: string;
|
||||
type: "object";
|
||||
properties: Record<string, Record<string, unknown>>;
|
||||
required?: string[];
|
||||
additionalProperties: false;
|
||||
}
|
||||
declare function toJsonSchema(schema: ObjectSchema | SchemaDescriptor, options?: {
|
||||
id?: string;
|
||||
title?: string;
|
||||
}): JsonSchemaDocument;
|
||||
declare function openApiRequestBody(schema: ObjectSchema | SchemaDescriptor, options?: {
|
||||
description?: string;
|
||||
required?: boolean;
|
||||
contentTypes?: string[];
|
||||
}): {
|
||||
required: boolean;
|
||||
content: {
|
||||
[k: string]: {
|
||||
schema: {
|
||||
$id?: string;
|
||||
title?: string;
|
||||
type: "object";
|
||||
properties: Record<string, Record<string, unknown>>;
|
||||
required?: string[];
|
||||
additionalProperties: false;
|
||||
};
|
||||
};
|
||||
};
|
||||
description?: string | undefined;
|
||||
};
|
||||
type ValidationMessageKey = "required" | "number" | `rule.${RuleDescriptor["kind"]}`;
|
||||
type ValidationMessageTranslator = (key: ValidationMessageKey, params: Record<string, unknown>) => string;
|
||||
declare function localizeDescriptor(schema: ObjectSchema | SchemaDescriptor, translate: ValidationMessageTranslator): SchemaDescriptor;
|
||||
declare function parseDescriptor<T = Record<string, unknown>>(descriptor: SchemaDescriptor, source: Record<string, unknown>): ParseResult<T>;
|
||||
|
||||
type ContractKind = "api" | "action" | "webhook" | "realtime" | "queue" | "cron" | "pubsub" | "plugin" | "config" | "env";
|
||||
interface ContractDefinition<T extends object = Record<string, unknown>> {
|
||||
kind: ContractKind;
|
||||
name: string;
|
||||
version: number;
|
||||
payload: ObjectSchema<T> | SchemaDescriptor;
|
||||
consumers?: string[];
|
||||
description?: string;
|
||||
}
|
||||
interface ContractRecord {
|
||||
kind: ContractKind;
|
||||
name: string;
|
||||
version: number;
|
||||
payload: SchemaDescriptor;
|
||||
consumers: string[];
|
||||
description?: string;
|
||||
}
|
||||
interface ContractSnapshot {
|
||||
format: 1;
|
||||
contracts: ContractRecord[];
|
||||
}
|
||||
interface ContractIssue {
|
||||
code: "WRN-CONTRACT-REMOVED" | "WRN-CONTRACT-FIELD-REMOVED" | "WRN-CONTRACT-FIELD-REQUIRED" | "WRN-CONTRACT-FIELD-TYPE" | "WRN-CONTRACT-RULE-TIGHTENED";
|
||||
contract: string;
|
||||
field?: string;
|
||||
message: string;
|
||||
consumers: string[];
|
||||
}
|
||||
declare function defineContract<T extends object>(definition: ContractDefinition<T>): ContractDefinition<T>;
|
||||
declare function defineEvent<T extends object>(definition: Omit<ContractDefinition<T>, "kind"> & {
|
||||
kind?: "realtime" | "pubsub";
|
||||
}): ContractDefinition<T>;
|
||||
declare class ContractRegistry {
|
||||
private readonly records;
|
||||
register<T extends object>(definition: ContractDefinition<T>): this;
|
||||
snapshot(): ContractSnapshot;
|
||||
}
|
||||
declare function checkContractCompatibility(previous: ContractSnapshot, current: ContractSnapshot): ContractIssue[];
|
||||
|
||||
/**
|
||||
* @wrnexus/validation — one schema, validated on the server (API) and the browser
|
||||
* (forms). A schema is a fluent builder; `.parse()` runs server-side and returns
|
||||
@@ -218,6 +363,8 @@ interface FieldDescriptor {
|
||||
optional?: boolean;
|
||||
/** Message used when a required field is empty. Defaults to "Required". */
|
||||
requiredMessage?: string;
|
||||
/** Message used when coercion to the declared type fails. */
|
||||
typeMessage?: string;
|
||||
label?: string;
|
||||
/** Trim string input before validating. */
|
||||
trim?: boolean;
|
||||
@@ -274,7 +421,9 @@ declare abstract class FieldSchema {
|
||||
runRefinements(value: unknown): string | null;
|
||||
describe(): FieldDescriptor;
|
||||
}
|
||||
declare class StringSchema extends FieldSchema {
|
||||
declare class StringSchema<TValue extends string = string> extends FieldSchema {
|
||||
/** Type-only marker used to preserve literal unions through schema inference. */
|
||||
readonly __value: TValue;
|
||||
readonly type: "string";
|
||||
private _trim;
|
||||
email(message?: string): this;
|
||||
@@ -282,16 +431,18 @@ declare class StringSchema extends FieldSchema {
|
||||
uuid(message?: string): this;
|
||||
date(message?: string): this;
|
||||
length(n: number, message?: string): this;
|
||||
oneOf(values: string[], message?: string): this;
|
||||
oneOf<const TValues extends readonly string[]>(values: TValues, message?: string): StringSchema<TValues extends readonly [string, ...string[]] ? TValues[number] : TValue>;
|
||||
trim(): this;
|
||||
pattern(re: RegExp, message?: string): this;
|
||||
describe(): FieldDescriptor;
|
||||
}
|
||||
declare class NumberSchema extends FieldSchema {
|
||||
declare class NumberSchema<TValue extends number = number> extends FieldSchema {
|
||||
/** Type-only marker used to preserve numeric literal unions through schema inference. */
|
||||
readonly __value: TValue;
|
||||
readonly type: "number";
|
||||
integer(message?: string): this;
|
||||
positive(message?: string): this;
|
||||
oneOf(values: number[], message?: string): this;
|
||||
oneOf<const TValues extends readonly number[]>(values: TValues, message?: string): NumberSchema<TValues extends readonly [number, ...number[]] ? TValues[number] : TValue>;
|
||||
}
|
||||
declare class BooleanSchema extends FieldSchema {
|
||||
readonly type: "boolean";
|
||||
@@ -299,27 +450,37 @@ declare class BooleanSchema extends FieldSchema {
|
||||
declare class UnknownSchema extends FieldSchema {
|
||||
readonly type: "unknown";
|
||||
}
|
||||
type AnyFieldSchema = StringSchema | NumberSchema | BooleanSchema | UnknownSchema;
|
||||
declare class ObjectSchema {
|
||||
type AnyFieldSchema = StringSchema<string> | NumberSchema<number> | BooleanSchema | UnknownSchema;
|
||||
/** Infer the runtime value produced by a field schema. */
|
||||
type InferFieldValue<TField extends FieldSchema> = TField extends StringSchema<infer TValue> ? TValue : TField extends NumberSchema<infer TValue> ? TValue : TField extends BooleanSchema ? boolean : unknown;
|
||||
/** Infer the validated object produced by a field map. */
|
||||
type InferObjectFields<TFields extends Record<string, FieldSchema>> = {
|
||||
[K in keyof TFields]: InferFieldValue<TFields[K]>;
|
||||
};
|
||||
/** Infer the object value produced by an object schema. */
|
||||
type InferSchema<TSchema extends ObjectSchema> = TSchema extends ObjectSchema<infer TValue> ? TValue : never;
|
||||
declare class ObjectSchema<TValue extends object = Record<string, unknown>> {
|
||||
private readonly fields;
|
||||
/** Type-only marker used by helper functions to infer validated output. */
|
||||
readonly __output: TValue;
|
||||
constructor(fields: Record<string, FieldSchema>);
|
||||
/** Return a defensive copy of the schema fields. */
|
||||
getFields(): Readonly<Record<string, FieldSchema>>;
|
||||
/** Create a new schema with fields added or replaced. The original is unchanged. */
|
||||
extend(fields: Record<string, FieldSchema>): ObjectSchema;
|
||||
extend<TFields extends Record<string, FieldSchema>>(fields: TFields): ObjectSchema<Omit<TValue, keyof TFields> & InferObjectFields<TFields>>;
|
||||
/** Create a new schema containing fields from both schemas. */
|
||||
merge(schema: ObjectSchema): ObjectSchema;
|
||||
merge<TOther extends object>(schema: ObjectSchema<TOther>): ObjectSchema<TValue & TOther>;
|
||||
/** Validate an input object; returns coerced values + per-field errors. */
|
||||
parse(input: unknown): ParseResult;
|
||||
parse(input: unknown): ParseResult<TValue>;
|
||||
describe(): SchemaDescriptor;
|
||||
}
|
||||
/** The fluent schema builder. */
|
||||
declare const v: {
|
||||
string: () => StringSchema;
|
||||
number: () => NumberSchema;
|
||||
string: () => StringSchema<string>;
|
||||
number: () => NumberSchema<number>;
|
||||
boolean: () => BooleanSchema;
|
||||
unknown: () => UnknownSchema;
|
||||
object: (fields: Record<string, FieldSchema>) => ObjectSchema;
|
||||
object: <TFields extends Record<string, FieldSchema>>(fields: TFields) => ObjectSchema<InferObjectFields<TFields>>;
|
||||
};
|
||||
/**
|
||||
* Validate environment variables against a schema at startup. Values are read
|
||||
@@ -333,14 +494,14 @@ declare const v: {
|
||||
* PORT: v.number(),
|
||||
* }));
|
||||
*/
|
||||
declare function parseEnv<T = Record<string, unknown>>(schema: ObjectSchema, source?: Record<string, string | undefined>): T;
|
||||
declare function parseEnv<T extends object>(schema: ObjectSchema<T>, source?: Record<string, string | undefined>): T;
|
||||
/** A 400 response carrying field errors, for API routes. */
|
||||
declare function invalid(errors: Record<string, string>): Response;
|
||||
/**
|
||||
* Parse a request's JSON body against a schema. On failure returns
|
||||
* `{ ok: false, response }` (a ready 400); on success `{ ok: true, value }`.
|
||||
*/
|
||||
declare function parseBody<T = Record<string, unknown>>(schema: ObjectSchema, req: Request): Promise<{
|
||||
declare function parseBody<T extends object>(schema: ObjectSchema<T>, req: Request): Promise<{
|
||||
ok: true;
|
||||
value: T;
|
||||
} | {
|
||||
@@ -348,7 +509,7 @@ declare function parseBody<T = Record<string, unknown>>(schema: Obje
|
||||
response: Response;
|
||||
}>;
|
||||
|
||||
export { type AnyFieldSchema, AsyncObjectSchema, type AsyncRefinement, type AsyncValidationContext, BooleanSchema, type FieldDescriptor, FieldSchema, NumberSchema, ObjectSchema, type OpenApiSchema, type ParseResult, type RuleDescriptor, type SchemaDescriptor, StringSchema, UnknownSchema, VALIDATE_RUNTIME, applyRule, asyncSchema, checkField, invalid, mergeValidationResults, parseBody, parseBodyAsync, parseEnv, renderSchemasScript, schemaToOpenApi, v };
|
||||
export { type AnyFieldSchema, AsyncObjectSchema, type AsyncRefinement, type AsyncValidationContext, BooleanSchema, type ContractDefinition, type ContractIssue, type ContractKind, type ContractRecord, ContractRegistry, type ContractSnapshot, type FieldDescriptor, FieldSchema, type InferFieldValue, type InferObjectFields, type InferSchema, type JsonSchemaDocument, NumberSchema, ObjectSchema, type OpenApiSchema, type ParseResult, type RuleDescriptor, type SchemaDescriptor, StringSchema, UnknownSchema, VALIDATE_RUNTIME, ValidationError, type ValidationMessageKey, type ValidationMessageTranslator, applyRule, asyncSchema, checkContractCompatibility, checkField, defineContract, defineEvent, firstValidationError, invalid, localizeDescriptor, mergeValidationResults, openApiRequestBody, parseBody, parseBodyAsync, parseDescriptor, parseEnv, parseOrThrow, renderSchemasScript, schemaFieldNames, schemaToOpenApi, toJsonSchema, v, validationResponse, validationSummary };
|
||||
</code></pre></section><section id="examples" class="examples"><h2>Examples</h2><p>Copy-ready examples from the installed package documentation.</p><div class="example-grid"><article class="example-card"><h3>Define a schema and validate an API body</h3><pre data-language="ts"><code>import { v, parseBody } from "@wrnexus/validation";
|
||||
|
||||
export const signupSchema = v.object({
|
||||
@@ -382,9 +543,9 @@ import { signupSchema } from "./app/schemas/signup.ts";
|
||||
const head = `<script>${renderSchemasScript({ signup: signupSchema.describe() })}</script>
|
||||
<script>${VALIDATE_RUNTIME}</script>`;
|
||||
// render a <form data-schema="signup"> with [data-error="email"] etc.</code></pre></article></div></section></article>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#the-v-builder">The v builder</a><a class="toc-level-4" href="#objectschema">ObjectSchema</a><a class="toc-level-4" href="#rules-and-coercion">Rules and coercion</a><a class="toc-level-4" href="#api-helpers">API helpers</a><a class="toc-level-4" href="#environment-config">Environment config</a><a class="toc-level-4" href="#client-runtime-from-runtime-ts">Client runtime (from runtime.ts)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#boundary-contracts">Boundary contracts</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#the-v-builder">The v builder</a><a class="toc-level-4" href="#objectschema">ObjectSchema</a><a class="toc-level-4" href="#rules-and-coercion">Rules and coercion</a><a class="toc-level-4" href="#api-helpers">API helpers</a><a class="toc-level-4" href="#environment-config">Environment config</a><a class="toc-level-4" href="#client-runtime-from-runtime-ts">Client runtime (from runtime.ts)</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-3" href="#helper-and-component-kit">Helper and component kit</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
|
||||
</main>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.7.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<footer><div class="footer-brand"><span class="footer-mark" aria-hidden="true">W</span><p><strong>WRNexusJS 0.8.0</strong><span>Complete API documentation generated from installed package declarations.</span></p></div><nav aria-label="Footer"><a href="/packages">All packages</a><a href="/getting-started">Get started</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p class="footer-meta">Private Developer Preview · Bun-native</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0215 {
|
||||
seo {
|
||||
title = "Release 0.2.15"
|
||||
@@ -5,13 +9,58 @@ page Release0215 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.15"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.15</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.15</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.15</h1><p>Released 2026-07-12 in this documentation repository. Twenty-five installed packages are aligned to this version. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.15</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.15</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.15</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.15</h1><p>Released 2026-07-12 in this documentation repository. Twenty-five installed packages are aligned to this version. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.15</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0217 {
|
||||
seo {
|
||||
title = "Release 0.2.17"
|
||||
@@ -5,13 +9,58 @@ page Release0217 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.17"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.17</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.17</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.17</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.17</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.17</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.17</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.17</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.17</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0218 {
|
||||
seo {
|
||||
title = "Release 0.2.18"
|
||||
@@ -5,13 +9,58 @@ page Release0218 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.18"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.18</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.18</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.18</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.18</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.18</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.18</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.18</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.18</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0219 {
|
||||
seo {
|
||||
title = "Release 0.2.19"
|
||||
@@ -5,13 +9,58 @@ page Release0219 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.19"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.19</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.19</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.19</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.19</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.19</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.19</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.19</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.19</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0220 {
|
||||
seo {
|
||||
title = "Release 0.2.20"
|
||||
@@ -5,13 +9,58 @@ page Release0220 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.20"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.20</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.20</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.20</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.20</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.20</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.20</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.20</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.20</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0221 {
|
||||
seo {
|
||||
title = "Release 0.2.21"
|
||||
@@ -5,13 +9,58 @@ page Release0221 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.21"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.21</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.21</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.21</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.21</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.21</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.21</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.21</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.21</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0222 {
|
||||
seo {
|
||||
title = "Release 0.2.22"
|
||||
@@ -5,13 +9,58 @@ page Release0222 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.22"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.22</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.22</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.22</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.22</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.22</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.22</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.22</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.22</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0223 {
|
||||
seo {
|
||||
title = "Release 0.2.23"
|
||||
@@ -5,13 +9,58 @@ page Release0223 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.23"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.23</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.23</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.23</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.23</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.23</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.23</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.23</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.23</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0224 {
|
||||
seo {
|
||||
title = "Release 0.2.24"
|
||||
@@ -5,13 +9,58 @@ page Release0224 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.24"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.24</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.24</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.24</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.24</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.24</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.24</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.24</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.24</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0225 {
|
||||
seo {
|
||||
title = "Release 0.2.25"
|
||||
@@ -5,13 +9,58 @@ page Release0225 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.25"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.25</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.25</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.25</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.25</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.25</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.25</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.25</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.25</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0226 {
|
||||
seo {
|
||||
title = "Release 0.2.26"
|
||||
@@ -5,13 +9,58 @@ page Release0226 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.26"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.26</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.26</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.26</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.26</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.26</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.26</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.26</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.26</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0227 {
|
||||
seo {
|
||||
title = "Release 0.2.27"
|
||||
@@ -5,13 +9,58 @@ page Release0227 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.27"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.27</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.27</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.27</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.27</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.27</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.27</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.27</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.27</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0228 {
|
||||
seo {
|
||||
title = "Release 0.2.28"
|
||||
@@ -5,13 +9,58 @@ page Release0228 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.28"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.28</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.28</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.28</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.28</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.28</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.28</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.28</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.28</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0229 {
|
||||
seo {
|
||||
title = "Release 0.2.29"
|
||||
@@ -5,13 +9,58 @@ page Release0229 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.29"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.29</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.29</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.29</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.29</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.29</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.29</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.29</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.29</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0230 {
|
||||
seo {
|
||||
title = "Release 0.2.30"
|
||||
@@ -5,13 +9,58 @@ page Release0230 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.30"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.30</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.30</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.30</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.30</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.30</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.30</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.30</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.30</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0231 {
|
||||
seo {
|
||||
title = "Release 0.2.31"
|
||||
@@ -5,13 +9,58 @@ page Release0231 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.31"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.31</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.31</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.31</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.31</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.31</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.31</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.31</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.31</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0232 {
|
||||
seo {
|
||||
title = "Release 0.2.32"
|
||||
@@ -5,13 +9,58 @@ page Release0232 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.32"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.32</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.32</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.32</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.32</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.32</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.32</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.32</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.32</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
BackToTop,
|
||||
} from "@wrnexus/ui"
|
||||
|
||||
page Release0233 {
|
||||
seo {
|
||||
title = "Release 0.2.33"
|
||||
@@ -5,13 +9,58 @@ page Release0233 {
|
||||
canonical = "https://wrnexusjs.dev/releases/0.2.33"
|
||||
}
|
||||
view {
|
||||
<SkipLink label="Skip to content" href="#main" class="docs-skip-link" />
|
||||
<div class="docs-shell">
|
||||
<header class="topbar"><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">Preview · v0.2.33</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div></header>
|
||||
<div class="mobile-doc-nav"><details><summary>Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
|
||||
<main id="main" class="portal-main"><nav class="breadcrumbs" aria-label="Breadcrumb"><a href="/">Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.33</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.33</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article></main>
|
||||
<footer><p><strong>WRNexusJS 0.2.33</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.</p></footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<SkipLink
|
||||
label="Skip to content"
|
||||
href="#main"
|
||||
class="docs-skip-link"
|
||||
/>
|
||||
<div
|
||||
class="docs-shell"
|
||||
>
|
||||
<header
|
||||
class="topbar"
|
||||
>
|
||||
<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">Preview · v0.2.33</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
|
||||
</header>
|
||||
<div
|
||||
class="mobile-doc-nav"
|
||||
>
|
||||
<details
|
||||
>
|
||||
<summary
|
||||
>
|
||||
Browse documentation</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="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav>
|
||||
</details>
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
class="portal-main"
|
||||
>
|
||||
<nav
|
||||
class="breadcrumbs"
|
||||
aria-label="Breadcrumb"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
>
|
||||
Home</a><span aria-hidden="true">/</span><span>Releases</span><span aria-hidden="true">/</span><span aria-current="page">Release 0.2.33</span></nav><article class="documentation prose standalone"><h1>WRNexusJS 0.2.33</h1><p>Released 2026-07-13. All 26 installed packages are aligned to this version. Highlights include the new helpers package, reliable workspace app addition, and browser SSO redirects through forward authentication. See the <a href="/changelog">changelog</a>, <a href="/guides/upgrading">upgrade guide</a>, and package references.</p></article>
|
||||
</main>
|
||||
<footer
|
||||
>
|
||||
<p
|
||||
>
|
||||
<strong
|
||||
>
|
||||
WRNexusJS 0.2.33</strong> · Private Developer Preview · Bun-native</p><nav aria-label="Footer"><a href="/access">Request access</a><a href="/license">License</a><a href="/security">Security</a><a href="/support">Support</a><a href="/llms.txt">AI guide</a></nav><p>WRNexusJS is created by <a href="https://workroot.in/">WorkRoot</a>. WRNexus is a separate SaaS product.
|
||||
</p>
|
||||
</footer>
|
||||
<BackToTop />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user