docs: update portal for WRNexusJS 0.8.0
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user