@conloca/astro-cms 0.2.1 → 0.2.2

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 (80) hide show
  1. package/README.md +21 -19
  2. package/dist/internal/page-handler.astro +8 -2
  3. package/dist/ts/node/content.d.ts +1 -2
  4. package/dist/ts/node/content.d.ts.map +1 -1
  5. package/dist/ts/node/content.js +1 -1
  6. package/dist/ts/node/content.js.map +1 -1
  7. package/dist/ts/src/collections.d.ts +31 -53
  8. package/dist/ts/src/collections.d.ts.map +1 -1
  9. package/dist/ts/src/collections.js +66 -71
  10. package/dist/ts/src/collections.js.map +1 -1
  11. package/dist/ts/src/entries.d.ts +44 -0
  12. package/dist/ts/src/entries.d.ts.map +1 -0
  13. package/dist/ts/src/entries.js +48 -0
  14. package/dist/ts/src/entries.js.map +1 -0
  15. package/dist/ts/src/handlers/collection-content-api.d.ts.map +1 -1
  16. package/dist/ts/src/handlers/collection-content-api.js +7 -2
  17. package/dist/ts/src/handlers/collection-content-api.js.map +1 -1
  18. package/dist/ts/src/handlers/collection-names.d.ts +9 -0
  19. package/dist/ts/src/handlers/collection-names.d.ts.map +1 -0
  20. package/dist/ts/src/handlers/collection-names.js +9 -0
  21. package/dist/ts/src/handlers/collection-names.js.map +1 -0
  22. package/dist/ts/src/handlers/page-render-core.d.ts +31 -12
  23. package/dist/ts/src/handlers/page-render-core.d.ts.map +1 -1
  24. package/dist/ts/src/handlers/page-render-core.js +38 -17
  25. package/dist/ts/src/handlers/page-render-core.js.map +1 -1
  26. package/dist/ts/src/index.d.ts +2 -2
  27. package/dist/ts/src/index.d.ts.map +1 -1
  28. package/dist/ts/src/index.js +1 -3
  29. package/dist/ts/src/index.js.map +1 -1
  30. package/dist/ts/src/internal/collection-parsers.d.ts +26 -0
  31. package/dist/ts/src/internal/collection-parsers.d.ts.map +1 -0
  32. package/dist/ts/src/internal/collection-parsers.js +34 -0
  33. package/dist/ts/src/internal/collection-parsers.js.map +1 -0
  34. package/dist/ts/src/internal/entry-issues.d.ts +8 -0
  35. package/dist/ts/src/internal/entry-issues.d.ts.map +1 -0
  36. package/dist/ts/src/internal/entry-issues.js +19 -0
  37. package/dist/ts/src/internal/entry-issues.js.map +1 -0
  38. package/dist/ts/src/internal/entry-validation.d.ts +93 -0
  39. package/dist/ts/src/internal/entry-validation.d.ts.map +1 -0
  40. package/dist/ts/src/internal/entry-validation.js +228 -0
  41. package/dist/ts/src/internal/entry-validation.js.map +1 -0
  42. package/dist/ts/src/lib/virtual-module-generators.d.ts +13 -0
  43. package/dist/ts/src/lib/virtual-module-generators.d.ts.map +1 -1
  44. package/dist/ts/src/lib/virtual-module-generators.js +18 -0
  45. package/dist/ts/src/lib/virtual-module-generators.js.map +1 -1
  46. package/dist/ts/src/loader.d.ts +9 -12
  47. package/dist/ts/src/loader.d.ts.map +1 -1
  48. package/dist/ts/src/loader.js +19 -16
  49. package/dist/ts/src/loader.js.map +1 -1
  50. package/dist/ts/src/page-schemas.d.ts +1 -1
  51. package/dist/ts/src/page-schemas.d.ts.map +1 -1
  52. package/dist/ts/src/page-schemas.js +1 -1
  53. package/dist/ts/src/page-schemas.js.map +1 -1
  54. package/dist/ts/src/plugin-spa.d.ts +12 -0
  55. package/dist/ts/src/plugin-spa.d.ts.map +1 -1
  56. package/dist/ts/src/plugin-spa.js +9 -2
  57. package/dist/ts/src/plugin-spa.js.map +1 -1
  58. package/dist/virtual-modules.d.ts +14 -0
  59. package/node/content.ts +10 -1
  60. package/package.json +12 -9
  61. package/src/collections.ts +107 -76
  62. package/src/entries.ts +111 -0
  63. package/src/handlers/collection-content-api.ts +7 -2
  64. package/src/handlers/collection-names.ts +8 -0
  65. package/src/handlers/page-handler.astro +8 -2
  66. package/src/handlers/page-render-core.ts +65 -17
  67. package/src/index.ts +6 -7
  68. package/src/internal/collection-parsers.ts +51 -0
  69. package/src/internal/entry-issues.ts +23 -0
  70. package/src/internal/entry-validation.ts +305 -0
  71. package/src/lib/virtual-module-generators.ts +20 -0
  72. package/src/loader.ts +33 -17
  73. package/src/page-schemas.ts +4 -0
  74. package/src/plugin-spa.ts +24 -1
  75. package/src/virtual-modules.d.ts +14 -0
  76. package/dist/ts/src/internal/page-collection-schema.d.ts +0 -44
  77. package/dist/ts/src/internal/page-collection-schema.d.ts.map +0 -1
  78. package/dist/ts/src/internal/page-collection-schema.js +0 -152
  79. package/dist/ts/src/internal/page-collection-schema.js.map +0 -1
  80. package/src/internal/page-collection-schema.ts +0 -210
