@conloca/astro-cms 0.2.6 → 0.3.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 (97) hide show
  1. package/README.md +169 -22
  2. package/dist/internal/PageRoot.astro +10 -0
  3. package/dist/internal/page-handler.astro +46 -13
  4. package/dist/internal/preview-page-handler.astro +46 -13
  5. package/dist/ts/.build-inputs.json +20 -15
  6. package/dist/ts/src/build/check-fragment-components.d.ts +18 -0
  7. package/dist/ts/src/build/check-fragment-components.d.ts.map +1 -0
  8. package/dist/ts/src/build/check-fragment-components.js +70 -0
  9. package/dist/ts/src/build/check-fragment-components.js.map +1 -0
  10. package/dist/ts/src/build/fragment-manifest.d.ts +35 -0
  11. package/dist/ts/src/build/fragment-manifest.d.ts.map +1 -0
  12. package/dist/ts/src/build/fragment-manifest.js +138 -0
  13. package/dist/ts/src/build/fragment-manifest.js.map +1 -0
  14. package/dist/ts/src/build/fragment-render-load.d.ts +17 -0
  15. package/dist/ts/src/build/fragment-render-load.d.ts.map +1 -0
  16. package/dist/ts/src/build/fragment-render-load.js +51 -0
  17. package/dist/ts/src/build/fragment-render-load.js.map +1 -0
  18. package/dist/ts/src/cms-handler.d.ts +6 -0
  19. package/dist/ts/src/cms-handler.d.ts.map +1 -1
  20. package/dist/ts/src/cms-handler.js +3 -5
  21. package/dist/ts/src/cms-handler.js.map +1 -1
  22. package/dist/ts/src/components/FragmentIsland.d.ts +17 -0
  23. package/dist/ts/src/components/FragmentIsland.d.ts.map +1 -0
  24. package/dist/ts/src/components/FragmentIsland.js +78 -0
  25. package/dist/ts/src/components/FragmentIsland.js.map +1 -0
  26. package/dist/ts/src/components/IslandSlot.d.ts +14 -0
  27. package/dist/ts/src/components/IslandSlot.d.ts.map +1 -0
  28. package/dist/ts/src/components/IslandSlot.js +19 -0
  29. package/dist/ts/src/components/IslandSlot.js.map +1 -0
  30. package/dist/ts/src/components/RenderWithFragments.d.ts +3 -1
  31. package/dist/ts/src/components/RenderWithFragments.d.ts.map +1 -1
  32. package/dist/ts/src/components/RenderWithFragments.js +1 -1
  33. package/dist/ts/src/components/RenderWithFragments.js.map +1 -1
  34. package/dist/ts/src/discovery/merge-registry.js +6 -2
  35. package/dist/ts/src/discovery/merge-registry.js.map +1 -1
  36. package/dist/ts/src/editor-descriptors.d.ts +4 -0
  37. package/dist/ts/src/editor-descriptors.d.ts.map +1 -1
  38. package/dist/ts/src/editor-descriptors.js +11 -0
  39. package/dist/ts/src/editor-descriptors.js.map +1 -1
  40. package/dist/ts/src/handlers/collection-content-api.d.ts +3 -1
  41. package/dist/ts/src/handlers/collection-content-api.d.ts.map +1 -1
  42. package/dist/ts/src/handlers/collection-content-api.js +13 -2
  43. package/dist/ts/src/handlers/collection-content-api.js.map +1 -1
  44. package/dist/ts/src/handlers/page-render-core.d.ts +36 -7
  45. package/dist/ts/src/handlers/page-render-core.d.ts.map +1 -1
  46. package/dist/ts/src/handlers/page-render-core.js +97 -18
  47. package/dist/ts/src/handlers/page-render-core.js.map +1 -1
  48. package/dist/ts/src/lib/hydration-scanner.d.ts +21 -0
  49. package/dist/ts/src/lib/hydration-scanner.d.ts.map +1 -1
  50. package/dist/ts/src/lib/hydration-scanner.js +50 -0
  51. package/dist/ts/src/lib/hydration-scanner.js.map +1 -1
  52. package/dist/ts/src/lib/hydration-script.d.ts +13 -5
  53. package/dist/ts/src/lib/hydration-script.d.ts.map +1 -1
  54. package/dist/ts/src/lib/hydration-script.js +74 -36
  55. package/dist/ts/src/lib/hydration-script.js.map +1 -1
  56. package/dist/ts/src/lib/routing-config.d.ts +1 -1
  57. package/dist/ts/src/lib/routing-config.d.ts.map +1 -1
  58. package/dist/ts/src/lib/routing-config.js +5 -2
  59. package/dist/ts/src/lib/routing-config.js.map +1 -1
  60. package/dist/ts/src/lib/unknown-components.d.ts +1 -2
  61. package/dist/ts/src/lib/unknown-components.d.ts.map +1 -1
  62. package/dist/ts/src/lib/virtual-module-generators.d.ts +37 -0
  63. package/dist/ts/src/lib/virtual-module-generators.d.ts.map +1 -1
  64. package/dist/ts/src/lib/virtual-module-generators.js +86 -0
  65. package/dist/ts/src/lib/virtual-module-generators.js.map +1 -1
  66. package/dist/ts/src/plugin-spa.d.ts +24 -0
  67. package/dist/ts/src/plugin-spa.d.ts.map +1 -1
  68. package/dist/ts/src/plugin-spa.js +136 -69
  69. package/dist/ts/src/plugin-spa.js.map +1 -1
  70. package/dist/ts/src/puck-manifest/types.d.ts +4 -0
  71. package/dist/ts/src/puck-manifest/types.d.ts.map +1 -1
  72. package/dist/ts/src/types.d.ts +14 -2
  73. package/dist/ts/src/types.d.ts.map +1 -1
  74. package/dist/virtual-modules.d.ts +26 -0
  75. package/package.json +10 -4
  76. package/src/build/check-fragment-components.ts +82 -0
  77. package/src/build/fragment-manifest.ts +163 -0
  78. package/src/build/fragment-render-load.ts +64 -0
  79. package/src/cms-handler.ts +3 -6
  80. package/src/components/FragmentIsland.tsx +97 -0
  81. package/src/components/IslandSlot.tsx +28 -0
  82. package/src/components/PageRoot.astro +10 -0
  83. package/src/components/RenderWithFragments.tsx +4 -1
  84. package/src/discovery/merge-registry.ts +8 -3
  85. package/src/editor-descriptors.ts +17 -0
  86. package/src/handlers/collection-content-api.ts +15 -2
  87. package/src/handlers/page-handler.astro +46 -13
  88. package/src/handlers/page-render-core.ts +132 -21
  89. package/src/lib/hydration-scanner.ts +65 -0
  90. package/src/lib/hydration-script.ts +83 -40
  91. package/src/lib/routing-config.ts +7 -3
  92. package/src/lib/unknown-components.ts +1 -1
  93. package/src/lib/virtual-module-generators.ts +106 -0
  94. package/src/plugin-spa.ts +182 -76
  95. package/src/puck-manifest/types.ts +8 -0
  96. package/src/types.ts +15 -1
  97. package/src/virtual-modules.d.ts +26 -0
