@universalcms/connect 0.0.0-stage → 0.13.0

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