package/README.md CHANGED
@@ -11,7 +11,8 @@ workflow, accessible at `/__cms` routes without requiring authentication or comp
11
11
 
12
12
  ```bash
13
13
  npm install @conloca/astro-cms
14
- npm install @astrojs/react @vitejs/plugin-react astro react react-dom vite zod
14
+ npm install @astrojs/react @vitejs/plugin-react astro react react-dom vite typia
15
+ npm install -D ttsc @ttsc/unplugin
15
16
  ```
16
17
 
17
18
  The second line is the full peer set — the CMS expects the host site to own those packages. `@astrojs/react` is not
@@ -168,24 +169,25 @@ With those four files in place, run the Astro dev server and open `/__cms`.
168
169
 
169
170
  Passed to `conlocaCMS({ ... })`. Only two are required.
170
171
 
171
- | Option | Required | What it does |
172
- | ---------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
173
- | `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. |
174
- | `puckConfigPath` | yes | Module whose default export is the Puck `Config`. Supplies the visual editor's component palette and seeds component auto-discovery. |
175
- | `canvasDir` | no | Directory for canvas documents. |
176
- | `route` | no | Where the CMS mounts. Defaults to `/__cms`. |
177
- | `layout` | no | Default layout for content pages. On its own it enables routing with a catch-all pattern. |
178
- | `routing` | no | Full routing configuration, for sites with more than one content route. |
179
- | `templates` | no | Page templates offered in the create-page dialog. |
180
- | `schemasPath` | no | Module exporting `dataSchemas`, `pageSchemas` and `mdxComponents`. Drives the page-settings form and the MDX component registry. |
181
- | `componentPaths` | no | Extra folders to scan for components wrapped in `withHydration()`. |
182
- | `mdxComponentFolders` | no | Folders scanned for locally authored MDX components, whose `interface Props` becomes the editor's prop panel. Defaults to `['src/components/mdx']`. |
183
- | `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. |
184
- | `siteStyles` | no | CSS injected into the Puck preview iframe so components render with site styling. |
185
- | `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. |
186
- | `editorCSS` | no | Raw CSS applied after auto-discovered host styles in the editor's host-preview layer. |
187
- | `fragmentPreviewRoute` | no | Route whose styles and content wrapper frame the standalone fragment editor. Defaults to `/`. |
188
- | `locales` | no | The site's locales and default locale. Without it: the site's `locales` and `defaultLocale` in `sites.json`, else `globalLocales`. |
172
+ | Option | Required | What it does |
173
+ | ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
174
+ | `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. |
175
+ | `puckConfigPath` | yes | Module whose default export is the Puck `Config`. Supplies the visual editor's component palette and seeds component auto-discovery. |
176
+ | `canvasDir` | no | Directory for canvas documents. |
177
+ | `route` | no | Where the CMS mounts. Defaults to `/__cms`. |
178
+ | `layout` | no | Default layout for content pages. On its own it enables routing with a catch-all pattern. |
179
+ | `routing` | no | Full routing configuration, for sites with more than one content route. |
180
+ | `templates` | no | Page templates offered in the create-page dialog. |
181
+ | `schemasPath` | no | Module exporting `dataSchemas`, `pageSchemas` and `mdxComponents`. Drives the page-settings form and the MDX component registry. |
182
+ | `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. |
183
+ | `componentPaths` | no | Extra folders to scan for components wrapped in `withHydration()`. |
184
+ | `mdxComponentFolders` | no | Folders scanned for locally authored MDX components, whose `interface Props` becomes the editor's prop panel. Defaults to `['src/components/mdx']`. |
185
+ | `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. |
186
+ | `siteStyles` | no | CSS injected into the Puck preview iframe so components render with site styling. |
187
+ | `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. |
188
+ | `editorCSS` | no | Raw CSS applied after auto-discovered host styles in the editor's host-preview layer. |
189
+ | `fragmentPreviewRoute` | no | Route whose styles and content wrapper frame the standalone fragment editor. Defaults to `/`. |
190
+ | `locales` | no | The site's locales and default locale. Without it: the site's `locales` and `defaultLocale` in `sites.json`, else `globalLocales`. |
189
191
 
190
192
  `ConlocaCMSOptions` also extends the editor's `UIConfig` (minus `basename`), so fields such as `apiBaseUrl`,
191
193
  `siteBaseUrl`, `enableDevtools`, `queryClientOptions`, `projectRoot` and `hosted` are accepted as well. Those exist for
@@ -10,6 +10,7 @@
10
10
  */
11
11
 
12
12
  import { getCollection } from 'astro:content';
13
+ import { loadContentSchemas } from 'virtual:conloca-content-schemas';
13
14
  import Layout from 'virtual:conloca-layout';
14
15
  import puckConfig from 'virtual:conloca-puck-config';
15
16
  import routingConfig from 'virtual:conloca-routing-config';
@@ -37,6 +38,7 @@ import {
37
38
  pageNotFoundResponse,
38
39
  resolvePuckData,
39
40
  } from '../ts/src/handlers/page-render-core.js';
41
+ import { previewEntryParsers } from '../ts/src/internal/collection-parsers.js';
40
42
 
41
43
  // prerender is controlled by injectRoute({ prerender }) in plugin-spa.ts
42
44
  // Do not hardcode here — it overrides the route-level config
@@ -148,11 +150,15 @@ if (!routeName || !collection || !pathname) {
148
150
 
149
151
  // Content-access seam. A caller can install a ContentAPI on
150
152
  // `Astro.locals.contentApi`; when present we read through it, so the page shows
151
- // what that reader serves. Absent — the normal render — we read Astro content
153
+ // what that reader serves, parsed with each collection's entry parser as the build
154
+ // parses its entries. Absent — the normal render — we read Astro content
152
155
  // collections, byte-for-byte identically to before the extraction.
153
156
  const previewContentApi = (Astro.locals as { contentApi?: ContentAPI }).contentApi;
154
157
  const source: PageContentSource = previewContentApi
155
- ? createReaderContentSource(previewContentApi, config.locale)
158
+ ? createReaderContentSource(previewContentApi, {
159
+ renderLocale: config.locale,
160
+ parsers: previewEntryParsers(config, await loadContentSchemas()),
161
+ })
156
162
  : createCollectionContentSource({
157
163
  getCollection: (name) => getCollection(name as never) as Promise<{ data: unknown }[]>,
158
164
  isDev: import.meta.env.DEV,
@@ -1,4 +1,3 @@
1
- export { ALL_FRAGMENTS_COLLECTION, type ConlocaCollectionsResult, type ConlocaDataOptions, type ConlocaPagesOptions, type CreateConlocaCollectionsOptions, conlocaData, conlocaFragments, conlocaPages, createConlocaCollections, pageSchemasOf, } from '../src/collections.js';
2
- export type { ConlocaPageEntry } from '../src/internal/page-collection-schema.js';
1
+ export { ALL_FRAGMENTS_COLLECTION, type CollectionEntryLike, type ConlocaCollectionsResult, type ConlocaDataEntry, type ConlocaDataOptions, type ConlocaFragmentEntry, type ConlocaPageEntry, type ConlocaPagesOptions, type CreateConlocaCollectionsOptions, conlocaData, conlocaDataEntries, conlocaFragmentEntries, conlocaFragments, conlocaPageEntries, conlocaPages, createConlocaCollections, type EntryParser, entryParserOf, pageSchemasOf, type TypedCollectionEntry, } from '../src/collections.js';
3
2
  export { type ConlocaLoaderOptions, conlocaLoader } from '../src/loader.js';
4
3
  //# sourceMappingURL=content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../node/content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../node/content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,KAAK,WAAW,EAChB,aAAa,EACb,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,3 +1,3 @@
1
- export { ALL_FRAGMENTS_COLLECTION, conlocaData, conlocaFragments, conlocaPages, createConlocaCollections, pageSchemasOf, } from '../src/collections.js';
1
+ export { ALL_FRAGMENTS_COLLECTION, conlocaData, conlocaDataEntries, conlocaFragmentEntries, conlocaFragments, conlocaPageEntries, conlocaPages, createConlocaCollections, entryParserOf, pageSchemasOf, } from '../src/collections.js';
2
2
  export { conlocaLoader } from '../src/loader.js';
3
3
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../node/content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAKxB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAA6B,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../../node/content.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EASxB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EAExB,aAAa,EACb,aAAa,GAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAA6B,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { defineCollection } from 'astro:content';
2
- import type { DataSchemas, PageSchemas } from '@conloca/cms-spa/page-schema-define';
3
- import { z } from 'zod';
4
- import { ALL_FRAGMENTS_COLLECTION } from './handlers/page-render-core.js';
2
+ import type { DataSchemas, HostSchema, PageSchemas } from '@conloca/cms-spa/page-schema-define';
3
+ import type { Loader } from 'astro/loaders';
4
+ import { ALL_FRAGMENTS_COLLECTION } from './handlers/collection-names.js';
5
+ import { type EntryParser } from './internal/entry-validation.js';
6
+ export { type CollectionEntryLike, type ConlocaDataEntry, type ConlocaFragmentEntry, type ConlocaPageEntry, conlocaDataEntries, conlocaFragmentEntries, conlocaPageEntries, type TypedCollectionEntry, } from './entries.js';
7
+ export type { EntryParser };
5
8
  export { ALL_FRAGMENTS_COLLECTION };
6
9
  /**
7
10
  * Options for createConlocaCollections().
@@ -16,8 +19,8 @@ export interface CreateConlocaCollectionsOptions {
16
19
  site?: string;
17
20
  /**
18
21
  * The same `pageSchemas` object the editor loads. Host meta fields are
19
- * validated on every page collection at build time (made optional, because
20
- * the editor scopes a descriptor to a prefix while Astro validates the
22
+ * validated on every page collection at build time (optional, because
23
+ * the editor scopes a descriptor to a prefix while Astro builds the
21
24
  * whole pile). Pass the object itself — not a hand-copied field list — so
22
25
  * the form and the build cannot drift. Listing types come from augmenting
23
26
  * `HostPageMeta`, not from Astro `entry.data`.
@@ -35,10 +38,8 @@ export interface ConlocaCollectionsResult {
35
38
  }
36
39
  /**
37
40
  * @deprecated Declare collections explicitly with {@link conlocaPages},
38
- * {@link conlocaData} and {@link conlocaFragments} — they keep the entry
39
- * types Astro's generated `getCollection` needs, and undeclared content
40
- * fails the build instead of silently not building. This wrapper still
41
- * works but returns untyped entries.
41
+ * {@link conlocaData} and {@link conlocaFragments} — undeclared content fails
42
+ * the build instead of silently not building. This wrapper still works.
42
43
  *
43
44
  * Creates Astro Content Collections by discovering from indexed content.
44
45
  * Uses content-api to find collections that have content.
@@ -47,7 +48,7 @@ export interface ConlocaCollectionsResult {
47
48
  * ```typescript
