docs: update portal for WRNexusJS 0.4.0

This commit is contained in:
2026-07-27 13:29:36 +05:30
parent 9e8c8dd521
commit 4846b3684b
162 changed files with 4574 additions and 967 deletions
+40 -4
View File
@@ -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="/components">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.3.6</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.4.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="/components">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.3.6</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.3.6</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.4.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.4.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>
@@ -92,6 +92,42 @@ tracker.addSink(anotherSink); // add more sinks later</code></pre>
<p>sink that throws is swallowed so it can never break the app.</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 &#123; Middleware &#125; from '@wrnexus/core';
type TelemetryKind = &quot;error&quot; | &quot;event&quot; | &quot;metric&quot; | &quot;span&quot;;
interface TelemetryEnvelope &#123;
id: string;
kind: TelemetryKind;
name: string;
timestamp: number;
traceId?: string;
userId?: string;
tenantId?: string;
attributes: Record&lt;string, unknown&gt;;
payload?: unknown;
&#125;
interface TelemetrySink &#123;
name?: string;
send(events: TelemetryEnvelope[]): void | Promise&lt;void&gt;;
&#125;
interface TelemetryPipeline &#123;
emit(input: Omit&lt;TelemetryEnvelope, &quot;id&quot; | &quot;timestamp&quot;&gt; &amp; Partial&lt;Pick&lt;TelemetryEnvelope, &quot;id&quot; | &quot;timestamp&quot;&gt;&gt;): Promise&lt;void&gt;;
flush(): Promise&lt;void&gt;;
close(): Promise&lt;void&gt;;
size(): number;
&#125;
interface TelemetryPipelineOptions &#123;
sinks: TelemetrySink[];
batchSize?: number;
flushIntervalMs?: number;
maxQueueSize?: number;
sampleRate?: number;
beforeSend?: (event: TelemetryEnvelope) =&gt; TelemetryEnvelope | null;
onSinkError?: (error: unknown, sink: TelemetrySink, events: readonly TelemetryEnvelope[]) =&gt; void | Promise&lt;void&gt;;
now?: () =&gt; number;
random?: () =&gt; number;
&#125;
declare function createTelemetryPipeline(options: TelemetryPipelineOptions): TelemetryPipeline;
declare const telemetryConsoleSink: TelemetrySink;
/**
* @wrnexus/tracking — error tracking with pluggable sinks. Capture exceptions
* manually or via middleware, and fan them out to any sink (console by default;
@@ -129,7 +165,7 @@ interface TrackerOptions &#123;
declare const consoleSink: ErrorSink;
declare function createTracker(options?: TrackerOptions): Tracker;
export &#123; type ErrorEvent, type ErrorSink, type Tracker, type TrackerOptions, consoleSink, createTracker &#125;;
export &#123; type ErrorEvent, type ErrorSink, type TelemetryEnvelope, type TelemetryKind, type TelemetryPipeline, type TelemetryPipelineOptions, type TelemetrySink, type Tracker, type TrackerOptions, consoleSink, createTelemetryPipeline, createTracker, telemetryConsoleSink &#125;;
</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>Manual capture</h3><pre data-language="ts"><code>import &#123; createTracker, consoleSink &#125; from &quot;@wrnexus/tracking&quot;;
const tracker = createTracker(&#123; sinks: [consoleSink] &#125;);
@@ -163,7 +199,7 @@ const tracker = createTracker(&#123;
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.3.6</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.4.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>
}