package/README.md CHANGED
@@ -178,31 +178,42 @@ const { title, description } = Astro.props;
178
178
  Supplying `layout` and nothing else turns on a catch-all `/[...slug]` route over the `pages` collection with a `404`
179
179
  fallback. Sites that need more than one route drop `layout` and use `routing.routes.<name>.layout` instead.
180
180
 
181
+ A route may also name an `editorFrame`: a module whose default export is a React component
182
+ `({ pathname, children }) => ReactNode` that renders the markup the route's layout puts around page content, for example
183
+ `<div className="page-shell">{children}</div>`. The editor canvas shows each page of that route inside it, so blocks
184
+ look as they do on the site. Publish ignores the frame apart from one thing: every published page of that route wraps
185
+ its content in `<div data-conloca-page-root="">`, which marks where page content starts. Routes without a frame are
186
+ unchanged, byte for byte. Selectors in the layout's CSS that target page content as a direct child (`main > section`)
187
+ may need adjusting on framed routes. Fragments render inline inside the frame with the site's own components, so prose
188
+ in the canvas sits in the same wrappers as on the page; `conloca doctor --live` (CC30) warns when a published page's
189
+ wrappers drift from its frame.
190
+
181
191
  With those four files in place, run the Astro dev server and open `/__cms`.
182
192
 
183
193
  ### Options
184
194
 
185
195
  Passed to `conlocaCMS({ ... })`. Only two are required.
186
196
 