48
49
  * // src/content.config.ts
49
50
  * import { createConlocaCollections } from '@conloca/astro-cms/node/content';
50
- * import { pageSchemas } from './page-schemas';
51
+ * import { pageSchemas } from './page-schemas.js';
51
52
  *
52
53
  * export const { collections } = await createConlocaCollections({ pageSchemas });
53
54
  * ```
@@ -77,17 +78,22 @@ export interface ConlocaPagesOptions {
77
78
  */
78
79
  export declare function pageSchemasOf(collection: object): PageSchemas | undefined;
79
80
  /**
80
- * One typed Astro collection for Conloca pages — the explicit,
81
- * Starlight-shaped declaration:
81
+ * The entry parser a Conloca-built collection's loader validates every entry
82
+ * with before storing it, or undefined for any other collection.
83
+ */
84
+ export declare function entryParserOf(collection: object): EntryParser<Record<string, unknown>> | undefined;
85
+ /**
86
+ * One Astro collection for Conloca pages — the explicit, Starlight-shaped
87
+ * declaration:
82
88
  *
83
89
  * ```ts
84
90
  * export const collections = { pages: conlocaPages({ pageSchemas }) };
85
91
  * ```
86
92
  *
87
- * Entry data is typed as {@link ConlocaPageEntry}; `getCollection('pages')`
88
- * carries pathname/title/dates and the host's declared meta fields.
93
+ * Every page is validated as {@link ConlocaPageEntry} while it loads; read it
94
+ * typed with `conlocaPageEntries(await getCollection('pages'), pageSchemas)`.
89
95
  */
90
- export declare function conlocaPages(options?: ConlocaPagesOptions): import("astro/content/config").CollectionConfig<z.ZodType<import("./internal/page-collection-schema.js").ConlocaPageEntry, unknown, z.core.$ZodTypeInternals<import("./internal/page-collection-schema.js").ConlocaPageEntry, unknown>>, import("astro/loaders").Loader>;
96
+ export declare function conlocaPages(options?: ConlocaPagesOptions): import("astro/content/config").CollectionConfig<import("astro:content").BaseSchema, Loader>;
91
97
  /** Options for conlocaData(). */
92
98
  export interface ConlocaDataOptions<DS extends DataSchemas> {
93
99
  /**
@@ -103,34 +109,22 @@ export interface ConlocaDataOptions<DS extends DataSchemas> {
103
109
  }
104
110
  /**
105
111
  * Deliberate asymmetry with pages: a data schema is validated AS GIVEN —
106
- * requiredness preserved, no rewrite guard — because the site owns it whole
107
- * for exactly one collection, unlike host page fields folded into the shared
108
- * pages schema. The flip side, accepted for now: a .transform or .default in
109
- * a dataSchema runs at build time but not in the editor form, so the two can
110
- * diverge.
112
+ * requiredness preserved — because the site owns it whole for exactly one
113
+ * collection, unlike host page fields checked across the shared pages pile.
111
114
  */
112
- declare function conlocaDataCollection<T extends z.ZodObject<z.ZodRawShape>>(name: string, payload: T, contentRoot: string, site: string): import("astro/content/config").CollectionConfig<z.ZodObject<{
113
- title: z.ZodString;
114
- description: z.ZodOptional<z.ZodString>;
115
- category: z.ZodOptional<z.ZodString>;
116
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
- id: z.ZodString;
118
- locale: z.ZodString;
119
- name: z.ZodString;
120
- data: z.ZodOptional<T>;
121
- }, z.core.$loose>, import("astro/loaders").Loader>;
115
+ declare function conlocaDataCollection(name: string, payload: HostSchema, contentRoot: string, site: string): import("astro/content/config").CollectionConfig<import("astro:content").BaseSchema, Loader>;
122
116
  /**
123
- * Typed Astro collections for Conloca data, one per `dataSchemas` key:
117
+ * Astro collections for Conloca data, one per `dataSchemas` key:
124
118
  *
125
119
  * ```ts
