release: WRNexusJS 0.4.0
This commit is contained in:
+10
-13
@@ -1,19 +1,16 @@
|
||||
# Framework integration
|
||||
|
||||
The current WRNexusJS component scanner always includes `packages/ui/components` and the application’s `app/components`. The installer therefore copies `Captcha.wrn` into `packages/ui/components/Captcha.wrn` while retaining the canonical package copy at `packages/captcha/components/Captcha.wrn`.
|
||||
WRNexusJS 0.4 discovers components and browser runtimes from installed package plugins.
|
||||
|
||||
A future framework improvement can read component directories registered by plugins and pass them to `createRouter({ componentDirs })`. `captchaPlugin()` already exposes the package directory through configuration and plugin metadata, so the package is ready for that change without changing its public API.
|
||||
`@wrnexus/captcha` is a complete example:
|
||||
|
||||
The installer adds these TypeScript aliases:
|
||||
- `packages/captcha/package.json` declares `wrnexus.plugin`.
|
||||
- `captchaPlugin()` contributes its component directory, client runtime, Tailwind source, and DevToolbar audit panel.
|
||||
- `Captcha.wrn` renders `data-wrnexus-runtime="captcha"`.
|
||||
- SSR injects the runtime only when the component appears.
|
||||
- CSR navigation mounts and unmounts the runtime.
|
||||
- Development serves the package source; production emits a hashed chunk.
|
||||
|
||||
```json
|
||||
{
|
||||
"@wrnexus/captcha": ["./packages/captcha/src/index.ts"],
|
||||
"@wrnexus/captcha/server": ["./packages/captcha/src/server/index.ts"],
|
||||
"@wrnexus/captcha/client": ["./packages/captcha/src/client/index.ts"],
|
||||
"@wrnexus/captcha/plugin": ["./packages/captcha/src/plugin.ts"],
|
||||
"@wrnexus/captcha/*": ["./packages/captcha/src/*"]
|
||||
}
|
||||
```
|
||||
There is intentionally no `packages/ui/components/Captcha.wrn`, no showcase-local copy, and no public `captcha.js` file.
|
||||
|
||||
After installation, regenerate the UI component reference so `Captcha` appears in generated component documentation.
|
||||
`integration/platform-upgrade.test.ts` exercises the 0.4 cross-package foundation.
|
||||
|
||||
Reference in New Issue
Block a user