@olonjs/next 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +56 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @olonjs/next
2
+
3
+ <p align="center">
4
+ <strong>Next.js App Router host binding for OlonJS.</strong><br />
5
+ RSC visitors + admin client island · server loaders · admin gate · public JSON rewrites.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://www.npmjs.com/package/@olonjs/next"><img src="https://img.shields.io/npm/v/@olonjs/next?color=blue&style=flat-square" alt="npm version"></a>
10
+ <a href="https://github.com/olonjs/npm-jpcore/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="license"></a>
11
+ </p>
12
+
13
+ **@olonjs/next** hosts an OlonJS tenant on Next.js (App Router), per **ADR-0017**: server components render the visitor, a client island mounts the admin. It is **not a second engine** — it composes `@olonjs/core` (server) and `@olonjs/react` (admin island).
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @olonjs/next @olonjs/core @olonjs/react
19
+ ```
20
+
21
+ Peer dependencies: `@olonjs/core@^2.0.0`, `@olonjs/react@^0.2.0`, `next@^15 || ^16`, `react@^19`, `react-dom@^19`, `react-router-dom@^6.29 || ^7`.
22
+
23
+ ## Subpath Exports
24
+
25
+ | Subpath | Audience | Contents (representative) |
26
+ |---|---|---|
27
+ | `.` | mixed | Shared constants and utilities |
28
+ | `./server` | Node/RSC only | `loadVisitorPage`, `loadLivePublicPageContent`, `loadPublishedStaticContent`, `resolveLocalDataRoots`, `safeDataSlugPath`, `applyDevSliceFilters`, `normalizePublicPageSlug`, `normalizePublishedSlug`, `buildPublicPageJsonRewrites`, `createPublicPageJsonHttpResult`, `listLocalImages`, `saveProjectStateToDisk`, `saveUploadedImage`, `MAX_UPLOAD_BYTES` |
29
+ | `./admin-gate` | server | `authorizeAdminRequest`, `buildAdminSessionCookie`, `parseCookieHeader`, `ADMIN_SESSION_COOKIE`, `ADMIN_SESSION_MAX_AGE` |
30
+ | `./client` | browser | `AdminIsland` (mounts `JsonPagesEngine` with the tenant config), `OLONJS_NEXT_CLIENT` |
31
+
32
+ ## Architecture Rules (mandatory)
33
+
34
+ - **Runtime-only agentic surface** — never add prebuild bake steps; page contracts, manifests and llms.txt are served by route handlers + `next.config` rewrites.
35
+ - **Never self-fetch your own origin** for `/pages` or `/config` JSON — that creates a rewrite loop. `bootSource: 'static'` reads the deployed repo from disk.
36
+ - **Env access** — `NEXT_PUBLIC_*` must be read as direct property access (Next inlines at build time; dynamic indexing breaks the client bundle).
37
+
38
+ ## Persistence Modes
39
+
40
+ | Mode | Condition | Behavior |
41
+ |---|---|---|
42
+ | Local | No cloud URL | Saves via `/api/save-to-file` (file-based) |
43
+ | HotSave | Cloud URL + key, no SAVE2REPO | Direct KV cloud save |
44
+ | Save2Repo | `NEXT_PUBLIC_OLONJS_SAVE2REPO=true` | Git commit via cloud bridge; boots from published static JSON |
45
+
46
+ ## Specs
47
+
48
+ Reference tenant wiring and the visitor/admin model: **ADR-0017** (`docs/decisions/ADR-0017-next-*`) and the `next` template source of truth at [`apps/next`](../../apps/next). Protocol contracts: [`specs/2.0/INDEX.md`](../../specs/2.0/INDEX.md).
49
+
50
+ ## Versioning
51
+
52
+ Patch-only auto-numbering (`0.0.XXX`) by the gated `release:enterprise` pipeline.
53
+
54
+ ## License
55
+
56
+ MIT — see [LICENSE](../../LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olonjs/next",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Next.js App Router host binding for OlonJS — RSC visitors + admin client island (ADR-0017).",
@@ -62,7 +62,7 @@
62
62
  "react-router-dom": "^6.29.0 || ^7.0.0"
63
63
  },
64
64
  "dependencies": {
65
- "@olonjs/core": "^2.0.3"
65
+ "@olonjs/core": "^2.0.4"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "@olonjs/react": {