126
120
  * export const collections = { ...conlocaData({ dataSchemas }) };
127
121
  * ```
128
122
  *
129
- * `getCollection('testimonials')` entries carry `data` typed by that key's
130
- * schema, and a stored entry that fails its schema fails the build instead
131
- * of rendering blank.
123
+ * A stored entry whose payload fails its schema fails the build instead of
124
+ * rendering blank. Read entries typed by that key's schema with
125
+ * `conlocaDataEntries(dataSchemas, 'testimonials', await getCollection('testimonials'))`.
132
126
  */
133
- export declare function conlocaData<DS extends DataSchemas>(options: ConlocaDataOptions<DS>): { [K in keyof DS]: ReturnType<typeof conlocaDataCollection<DS[K]>>; };
127
+ export declare function conlocaData<DS extends DataSchemas>(options: ConlocaDataOptions<DS>): { [K in keyof DS]: ReturnType<typeof conlocaDataCollection>; };
134
128
  /**
135
129
  * The fragments aggregate (always) plus one collection per named fragment
136
130
  * folder: `...conlocaFragments('general')`. No arguments declares only the
@@ -140,22 +134,6 @@ export declare function conlocaData<DS extends DataSchemas>(options: ConlocaData
140
134
  * contentRoot (via CONLOCA_CONTENT_ROOT) and the site is always 'default'.
141
135
  */
142
136
  export declare function conlocaFragments<const N extends readonly string[]>(...names: N): {
143
- [ALL_FRAGMENTS_COLLECTION]: ReturnType<(collection?: string) => import("astro/content/config").CollectionConfig<z.ZodObject<{
144
- title: z.ZodString;
145
- description: z.ZodOptional<z.ZodString>;
146
- category: z.ZodOptional<z.ZodString>;
147
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
148
- id: z.ZodString;
149
- locale: z.ZodString;
150
- name: z.ZodString;
151
- }, z.core.$loose>, import("astro/loaders").Loader>>;
152
- } & { [K in N[number]]: ReturnType<(collection?: string) => import("astro/content/config").CollectionConfig<z.ZodObject<{
153
- title: z.ZodString;
154
- description: z.ZodOptional<z.ZodString>;
155
- category: z.ZodOptional<z.ZodString>;
156
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
157
- id: z.ZodString;
158
- locale: z.ZodString;
159
- name: z.ZodString;
160
- }, z.core.$loose>, import("astro/loaders").Loader>>; };
137
+ [ALL_FRAGMENTS_COLLECTION]: ReturnType<(collection?: string) => import("astro/content/config").CollectionConfig<import("astro:content").BaseSchema, Loader>>;
138
+ } & { [K in N[number]]: ReturnType<(collection?: string) => import("astro/content/config").CollectionConfig<import("astro:content").BaseSchema, Loader>>; };
161
139
  //# sourceMappingURL=collections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe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AAO,GAAE,mBAAwB,+FAa7D;AAED,iCAAiC;AACjC,MAAM,WAAW,kBAAkB,CAAC,EAAE,SAAS,WAAW;IACxD;;;;OAIG;IACH,WAAW,EAAE,EAAE,CAAC;IAChB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,+FASlG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,SAAS,WAAW,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC,GAS3D,GAAG,CAAC,IAAI,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,GAAE,CACpF;AASD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,GAqBJ;IACvE,CAAC,wBAAwB,CAAC,EAAE,UAAU,eAlBC,MAAM,iGAkBoB,CAAC;CACnE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,eAnBO,MAAM,iGAmBc,GAAE,CAChE"}
@@ -1,18 +1,35 @@
1
1
  import { defineCollection } from 'astro:content';
2
2
  import { createContentAPI } from '@conloca/content-api/reader';
3
- import { dataMetaSchema, fragmentMetaSchema, pageMetaSchema } from '@conloca/content-api/schemas';
4
- import { z } from 'zod';
5
- import { ALL_FRAGMENTS_COLLECTION } from './handlers/page-render-core.js';
3
+ import { parseLooseDataMeta } from '@conloca/content-api/schemas';
4
+ import { ALL_FRAGMENTS_COLLECTION } from './handlers/collection-names.js';
6
5
  import { declareConlocaCollection, withDeclarationCheck } from './internal/declared-collections.js';
7
- import { buildPageCollectionSchema, hostFieldsFromPageSchemas } from './internal/page-collection-schema.js';
6
+ import { createDataEntryParser, createPageEntryParser, parseFragmentEntry, } from './internal/entry-validation.js';
8
7
  import { conlocaLoader } from './loader.js';
8
+ export { conlocaDataEntries, conlocaFragmentEntries, conlocaPageEntries, } from './entries.js';
9
9
  export { ALL_FRAGMENTS_COLLECTION };
10
+ /**
11
+ * How every collection below is declared: a loader and NO `schema`.
12
+ *
13
+ * Astro's `schema` option only accepts Zod; it is optional, and without it
14
+ * `parseData` stores the loader's data unchanged. Validation therefore runs in
15
+ * the loader, before `store.set`, with the generated Typia validators for the
16
+ * collection (see `internal/entry-validation.ts`) — a stored entry that fails
17
+ * them still fails the build. Entry typing comes from the typed accessors
18
+ * (`conlocaPageEntries` / `conlocaDataEntries` / `conlocaFragmentEntries`),
19
+ * because Astro infers `getCollection` types from a Zod schema only.
20
+ */
21
+ function conlocaCollection(loader, parseEntry) {
22
+ const defined = defineCollection({ loader });
23
+ entryParsersByCollection.set(defined, parseEntry);
24
+ return defined;
25
+ }
26
+ // The entry parser each Conloca-built collection's loader validates with, so a
27
+ // test (or a host) can run exactly the build's validation without a content root.
28
+ const entryParsersByCollection = new WeakMap();
10
29
  /**
11
30
  * @deprecated Declare collections explicitly with {@link conlocaPages},
12
- * {@link conlocaData} and {@link conlocaFragments} — they keep the entry
13
- * types Astro's generated `getCollection` needs, and undeclared content
14
- * fails the build instead of silently not building. This wrapper still
15
- * works but returns untyped entries.
31
+ * {@link conlocaData} and {@link conlocaFragments} — undeclared content fails
32
+ * the build instead of silently not building. This wrapper still works.
16
33
  *
17
34
  * Creates Astro Content Collections by discovering from indexed content.
18
35
  * Uses content-api to find collections that have content.
@@ -21,7 +38,7 @@ export { ALL_FRAGMENTS_COLLECTION };
21
38
  * ```typescript
