@universalcms/connect 0.1.0 → 0.13.1

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 (130) hide show
  1. package/README.md +699 -37
  2. package/dist/angular-runtime.d.mts +4 -0
  3. package/dist/angular-runtime.mjs +7 -0
  4. package/dist/angular-setup.mjs +124 -0
  5. package/dist/astro-runtime.d.mts +6 -0
  6. package/dist/astro-runtime.mjs +255 -0
  7. package/dist/astro-setup.mjs +215 -0
  8. package/dist/astro-source.mjs +451 -0
  9. package/dist/astro-website.d.mts +5 -0
  10. package/dist/astro-website.mjs +42 -0
  11. package/dist/cli.mjs +418 -15
  12. package/dist/connector-runtime.mjs +130 -0
  13. package/dist/content-next-setup.mjs +207 -0
  14. package/dist/content-registry-validation.mjs +40 -0
  15. package/dist/content-registry.mjs +44 -0
  16. package/dist/content-setup.mjs +13 -0
  17. package/dist/content-storefront-setup.mjs +155 -0
  18. package/dist/content-vite-setup.mjs +107 -0
  19. package/dist/core.mjs +32 -51
  20. package/dist/framework-ownership.mjs +68 -0
  21. package/dist/framework.mjs +54 -0
  22. package/dist/guided.mjs +514 -0
  23. package/dist/native-adapters.mjs +31 -0
  24. package/dist/native-chrome-model.d.mts +3 -0
  25. package/dist/native-chrome-model.mjs +14 -0
  26. package/dist/native-chrome-review.mjs +49 -0
  27. package/dist/native-chrome-source.mjs +69 -0
  28. package/dist/native-route-review.mjs +152 -0
  29. package/dist/native-routes.mjs +27 -0
  30. package/dist/native-website-model.d.mts +18 -0
  31. package/dist/native-website-model.mjs +67 -0
  32. package/dist/native-website-server.d.mts +1 -0
  33. package/dist/native-website-server.mjs +35222 -0
  34. package/dist/native-website-server.mjs.LEGAL.txt +56 -0
  35. package/dist/native-website.d.mts +3 -0
  36. package/dist/native-website.mjs +120 -0
  37. package/dist/native-website.mjs.LEGAL.txt +56 -0
  38. package/dist/next-publication.d.mts +12 -0
  39. package/dist/next-publication.mjs +107 -0
  40. package/dist/next-settings-layout.mjs +233 -0
  41. package/dist/next-source.d.mts +8 -0
  42. package/dist/next-source.mjs +93 -0
  43. package/dist/page-discovery.mjs +236 -0
  44. package/dist/page-mapping-review.mjs +160 -0
  45. package/dist/preflight-recovery.mjs +130 -0
  46. package/dist/preflight.mjs +138 -0
  47. package/dist/project-files.mjs +56 -0
  48. package/dist/public-bindings.d.mts +3 -0
  49. package/dist/public-bindings.mjs +28 -0
  50. package/dist/publication-browser.d.mts +5 -0
  51. package/dist/publication-browser.mjs +258 -0
  52. package/dist/publication-check.mjs +141 -0
  53. package/dist/publication-document.d.mts +2 -0
  54. package/dist/publication-document.mjs +59 -0
  55. package/dist/publication-next-setup.mjs +134 -0
  56. package/dist/publication-setup.mjs +138 -0
  57. package/dist/publication-verification.mjs +85 -0
  58. package/dist/publication.css +6 -0
  59. package/dist/publication.d.mts +31 -0
  60. package/dist/publication.mjs +320 -0
  61. package/dist/react-publication.d.mts +22 -0
  62. package/dist/react-publication.mjs +301 -0
  63. package/dist/react-website.d.mts +15 -0
  64. package/dist/react-website.mjs +735 -0
  65. package/dist/reviewed-commerce-ownership.mjs +26 -0
  66. package/dist/reviewed-commerce-settings-setup.mjs +243 -0
  67. package/dist/reviewed-native-ownership.mjs +118 -0
  68. package/dist/reviewed-storefront-source.mjs +227 -0
  69. package/dist/runtime-dependencies.mjs +59 -0
  70. package/dist/settings-only-setup.mjs +100 -0
  71. package/dist/settings-only.d.mts +4 -0
  72. package/dist/settings-only.mjs +49 -0
  73. package/dist/setup-environment.mjs +70 -0
  74. package/dist/source-bindings.mjs +77 -0
  75. package/dist/source-check.mjs +149 -0
  76. package/dist/source-collect.mjs +80 -0
  77. package/dist/source-config.mjs +20 -0
  78. package/dist/source-extract.mjs +514 -0
  79. package/dist/source-finalize.mjs +52 -0
  80. package/dist/source-routes.mjs +65 -0
  81. package/dist/source-setup.mjs +490 -0
  82. package/dist/staged-setup.mjs +287 -0
  83. package/dist/static-runtime.mjs +67 -0
  84. package/dist/static-setup.mjs +136 -0
  85. package/dist/svelte-runtime.d.mts +27 -0
  86. package/dist/svelte-runtime.mjs +40 -0
  87. package/dist/svelte-setup.mjs +135 -0
  88. package/dist/svelte-template.mjs +48 -0
  89. package/dist/templates.mjs +167 -3
  90. package/dist/vendor/astro-compiler/LICENSE +53 -0
  91. package/dist/vendor/astro-compiler/astro.wasm +0 -0
  92. package/dist/vendor/astro-compiler/chunk-W5DTLHV4.js +1 -0
  93. package/dist/vendor/astro-compiler/node/index.js +1 -0
  94. package/dist/vendor/project-analysis.mjs +58 -4
  95. package/dist/vendor/react-LICENSE.txt +21 -0
  96. package/dist/vendor/react-document.mjs +124 -0
  97. package/dist/vendor/react-dom-LICENSE.txt +21 -0
  98. package/dist/vendor/react-form.mjs +63 -0
  99. package/dist/vendor/react-safety.mjs +47 -0
  100. package/dist/vendor/source-manifest-provider.mjs +104 -0
  101. package/dist/vendor/typescript-LICENSE.txt +55 -0
  102. package/dist/vendor/typescript.cjs +200276 -0
  103. package/dist/vite-publication-server.d.mts +3 -0
  104. package/dist/vite-publication-server.mjs +82 -0
  105. package/dist/vite-publication.d.mts +15 -0
  106. package/dist/vite-publication.mjs +241 -0
  107. package/dist/vite-source-discovery.mjs +315 -0
  108. package/dist/vite-source.d.mts +30 -0
  109. package/dist/vite-source.mjs +141 -0
  110. package/dist/vue-runtime.d.mts +10 -0
  111. package/dist/vue-runtime.mjs +50 -0
  112. package/dist/vue-server.d.mts +2 -0
  113. package/dist/vue-server.mjs +58 -0
  114. package/dist/vue-setup.mjs +127 -0
  115. package/dist/vue-source.mjs +168 -0
  116. package/dist/website-check.mjs +41 -0
  117. package/dist/website-http.mjs +149 -0
  118. package/dist/website-model.d.mts +20 -0
  119. package/dist/website-model.mjs +155 -0
  120. package/dist/website-next.d.mts +2 -0
  121. package/dist/website-next.mjs +29 -0
  122. package/dist/website-node.d.mts +3 -0
  123. package/dist/website-node.mjs +50 -0
  124. package/dist/website-runtime.d.mts +13 -0
  125. package/dist/website-runtime.mjs +404 -0
  126. package/dist/website-schema.mjs +22175 -0
  127. package/dist/website-setup.mjs +256 -0
  128. package/dist/website.css +49 -0
  129. package/dist/wizard.mjs +237 -38
  130. package/package.json +44 -7