187
- | Option | Required | What it does |
188
- | ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189
- | `contentRoot` | yes | Directory holding `sites.json` and the content files. Also handed to the collection factories, so the content config needs no copy of it. |
190
- | `puckConfigPath` | yes | Module whose default export is the Puck `Config`. Supplies the visual editor's component palette and seeds component auto-discovery. |
191
- | `canvasDir` | no | Directory for canvas documents. |
192
- | `route` | no | Where the CMS mounts. Defaults to `/__cms`. |
193
- | `layout` | no | Default layout for content pages. On its own it enables routing with a catch-all pattern. |
194
- | `routing` | no | Full routing configuration, for sites with more than one content route. |
195
- | `templates` | no | Page templates offered in the create-page dialog. |
196
- | `schemasPath` | no | Module exporting `dataSchemas`, `pageSchemas` and `mdxComponents`. Drives the page-settings form and the MDX component registry. |
197
- | `contentSchemasPath` | no | Schema-only module exporting the `pageSchemas` / `dataSchemas` your content config passes to `conlocaPages()` / `conlocaData()`. Draft previews parse entries with the entry parsers built from it, as the build does. |
198
- | `componentPaths` | no | Extra folders to scan for components wrapped in `withHydration()`. |
199
- | `mdxComponentFolders` | no | Folders scanned for locally authored MDX components, whose `interface Props` becomes the editor's prop panel. Defaults to `['src/components/mdx']`. |
200
- | `assetsPath` | no | Upload directory; enables the Media Library. The site must serve it from `publicDir`, directly or through a link there, or dev and build fail. |
201
- | `siteStyles` | no | CSS injected into the Puck preview iframe so components render with site styling. |
202
- | `editorStyles` | no | CSS injected into the MDX editor's admin document. Host-component selectors only — see the file's own notes on what does not belong. |
203
- | `editorCSS` | no | Raw CSS applied after auto-discovered host styles in the editor's host-preview layer. |
204
- | `fragmentPreviewRoute` | no | Route whose styles and content wrapper frame the standalone fragment editor. Defaults to `/`. |
205
- | `locales` | no | The site's locales and default locale. Without it: the site's `locales` and `defaultLocale` in `sites.json`, else `globalLocales`. |
197
+ | Option | Required | What it does |
198
+ | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
199
+ | `contentRoot` | yes | Directory holding `sites.json` and the content files. Also handed to the collection factories, so the content config needs no copy of it. |
200
+ | `puckConfigPath` | yes | Module whose default export is the Puck `Config`. Supplies the visual editor's component palette and seeds component auto-discovery. |
201
+ | `canvasDir` | no | Directory for canvas documents. |
202
+ | `route` | no | Where the CMS mounts. Defaults to `/__cms`. |
203
+ | `layout` | no | Default layout for content pages. On its own it enables routing with a catch-all pattern. |
204
+ | `routing` | no | Full routing configuration, for sites with more than one content route. |
205
+ | `templates` | no | Page templates offered in the create-page dialog. |
206
+ | `schemasPath` | no | Module exporting `dataSchemas`, `pageSchemas` and `mdxComponents`. Drives the page-settings form and the MDX component registry. |
207
+ | `contentSchemasPath` | no | Schema-only module exporting the `pageSchemas` / `dataSchemas` your content config passes to `conlocaPages()` / `conlocaData()`. Draft previews parse entries with the entry parsers built from it, as the build does. |
208
+ | `componentPaths` | no | Extra folders to scan for components wrapped in `withHydration()`. |
209
+ | `mdxComponentFolders` | no | Folders scanned for locally authored MDX components, whose `interface Props` becomes the editor's prop panel. Defaults to `['src/components/mdx']`. |
210
+ | `assetsPath` | no | Upload directory; enables the Media Library. The site must serve it from `publicDir`, directly or through a link there, or dev and build fail. |
211
+ | `siteStyles` | no | CSS injected into the Puck preview iframe so components render with site styling. |
212
+ | `editorStyles` | no | CSS injected into the MDX editor's admin document. Host-component selectors only — see the file's own notes on what does not belong. |
213
+ | `editorCSS` | no | Raw CSS applied after auto-discovered host styles in the editor's host-preview layer. |
214
+ | `fragmentPreviewRoute` | no | Route whose styles and content wrapper frame the standalone fragment editor, and the `pathname` the fragment live preview's editor frame receives, in dev and in the built editor. Defaults to `/`. |
215
+ | `fragmentComponentsPath` | no | Module exporting `fragmentComponents = defineFragmentComponents(...)`: the components and element overrides fragments may use. See [Fragment components](#fragment-components). |
216
+ | `locales` | no | The site's locales and default locale. Without it: the site's `locales` and `defaultLocale` in `sites.json`, else `globalLocales`. |
206
217
 
207
218
  `ConlocaCMSOptions` also extends the editor's `UIConfig` (minus `basename`), so fields such as `apiBaseUrl`,
208
219
  `siteBaseUrl`, `enableDevtools`, `queryClientOptions`, `projectRoot` and `hosted` are accepted as well. Those exist for
@@ -282,6 +293,141 @@ editing a page never moves it; `'date-asc'` and `'title'` are the others; pages
282
293
  and `locale` to read another language. It reads the pages of the content routes `conlocaCMS()` serves, so it needs
283
294
  `layout` or `routing` set there and throws when neither is.
284
295
 
296
+ ## Fragment components
297
+
298
+ Fragments can use the site's own React components and restyle the HTML their Markdown produces. The site declares both
299
+ in a render module and names it with `fragmentComponentsPath`:
300
+
301
+ ```tsx
302
+ // src/fragment-components.tsx
303
+ import { defineFragmentComponents } from '@conloca/mdx/render';
304
+ import { Callout } from './components/Callout';
305
+ import { SectionHeading } from './components/SectionHeading';
306
+
307
+ export const fragmentComponents = defineFragmentComponents({
308
+ components: { Callout },
309
+ elements: { h2: SectionHeading },
310
+ });
311
+ ```
312
+
313
+ ```js
314
+ // astro.config.mjs
315
+ conlocaCMS({
316
+ contentRoot: './content',
317
+ puckConfigPath: './src/puck.config.tsx',
318
+ fragmentComponentsPath: './src/fragment-components.tsx',
319
+ });
320
+ ```
321
+
322
+ Published pages, draft previews, the editor canvas and the fragment editor's live preview all render fragments from this
323
+ module, with `evaluateMDXToComponent` from `@conloca/mdx/render`. That is why it is its own module and not part of
324
+ `schemasPath`: it loads in the server runtime that renders pages, which may forbid code generation from strings, so it
325
+ must import no editor code. `schemasPath` holds the editor's descriptors and may import editor code. The rules for
326
+ components, element overrides and JSON props are in the `@conloca/mdx` README.
327
+
328
+ In the fragment editor:
329
+
330
+ - **Descriptors join by name.** The editor offers the vocabulary's components only, and uses the `mdxComponents`
331
+ descriptor of the same name (from `schemasPath`, see below) for its label, insert hint and props. A descriptor with no
332
+ vocabulary component stays available on MDX pages only. A vocabulary component without a descriptor is still offered,
333
+ with no settings fields, and is inserted without a body; declare a descriptor with `hasChildren: true` to give it an
334
+ editable body.
335
+ - **No custom editors.** A descriptor's custom `Editor` is not used in fragments: the editor renders the site's
336
+ component itself, with the settings panel for props.
337
+ - **List and object props.** A descriptor prop may be `{ type: 'list', of: … }` or `{ type: 'object', fields: … }`.
338
+ Authors edit them in the settings panel, never as JSON, and the editor writes them as JSON attribute values.
339
+ `defineMdxComponents` warns when a string, number or boolean default does not match its type, and throws for a list or
340
+ object prop with no `of` or `fields`, or a default of the wrong shape.
341
+ - **Block types.** A descriptor with `blockType: true` (it needs `kind: 'flow'` and `hasChildren: true`) is a text
342
+ style, such as an eyebrow: its body is one line of text. The toolbar's Block type dropdown lists it after Paragraph,
343
+ Quote and the headings, and shows it while the caret is inside one. Choosing it turns the selected lines into the
344
+ component, each holding its line; choosing Paragraph, Quote or a heading turns the component's lines back. Every
345
+ component, block type or not, stays in the `/` menu and Insert component.
346
+ - **Hidden props.** A top-level prop with `hidden: true` is kept out of the settings panel; its value is kept as
347
+ written.
348
+ - **Outline anchors.** For a component the render module declares as an `outline` entry (see Component outline below),
349
+ the editor fills in the anchor prop from the contents text when the author sets the text and the component has no
350
+ anchor yet. It never changes an anchor that exists, so links to it keep working when the text changes. Pair it with
351
+ `hidden: true` on the anchor prop so authors only write the contents text.
352
+ - **The save check.** The editor refuses to save a fragment the renderer would refuse or change: a parse failure,
353
+ `import`/`export` lines, `{…}` expressions, a component the vocabulary lacks, a prop value that is not valid JSON, a
354
+ `{...spread}` or code in an attribute, or a declared prop of the wrong type. The message names the component or line;
355
+ for a component the vocabulary lacks, it also lists the vocabulary. The text stays in the editor, unsaved. An editor
356
+ that syncs as you type holds such an edit unsent, shows `Not saved:` with the message, and asks before leaving; it
357
+ syncs once fixed or undone. A body that already failed the check when it arrived is not held, so it can still be
358
+ fixed. A component prop value that is not valid JSON is never published.
359
+ - **The live preview** renders the fragment in the editor frame of the first routing entry, in declaration order, that
360
+ declares an `editorFrame`, with `fragmentPreviewRoute` as its `pathname`. With no framed route there is no frame. To
361
+ use another frame, reorder the routes or point `fragmentPreviewRoute` at a path the frame recognizes.
362
+ - **Outline.** The page outline comes from the fragment's Markdown headings, including those written between a
363
+ component's tags; a heading the component itself renders is not in the outline.
364
+ - **Component outline.** Components the render module declares as contents entries, with
365
+ `defineFragmentComponents({ components: { Section }, outline: { Section: { id: 'id', text: 'label' } } })`, reach your
366
+ `ContentFragmentSection` block as `fragmentComponentOutline` (`{ component, id, text }` in document order), next to
367
+ the heading list in `fragmentOutline`. The published page, draft previews and the editor canvas hand the block the
368
+ same lists, so a contents column built from either matches on every surface.
369
+
370
+ The build fails when a live fragment (published, or scheduled and not expired) fails to parse or uses a component the
371
+ render module does not declare, naming the fragment, its file and line, and the component. When the module cannot be
372
+ loaded outside Astro's pipeline, the build only warns and skips the name check.
373
+
374
+ Author-written `style` is dropped from every element and component in fragments, raw HTML included; the column alignment
375
+ the renderer gives Markdown tables is kept. Props and attributes whose names start with `on`, in any case, are never
376
+ passed; rename them.
377
+
378
+ A component that renders a prop as HTML (`dangerouslySetInnerHTML`) turns author text into markup, in the editor page
379
+ and on the published site. That is the site's code choice; render props as text unless the markup is trusted.
380
+
381
+ Inside an object or list prop, a key starting with `on`, in any case, is dropped at any depth when its value is text, so
382
+ a component that spreads the object onto an element never publishes an author's handler; `{"online": true}` is kept. The
383
+ save check refuses such a key, naming its path.
384
+
385
+ Discovered components can be adjusted with `src/cms-overrides`, but an override cannot declare list or object props;
386
+ declare those in `mdxComponents`.
387
+
388
+ ### Interactive fragment components
389
+
390
+ Fragment components are static HTML by default. To make one interactive on published pages, wrap it with `withHydration`
391
+ from `@conloca/astro-cms/hydration` and pick a strategy: `'load'` (on page load), `'visible'` (when it scrolls into
392
+ view) or `'idle'` (when the browser is idle).
393
+
394
+ ```tsx
395
+ // src/fragments/Disclosure.tsx
396
+ import { withHydration } from '@conloca/astro-cms/hydration';
397
+
398
+ export const Disclosure = withHydration(DisclosureView, 'load');
399
+ ```
400
+
401
+ ```tsx
402
+ // the render module
403
+ import { defineFragmentComponents } from '@conloca/mdx/render';
404
+ import { Disclosure } from './fragments/Disclosure';
405
+
406
+ export const fragmentComponents = defineFragmentComponents({ components: { Disclosure } });
407
+ ```
408
+
409
+ - **One file per hydrated component.** Put each hydrated component in its own file that calls `withHydration`, and
410
+ import it into the render module by name. A page then downloads only the chunks of the islands it uses; two hydrated
411
+ components in one file share a chunk. One defined in the render module, or re-exported through another file, has no
412
+ module the build can map. `astro build` then fails, whatever the output mode, with
413
+ `Fragment component <Name> is wrapped in withHydration(), but the build found no module for it. Import it into the render module by name from the file that calls withHydration().`
414
+ That build check needs to load the render module outside Astro's pipeline; when it cannot, the build only warns that
415
+ the mapping was not checked. Prerendering, `astro dev` and draft previews throw the same error when they render
416
+ fragments; a live on-demand page logs it once and renders that component without hydration, with every other fragment
417
+ and island intact.
418
+ - **Props are JSON.** The component receives the props the server render passed, after the rules above (JSON, or the
419
+ object-literal form `staticDataValue` also accepts).
420
+ - **Children are the page's server HTML.** The browser re-uses the HTML the page already contains for the component's
421
+ children; state inside them is not React state. An island nested in them hydrates on its own; after the outer island
422
+ remounts its children, the nested one stays static.
423
+ - **Element overrides cannot hydrate.** Wrapping one throws
424
+ `Element override <a> is wrapped in withHydration(); only fragment components can hydrate.`
425
+ - **Outline.** A hydrated component can be an `outline` entry; it still appears in the contents.
426
+ - **No island, no script.** A page with no island ships no hydration script.
427
+ - **Wrappers.** The `conloca-island` and `conloca-island-slot` wrappers are `display:contents`, so direct-child
428
+ selectors across them stop matching.
429
+ - **In the editor** the component is live immediately and its strategy is ignored.
430
+
285
431
  ## MDX component registry
286
432
 
287
433
  Hosts can register JSX components (their own, or third-party ones like Starlight's `<Steps>`, `<Tabs>`, `<Card>`) with
@@ -319,9 +465,10 @@ In the editor, registered components appear in two places:
319
465
 
320
466
  ### Auto-import injection (and its pruning caveat)
321
467
 
322
- Setting `import: { from: '<module>' }` on a descriptor opts the component into automatic import injection: whenever the
323
- component appears in the document, the CMS save serializer emits the matching `import { Name } from '<module>'` line at
324
- the top of the file (after frontmatter).
468
+ Setting `import: { from: '<module>' }` on a descriptor opts the component into automatic import injection on MDX pages:
469
+ whenever the component appears in the document, the CMS save serializer emits the matching
470
+ `import { Name } from '<module>'` line at the top of the file (after frontmatter). Fragments never get an `import` line:
471
+ their components come from the render module, and the editor refuses to save a fragment with one.
325
472
 
326
473
  **Important: the editor rebuilds the import block on every save from components actually referenced in the tree.**
327
474
  Imports for unused components are dropped. So are non-JSX imports — type imports, side-effect imports
@@ -0,0 +1,10 @@
1
+ ---
2
+ /** Wraps page content in the marker the editor frame's drift check stops at, on routes that declare an `editorFrame`. */
3
+ interface Props {
4
+ framed: boolean;
5
+ }
6
+
7
+ const { framed } = Astro.props;
8
+ ---
9
+
10
+ {framed ? <div data-conloca-page-root=""><slot /></div> : <slot />}
@@ -11,6 +11,11 @@
11
11
 
12
12
  import { getCollection } from 'astro:content';
13
13
  import { loadContentSchemas } from 'virtual:conloca-content-schemas';
14
+ import {
15
+ fragmentComponentsPath,
16
+ fragmentIslandLoaders,
17
+ loadFragmentComponents,
18
+ } from 'virtual:conloca-fragment-components';
14
19
  import Layout from 'virtual:conloca-layout';
15
20
  import puckConfig from 'virtual:conloca-puck-config';
16
21
  import routingConfig from 'virtual:conloca-routing-config';
@@ -30,15 +35,19 @@ import {
30
35
  createReaderContentSource,
31
36
  findUnknownComponentTypes,
32
37
  getPageEntries,
38
+ loadFragmentVocabulary,
33
39
  loadMdxComponents,
40
+ type MdxFragmentComponent,
34
41
  normalizePathname,
35
42
  type PageContentSource,
36
43
  type PageEntryData,
37
44
  type PageEntryRecord,
45
+ pageHasFragmentIslands,
38
46
  pageNotFoundResponse,
39
47
  resolvePuckData,
40
48
  } from '../ts/src/handlers/page-render-core.js';
41
49
  import { previewEntryParsers } from '../ts/src/internal/collection-parsers.js';
50
+ import PageRoot from './PageRoot.astro';
42
51
 
43
52
  // prerender is controlled by injectRoute({ prerender }) in plugin-spa.ts
44
53
  // Do not hardcode here — it overrides the route-level config
@@ -210,6 +219,9 @@ try {
210
219
  throw error;
211
220
  }
212
221
 
222
+ // A route with an editor frame marks where page content starts, which the canvas drift check stops at.
223
+ const framed = page !== undefined && config.routes[routeName]?.editorFrame !== undefined;
224
+
213
225
  const dataContext = await buildDataContext(source, config.routes[routeName], config, matchedPage);
214
226
 
215
227
  const hasPuckData = !!page?.puckData && Object.keys(page.puckData).length > 0;
@@ -230,28 +242,46 @@ if (hasPuckData && resolvedPuckData) {
230
242
  }
231
243
  }
232
244
 
233
- const needsHydration = hasPuckData && resolvedPuckData && hasHydratableComponents(resolvedPuckData, puckConfig);
234
-
235
245
  let PageRenderer: ComponentType | undefined;
246
+ let mdxComponents: MdxFragmentComponent[] = [];
236
247
 
237
248
  if (hasPuckData && page && resolvedPuckData) {
238
- try {
239
- const mdxComponents = await loadMdxComponents(
240
- source,
241
- config.locale,
242
- await loadEvaluateMDXToComponent(),
243
- import.meta.env.DEV,
244
- );
245
- PageRenderer = createPageRendererWithFragments(puckConfig, resolvedPuckData, mdxComponents, dataContext);
246
- } catch (error) {
247
- console.error('[Conloca] MDX evaluation failed, falling back to plain render:', error);
248
- PageRenderer = undefined;
249
+ const showErrors = import.meta.env.DEV || previewContentApi !== undefined;
250
+ // A broken render module fails the static build and shows in previews, but must not take down a live SSR site.
251
+ const fragmentVocabulary = await loadFragmentVocabulary(
252
+ loadFragmentComponents,
253
+ Astro.isPrerendered || showErrors,
254
+ fragmentComponentsPath,
255
+ fragmentIslandLoaders,
256
+ );
257
+ if (fragmentVocabulary) {
258
+ try {
259
+ mdxComponents = await loadMdxComponents(
260
+ source,
261
+ config.locale,
262
+ await loadEvaluateMDXToComponent(),
263
+ import.meta.env.DEV,
264
+ fragmentVocabulary,
265
+ showErrors,
266
+ );
267
+ PageRenderer = createPageRendererWithFragments(puckConfig, resolvedPuckData, mdxComponents, dataContext);
268
+ } catch (error) {
269
+ console.error('[Conloca] MDX evaluation failed, falling back to plain render:', error);
270
+ PageRenderer = undefined;
271
+ }
249
272
  }
250
273
  }
274
+
275
+ const needsHydration =
276
+ hasPuckData &&
277
+ resolvedPuckData &&
278
+ (hasHydratableComponents(resolvedPuckData, puckConfig) ||
279
+ (PageRenderer !== undefined && pageHasFragmentIslands(resolvedPuckData, mdxComponents)));
251
280
  ---
252
281
 
253
282
  {Layout && page ? (
254
283
  <Layout title={page.title ?? 'Page'} description={page.description} page={dataContext.page}>
284
+ <PageRoot framed={framed}>
255
285
  {hasPuckData && PageRenderer ? (
256
286
  <PageRenderer />
257
287
  ) : hasPuckData && resolvedPuckData ? (
@@ -265,6 +295,7 @@ if (hasPuckData && page && resolvedPuckData) {
265
295
  <p>This page has no content yet.</p>
266
296
  </div>
267
297
  )}
298
+ </PageRoot>
268
299
  </Layout>
269
300
  ) : page ? (
270
301
  <html lang={config.locale || 'en'}>
@@ -276,6 +307,7 @@ if (hasPuckData && page && resolvedPuckData) {
276
307
  {needsHydration && <script>import 'virtual:conloca-hydration-entry'</script>}
277
308
  </head>
278
309
  <body>
310
+ <PageRoot framed={framed}>
279
311
  {hasPuckData && PageRenderer ? (
280
312
  <PageRenderer />
281
313
  ) : hasPuckData && resolvedPuckData ? (
@@ -289,6 +321,7 @@ if (hasPuckData && page && resolvedPuckData) {
289
321
  <p>This page has no content yet.</p>
290
322
  </div>
291
323
  )}
324
+ </PageRoot>
292
325
  </body>
293
326
  </html>
294
327
  ) : (
@@ -11,6 +11,11 @@
11
11
 
12
12
  import { getCollection } from 'astro:content';
13
13
  import { loadContentSchemas } from 'virtual:conloca-content-schemas';
14
+ import {
15
+ fragmentComponentsPath,
16
+ fragmentIslandLoaders,
17
+ loadFragmentComponents,
18
+ } from 'virtual:conloca-fragment-components';
14
19
  import Layout from 'virtual:conloca-layout';
15
20
  import puckConfig from 'virtual:conloca-puck-config';
16
21
  import routingConfig from 'virtual:conloca-routing-config';
@@ -30,15 +35,19 @@ import {
30
35
  createReaderContentSource,
31
36
  findUnknownComponentTypes,
32
37
  getPageEntries,
38
+ loadFragmentVocabulary,
33
39
  loadMdxComponents,
40
+ type MdxFragmentComponent,
34
41
  normalizePathname,
35
42
  type PageContentSource,
36
43
  type PageEntryData,
37
44
  type PageEntryRecord,
45
+ pageHasFragmentIslands,
38
46
  pageNotFoundResponse,
39
47
  resolvePuckData,
40
48
  } from '../ts/src/handlers/page-render-core.js';
41
49
  import { previewEntryParsers } from '../ts/src/internal/collection-parsers.js';
50
+ import PageRoot from './PageRoot.astro';
42
51
 
43
52
  // prerender is controlled by injectRoute({ prerender }) in plugin-spa.ts
44
53
  // Do not hardcode here — it overrides the route-level config
@@ -210,6 +219,9 @@ try {
210
219
  throw error;
211
220
  }
212
221
 
222
+ // A route with an editor frame marks where page content starts, which the canvas drift check stops at.
223
+ const framed = page !== undefined && config.routes[routeName]?.editorFrame !== undefined;
224
+
213
225
  const dataContext = await buildDataContext(source, config.routes[routeName], config, matchedPage);
214
226
 
215
227
  const hasPuckData = !!page?.puckData && Object.keys(page.puckData).length > 0;
@@ -230,28 +242,46 @@ if (hasPuckData && resolvedPuckData) {
230
242
  }
231
243
  }
232
244
 
233
- const needsHydration = hasPuckData && resolvedPuckData && hasHydratableComponents(resolvedPuckData, puckConfig);
234
-
235
245
  let PageRenderer: ComponentType | undefined;
246
+ let mdxComponents: MdxFragmentComponent[] = [];
236
247
 
237
248
  if (hasPuckData && page && resolvedPuckData) {
238
- try {
239
- const mdxComponents = await loadMdxComponents(
240
- source,
241
- config.locale,
242
- await loadEvaluateMDXToComponent(),
243
- import.meta.env.DEV,
244
- );
245
- PageRenderer = createPageRendererWithFragments(puckConfig, resolvedPuckData, mdxComponents, dataContext);
246
- } catch (error) {
247
- console.error('[Conloca] MDX evaluation failed, falling back to plain render:', error);
248
- PageRenderer = undefined;
249
+ const showErrors = import.meta.env.DEV || previewContentApi !== undefined;
250
+ // A broken render module fails the static build and shows in previews, but must not take down a live SSR site.
251
+ const fragmentVocabulary = await loadFragmentVocabulary(
252
+ loadFragmentComponents,
253
+ Astro.isPrerendered || showErrors,
254
+ fragmentComponentsPath,
255
+ fragmentIslandLoaders,
256
+ );
257
+ if (fragmentVocabulary) {
258
+ try {
259
+ mdxComponents = await loadMdxComponents(
260
+ source,
261
+ config.locale,
262
+ await loadEvaluateMDXToComponent(),
263
+ import.meta.env.DEV,
264
+ fragmentVocabulary,
265
+ showErrors,
266
+ );
267
+ PageRenderer = createPageRendererWithFragments(puckConfig, resolvedPuckData, mdxComponents, dataContext);
268
+ } catch (error) {
269
+ console.error('[Conloca] MDX evaluation failed, falling back to plain render:', error);
270
+ PageRenderer = undefined;
271
+ }
249
272
  }
250
273
  }
274
+
275
+ const needsHydration =
276
+ hasPuckData &&
277
+ resolvedPuckData &&
278
+ (hasHydratableComponents(resolvedPuckData, puckConfig) ||
279
+ (PageRenderer !== undefined && pageHasFragmentIslands(resolvedPuckData, mdxComponents)));
251
280
  ---
252
281
 
253
282
  {Layout && page ? (
254
283
  <Layout title={page.title ?? 'Page'} description={page.description} page={dataContext.page}>
284
+ <PageRoot framed={framed}>
255
285
  {hasPuckData && PageRenderer ? (
256
286
  <PageRenderer />
257
287
  ) : hasPuckData && resolvedPuckData ? (
@@ -265,6 +295,7 @@ if (hasPuckData && page && resolvedPuckData) {
265
295
  <p>This page has no content yet.</p>
266
296
  </div>
267
297
  )}
298
+ </PageRoot>
268
299
  </Layout>
269
300
  ) : page ? (
270
301
  <html lang={config.locale || 'en'}>
@@ -276,6 +307,7 @@ if (hasPuckData && page && resolvedPuckData) {
276
307
  {needsHydration && <script>import 'virtual:conloca-hydration-entry'</script>}
277
308
  </head>
278
309
  <body>
310
+ <PageRoot framed={framed}>
279
311
  {hasPuckData && PageRenderer ? (
280
312
  <PageRenderer />
281
313
  ) : hasPuckData && resolvedPuckData ? (
@@ -289,6 +321,7 @@ if (hasPuckData && page && resolvedPuckData) {
289
321
  <p>This page has no content yet.</p>
290
322
  </div>
291
323
  )}
324
+ </PageRoot>
292
325
  </body>
293
326
  </html>
294
327
  ) : (
@@ -4,27 +4,32 @@
4
4
  "packages/astro-cms/node/content.ts": "0395f9ca5dc3e0644d0a38296f65fa3a45847640789298ba68cae793c904a9ef",
5
5
  "packages/astro-cms/node/index.ts": "7d954c16c9730e28343269d94494ab275361aed23a0ea4dcc5da9afe7ffb185b",
6
6
  "packages/astro-cms/src/asset-ref-base.ts": "067abe98eabc99d7797017028d20b3fa198cb0103d4fcb7be41d6e318d342e33",
7
+ "packages/astro-cms/src/build/check-fragment-components.ts": "1804179b6c1cf1c3c63d9ee4b633f69d1f5c946647b1241e7d038041a6aede1a",
8
+ "packages/astro-cms/src/build/fragment-manifest.ts": "eef244ab102ad9106b608db362b2a0ac065a4c7ce9b93ff2a8e6e42fc5374ddd",
9
+ "packages/astro-cms/src/build/fragment-render-load.ts": "0d3312bea655834b6abf0e26f4521dcd961e1d831ec0bddebb0fdad2bab35970",
7
10
  "packages/astro-cms/src/checks.ts": "1a8da3a93141d5121fdff937eea447fcfc46eec94449e04128c920a21de7c0e5",
8
- "packages/astro-cms/src/cms-handler.ts": "02f62cb916c5c3410b722cb4683471f17f36cfbe24fc5de1e9a1e6307d79cb7f",
11
+ "packages/astro-cms/src/cms-handler.ts": "24b770f40cf5fc2736482d899d044247e0ddcd8ae0a0a287f0c5e8082847cdc3",
9
12
  "packages/astro-cms/src/collections.ts": "7a6f4700b374c6c058fea7b9adcb322e2340e73b0e0f812a707d36cfaf5f2ea2",
10
13
  "packages/astro-cms/src/components.ts": "c819b416f5b3fe8750f126babef5450d28b24e1b5f055f6dfbd18613e1f64b3b",
14
+ "packages/astro-cms/src/components/FragmentIsland.tsx": "5e1e8fa881d7ae0d101f144bd32afc23cc60aa2f2da9728e7439139cb98da15b",
11
15
  "packages/astro-cms/src/components/HydrationWrapper.tsx": "a2b1e9b198d969ce4f326aef0634e5876fcc01b1c27f1fe9eaac202946804667",
12
- "packages/astro-cms/src/components/RenderWithFragments.tsx": "9b01959eb75fa522b4169acdb76f3f32051c36ea9d45c6758ca7d38f0bf9943e",
16
+ "packages/astro-cms/src/components/IslandSlot.tsx": "9a45fc1358b2d6ba311ae20d66432d53e2dd2e30c086ac651572f1f559065695",
17
+ "packages/astro-cms/src/components/RenderWithFragments.tsx": "4c78403a5b9fd23c42809cab74f93010f52d30074f0cd698ddadd5909857c7e3",
13
18
  "packages/astro-cms/src/components/RenderWithHydration.tsx": "a438f2e0da5bc041cd1abe2857172c19826508be7b2d17edaf8edb0b9a163e2c",
14
19
  "packages/astro-cms/src/discovery/astro-frontmatter.ts": "b933216ca24ad672a642804168a0991cc6e63df1a552d63bc29a4e3e9675028d",
15
20
  "packages/astro-cms/src/discovery/discover.ts": "4bed6c5fd97ad27380ed77076026426d393d889fdbe885950800b3b62841b4e9",
16
21
  "packages/astro-cms/src/discovery/extract-props-ts.ts": "48cb07d8ebc2e9e84a8d60cfaf63a74273e8c7464593d6b0c168849f0503ee12",
17
- "packages/astro-cms/src/discovery/merge-registry.ts": "eff6b77983417f633b47ee724b7fa74078184b6b08983fdad5014629b9d2fbb3",
22
+ "packages/astro-cms/src/discovery/merge-registry.ts": "626f8c8390b685ee1608570e2dc66d52367e43cc1f547b7739ee80f0cd0073e2",
18
23
  "packages/astro-cms/src/discovery/registry-endpoint.ts": "19434c23476db4bdeb63a7b9f0cc2debb8990b9092c3c9f440313c51832357c4",
19
24
  "packages/astro-cms/src/discovery/scan-components.ts": "bd130d8b4028a97ecef6a88a9ec373d2615e7eb1536377db61b731476d7fe185",
20
25
  "packages/astro-cms/src/discovery/scan-mdx.ts": "549ad7857fce495c570975891f7dd2e5cb74e5b2161ee50237e834ebd86a749f",
21
26
  "packages/astro-cms/src/discovery/scan-overrides.ts": "47aee15f7f5f5bcc1172046d896ae24f0bbcb0148f39da76ef83101d1181d0b5",
22
- "packages/astro-cms/src/editor-descriptors.ts": "f31f6e588701a79d43f9a24e2d1822b6a802bd3ad873f02235db7d17c3775d78",
27
+ "packages/astro-cms/src/editor-descriptors.ts": "7edf23c4eebaaeada1c7c6dfc4b234eef240a1e461872ef2f5866180f8876019",
23
28
  "packages/astro-cms/src/entries.ts": "5706eff596245f53d0b58187fb562d93a331b230ad9f2c56fbfdeb102f67e11a",
24
29
  "packages/astro-cms/src/env.d.ts": "eef7dbb364ad6c1846070cbbb429ea19cbf2976ef402dc0696bd448a4e50b606",
25
- "packages/astro-cms/src/handlers/collection-content-api.ts": "ddbf30c429018f3b32e749efff5832967f77adf71c4d4726d9fa924856fc2319",
30
+ "packages/astro-cms/src/handlers/collection-content-api.ts": "acabf8106c773db6b5a016166591a85319502edd533939caad8f992f2717b4dc",
26
31
  "packages/astro-cms/src/handlers/collection-names.ts": "9dbb653d3ae13901036e25e165f2a7188f4a8ffee4879ccd6313dc75ef9f6c43",
27
- "packages/astro-cms/src/handlers/page-render-core.ts": "de9bbadd2c4efbf910dfc32ba73acc1b4dcfded54818dbc67ea402df6551f59b",
32
+ "packages/astro-cms/src/handlers/page-render-core.ts": "618b6faee646465fd9ae03142f968ce2bdc77ec058f4f803ff17fc7f97f82b34",
28
33
  "packages/astro-cms/src/hydration.ts": "953d23b741665fe14add0fce43e5121e9180ea9c603922acb642fe111c75b7af",
29
34
  "packages/astro-cms/src/index.ts": "e98c16ef235804e5e858c5f4d86a577ce07b6f0d0c71714259dc58bef7683465",
30
35
  "packages/astro-cms/src/internal/collection-parsers.ts": "360963adfc303bccf4170445f287df46b0e9d1d5ecf5f783e2596a2d7f0b9352",
@@ -32,18 +37,18 @@
32
37
  "packages/astro-cms/src/internal/entry-issues.ts": "53ad83202add972705f26e9a3c5dcd5cb00d434cb921b46402897b71d7ed1d4a",
33
38
  "packages/astro-cms/src/internal/entry-validation.ts": "c0e82e5836ddaa258c14d5419da484a73592b314e502f564be63b19e82c620b6",
34
39
  "packages/astro-cms/src/lib/content-config-guard.ts": "c737218f7977350cb382370d0ba225cec8b0b9407593d1883e724bea43f186fd",
35
- "packages/astro-cms/src/lib/hydration-scanner.ts": "9c0345e6820d4d098707e3a52c4dee7fb699cc301634f95903e0bbd8e4faffc2",
36
- "packages/astro-cms/src/lib/hydration-script.ts": "d745085732293377495f4737d36665b18514a4c259e118814d38c96445c39539",
40
+ "packages/astro-cms/src/lib/hydration-scanner.ts": "8aa03db640c5f88404ec53a8a97e0772fbe09b355f55413e013e1d1dbdc40529",
41
+ "packages/astro-cms/src/lib/hydration-script.ts": "f3f2fe30cf34e0b5e06f1151af185013825a80e9d486234f7c9cb34873cd5e1c",
37
42
  "packages/astro-cms/src/lib/hydration-utils.ts": "ad7303f4814a1ff73cddf7786dfaf0bff8f0871e32d89f481fb2f44747eb61a4",
38
43
  "packages/astro-cms/src/lib/resolve-locale.ts": "d9d25edcc18b5b72d231d901815fc3828195171914a15cba96732e00315e3d66",
39
44
  "packages/astro-cms/src/lib/resolve-site-name.ts": "cb712d18fbab21c9b55da24fb35401ff3505b20c46b8bea8285773c847f2c942",
40
45
  "packages/astro-cms/src/lib/route-utils.ts": "465820fa2e7d1b00a81fa7856ed71f0d3a12ed40bd71cab973ac31c7e4591868",
41
- "packages/astro-cms/src/lib/routing-config.ts": "bcc76af7ac0545681b90f513a843e1ac3b33e4c904392ba09159caa29af10005",
46
+ "packages/astro-cms/src/lib/routing-config.ts": "903e40bcc85a457b0bae902dfe784ebbddf0df35966feba3fe6b6e91ab8088d5",
42
47
  "packages/astro-cms/src/lib/serialize-props.ts": "cc393c69d3e32149d78c01f571296b22ad5843217923ba900f2400ac92a5ae29",
43
48
  "packages/astro-cms/src/lib/static-page-routes.ts": "575d4caeeef50a7ff48939149751c2f31e6daae0df8f51464388311922db87ff",
44
49
  "packages/astro-cms/src/lib/static-routes-endpoint.ts": "36cfeb307547b865f0b21313143c9483dc66d6780f3294c8bd3a744bc893d38a",
45
- "packages/astro-cms/src/lib/unknown-components.ts": "9c9511acee41353522259366ba4a53523091beed29c755b971e65a98641ff4dc",
46
- "packages/astro-cms/src/lib/virtual-module-generators.ts": "bec2d598588904c712fecfa8c37ed5a5f397390204dbc03645f0a24dbb84340a",
50
+ "packages/astro-cms/src/lib/unknown-components.ts": "7fc340acda320d5db2d4ac6713f2a9934a4b1509e0f691a6d3c33015e50c005f",
51
+ "packages/astro-cms/src/lib/virtual-module-generators.ts": "2185c30d847d121fc56721a03a57e455a2ccf2565ec5aacbc9f0ef232b3454ae",
47
52
  "packages/astro-cms/src/lib/withHydration.ts": "3803e16067e769f8c5be6485c74ef3c4c70cda061e2d1929ccbadd7e70a020ed",
48
53
  "packages/astro-cms/src/loader.ts": "3f1fccdbff967ffe5892738a439131735eb81610674b7698b0510612e56665e7",
49
54
  "packages/astro-cms/src/locales-helpers.ts": "869b5132de90c2a51bcee956b68adc0813c3a34790ba112d35ce2c98f772c939",
@@ -51,7 +56,7 @@
51
56
  "packages/astro-cms/src/page-feed.ts": "5f34c09b0dc982bf9712d2e2a2feac620b45cfaba70afb822c5ff757af5c5a44",
52
57
  "packages/astro-cms/src/page-schemas.ts": "310c74d83cc6bd9d2f1220beffbf005f5f33a8d3448de7dae8fe689a4dde036e",
53
58
  "packages/astro-cms/src/path-validation.ts": "08c6b3c2c577e16accb9063b46769800691f306f6a1c6f85ddd08b93f21da408",
54
- "packages/astro-cms/src/plugin-spa.ts": "7d054abdc3db30403fa052f98e1e30419946ac66f271b245d973629173b5df14",
59
+ "packages/astro-cms/src/plugin-spa.ts": "8366ae1d7a6945a1051bf8a7f14777884fcde83271a82d5f2a277417af20a0d8",
55
60
  "packages/astro-cms/src/puck-manifest/components-endpoint.ts": "bee3059e4ae2f84fd148fc370e25f00303f12c783312bc1b3e1ce24228a00e0d",
56
61
  "packages/astro-cms/src/puck-manifest/field-projection.ts": "5ffd0a4c02a785e100e0066d88f05e7488cfa5a823aeda1a5464c43b67112dea",
57
62
  "packages/astro-cms/src/puck-manifest/index.ts": "9681b175a4e0e225a673422b890963a0c75bb375578b5d91c9b2381ed6208bc2",
@@ -63,7 +68,7 @@
63
68
  "packages/astro-cms/src/puck-manifest/resolve-reference.ts": "e6f2cdc09ed25b7d74b410c74908c4ed5aadc76566fcfe2cfed472fcc625668e",
64
69
  "packages/astro-cms/src/puck-manifest/source-reference.ts": "026ed77de6d6225883c5522f56b726e1d3c0fdbbf8fc3a0c2f43e7668df406eb",
65
70
  "packages/astro-cms/src/puck-manifest/syntax.ts": "ce507adeefb90f1190e226edc1df6491c8bbe1e4f163a679dc84453206eb2456",
66
- "packages/astro-cms/src/puck-manifest/types.ts": "b555d2ddc4410db536929ebbdb587470324139b7ee6eda644a7059153be2068a",
71
+ "packages/astro-cms/src/puck-manifest/types.ts": "8f4dee34d7c8d8e9e6e28e32a86cbe3f7460c9c3642aa41bb33424e319fdf3fb",
67
72
  "packages/astro-cms/src/safe-json-stringify.ts": "73309d0b557b355413778ac964927eedcfd5199c2f59649b53a49aa723ac78fe",
68
73
  "packages/astro-cms/src/sandbox-frame-handler.ts": "012305513912b974f74fb2fe848ed0ce4eca54e3e1fade17c7d00d76e35fbbba",
69
74
  "packages/astro-cms/src/site-styles/content-wrapper-endpoint.ts": "b5a8ec06931c398a31fa76d14ff5b6e37576861c08ae8df964b7b48e62eab858",
@@ -71,8 +76,8 @@
71
76
  "packages/astro-cms/src/site-styles/styles-endpoint.ts": "cf309e00122158f482eae27b1293d48a5f58560c66c9eaa3f81bc2e511232b50",
72
77
  "packages/astro-cms/src/sitemap-options.ts": "a35b393092d4c3124c9a7ea4fd63cc502a9096658ad7237852a249f3838ea8b5",
73
78
  "packages/astro-cms/src/tiptap-html-static.ts": "b112885665f2b10d9406cf21b8d3d6f5f7d8d80b9d4fe4e3b0689ec2edac106a",
74
- "packages/astro-cms/src/types.ts": "2d79d9b8ecff8f7b4be877e9609d214c85ebb207f9c824ddfcccc0e0d3f41737",
75
- "packages/astro-cms/src/virtual-modules.d.ts": "77d7fbeec1a7ddd87cfcccdce7cd434e98077500d84cff5ed0ca3baa310370ba",
79
+ "packages/astro-cms/src/types.ts": "dab99d4a1b9f901d955e992f69fd0ec76f1a5fe74ca5e3b08635cc094c5cca13",
80
+ "packages/astro-cms/src/virtual-modules.d.ts": "e2f54d6206bcd66a4c54aee1c8ebbd0d5f28f9da5a6dac3649a225c358d20d3d",
76
81
  "packages/astro-cms/tsconfig.lib.json": "c1edf2dfd63f69fe4e351c0d1154faa305280fcd8e0a01bf3e8853d03df9ed4c"
77
82
  },
78
83
  "complete": [
@@ -0,0 +1,18 @@
1
+ import type { UserConfig } from 'vite';
2
+ /**
3
+ * Problem lines for every fragment the site may serve (live or scheduled, not expired) that fails to parse or uses a
4
+ * component `fragmentComponentsPath` does not declare, and for a `withHydration()` component the build cannot map to
5
+ * a module: that one fails every page with fragments, so the build fails here whatever the output mode. A module that
6
+ * cannot load here only warns and skips the name check, because a module Astro builds may not load outside Astro's own
7
+ * pipeline.
8
+ */
9
+ export declare function checkFragmentComponents(input: {
10
+ contentRoot: string;
11
+ root: string;
12
+ vite: UserConfig;
13
+ fragmentComponentsPath: string | undefined;
14
+ logger: {
15
+ warn(message: string): void;
16
+ };
17
+ }): Promise<string[]>;
18
+ //# sourceMappingURL=check-fragment-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-fragment-components.d.ts","sourceRoot":"","sources":["../../../../src/build/check-fragment-components.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAOvC;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE;QAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACzC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAwDpB"}