22
39
  * // src/content.config.ts
23
40
  * import { createConlocaCollections } from '@conloca/astro-cms/node/content';
24
- * import { pageSchemas } from './page-schemas';
41
+ * import { pageSchemas } from './page-schemas.js';
25
42
  *
26
43
  * export const { collections } = await createConlocaCollections({ pageSchemas });
27
44
  * ```
@@ -34,32 +51,17 @@ export async function createConlocaCollections(options = {}) {
34
51
  const { contentRoot = process.env.CONLOCA_CONTENT_ROOT ?? './content', site = 'default', pageSchemas } = options;
35
52
  const api = await createContentAPI({ contentRoot });
36
53
  const collections = {};
37
- collections[ALL_FRAGMENTS_COLLECTION] = defineCollection({
38
- loader: conlocaLoader({ contentRoot, site, kind: 'fragment' }),
39
- schema: fragmentMetaSchema.loose(),
40
- });
54
+ collections[ALL_FRAGMENTS_COLLECTION] = conlocaCollection(conlocaLoader({ contentRoot, site, kind: 'fragment', parseEntry: parseFragmentEntry }), parseFragmentEntry);
41
55
  for (const name of api.fragments.collections) {
42
- collections[name] = defineCollection({
43
- loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'fragment' }),
44
- schema: fragmentMetaSchema.loose(),
45
- });
56
+ collections[name] = conlocaCollection(conlocaLoader({ collection: name, contentRoot, site, kind: 'fragment', parseEntry: parseFragmentEntry }), parseFragmentEntry);
46
57
  }
47
58
  for (const name of api.data.collections) {
48
- collections[name] = defineCollection({
49
- loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'data' }),
50
- schema: dataMetaSchema.loose(),
51
- });
59
+ collections[name] = conlocaCollection(conlocaLoader({ collection: name, contentRoot, site, kind: 'data', parseEntry: parseLooseDataMeta }), parseLooseDataMeta);
52
60
  }
53
- const hostFields = pageSchemas ? hostFieldsFromPageSchemas(pageSchemas) : undefined;
54
- const pageSchema = hostFields && Object.keys(hostFields.shape).length > 0
55
- ? buildPageCollectionSchema(hostFields)
56
- : pageMetaSchema.loose();
61
+ const parsePage = createPageEntryParser(pageSchemas);
57
62
  const siteCollections = api.getSite(site)?.collections ?? new Set();
58
63
  for (const name of siteCollections) {
59
- collections[name] = defineCollection({
60
- loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'page' }),
61
- schema: pageSchema,
62
- });
64
+ collections[name] = conlocaCollection(conlocaLoader({ collection: name, contentRoot, site, kind: 'page', parseEntry: parsePage }), parsePage);
63
65
  }
64
66
  return { collections };
65
67
  }
@@ -77,69 +79,68 @@ export function pageSchemasOf(collection) {
77
79
  return pageSchemasByCollection.get(collection);
78
80
  }
79
81
  /**
80
- * One typed Astro collection for Conloca pages — the explicit,
81
- * Starlight-shaped declaration:
82
+ * The entry parser a Conloca-built collection's loader validates every entry
83
+ * with before storing it, or undefined for any other collection.
84
+ */
85
+ export function entryParserOf(collection) {
86
+ return entryParsersByCollection.get(collection);
87
+ }
88
+ /**
89
+ * One Astro collection for Conloca pages — the explicit, Starlight-shaped
90
+ * declaration:
82
91
  *
83
92
  * ```ts