package/README.md CHANGED
@@ -1,39 +1,532 @@
1
1
  # @universalcms/connect
2
2
 
3
3
  Local, deterministic website setup without AI. Universal CMS stays hosted; this
4
- package creates a website integration, not a CMS installation. Version 0.1.0 is
5
- a local prerelease; no public npm publication is claimed.
4
+ package creates a website integration, not a CMS installation. Version 0.13.1 is
5
+ prepared locally; this repository does not establish its public npm availability.
6
6
 
7
- Supported templates: **Next.js 16 App Router on Node** and **React 19.2+ with
8
- Vite 6/7/8 plus a private Node server**. Use Node 22.12 or newer (below 27).
7
+ ## Quick start
8
+
9
+ ```sh
10
+ npx @universalcms/connect@latest --cms https://YOUR_CMS_ADMIN_ORIGIN
11
+ ```
12
+
13
+ Run it in the website folder. It opens the CMS to approve the website, installs
14
+ this package, connects pages, header/footer and settings, saves the website key
15
+ privately in `.env.local`, then guides the restart, content import and final check.
16
+ Run it again to continue where it stopped. Without a browser, create a one-time
17
+ `--code` command in Developer setup. See [connector setup](../../docs/connector-setup.md#one-command-connection-recommended).
18
+ When no page can be edited automatically, the command offers a settings-only
19
+ connection (Next.js): the CMS manages menus, branding, SEO, analytics, scripts,
20
+ consent and redirects while the site renders every page. Add
21
+ `<CmsNavigation location="header" />` from `@universalcms/connect/react-website`
22
+ where CMS menus should appear.
23
+ The individual commands below remain for developers and reviewed integrations.
24
+
25
+ Supported templates: **Next.js 16 App Router on Node**, **React 19.2+ with
26
+ Vite 6/7/8 plus a private Node server**, and **bounded Astro 7.2.1–7.x projects
27
+ with official Node 11/React 7 integrations and React/React DOM 19.2+ within 19.x**.
28
+ Version 0.12.0 also supplies bounded native Vue, Nuxt, Angular, SvelteKit and
29
+ literal HTML adapters. The same CMS download service supplies a separate native
30
+ [WordPress PHP plugin](../wordpress/README.md), installed with WP-CLI, not npm.
31
+ Use Node 22.12 or newer (below 27); individual frameworks have stricter floors.
9
32
  Stable exact, caret and tilde version declarations are recognized. Workspaces,
10
- Pages Router, static Next exports, dynamic Next configuration, Cache Components,
11
- custom page extensions/base paths, route groups and
12
- ambiguous framework evidence require manual review. Analyze the individual
33
+ Pages Router, static Next exports, dynamic routing configuration,
34
+ custom page extensions/base paths and ambiguous framework evidence require manual
35
+ review. Standard Cache Components layouts support source export and original-page
36
+ publication checks. Route groups support source discovery and publication checks. Analyze the individual
13
37
  website folder, not its parent workspace.
14
38
 
15
- Install the reviewed connector tarball from your operator:
39
+ | Selection | Automatic profile in 0.12.0 |
40
+ | --- | --- |
41
+ | Vue | Vue 3.5, Vite 7/8, official Vue plugin 6; literal root SFC and ordinary startup. Vue must be a production dependency. Generated private Node SSR host. |
42
+ | Nuxt | Nuxt 4 and Vue 3.5, literal `app/pages`, ordinary server configuration; Node 22.18+, 24.11+ or supported newer major below 27. |
43
+ | Angular | Angular 22.2, TypeScript 6, existing ordinary Node SSR scaffold and literal root component; Node 22.22.3+, 24.15+ or 26. A browser-only scaffold needs the matching official Angular SSR integration first. |
44
+ | SvelteKit | Kit 3.1+, Svelte 5.57.1+, Vite 8.0.12+, Vite plugin 7.3.1+, adapter-node 6; Node 22.17+ or supported newer major. Literal pages and ordinary Kit 3 Vite configuration. |
45
+ | Static | Complete literal `index.html` documents at directory routes, plus ordinary CSS/images/fonts. A generated private Node host is required. Custom scripts/builders and static-only deployment require review. |
46
+ | WordPress | Separate native plugin for inspected single-site WordPress pages/posts; see its exact theme, PHP, permalink and migration restrictions. |
47
+ | Custom | Inspect the actual project and dispatch to a compatible implemented adapter. An arbitrary backend or custom router still needs a reviewed integration. |
48
+
49
+ The native adapters preserve supported framework markup and styles, freeze the
50
+ original source privately, and bind current published blocks to stable IDs. A
51
+ self-contained `<universalcms-website>` element hosts the shared twelve-section
52
+ configuration renderer while the framework retains its native light DOM. Vue,
53
+ Nuxt, Angular, SvelteKit and HTML customers do not install React. Node frameworks
54
+ use the same source, publication, document, settings and new-page contracts.
55
+ Version 0.12 adds explicit native route and layout reviews described below.
56
+ Executable page logic, unsupported custom routers/layouts and ownership conflicts
57
+ still require a reviewed adapter; the CLI never deletes them to pass.
58
+ Angular's generated development command builds and runs the reviewed SSR server;
59
+ it does not promise `ng serve` hot reload.
60
+
61
+ Follow Developer setup in order: install the connector, run the fully scoped
62
+ read-only `preflight` command, then create or reuse an environment-scoped server
63
+ key and save it privately only after preflight succeeds. Run the fully scoped
64
+ `setup --original-routes-only` command in the website folder. Full setup prepares
65
+ source import, original-route publication control and native CMS content bindings,
66
+ then requires a second file review to install all twelve website configuration
67
+ consumers. `setup-settings --apply` resumes that stage if it was not completed.
68
+ Restart/deploy, verify the running website and import drafts. Imported drafts are
69
+ unavailable on the managed original URLs until explicitly published in the CMS.
70
+ Saving a draft edit of an already-published page preserves its last publication;
71
+ unpublishing removes the page. Failed delivery never restores hardcoded copy.
72
+
73
+ ## Incomplete setup and custom layouts in 0.12
74
+
75
+ A failed preflight or installer does not install the missing endpoint. Developer
76
+ Setup keeps later commands behind the preflight acknowledgment, reports the
77
+ failed stage, and separates **Diagnose connection** (read-only) from **Repair
78
+ incomplete setup** (explicit website code changes). Neither changes CMS content,
79
+ credentials, permissions or publications. The generated AI repair instructions
80
+ use the same installed framework-specific review commands as the CLI.
81
+
82
+ For a fresh Next 16 App Router project, `review-routes --dry-run` inventories
83
+ ordinary static routes and supported final single-segment dynamic routes.
84
+ `review-routes` asks which routes stay native and saves their dependency hashes
85
+ only after confirmation. At least one public page must remain CMS-managed.
86
+ `review-layout --dry-run` inspects one ordinary server root layout with a single
87
+ children slot and one unconditional semantic header/footer. Inline markup and
88
+ supported local default/named components are recognized. After review, full setup
89
+ appends settings consumers while preserving native controls and route ownership.
90
+
91
+ For supported Vue, Nuxt, Angular SSR, SvelteKit and Static profiles,
92
+ `review-layout` proposes seven empty settings slots inside literal native
93
+ header/footer markup and saves the reviewed source hashes. Existing text, links,
94
+ classes and native details controls remain website-owned. Forms, executable
95
+ expressions and component-driven chrome require a native adapter. New CMS-only
96
+ pages keep the shared CMS page layout; they do not clone an original native
97
+ page. Astro custom chrome remains a separately reviewed integration.
98
+
99
+ Both review commands default to No, support `--dry-run`, reject linked/stale
100
+ source and refuse to rewrite an already-installed content integration. A review
101
+ is not installation or verification. Rerun scoped preflight, complete setup,
102
+ restart/deploy, then check source/publication/settings and actual website
103
+ behavior. Arbitrary custom routes and every possible framework version are not
104
+ automatically supported.
105
+
106
+ After successful import, run `universalcms-connect finalize-source --apply` and
107
+ restart/deploy to close the bootstrap source endpoint. Then run
108
+ `universalcms-connect check-publication --path /` and verify actual rendered
109
+ content in a browser. Both CLI and AI-assisted setup follow this same contract.
110
+ A local connection does not verify a separate live deployment.
111
+
112
+ Version 0.10.0 adds original-page Astro setup through the same CLI and AI contract.
113
+ The reviewed installation adds the official Node and React integrations; it does
114
+ not silently upgrade Astro. Public literal `.astro` pages and simple relative
115
+ layouts keep their native markup/classes/styles, while a shared React island
116
+ composes all twelve settings consumers and additional published blocks. The
117
+ generated on-demand Node runtime serves source, publication and settings
118
+ endpoints and new published CMS paths. Use the generated scripts to restart, or
119
+ `npm run build` and `npm run start` to deploy, then verify actual delivery and
120
+ rendering. This integration requires a Node host; static-only hosting uses a
121
+ separately reviewed private content build.
122
+
123
+ Astro inspection refuses executable frontmatter, arbitrary components, dynamic
124
+ or private routes, middleware, native custom chrome and ambiguous ownership.
125
+ Document-base/HTTP-equivalent metadata and public HTML, extensionless pages,
126
+ reserved/private assets or linked files also require review. Static assets are
127
+ checked because the standalone server serves them before publication middleware.
128
+ Supported headings, paragraphs, simple text lists and quoted images get stable
129
+ bindings; standalone safe links remain native. Root-relative images resolve
130
+ against the saved website origin. Formatted list rows and links inside editable
131
+ text need explicit bindings. Source files, original baselines, imported layouts
132
+ and inventories are checked before changes. The source/generated-file and
133
+ aggregate snapshot cap is 128 KiB; route, AST and document budgets also apply.
134
+ See the [Astro adapter guide](../astro/README.md) for exact limits and sequence.
135
+ Installing all twelve consumers grants no settings access: current server-key
136
+ sections, saved configuration, enabled state and consent still control output.
137
+ Generated lifecycle hooks run `sync-source` before development, build, start and
138
+ preview; custom existing hooks are preserved and require review. Use the generated
139
+ package scripts. Direct Astro commands bypass ownership validation and are outside
140
+ the supported setup workflow.
141
+
142
+ Version 0.9.3 introduced local `preflight` before key entry in CLI and AI-assisted
143
+ instructions. It checks actual framework/runtime evidence and plans original
144
+ source, publication and content bindings without writing files, reading private
145
+ environment files or executing project code. A passing plan is not an installed
146
+ or verified live connection. Stop on a review-required result and follow its
147
+ framework-specific guidance. Native framework support added in 0.12.0 uses the
148
+ profiles above. Other backends and incompatible versions retain the applicable
149
+ reviewed private SDK, native REST or build integration.
150
+ See the [framework support matrix](../../docs/connector-setup.md#framework-selection-and-preflight).
151
+
152
+ Stop when any setup command fails. Saving the private key alone does not install
153
+ the source, publication or settings endpoints. If setup refuses a native route or
154
+ custom layout, preserve it and complete its reviewed integration before the
155
+ restart/check steps; restarting does not create missing endpoint files.
156
+
157
+ Version 0.9.2 supports explicit reviewed native ownership for mixed Next
158
+ application/content sites through `.universalcms/native.routes.json`. The manifest
159
+ records the `reviewed-next-native-v1` profile, exact native static paths, final
160
+ single-segment patterns such as `/shop/[id]`, and reviewed source-file hashes.
161
+ Native application routes stay out of the source import and retain their own
162
+ rendering. A developer must review this manifest; automatic detection never
163
+ silently labels a product, cart or prescription workflow as CMS-owned content.
164
+ Unsupported dynamic descendants, changed hashes and overlapping ownership stop
165
+ setup. Custom headers and footers still need explicit shared settings components.
166
+
167
+ Full setup also checks the running publication adapter after saving. If it prints
168
+ `CONNECTION NOT READY`, follow its exact-origin restart/deployment instructions
169
+ and scoped `check-publication` command. An old server can continue running after
170
+ integration files were removed or packages reinstalled. Setup never stops it or
171
+ switches ports automatically; saved files alone do not mean a connected website.
172
+
173
+ Run these commands in the project that serves the website URL shown in Developer
174
+ setup. A different website folder keeps its own connection and key. If the CLI
175
+ reports a connection mismatch, compare its saved and requested public values,
176
+ then open the correct project folder or copy commands for the existing website.
177
+ Do not continue to restart/check steps after that failure, remove scope guards,
178
+ or reuse another website's key. A busy port can mean the correct website is
179
+ already running; stop only its known server before restarting it.
180
+
181
+ The website URL must identify the customer website, not the CMS admin. CLI and
182
+ AI setup use the same public source reader; neither setup method can fetch a
183
+ customer export from the centrally hosted admin's origin.
184
+
185
+ ### Website configuration and new published routes (0.9.1)
186
+
187
+ Full `setup` includes a separate mandatory review of all twelve website settings
188
+ consumers after original-page integration. Both CLI and AI-assisted setup require
189
+ those consumers to be installed; installing only content or Navigation leaves
190
+ full setup incomplete. Declining or failing the review also leaves setup
191
+ incomplete. To complete that stage or review an intact supported installation,
192
+ use the saved public connection:
193
+
194
+ ```sh
195
+ npx --no-install universalcms-connect setup-settings --apply
196
+ npx --no-install universalcms-connect check-settings
197
+ ```
198
+
199
+ Restart or deploy between those commands. The first installs shared consumers
200
+ for branding, social, SEO, languages, analytics, navigation, experience, scripts,
201
+ redirects, authors, templates and taxonomies. It also resolves new published CMS
202
+ page/post destinations and taxonomy archives without adding every entry to the
203
+ menus. Original website links remain; saved CMS menu additions are separate.
204
+ It changes no CMS records, publications, keys or granted configuration sections.
205
+
206
+ Automatic installation supports intact generated Next.js App Router, simple
207
+ Vite original-page wrappers and bounded Astro layouts without existing site
208
+ chrome. The exact reviewed
209
+ commerce profile also installs all twelve consumers, placing saved menu additions
210
+ inside its native desktop header, mobile menu and footer while preserving native
211
+ links, cart behavior and reserved commerce routes. Its shared layout supplies
212
+ branding, social, languages and consent controls, with the remaining settings
213
+ bound to the server runtime and managed pages. Other native headers/footers,
214
+ custom wrappers and ambiguous routers require a reviewed adapter. The planner
215
+ refuses to overwrite them. Reuse `@universalcms/connect/website-runtime`,
216
+ `@universalcms/connect/react-website` and `@universalcms/connect/website.css`, placing
217
+ the explicit components in the website's existing layout. No arbitrary website
218
+ or framework support is implied by a successful package installation.
219
+
220
+ The settings diagnostic is a credential-free, exact-origin, no-store read at
221
+ `/api/universalcms/settings?check=connection&siteId=...&environmentId=...`.
222
+ It returns all twelve consumer-installation/read statuses and `renderedVerified: false`, never
223
+ setting values or secrets. `installed: false` means the website lacks that
224
+ consumer; full setup and `check-settings` cannot pass the installation gate until
225
+ all twelve are installed. For an installed consumer, an authorized unsaved
226
+ section is `missing`; an ungranted section is `denied`; a delivery error is
227
+ `unavailable`. A key intentionally
228
+ granted only SEO and Scripts can leave the other ten sections disabled while
229
+ their installed consumers remain ready for a later authorized key. Passing the
230
+ installation gate does not mean those disabled features are working. Neither the
231
+ CLI nor the admin broadens access or changes a key automatically.
232
+ Test the actual required output, script/analytics consent, redirect status,
233
+ metadata, menu clicks, empty settings and refresh independently for each deployed
234
+ origin. HTTP delivery success is not rendered-behavior verification.
235
+
236
+ For a reviewed custom layout, put one `WebsiteProvider` around the existing
237
+ layout and place `CmsNavigation` in the native desktop header, mobile menu and
238
+ footer. Pass `excludeUrls` for links already rendered by that native menu;
239
+ `location="footer"` includes saved flat links, groups and footer text. A mobile
240
+ slot can use `onNavigate` to close its existing menu. Use
241
+ `CmsWebsitePage chrome={false}` for new CMS page bodies inside that layout.
242
+ Preserve native interaction handlers and route families. Do not install a second
243
+ `CmsWebsite` header/footer around a layout that already owns them. A Navigation-only
244
+ adapter is incomplete: compose branding, social and language controls, experience
245
+ and consent controls, current SEO and redirects, consent-gated analytics/scripts,
246
+ and author/template/taxonomy presentation for managed pages. Keep one settings
247
+ and script-effects owner per website scope. Validate all twelve consumers, the
248
+ server adapter, publication filtering, exact origin and actual desktop/mobile
249
+ link clicks before reporting the layout connected. Instructions and diagnostics
250
+ never contain or replace the private key.
251
+
252
+ The generated settings manifest records owned adapter files. Subsequent key
253
+ renewal and source finalization accept those intact owned adapters. For an
254
+ expired key, save a replacement with the intended same sections using
255
+ `server-key --prepare-only`, then restart/deploy and verify delivery; full setup
256
+ is not repeated. The command saves only the explicitly confirmed private key
257
+ configuration and Git-ignore protection; it does not install or change settings
258
+ adapters. Newly granted sections work only where their consumers are already
259
+ installed. Configure a hosted website's private key separately. A changed or
260
+ custom adapter still requires review, not forced overwriting.
261
+
262
+ For an operator's downloaded artifact, the installation is:
263
+
264
+ ```sh
265
+ npm install --save-prod ./vendor/universalcms-connect-0.13.1.tgz
266
+ ```
267
+
268
+ Use your project's package manager. These paths are examples for downloaded
269
+ tarballs; Developer setup provides the actual hosted download URLs.
270
+
271
+ The original-route mode uses the connector's bundled renderer and stylesheet.
272
+ It does not create the optional SDK demo. Existing demo files remain preserved
273
+ and keep their runtime dependency checks; repairing such an installation may
274
+ still require the SDK, React renderer and Next adapter tarballs. The separate
275
+ `init` and legacy `setup` flows retain that demo behavior.
276
+
277
+ Before requesting a key or writing a delivery scaffold, `setup` checks installed
278
+ runtime packages, compatible versions, production declarations and the React
279
+ stylesheet. It checks again after confirmation; `server-key` performs the same
280
+ checks for an existing scaffold. Missing or incomplete installations stop with a
281
+ concrete install command using the saved CMS admin origin. A declaration alone
282
+ does not prove a package is installed. These checks inspect bounded metadata and
283
+ files without importing website code or running the package manager. A successful
284
+ check still requires the website's build and rendered-delivery verification.
285
+
286
+ The bundled connector itself must be declared in production `dependencies`, with
287
+ the same installed version as the executing CLI and intact renderer/CSS exports.
288
+ A cached or external CLI cannot substitute for that local runtime. Project-local
289
+ pnpm links are supported; hoisted/shared workspace installations require review.
290
+
291
+ CLI setup does not use an AI model, provider key or AI quota. For supported page
292
+ layouts it prepares the same source import and published-content rendering
293
+ boundaries used by an explicit developer integration. The CMS's Connect & fetch
294
+ content action imports drafts; publishing remains an explicit CMS action.
295
+ Full setup performs framework detection, complete source mapping and content-binding
296
+ validation before its key prompt or integration writes. Explicit private key
297
+ preparation is separate and does not verify an adapter. Unsupported layouts need a reviewed
298
+ developer adapter; they never become a successful partial setup.
299
+
300
+ Developer setup has three screens: **Set up website → Connect website → Setup
301
+ summary**. Key creation and reuse are on the first screen. After installing the
302
+ connector, run its scoped **Save server key privately** command. Paste the key
303
+ only at the hidden terminal prompt and confirm the private save. Then run
304
+ **Connect original website pages**, restart the website and check publication
305
+ behavior before fetching. The server key stays on the website server; the browser
306
+ checks original URLs and the public diagnostic without sending credentials.
307
+
308
+ ### Prepare the server key (0.9.1)
309
+
310
+ The first screen supplies `server-key --prepare-only` with public connection
311
+ flags. This explicitly prepares the private server environment before full setup
312
+ or alongside a source-only integration. It stores the key in Git-ignored
313
+ `.env.local` with owner-only access; credentials never enter command arguments,
314
+ source exports or generated public files. Review the displayed API origin,
315
+ website, environment and other public values before entering the key.
316
+
317
+ Existing public and private connection bindings must agree. The command refuses
318
+ invalid or changed configuration, unsafe files and conflicting environment
319
+ overrides. It writes no renderer or public connection record and makes no network
320
+ request. Saving a key does not verify its authorization, published delivery or
321
+ website rendering. For a live deployment, configure the same private values in
322
+ the hosting provider's server settings; local `.env.local` is not deployed by Git.
323
+ The default `server-key` command, without `--prepare-only`, still requires an
324
+ intact generated delivery integration.
325
+
326
+ ### Prepare content import (0.9.1)
327
+
328
+ `setup-source --apply --require-server-key` remains an explicit migration-only
329
+ command. It validates saved private bindings without installing publication or
330
+ content rendering. `setup --original-routes-only` is the primary full-connection
331
+ command and never silently falls back to source-only preparation. Source-only
332
+ servers do not pass the CMS connection completion checks.
333
+
334
+ The diagnostic reports the installed binding registry and a scoped publication
335
+ read. `check-publication` additionally reads one original URL and checks its HTTP
336
+ status and scoped runtime headers. Both distinguish unpublished pages (404) from
337
+ failed delivery (503). These checks cannot prove DOM correctness: actual published
338
+ text, draft isolation, native interactions and local/live deployment must be tested.
339
+
340
+ `finalize-source --apply` closes the initial export only with intact full runtime
341
+ and content bindings. Source handlers then return 410 without reading the saved
342
+ baseline. Setup reruns preserve closure, and no original source or CMS publication
343
+ is deleted. Run it only after importing and reviewing the source content. Review
344
+ static assets and previous browser caches separately.
345
+
346
+ The reviewed clothes-storefront profile binds 12 original pages to CMS documents
347
+ while retaining its native layout and handlers. Tracking and stylist consultation
348
+ remain website-owned. The reviewed ice-cream profile binds seven editorial pages
349
+ and preserves 19 exact commerce URLs, including 16 product details. Their catalog,
350
+ cart and checkout data remain website-owned. Both profiles check original module
351
+ hashes and preserve imported block IDs. Changed or unrecognized compositions need
352
+ review; these profiles are not general custom-router or commerce-data support.
353
+ Setup never executes customer code or reads visitor inputs, browser storage or
354
+ checkout state to discover content.
355
+
356
+ Source-only Vite dev/preview now use the registered loopback port with strictPort.
357
+ Stop the old server first; a busy or conflicting port fails rather than moving to
358
+ another port. Run `check-source` after restarting, then fetch drafts in the CMS.
359
+ Static hosting still needs a deployed server source adapter; local source setup
360
+ does not deploy a live website.
361
+
362
+ After saving source files, 0.7.3 checks the running endpoint and reports source
363
+ readiness separately from file creation. An old Vite process keeps its original
364
+ configuration until restarted; changing package scripts does not restart it.
365
+ If the endpoint is missing or returns the SPA HTML, stop the old server, run the
366
+ printed startup command in that project and repeat `check-source`. The check can
367
+ read saved public source settings without requiring a private delivery key.
368
+ Both setup methods validate the source, publication adapter, every registered
369
+ original URL and installation of all twelve settings consumers before import.
370
+ Intentionally ungranted settings remain disabled. A closed export skips the
371
+ source fetch and remains eligible for publication rechecks. Rendered browser behavior and each
372
+ live deployment remain separate evidence.
373
+
374
+ `setup --original-routes-only` saves a public connection record alongside the
375
+ complete reviewed integration, then offers key entry. A missing route mapping
376
+ stops before any new connection/integration files or key prompt. `analyze` is an
377
+ optional diagnostic: it only prints a report and cannot create `/api/cms-source`
378
+ or prepare a website for Connect & fetch content. For unsupported layouts, finish
379
+ the reviewed developer adapter before fetching content.
380
+
381
+ The separate commands below remain available for existing scripts and staged use:
382
+
383
+ 1. **Connect the website.** Review and save its public connection settings.
384
+
385
+ ```sh
386
+ npx --no-install universalcms-connect connect \
387
+ --api-origin https://cms.example.com \
388
+ --site 11111111-1111-4111-8111-111111111111 \
389
+ --environment 22222222-2222-4222-8222-222222222222 \
390
+ --locale en \
391
+ --website-origin http://localhost:8080 \
392
+ --admin-origin http://localhost:3000
393
+ ```
394
+
395
+ Missing values are prompted in the terminal. After confirmation, `connect`
396
+ saves only `.universalcms/connection.json`: the API origin, site/environment
397
+ IDs, locale and website/admin origins. It does not authenticate, contact the
398
+ CMS, import content or save a key. It reads bounded existing private settings
399
+ to check their connection binding without displaying credentials. Keep the
400
+ public connection file with the integration.
401
+ Repeating the same connection is safe; a different connection or conflicting
402
+ saved runtime/source settings requires manual review and is refused.
403
+
404
+ 2. **Set up the integration.** Review the proposed files before saving.
405
+
406
+ ```sh
407
+ npx --no-install universalcms-connect setup
408
+ ```
409
+
410
+ Setup reads the saved connection, creates the source adapter, installs
411
+ publication checks and binds supported native page components to published
412
+ content at reviewed original URLs, including the homepage. It next requires a
413
+ separate review of all twelve settings consumers, including native header and
414
+ footer integration. An unsupported or declined stage leaves setup incomplete.
415
+ After that stage succeeds it asks **Save a server key now?** Accept to enter an
416
+ existing key through the hidden prompt and review its private save, or choose
417
+ No to create a key in the CMS first. Deferring leaves `.env.local` unchanged.
418
+ Canceling or failing the later key step retains the saved integration files.
419
+ Custom server/router code remains unchanged.
420
+
421
+ 3. **Save the server key if you deferred it.** Create an environment-scoped server delivery key in
422
+ Developer setup, then paste it into the hidden terminal prompt.
423
+
424
+ ```sh
425
+ npx --no-install universalcms-connect server-key
426
+ ```
427
+
428
+ The command checks that the generated delivery configuration matches the
429
+ saved connection. After confirmation, it saves private server settings to
430
+ `.env.local` with owner-only mode `0600` and excludes the file from Git. Never
431
+ add a key to a command, public configuration or an AI prompt. Full setup
432
+ supports server keys with Cache Components. The separate `setup-source` command
433
+ alone does not install publication checks or prepare private key entry.
434
+
435
+ These commands do not install dependencies, execute website scripts, import CMS
436
+ content or call AI. The connector bundles its shared content renderer; the
437
+ additive `init` demo also needs the SDK and adapters described below. A saved connection and key do not establish successful API delivery or
438
+ actual website rendering; verify those separately after publishing a page.
439
+
440
+ Full `setup` installs publication checks before original public pages render.
441
+ Review every proposed URL-to-kind/slug/locale mapping, including `/` to the home
442
+ page. Published pages retain their existing components and design; missing or
443
+ unpublished pages return HTTP 404. Delivery failures return HTTP 503 without
444
+ original content. The completed settings integration resolves new published CMS
445
+ page/post destinations and taxonomy archives; unknown or unpublished public URLs
446
+ return 404. Private/account, API, admin, preview, framework and asset
447
+ paths remain outside this public-page policy.
448
+
449
+ The separate source-only command and additive `init` demo do not install this
450
+ original-page protection. Upgrade older installations by rerunning full `setup`
451
+ with 0.10.0, then restarting or rebuilding and deploying the website.
452
+ Verify published, all-unpublished and publish-to-unpublish states using fixtures
453
+ or disposable staging content at the original URLs, through direct requests,
454
+ client navigation, reload and cached/prefetched routes. Do not change customer
455
+ publications merely to test. Verify the documented rebuild/cache/deployment policy
456
+ for static hosts. Successful API reads and demo routes do not establish that
457
+ original pages follow CMS publication. Existing websites need the reviewed runtime
458
+ integration and deployment; these instructions do not apply it automatically.
459
+ Public migration exports and previously public assets remain separate concerns.
460
+
461
+ For compatibility, running `setup` without `.universalcms/connection.json` keeps
462
+ the combined guided flow: it asks for public values and a hidden server key,
463
+ then writes the private settings and scaffold after one file-summary confirmation.
464
+ It then requires the separate all-settings review; declining it leaves the saved
465
+ core integration incomplete.
466
+ Existing private values can be accepted with Enter; a saved key is never shown.
467
+ That legacy flow can offer an optional published-page slug for a delivery check.
468
+ Skipping or failing verification is reported as unverified delivery.
469
+
470
+ For Next.js, setup uses the website and CMS admin origins to prepare
471
+ `/api/cms-source`. Source export itself needs no delivery key; original-page
472
+ publication checks do require one, including with Cache Components.
473
+ Public static page discovery uses a bounded TypeScript parser without AI or
474
+ executing your page code. In development every source request discovers new
475
+ pages. Production uses a snapshot refreshed by `npm run build` before deployment;
476
+ running `next build` directly bypasses npm's prebuild hook, so run `sync-source`
477
+ first in that case. Deploy the new build before reconnecting from the CMS.
478
+
479
+ For source-only setup:
16
480
 
17
481
  ```sh
18
- npm install --save-prod ./vendor/universalcms-connect-0.1.0.tgz
19
- npx --no-install universalcms-connect setup
482
+ npx --no-install universalcms-connect setup-source \
483
+ --website-origin http://localhost:8080 \
484
+ --admin-origin http://localhost:3000 \
485
+ --site 11111111-1111-4111-8111-111111111111 \
486
+ --environment 22222222-2222-4222-8222-222222222222
487
+ # Review the plan, then repeat with --apply.
488
+ npx --no-install universalcms-connect sync-source
20
489
  ```
21
490
 
22
- Guided setup asks for the API origin, website/environment IDs, locale and a
23
- hidden server delivery key. Vite also needs the website origin; existing servers
24
- that use the CMS admin origin are prompted for it. Values provided through the
25
- CMS's generated command are already filled in. Saved values can be accepted
26
- with Enter, and an existing saved key can be kept without displaying it.
27
-
28
- After one file-summary confirmation it writes `.env.local` with owner-only
29
- permissions, excludes that file from Git and creates the framework scaffold.
30
- Reruns can replace connection values in unchanged generated files and the
31
- private env file; unrelated env settings and custom source edits are preserved.
32
- Already tracked secrets, unsafe links and conflicting higher-priority env files
33
- are rejected. An optional published-page slug checks delivery after saving.
34
- Setup never imports content, calls AI, installs dependencies or changes custom
35
- server/router code. Install the SDK and renderer from your operator as described
36
- below; API verification and actual website rendering are separate checks.
491
+ Setup writes `.universalcms/source.config.json`, `source.generated.json`, a scoped
492
+ Next route and a prebuild refresh hook. Commit the public configuration and
493
+ snapshot with the integration. Keep the exact website/admin origins correct for
494
+ each deployment. Existing custom source endpoints are preserved and need an
495
+ explicit one-time integration of `createNextSourceHandler` with their reviewed
496
+ `baseManifest`; listed `skipSlugs` retain those documents. Subsequent source
497
+ refreshes preserve that adapter and reviewed content.
498
+
499
+ Only public static pages are opted into automatic discovery. Review public-page
500
+ scope at setup and use `excludedRoutes` in the public source config for paths or
501
+ subtrees that must never be exported. Common private route names, middleware,
502
+ auth-dependent pages/layouts and unknown conditionals are conservatively omitted.
503
+ These guards cannot establish that an arbitrary application is public. The parser
504
+ supports literal JSX text and selected immutable lists; forms, input values,
505
+ private runtime state, imported components and database-backed/dynamic routes
506
+ require an explicit public mapping. Unsupported content is reported, never
507
+ replaced with placeholder pages. Layout/design and interaction are not copied.
508
+ Inspect imported drafts before publishing. Existing CMS entries are preserved.
509
+
510
+ `check-source --check-routes` compares static Next paths with the export (`/`
511
+ maps to `home`). Missing pages fail the check, including deliberately excluded
512
+ pages that need review; dynamic/custom/parallel routing stays unverified.
513
+ React/Vite source setup can discover a directly mounted static App or flat literal
514
+ React Router routes with local static page modules. It plans a nonempty manifest
515
+ at `.universalcms/source.entries.json`, using the existing version 1 `{ version,
516
+ entries }` contract, plus `.universalcms/content.routes.json` page bindings.
517
+ It inspects the actual HTML/React entry without executing components. Custom
518
+ history routers, guarded routes, dynamic data and incomplete extraction need a
519
+ reviewed mapping; arbitrary router inference is not supported.
520
+ Once mapped, `setup` or `setup-source --apply` creates a Vite source plugin wrapper
521
+ and updates ordinary dev/preview scripts, preserving the original config. The
522
+ normal package start command then serves `/api/cms-source` before HTML fallback.
523
+ Missing/invalid mappings stop full setup before integration files or key prompts.
524
+ Customized wrappers/start commands are preserved for manual integration.
525
+ All entries must use the configured locale; apply private-route exclusions to the
526
+ manifest itself. The public read sends no key and enforces exact scope, host and
527
+ CMS origin. Local preview is supported, but static hosting needs a server endpoint.
528
+ The package exports `universalCmsSource` and `createViteSourceHandler` from
529
+ `@universalcms/connect/vite-source` for reviewed custom integrations.
37
530
 
38
531
  The original plan/apply commands remain available for advanced setup without
39
532
  writing a secret file:
@@ -46,7 +539,7 @@ npx --no-install universalcms-connect init \
46
539
  --environment 22222222-2222-4222-8222-222222222222
47
540
  ```
48
541
 
49
- After a public release, `npx @universalcms/connect@0.1.0 init` is the equivalent
542
+ After a public release, `npx @universalcms/connect@0.13.1 init` is the equivalent
50
543
  registry entry point. Copy the real IDs/API origin from **Developer setup**.
51
544
  Missing values are prompted in a terminal; `--non-interactive` fails instead.
52
545
  Init prints a plan. Run the same command with `--apply` after reviewing it.
@@ -74,8 +567,8 @@ component, an additive dev-proxy wrapper and a private Node handler. For Vite
74
567
  production, deploy the static site **and** the private handler, and configure
75
568
  the host to proxy `/api/universalcms/page`; the Vite dev proxy is insufficient.
76
569
 
77
- For Vite websites with a detected existing Node server, setup prints a specific
78
- warning and an existing-server integration guide. Keep the website's normal
570
+ For Vite websites with a detected existing Node server, full setup stops before
571
+ saving files and requests an existing-server integration review. Keep the website's normal
79
572
  startup, SSR bootstrap and routes. Register `createPageHandler` from
80
573
  `@universalcms/connect/node` with its private fixed-scope SDK client before the
81
574
  existing API/SSR fallback; install the connector as a production dependency if
@@ -89,6 +582,47 @@ preview and SEO are deliberate follow-up integrations through the SDK. It does
89
582
  not silently create, import or publish CMS content. Successful API verification
90
583
  is distinct from a verified website deployment.
91
584
 
585
+ ### Diagnose Connect & fetch content
586
+
587
+ The CMS button reads the website's **`/api/cms-source`** endpoint. Current Next.js
588
+ `setup` prepares automatic public static-page discovery. Legacy `init` only
589
+ prepares delivery scaffolding. React/Vite setup serves its reviewed public manifest through the normal dev command.
590
+ Custom exporters need their explicit adapter; a delivery check alone is insufficient.
591
+
592
+ Use the CMS's reviewed 0.13.1 package for the staged commands and current source
593
+ discovery. Review source diagnostics and complete public
594
+ mappings for unsupported pages. Restart the website using its normal server command, then run:
595
+
596
+ ```sh
597
+ npx --no-install universalcms-connect check-source \
598
+ --website-origin http://localhost:8080 \
599
+ --admin-origin http://localhost:3000 \
600
+ --site 11111111-1111-4111-8111-111111111111 \
601
+ --environment 22222222-2222-4222-8222-222222222222
602
+ ```
603
+
604
+ Replace the public values with the exact website/CMS origins and scope from
605
+ Developer setup. `localhost` and `127.0.0.1` are different origins. No delivery
606
+ key is needed, requested or sent. Supplying all four flags bypasses local saved
607
+ configuration and works without running `init` or `setup`, including websites
608
+ whose Next.js settings require manual integration. Otherwise missing values use
609
+ sanitized `.env.local`/connector-config defaults. The command does not execute
610
+ website code, change files, import content, make a CMS request or call AI.
611
+
612
+ The read has a 10-second deadline, 20 MiB response budget, redirect rejection,
613
+ fixed endpoint and exact scope/CORS checks. It validates the entire manifest's
614
+ envelope, document shape, canonical identities and taxonomy assignments, up to
615
+ 1,000 entries. It prints fixed diagnostics and counts rather than returned
616
+ content. A nonzero exit identifies a missing route, origin/scope mismatch, invalid
617
+ manifest or other failed read; an empty export does not pass an existing-site check.
618
+
619
+ A successful check is **not** complete authoring block-schema validation,
620
+ inventory completeness or proof of browser access. Validate every complete
621
+ document with the CMS v1 authoring schema, account for all public routes and
622
+ unsupported mappings, and retry **Connect & fetch content** from the signed-in
623
+ CMS browser. Browser local-network permissions may still need to be granted.
624
+ The CLI must not loosen CORS or put a CMS key on the public source request.
625
+
92
626
  Analysis reads exact bounded project files and installed package metadata; it
93
627
  never evaluates configuration, runs website code, loads `.env`, crawls sites,
94
628
  uploads source or calls AI. Its sanitized JSON report can be supplied explicitly
@@ -99,21 +633,27 @@ Init-generated files use exclusive creation; identical reruns are unchanged, con
99
633
  stop before writes, symlinks and unsafe paths are rejected. Do not modify the
100
634
  project concurrently while setup applies: an interrupted or concurrently changed
101
635
  filesystem can leave a partial set of newly created files; rerun the same setup
102
- after inspection. Init does not replace or delete existing files. Guided setup
103
- can replace unchanged generated files and private connection assignments after
104
- confirmation. Each file replacement is atomic; the overall multi-file operation
105
- can be interrupted after some settings or files have been saved.
636
+ after inspection. Init does not replace or delete existing files. Staged setup
637
+ keeps the connection fixed; changing the site, environment or origins requires
638
+ manual review. The legacy guided flow without a connection record can replace
639
+ unchanged generated files and private connection assignments after confirmation.
640
+ Each file replacement is atomic; the overall multi-file operation can be
641
+ interrupted after some settings or files have been saved.
106
642
 
107
643
  `check` performs a bounded published-page read with fixed site/environment/locale,
108
644
  no cookies and redirect rejection. It prints constant status messages, not returned
109
645
  content or credentials. Keys are never accepted as CLI flags, persisted in output,
110
- or put in `NEXT_PUBLIC_`/`VITE_` configuration. Guided `setup` is the explicit
111
- exception for local secret persistence: it saves only to private `.env.local`,
112
- never generated documentation or public configuration. No install/postinstall hook runs.
646
+ or put in `NEXT_PUBLIC_`/`VITE_` configuration. `server-key` and the legacy combined
647
+ `setup` save secrets only to private `.env.local`, never generated documentation
648
+ or public configuration. Unrelated private assignments and comments are preserved.
649
+ Tracked secret files, unsafe links, ambiguous managed assignments, stale plans
650
+ and conflicting process/development/production overrides are rejected. No
651
+ install/postinstall hook runs.
113
652
 
114
653
  Development: `node scripts/build.mjs` makes the packed `dist` artifact and copies
115
- five reviewed analyzer/checker sources from `integrations/custom`. The tarball
116
- contains no workspace-relative imports or runtime dependencies. Rebuild whenever
654
+ six reviewed analyzer/checker/provider sources from `integrations/custom`, plus
655
+ the TypeScript parser and its Apache license from the locked workspace compiler. The tarball
656
+ contains no workspace-relative imports. Its optional React peer is used only by website rendering, never by the CLI. Rebuild whenever
117
657
  those shared sources change. Run `tests/connect-package.test.ts` and the existing
118
658
  project-analysis, dependency-diagnostics and check-delivery tests before release.
119
659
  From the repository root, run `node integrations/connect/scripts/smoke.mjs`
@@ -121,3 +661,125 @@ for production-build/browser verification using clean consumers and a synthetic
121
661
  CMS API. It defaults to offline dependency installation; `--online` permits
122
662
  public registry downloads and `--vite8` selects Vite 8.3 instead of Vite 7.3.
123
663
  It does not use customer records or live provider credentials.
664
+
665
+ ## Original-page publication control (0.6.1)
666
+
667
+ Full `setup` installs publication checks for reviewed original URLs, including the
668
+ exported homepage. Missing/unpublished entries return HTTP 404; failed delivery
669
+ returns 503. Published pages retain their native design. Review the printed URL
670
+ mapping before Save; use `.universalcms/publication.routes.json` for custom paths.
671
+ Next 16 Cache Components is supported through a Node proxy. Standard Vite dev,
672
+ preview and build use the publication plugin; run the generated `npm start` Node
673
+ host for production. Static-only hosting cannot enforce this check.
674
+ For loopback website origins, dev and preview use the saved port with strict port
675
+ binding. Stop the dev server before starting preview; conflicting port overrides
676
+ require correcting the connection or command rather than silently using another origin.
677
+
678
+ Upgrade the connector, rerun setup and restart/deploy existing websites. Custom
679
+ servers/proxies/layouts require review and do not silently receive a success
680
+ claim. `init` remains an additive demo; `setup-source` exports content only.
681
+ The browser rechecks open pages on focus/history/visibility and every 15 seconds.
682
+ Full setup also installs the frozen source bindings described below; custom components use the same published-content provider.
683
+
684
+ ## Rendering published changes (0.6.1)
685
+
686
+ Full `setup` binds supported public JSX/TSX page components to the delivered
687
+ published document. Native elements and handlers remain mounted; stable imported
688
+ block IDs select the content. Deleted blocks disappear, empty documents stay empty,
689
+ and new blocks appear after the bound page body. Original native layout positions
690
+ remain fixed; arbitrary section reordering and imported component internals need
691
+ explicit mappings. Unsupported mappings stop setup before writes rather than
692
+ reporting an availability-only integration as complete.
693
+
694
+ Next App Router pages receive a request-time server wrapper and metadata from the
695
+ same published revision. The reviewed configuration serves metadata in the initial
696
+ HTML and disables a literal Cache Components flag only when the bounded source
697
+ review finds no active `use cache`, `cacheLife` or `cacheTag` usage. Applications
698
+ using those features need an explicit request-time integration; setup preserves
699
+ their settings and stops before writes. Vite page modules receive a browser provider that waits
700
+ for the private server's validated public projection before showing managed
701
+ content. A directly mounted static App or flat literal React Router page tree can
702
+ be discovered when there is no existing manifest. Other reviewed Vite routes
703
+ require `.universalcms/content.routes.json`:
704
+
705
+ ```json
706
+ [
707
+ { "path": "/", "sourceFile": "src/pages/Home.jsx" },
708
+ { "path": "/articles/story", "sourceFile": "src/pages/Story.jsx" }
709
+ ]
710
+ ```
711
+
712
+ These modules must match their reviewed source manifest blocks. Existing AI import
713
+ IDs are retained only when the entire ordered type/text/data structure matches.
714
+ Custom routers and unmatched imports use an explicit reviewed binding through
715
+ `@universalcms/connect/react-publication`; setup does not guess from similar text.
716
+ The same runtime works for pages and posts, in development and on the generated
717
+ production server. Static-only hosting needs a private runtime adapter or a
718
+ separately verified rebuild/deployment pipeline.
719
+
720
+ The `.universalcms/content.bindings.json` registry records source, native module,
721
+ inventory and original-backup hashes. Reconnects and builds retain frozen import
722
+ IDs. Concurrent edits, edited wrappers or changed native modules require review,
723
+ so setup never silently regenerates CMS identities from edited text. Add routes
724
+ through another reviewed setup. Keep original backups private to the project.
725
+
726
+ For existing sites, install the new connector, rerun full setup, review the files,
727
+ build and deploy to **each** local/live host. Updating the CMS or downloading a
728
+ package does not modify already deployed website bundles. Existing AI integrations
729
+ can use the shared provider/bindings while retaining their custom server/router.
730
+ The AI setup prompt requires rendered revision-change tests on every deployed
731
+ origin; API availability alone cannot pass that gate.
732
+
733
+
734
+ Importing source creates editable drafts. Publication checks control availability;
735
+ the website must also render the delivered document to display those edits. Saving
736
+ a draft keeps the current public revision. **Update live / Publish** creates the
737
+ new public revision.
738
+
739
+ Server components can read the current document with the same reviewed route
740
+ registry and private `CMS_API_KEY` used by the publication proxy:
741
+
742
+ ```js
743
+ import { createPublishedDocumentReader, publicPublishedEntry } from '@universalcms/connect/publication';
744
+ import configuration from './.universalcms/publication.config.json' with { type: 'json' };
745
+
746
+ const readPublished = createPublishedDocumentReader({ configuration });
747
+ const result = await readPublished('/about');
748
+ // Handle missing as 404 and unavailable as 503; never fall back to old page text.
749
+ if (result.state === 'published') {
750
+ const entry = publicPublishedEntry(result.entry);
751
+ // Pass entry.document to the website's reviewed native components or renderer.
752
+ }
753
+ ```
754
+
755
+ The Next proxy and Vite host also serve `GET /api/universalcms/document?path=/about`.
756
+ Only registered public paths are accepted; scope and the server key stay on the
757
+ server. The published response contains `state`, `revision` and `entry`. Custom
758
+ fields, unknown properties and form notification destinations are omitted from
759
+ this browser projection. Private server readers can explicitly map approved
760
+ custom fields themselves. Missing publications return 404 and failed delivery
761
+ returns 503. Responses use no-store caching.
762
+ The existing publication-status response remains `{ "state": "published" }` for
763
+ older browser scripts. The current script requests a revision token with
764
+ `X-UniversalCMS-Include-Revision: 1`; this avoids breaking open tabs during an upgrade.
765
+
766
+ Preserve the imported block IDs in an explicit component mapping. Do not regenerate
767
+ them from edited text or blindly replace matching DOM text. Shared phrases,
768
+ collections and imported components need distinct reviewed slots. Handle removed
769
+ blocks without restoring stale literals and define where added blocks render.
770
+
771
+ To keep an open page current, emit a meta element named
772
+ `universalcms-publication-revision`, with `content` equal to the rendered revision
773
+ token and `data-path` equal to its registered path. The browser checks publication
774
+ on focus and every 15 seconds. A changed revision reloads the page by default;
775
+ a provider can handle the cancelable `universalcms:publication-change` event,
776
+ fetch the public document, update its React state, and then update the meta token.
777
+ The provider must handle failed/missing responses without retaining old content.
778
+ Full setup now creates these native component bindings for supported source modules. The source-only importer remains separate.
779
+
780
+ Production publication tests use synthetic content and a private fixture key:
781
+ `node scripts/test-connect-next-publication.mjs` (from the repository root), then
782
+ `node integrations/connect/scripts/publication-smoke.mjs` with
783
+ `UNIVERSALCMS_SMOKE_VITE_MODULE` set to an installed Vite 6/7/8
784
+ `dist/node/index.js` file. Build the connector first; both scripts require local
785
+ HTTP listeners and installed Chrome. They do not change customer publications.