84
93
  * export const collections = { pages: conlocaPages({ pageSchemas }) };
85
94
  * ```
86
95
  *
87
- * Entry data is typed as {@link ConlocaPageEntry}; `getCollection('pages')`
88
- * carries pathname/title/dates and the host's declared meta fields.
96
+ * Every page is validated as {@link ConlocaPageEntry} while it loads; read it
97
+ * typed with `conlocaPageEntries(await getCollection('pages'), pageSchemas)`.
89
98
  */
90
99
  export function conlocaPages(options = {}) {
91
100
  const { contentRoot = defaultContentRoot(), site = 'default', collection = 'pages', pageSchemas } = options;
92
101
  declareConlocaCollection('page', collection);
93
- const defined = defineCollection({
94
- loader: withDeclarationCheck(conlocaLoader({ collection, contentRoot, site, kind: 'page' }), {
95
- contentRoot,
96
- site,
97
- }),
98
- schema: buildPageCollectionSchema(pageSchemas ? hostFieldsFromPageSchemas(pageSchemas) : z.object({})),
99
- });
102
+ const parseEntry = createPageEntryParser(pageSchemas);
103
+ const defined = conlocaCollection(withDeclarationCheck(conlocaLoader({ collection, contentRoot, site, kind: 'page', parseEntry }), {
104
+ contentRoot,
105
+ site,
106
+ }), parseEntry);
100
107
  if (pageSchemas)
101
108
  pageSchemasByCollection.set(defined, pageSchemas);
102
109
  return defined;
103
110
  }
104
111
  /**
105
112
  * Deliberate asymmetry with pages: a data schema is validated AS GIVEN —
106
- * requiredness preserved, no rewrite guard — because the site owns it whole
107
- * for exactly one collection, unlike host page fields folded into the shared
108
- * pages schema. The flip side, accepted for now: a .transform or .default in
109
- * a dataSchema runs at build time but not in the editor form, so the two can
110
- * diverge.
113
+ * requiredness preserved — because the site owns it whole for exactly one
114
+ * collection, unlike host page fields checked across the shared pages pile.
111
115
  */
112
116
  function conlocaDataCollection(name, payload, contentRoot, site) {
113
- return defineCollection({
114
- loader: withDeclarationCheck(conlocaLoader({ collection: name, contentRoot, site, kind: 'data' }), {
115
- contentRoot,
116
- site,
117
- }),
118
- // Base meta plus this collection's payload under `data`. `data` stays
119
- // optional: an entry saved before any payload exists is not an error.
120
- schema: z.looseObject({ ...dataMetaSchema.shape, data: payload.optional() }),
121
- });
117
+ const parseEntry = createDataEntryParser(payload);
118
+ return conlocaCollection(withDeclarationCheck(conlocaLoader({ collection: name, contentRoot, site, kind: 'data', parseEntry }), {
119
+ contentRoot,
120
+ site,
121
+ }), parseEntry);
122
122
  }
123
123
  /**
124
- * Typed Astro collections for Conloca data, one per `dataSchemas` key:
124
+ * Astro collections for Conloca data, one per `dataSchemas` key:
125
125
  *
126
126
  * ```ts
127
127
  * export const collections = { ...conlocaData({ dataSchemas }) };
128
128
  * ```
129
129
  *
130
- * `getCollection('testimonials')` entries carry `data` typed by that key's
131
- * schema, and a stored entry that fails its schema fails the build instead
132
- * of rendering blank.
130
+ * A stored entry whose payload fails its schema fails the build instead of
131
+ * rendering blank. Read entries typed by that key's schema with
132
+ * `conlocaDataEntries(dataSchemas, 'testimonials', await getCollection('testimonials'))`.
133
133
  */
134
134
  export function conlocaData(options) {
135
135
  const { dataSchemas, contentRoot = defaultContentRoot(), site = 'default' } = options;
136
- const entries = Object.entries(dataSchemas).map(([name, payload]) => {
136
+ const collections = {};
137
+ for (const [name, payload] of Object.entries(dataSchemas)) {
137
138
  declareConlocaCollection('data', name);
138
- return [name, conlocaDataCollection(name, payload, contentRoot, site)];
139
- });
140
- // Object.fromEntries erases per-key types; the assertion restores exactly
141
- // what the loop built — one collection per dataSchemas key.
142
- return Object.fromEntries(entries);
139
+ collections[name] = conlocaDataCollection(name, payload, contentRoot, site);
140
+ }
141
+ // The loop built exactly one collection per dataSchemas key; the record type
142
+ // keeps those keys for the content.config `collections` export.
143
+ return collections;
143
144
  }
144
145
  /**
145
146
  * The folder the editor saves every new fragment to (content/fragments/fragments/).
@@ -159,13 +160,7 @@ export function conlocaFragments(...names) {
159
160
  const contentRoot = defaultContentRoot();
160
161
  const site = 'default';
161
162
  declareConlocaCollection('fragment', EDITOR_FRAGMENT_FOLDER);
162
- const fragmentCollection = (collection) => defineCollection({
163
- loader: withDeclarationCheck(conlocaLoader({ collection, contentRoot, site, kind: 'fragment' }), {
164
- contentRoot,
165
- site,
166
- }),
167
- schema: fragmentMetaSchema.loose(),
168
- });
163
+ const fragmentCollection = (collection) => conlocaCollection(withDeclarationCheck(conlocaLoader({ collection, contentRoot, site, kind: 'fragment', parseEntry: parseFragmentEntry }), { contentRoot, site }), parseFragmentEntry);
169
164
  const named = Object.fromEntries(names.map((name) => {
170
165
  declareConlocaCollection('fragment', name);
171
166
  return [name, fragmentCollection(name)];
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAA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CAClB,aAAa,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC,EAClG,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,EACD,kBAAkB,CACnB,CAAC;IACJ,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAC9B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjB,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAU,CAAC;IACnD,CAAC,CAAC,CACH,CAAC;IACF,uEAAuE;IACvE,qEAAqE;IACrE,uBAAuB;IACvB,OAAO,EAAE,CAAC,wBAAwB,CAAC,EAAE,kBAAkB,EAAE,EAAE,GAAG,KAAK,EAEJ,CAAC;AAClE,CAAC"}
@@ -0,0 +1,44 @@
1
+ import type { DataSchemas, HostSchemaType, PageSchemas } from '@conloca/cms-spa/page-schema-define';
2
+ import { type ConlocaDataEntry, type ConlocaFragmentEntry, type ConlocaPageEntry } from './internal/entry-validation.js';
3
+ /**
4
+ * Typed reads of Conloca collections.
5
+ *
6
+ * Astro types `getCollection()` entries from a collection's Zod `schema`; the
7
+ * Conloca factories declare none (the loader validates with generated Typia
8
+ * validators instead), so Astro's own entry type for them is `any`. These
9
+ * accessors take what `getCollection()` returned and hand back entries typed
10
+ * by the same declarations the build validated with — re-running those
11
+ * validators, so the type is earned at runtime rather than asserted:
12
+ *
13
+ * ```ts
14
+ * import { getCollection } from 'astro:content';
15
+ * import { conlocaPageEntries } from '@conloca/astro-cms/collections';
16
+ * import { pageSchemas } from '../page-schemas';
17
+ *
18
+ * const pages = conlocaPageEntries(await getCollection('pages'), pageSchemas);
19
+ * pages[0].data.title; // string
20
+ * ```
21
+ *
22
+ * They take the entries rather than calling `getCollection` themselves so they
23
+ * stay importable (and testable) outside Astro's virtual modules.
24
+ *
25
+ * Each call re-validates every entry it is given; call once per collection
26
+ * read (e.g. in `getStaticPaths` or once per page) rather than per access.
27
+ */
28
+ /** The fields every Astro collection entry carries besides `data`. */
29
+ export interface CollectionEntryLike {
30
+ id: string;
31
+ data: unknown;
32
+ }
33
+ /** An Astro collection entry with `data` replaced by its validated, typed form. */
34
+ export type TypedCollectionEntry<E extends CollectionEntryLike, T> = Omit<E, 'data'> & {
35
+ data: T;
36
+ };
37
+ /** `getCollection('pages')` entries, validated and typed as {@link ConlocaPageEntry}. */
38
+ export declare function conlocaPageEntries<E extends CollectionEntryLike>(entries: readonly E[], pageSchemas?: PageSchemas): TypedCollectionEntry<E, ConlocaPageEntry>[];
39
+ /** A `conlocaData` collection's entries, with `data` validated and typed by that key's host schema. */
40
+ export declare function conlocaDataEntries<E extends CollectionEntryLike, DS extends DataSchemas, K extends keyof DS & string>(dataSchemas: DS, collection: K, entries: readonly E[]): TypedCollectionEntry<E, ConlocaDataEntry<HostSchemaType<DS[K]>>>[];
41
+ /** Fragment collection entries, validated and typed as {@link ConlocaFragmentEntry}. */
42
+ export declare function conlocaFragmentEntries<E extends CollectionEntryLike>(entries: readonly E[]): TypedCollectionEntry<E, ConlocaFragmentEntry>[];
43
+ export type { ConlocaDataEntry, ConlocaFragmentEntry, ConlocaPageEntry };
44
+ //# sourceMappingURL=entries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../../src/entries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEpG,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAKtB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAA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