@lupinum/ginko-content 0.1.5 → 0.2.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 (230) hide show
  1. package/compatibility.json +1 -1
  2. package/dist/cli.mjs +2 -2
  3. package/dist/cms-contract/build.js +15 -20
  4. package/dist/cms-contract/types.d.ts +12 -7
  5. package/dist/core/content/document +1 -0
  6. package/dist/core/content/document.d.ts +16 -0
  7. package/dist/core/content/document.js +2 -0
  8. package/dist/core/content/graph.d.ts +3 -1
  9. package/dist/core/content/graph.js +21 -20
  10. package/dist/core/content/locale.d.ts +6 -1
  11. package/dist/core/content/locale.js +17 -6
  12. package/dist/core/content/path.d.ts +5 -5
  13. package/dist/core/content/path.js +8 -8
  14. package/dist/core/content/snapshot +1 -0
  15. package/dist/core/content/snapshot.d.ts +25 -0
  16. package/dist/core/content/snapshot.js +99 -0
  17. package/dist/core/provider-errors.d.ts +1 -1
  18. package/dist/core/provider-errors.js +1 -0
  19. package/dist/core/query/builder.js +3 -3
  20. package/dist/core/query/execute.js +75 -36
  21. package/dist/core/query/filter.js +2 -2
  22. package/dist/core/query/lower.js +79 -3
  23. package/dist/core/query/params.js +7 -7
  24. package/dist/core/query/plan.d.ts +18 -0
  25. package/dist/core/query/plan.js +7 -0
  26. package/dist/core/references/resolve.js +6 -9
  27. package/dist/features/agent/agent-markdown +1 -0
  28. package/dist/features/agent/agent-markdown.d.ts +116 -0
  29. package/dist/features/agent/agent-markdown.js +138 -0
  30. package/dist/features/agent/walker +1 -0
  31. package/dist/features/agent/walker.d.ts +10 -0
  32. package/dist/features/agent/walker.js +174 -0
  33. package/dist/features/collections/resolve.d.ts +2 -2
  34. package/dist/features/collections/resolve.js +19 -16
  35. package/dist/features/localization/links.js +1 -1
  36. package/dist/features/localization/results.d.ts +3 -3
  37. package/dist/features/localization/results.js +46 -41
  38. package/dist/features/localization/translated-slugs.js +5 -5
  39. package/dist/features/navigation/build.d.ts +2 -2
  40. package/dist/features/navigation/build.js +23 -26
  41. package/dist/features/navigation/canonical.d.ts +10 -11
  42. package/dist/features/navigation/canonical.js +26 -21
  43. package/dist/features/navigation/resolve.js +4 -4
  44. package/dist/features/navigation/tree.js +3 -3
  45. package/dist/{runtime → features}/query/backlinks.js +3 -5
  46. package/dist/{runtime → features}/query/documents.js +1 -1
  47. package/dist/{runtime → features}/query/localized-docs.d.ts +1 -1
  48. package/dist/{runtime → features}/query/localized-docs.js +3 -6
  49. package/dist/{runtime → features}/query/navigation.d.ts +1 -1
  50. package/dist/{runtime → features}/query/navigation.js +8 -8
  51. package/dist/{runtime → features}/query/populate.js +6 -14
  52. package/dist/{runtime → features}/query/unified.d.ts +4 -4
  53. package/dist/{runtime → features}/query/unified.js +4 -2
  54. package/dist/{runtime → features}/query/variants.js +4 -4
  55. package/dist/features/search/navigation.js +2 -2
  56. package/dist/features/search/sections.d.ts +1 -1
  57. package/dist/features/search/sections.js +1 -1
  58. package/dist/features/sitemap/query.d.ts +5 -5
  59. package/dist/features/sitemap/query.js +6 -6
  60. package/dist/integrations/nitro/ingest.js +9 -20
  61. package/dist/integrations/nitro/storage.d.ts +1 -0
  62. package/dist/integrations/nitro/storage.js +21 -34
  63. package/dist/module.d.mts +135 -803
  64. package/dist/module.json +1 -1
  65. package/dist/module.mjs +143 -51
  66. package/dist/parsers/csv.js +3 -3
  67. package/dist/parsers/index.js +3 -3
  68. package/dist/parsers/json.js +8 -6
  69. package/dist/parsers/markdown-plugins.js +9 -5
  70. package/dist/parsers/markdown.js +7 -6
  71. package/dist/parsers/path-meta.js +21 -19
  72. package/dist/parsers/reserved +1 -0
  73. package/dist/parsers/reserved.d.ts +15 -0
  74. package/dist/parsers/reserved.js +35 -0
  75. package/dist/parsers/yaml.js +6 -4
  76. package/dist/public/agent +1 -0
  77. package/dist/public/agent.d.ts +17 -0
  78. package/dist/public/agent.js +34 -0
  79. package/dist/public/client.d.ts +2 -3
  80. package/dist/public/client.js +1 -2
  81. package/dist/public/provider-query +1 -0
  82. package/dist/public/provider-query.d.ts +58 -0
  83. package/dist/public/provider-query.js +5 -0
  84. package/dist/public/provider.d.ts +8 -3
  85. package/dist/public/provider.js +2 -0
  86. package/dist/public/server.d.ts +7 -12
  87. package/dist/public/server.js +5 -36
  88. package/dist/runtime/app/components/ContentRenderer.d.vue.ts +3 -3
  89. package/dist/runtime/app/components/ContentRenderer.vue +2 -2
  90. package/dist/runtime/app/components/ContentRenderer.vue.d.ts +3 -3
  91. package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +1 -1
  92. package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +1 -1
  93. package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +4 -4
  94. package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +4 -4
  95. package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +1 -1
  96. package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +1 -1
  97. package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +1 -1
  98. package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +4 -4
  99. package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +1 -1
  100. package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +3 -3
  101. package/dist/runtime/app/composables/preview.d.ts +1 -1
  102. package/dist/runtime/app/composables/query-api.d.ts +5 -5
  103. package/dist/runtime/app/composables/query-api.js +5 -3
  104. package/dist/runtime/app/composables/route.d.ts +1 -1
  105. package/dist/runtime/app/composables/route.js +4 -4
  106. package/dist/runtime/app/composables/search.js +1 -1
  107. package/dist/runtime/app/composables/use-content-document.js +1 -1
  108. package/dist/runtime/app/composables/use-content-list.js +1 -1
  109. package/dist/runtime/app/composables/use-content-navigation.js +2 -2
  110. package/dist/runtime/app/composables/use-content-page.js +4 -4
  111. package/dist/runtime/app/pages/content.vue +2 -1
  112. package/dist/runtime/markdown/plugins.js +6 -8
  113. package/dist/runtime/server/agent-markdown.d.ts +5 -65
  114. package/dist/runtime/server/agent-markdown.js +40 -315
  115. package/dist/runtime/server/agent-site.js +9 -2
  116. package/dist/runtime/server/api/agent-raw.js +1 -1
  117. package/dist/runtime/server/api/cache.d.ts +1 -1
  118. package/dist/runtime/server/api/cache.js +43 -4
  119. package/dist/runtime/server/api/locales.js +3 -3
  120. package/dist/runtime/server/api/navigation.d.ts +1 -1
  121. package/dist/runtime/server/api/navigation.js +3 -1
  122. package/dist/runtime/server/api/query.js +2 -2
  123. package/dist/runtime/server/api/search-index.d.ts +1 -1
  124. package/dist/runtime/server/api/sitemap.d.ts +1 -1
  125. package/dist/runtime/server/cache-adapters.d.ts +18 -0
  126. package/dist/runtime/server/cache-adapters.js +12 -0
  127. package/dist/runtime/server/collection-helpers.d.ts +2 -2
  128. package/dist/runtime/server/collection-helpers.js +15 -11
  129. package/dist/runtime/server/index.d.ts +6 -4
  130. package/dist/runtime/server/index.js +10 -3
  131. package/dist/runtime/server/middleware/agent-link-headers.js +1 -1
  132. package/dist/runtime/server/middleware/agent-markdown.js +1 -1
  133. package/dist/runtime/server/navigation-query.d.ts +2 -2
  134. package/dist/runtime/server/navigation-query.js +52 -7
  135. package/dist/runtime/server/navigation.d.ts +1 -1
  136. package/dist/runtime/server/provider-document +1 -0
  137. package/dist/runtime/server/provider-document.d.ts +59 -0
  138. package/dist/runtime/server/provider-document.js +48 -0
  139. package/dist/runtime/server/provider-query-wire +1 -0
  140. package/dist/runtime/server/provider-query-wire.d.ts +32 -0
  141. package/dist/runtime/server/provider-query-wire.js +27 -0
  142. package/dist/runtime/server/provider-query.d.ts +18 -9
  143. package/dist/runtime/server/provider-query.js +62 -28
  144. package/dist/runtime/server/provider-result.d.ts +4 -4
  145. package/dist/runtime/server/providers/filesystem.js +3 -11
  146. package/dist/runtime/server/providers/index.d.ts +18 -1
  147. package/dist/runtime/server/providers/index.js +72 -20
  148. package/dist/runtime/server/query-api.d.ts +5 -5
  149. package/dist/runtime/server/query-api.js +9 -6
  150. package/dist/runtime/server/query-executor.d.ts +3 -3
  151. package/dist/runtime/server/query-executor.js +43 -59
  152. package/dist/runtime/server/search.d.ts +1 -1
  153. package/dist/runtime/server/search.js +4 -4
  154. package/dist/runtime/server/sitemap.js +5 -5
  155. package/dist/runtime/server/storage-access.d.ts +4 -1
  156. package/dist/runtime/server/storage-access.js +27 -2
  157. package/dist/runtime/transformers/component-resolver.d.ts +1 -1
  158. package/dist/storage/content.d.ts +2 -6
  159. package/dist/storage/content.js +19 -8
  160. package/dist/storage/contents.d.ts +9 -1
  161. package/dist/storage/contents.js +26 -19
  162. package/dist/storage/driver.d.ts +2 -2
  163. package/dist/storage/driver.js +2 -1
  164. package/dist/storage/graph.js +4 -0
  165. package/dist/storage/manifest.js +3 -1
  166. package/dist/storage/references.js +9 -5
  167. package/dist/storage/snapshot-runtime +1 -0
  168. package/dist/storage/snapshot-runtime.d.ts +11 -0
  169. package/dist/storage/snapshot-runtime.js +46 -0
  170. package/dist/storage/validation.d.ts +1 -1
  171. package/dist/storage/validation.js +79 -105
  172. package/dist/testing/provider-contract.d.ts +14 -4
  173. package/dist/testing/provider-contract.js +121 -68
  174. package/dist/testing/provider-fixture.d.ts +1 -1
  175. package/dist/testing/provider-fixture.js +124 -120
  176. package/dist/types/config.d.ts +17 -4
  177. package/dist/types/content.d.ts +104 -70
  178. package/dist/types/fields.js +1 -1
  179. package/dist/types/module.d.ts +1 -1
  180. package/dist/types/query-parts/public.d.ts +14 -5
  181. package/dist/types/query-parts/results.d.ts +6 -2
  182. package/dist/types/query-parts/transport.d.ts +19 -0
  183. package/dist/types/virtual.d.ts +6 -0
  184. package/dist/types.d.mts +2 -2
  185. package/dist/web-types.json +1 -1
  186. package/package.json +39 -9
  187. package/dist/runtime/app/plugins/markdown-components +0 -1
  188. package/dist/runtime/app/plugins/markdown-components.d.ts +0 -2
  189. package/dist/runtime/app/plugins/markdown-components.js +0 -19
  190. /package/dist/{runtime → features/agent}/agent-paths +0 -0
  191. /package/dist/{runtime → features/agent}/agent-paths.d.ts +0 -0
  192. /package/dist/{runtime → features/agent}/agent-paths.js +0 -0
  193. /package/dist/{runtime → features}/query/backlinks +0 -0
  194. /package/dist/{runtime → features}/query/backlinks.d.ts +0 -0
  195. /package/dist/{runtime → features}/query/context +0 -0
  196. /package/dist/{runtime → features}/query/context.d.ts +0 -0
  197. /package/dist/{runtime → features}/query/context.js +0 -0
  198. /package/dist/{runtime → features}/query/documents +0 -0
  199. /package/dist/{runtime → features}/query/documents.d.ts +0 -0
  200. /package/dist/{runtime → features}/query/errors +0 -0
  201. /package/dist/{runtime → features}/query/errors.d.ts +0 -0
  202. /package/dist/{runtime → features}/query/errors.js +0 -0
  203. /package/dist/{runtime → features}/query/handles +0 -0
  204. /package/dist/{runtime → features}/query/handles.d.ts +0 -0
  205. /package/dist/{runtime → features}/query/handles.js +0 -0
  206. /package/dist/{runtime → features}/query/locale-options +0 -0
  207. /package/dist/{runtime → features}/query/locale-options.d.ts +0 -0
  208. /package/dist/{runtime → features}/query/locale-options.js +0 -0
  209. /package/dist/{runtime → features}/query/localized-docs +0 -0
  210. /package/dist/{runtime → features}/query/navigation +0 -0
  211. /package/dist/{runtime → features}/query/pagination +0 -0
  212. /package/dist/{runtime → features}/query/pagination.d.ts +0 -0
  213. /package/dist/{runtime → features}/query/pagination.js +0 -0
  214. /package/dist/{runtime → features}/query/populate +0 -0
  215. /package/dist/{runtime → features}/query/populate.d.ts +0 -0
  216. /package/dist/{runtime → features}/query/public-limits +0 -0
  217. /package/dist/{runtime → features}/query/public-limits.d.ts +0 -0
  218. /package/dist/{runtime → features}/query/public-limits.js +0 -0
  219. /package/dist/{runtime → features}/query/resolve +0 -0
  220. /package/dist/{runtime → features}/query/resolve.d.ts +0 -0
  221. /package/dist/{runtime → features}/query/resolve.js +0 -0
  222. /package/dist/{runtime → features}/query/responses +0 -0
  223. /package/dist/{runtime → features}/query/responses.d.ts +0 -0
  224. /package/dist/{runtime → features}/query/responses.js +0 -0
  225. /package/dist/{runtime → features}/query/routes +0 -0
  226. /package/dist/{runtime → features}/query/routes.d.ts +0 -0
  227. /package/dist/{runtime → features}/query/routes.js +0 -0
  228. /package/dist/{runtime → features}/query/unified +0 -0
  229. /package/dist/{runtime → features}/query/variants +0 -0
  230. /package/dist/{runtime → features}/query/variants.d.ts +0 -0
@@ -12,22 +12,80 @@ export interface ContentSeoMeta {
12
12
  image?: string | ContentSeoImage;
13
13
  }
14
14
  /**
15
- * Internal metadata attached to every parsed content record.
15
+ * Optional file-provenance metadata. Absent for non-filesystem providers
16
+ * (e.g. CMS-backed documents) that have no backing file.
16
17
  */
17
- export interface ParsedContentInternalMeta {
18
+ export interface ContentFileMeta {
18
19
  /**
19
- * Stable unique id for the parsed source record.
20
+ * Backing source name when multiple content sources are configured.
20
21
  */
21
- _id: string;
22
+ source?: string;
22
23
  /**
23
- * Backing source name when multiple content sources are configured.
24
+ * Source file path relative to the content root.
25
+ */
26
+ path?: string;
27
+ /**
28
+ * Path stem (the source path without its extension).
24
29
  */
25
- _source?: string;
30
+ stem?: string;
31
+ /**
32
+ * Parent directory segment of the source file.
33
+ */
34
+ dir?: string;
35
+ /**
36
+ * Source file basename without extension.
37
+ */
38
+ basename?: string;
39
+ /**
40
+ * Source file extension.
41
+ */
42
+ extension?: 'md' | 'yaml' | 'yml' | 'json' | 'json5' | 'csv';
43
+ }
44
+ /**
45
+ * Per-request locale/reference resolution carrier.
46
+ *
47
+ * Folded from the legacy underscore resolution meta into one object. It is the
48
+ * pre-shaping form of the modern `resolved`/`localePaths`/`variants` envelope:
49
+ * the query pipeline attaches it, and result shaping reads it to build
50
+ * `ContentRouteMeta`. Field names mirror `ContentResolvedMeta` so a consumer
51
+ * can read `resolved.locale`/`resolved.requestedRoute`/… off either a raw
52
+ * document or a fully shaped result.
53
+ */
54
+ export interface ContentDocumentResolution {
55
+ /** Resolved locale after locale fallback. */
56
+ locale?: string;
57
+ /** Requested locale before locale fallback. */
58
+ requestedLocale?: string;
59
+ /** Whether the returned content was resolved through fallback. */
60
+ fallback?: boolean;
61
+ /** Locales that have a concrete variant for this document. */
62
+ availableLocales?: string[];
63
+ /** Map of available locale code to its locale-specific path. */
64
+ variantPaths?: Record<string, string>;
65
+ /** Requested route path before locale fallback. */
66
+ requestedPath?: string;
67
+ /** Requested public route before locale fallback. */
68
+ requestedRoute?: string;
69
+ /** Requested authored reference before locale fallback. */
70
+ requestedRef?: string;
71
+ /** Resolved markdown `$ref` links for the current runtime locale. */
72
+ resolvedRefs?: Record<string, string>;
73
+ }
74
+ /**
75
+ * Internal metadata attached to every parsed content record.
76
+ */
77
+ export interface ParsedContentInternalMeta {
78
+ /**
79
+ * Stable, fully-qualified, locale-suffixed system id for the parsed record.
80
+ * System-computed and reserved: user frontmatter `id` does not override it —
81
+ * use `ref` for a stable authored alias.
82
+ */
83
+ id: string;
26
84
  /**
27
85
  * Canonical content path. This is source-agnostic, so the same route can be
28
86
  * backed by local files, remote storage, or generated data.
29
87
  */
30
- _path?: string;
88
+ path?: string;
31
89
  /**
32
90
  * Human-readable title resolved from frontmatter or generated metadata.
33
91
  */
@@ -47,75 +105,46 @@ export interface ParsedContentInternalMeta {
47
105
  /**
48
106
  * Marks the document as a draft.
49
107
  */
50
- _draft?: boolean;
108
+ draft?: boolean;
51
109
  /**
52
110
  * Marks the document as a partial that should not become a page by default.
53
111
  */
54
- _partial?: boolean;
112
+ partial?: boolean;
55
113
  /**
56
114
  * Locale code for the concrete variant.
57
115
  */
58
- _locale?: string;
59
- /**
60
- * Locale-agnostic content identity used to resolve variants.
61
- */
62
- _canonicalKey?: string;
63
- /**
64
- * Requested route path before locale fallback.
65
- */
66
- _requestedPath?: string;
67
- /**
68
- * Requested public route before locale fallback.
69
- */
70
- _requestedRoute?: string;
71
- /**
72
- * Requested authored reference before locale fallback.
73
- */
74
- _requestedRef?: string;
116
+ locale?: string;
75
117
  /**
76
- * Requested locale before locale fallback.
118
+ * Opaque, locale-agnostic content identity join key used to resolve variants.
119
+ * Never parse or render this as a URL — under translated slugs it is a numeric
120
+ * identity (e.g. `1/1`), not a path.
77
121
  */
78
- _requestedLocale?: string;
122
+ canonicalKey?: string;
79
123
  /**
80
- * Resolved locale after locale fallback.
124
+ * Per-request locale/reference resolution carrier (folded from the legacy
125
+ * underscore resolution meta). Absent until the query pipeline resolves a
126
+ * variant; shaping reads it to build the `resolved`/`localePaths`/`variants`
127
+ * route envelope.
81
128
  */
82
- _resolvedLocale?: string;
83
- /**
84
- * Whether the returned content was resolved through fallback.
85
- */
86
- _fallback?: boolean;
87
- /**
88
- * Locales that have a concrete variant for this document.
89
- */
90
- _availableLocales?: string[];
91
- /**
92
- * Map of available locale code to its locale-specific path.
93
- */
94
- _variantPaths?: Record<string, string>;
95
- /**
96
- * Resolved markdown `$ref` links for the current runtime locale.
97
- */
98
- _resolvedRefs?: Record<string, string>;
129
+ resolved?: ContentDocumentResolution;
99
130
  /**
100
131
  * Collection name, when matched by a configured collection glob.
101
132
  */
102
- _collection?: string;
133
+ collection?: string;
103
134
  /**
104
- * Marks folder-scoped navigation metadata documents.
135
+ * Internal marker: this parsed record is a folder-scoped `.navigation.yml`
136
+ * configuration document, not a routable page. Providers may expose it so
137
+ * generic filtering can consistently exclude navigation config records.
105
138
  */
106
- _navigation?: boolean;
139
+ navigationFile?: boolean;
107
140
  /**
108
141
  * Parsed document kind.
109
142
  */
110
- _type?: 'markdown' | 'yaml' | 'json' | 'csv';
143
+ type?: 'markdown' | 'yaml' | 'json' | 'csv';
111
144
  /**
112
- * Source file path relative to the content root.
145
+ * File-provenance metadata. Optional: absent for providers with no backing file.
113
146
  */
114
- _file?: string;
115
- /**
116
- * Source file extension.
117
- */
118
- _extension?: 'md' | 'yaml' | 'yml' | 'json' | 'json5' | 'csv';
147
+ file?: ContentFileMeta;
119
148
  }
120
149
  /**
121
150
  * One entry in a generated table of contents.
@@ -194,6 +223,19 @@ export interface ParsedContentMeta extends ParsedContentInternalMeta {
194
223
  layout?: LayoutKey;
195
224
  [key: string]: unknown;
196
225
  }
226
+ /**
227
+ * Sentinel returned by content loaders for a source id that produced no
228
+ * servable document — an ignored file, a missing source body, or an
229
+ * unsupported extension. It carries only the id and a `null` body; the
230
+ * `missing` flag is the discriminant separating it from a real
231
+ * {@link ParsedContent}. Use the shared `isRealDocument` guard
232
+ * (`core/content/document`) to filter these out.
233
+ */
234
+ export interface MissingDocument {
235
+ id: string;
236
+ body: null;
237
+ missing: true;
238
+ }
197
239
  /**
198
240
  * Strict parsed content shape with no open-ended index signature.
199
241
  */
@@ -233,11 +275,7 @@ export interface StrictParsedContent extends StrictParsedContentMeta {
233
275
  * Specialized parsed content shape for markdown sources.
234
276
  */
235
277
  export interface MarkdownParsedContent extends ParsedContent {
236
- _type: 'markdown';
237
- /**
238
- * Whether the markdown source rendered no meaningful body content.
239
- */
240
- _empty: boolean;
278
+ type: 'markdown';
241
279
  /**
242
280
  * Description resolved from frontmatter or excerpt generation.
243
281
  */
@@ -290,17 +328,13 @@ export interface NavItem {
290
328
  * Nuxt Content compatible route path used by Nuxt UI content components.
291
329
  */
292
330
  path: string;
293
- /**
294
- * Canonical content route without locale prefix.
295
- */
296
- _path: string;
297
331
  stem?: string;
298
332
  page?: false;
299
- _id?: string;
300
- _canonicalKey?: string;
301
- _locale?: string;
302
- _fallback?: boolean;
303
- _draft?: boolean;
333
+ id?: string;
334
+ canonicalKey?: string;
335
+ locale?: string;
336
+ fallback?: boolean;
337
+ draft?: boolean;
304
338
  children?: NavItem[];
305
339
  [key: string]: unknown;
306
340
  }
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CONTENT_REFERENCE_PREFIX } from "./reference.js";
3
- export const CONTENT_FIELD_METADATA_KEY = Symbol.for("lupinum.ginko-content.field-metadata");
3
+ export const CONTENT_FIELD_METADATA_KEY = /* @__PURE__ */ Symbol.for("lupinum.ginko-content.field-metadata");
4
4
  function readFieldMetadata(schema) {
5
5
  const value = schema?.[CONTENT_FIELD_METADATA_KEY];
6
6
  return value ? { ...value } : null;
@@ -218,7 +218,7 @@ export interface ContentSearchOptions {
218
218
  /**
219
219
  * Query predicate applied before records are indexed.
220
220
  *
221
- * @default { _draft: false, _partial: false }
221
+ * @default { draft: false, partial: false }
222
222
  */
223
223
  filterQuery?: ContentQueryBuilderWhere;
224
224
  /**
@@ -76,6 +76,15 @@ type LocaleOption<H, OptKey extends string = 'locale'> = HandleIsI18n<H> extends
76
76
  } : {
77
77
  [K in OptKey]?: string;
78
78
  };
79
+ /**
80
+ * Argument tuple for verbs whose options parameter is defaulted (`many`, `tree`).
81
+ *
82
+ * For i18n handles the options object is REQUIRED (its type already requires
83
+ * `locale` via `LocaleOption`) — a defaulted `options = {}` parameter would
84
+ * otherwise silently satisfy the locale obligation and reopen the i18n hole.
85
+ * For non-i18n handles the options object stays optional. (CS-7, T5.5.)
86
+ */
87
+ export type OptionsArg<H, O> = HandleIsI18n<H> extends true ? [options: O] : [options?: O];
79
88
  type SourceIsI18n<S> = S extends ReadonlyArray<infer I> ? true extends HandleIsI18n<I> ? true : false : HandleIsI18n<S>;
80
89
  type BacklinksLocaleOption<Target, Source> = HandleIsI18n<Target> extends true ? {
81
90
  locale: string;
@@ -88,7 +97,8 @@ export type LocaleFallback = false | true | 'default' | string | string[];
88
97
  export type LocalizedContentDocument<T = ParsedContentMeta> = T & ContentRouteMeta & {
89
98
  locale: string;
90
99
  path: string;
91
- canonicalPath: string;
100
+ /** the resolved variant's route path before locale prefixing */
101
+ unprefixedPath: string;
92
102
  localePaths: Record<string, LocalePathEntry>;
93
103
  stem?: string;
94
104
  extension?: string;
@@ -108,7 +118,8 @@ export interface ResolutionEnvelope {
108
118
  found: boolean;
109
119
  collection: string;
110
120
  path?: string;
111
- canonicalPath?: string;
121
+ /** the resolved variant's route path before locale prefixing */
122
+ unprefixedPath?: string;
112
123
  ref?: string;
113
124
  locale?: string;
114
125
  };
@@ -182,12 +193,10 @@ export type TreeOptions<H = unknown, Fields extends ReadonlyArray<keyof HandleSc
182
193
  sort?: SortSpec<HandleSchema<H>>;
183
194
  fields?: Fields;
184
195
  fallback?: LocaleFallback;
185
- locale?: string;
186
- };
196
+ } & LocaleOption<H>;
187
197
  export type ContentTreeItem<T = ParsedContentMeta, Fields extends ReadonlyArray<keyof T | string> | undefined = undefined> = {
188
198
  title: string;
189
199
  path: string;
190
- _path?: string;
191
200
  children?: Array<ContentTreeItem<T, Fields>>;
192
201
  } & (Fields extends ReadonlyArray<infer K> ? Pick<T, Extract<K, keyof T>> : Record<never, never>);
193
202
  export type { ContentNavigationItem };
@@ -40,7 +40,8 @@ export interface ContentLocaleEntry {
40
40
  export interface ContentLocaleRoute {
41
41
  locale: string;
42
42
  path: string;
43
- canonicalPath: string;
43
+ /** the resolved variant's route path before locale prefixing */
44
+ unprefixedPath: string;
44
45
  }
45
46
  export interface LocalePathEntry {
46
47
  path: string;
@@ -57,12 +58,15 @@ export interface ContentResolvedMeta {
57
58
  requestedRoute?: string;
58
59
  requestedRef?: string;
59
60
  availableLocales: string[];
61
+ /** Resolved markdown `$ref` links for the current runtime locale. */
62
+ resolvedRefs?: Record<string, string>;
60
63
  }
61
64
  export interface ContentRouteMeta {
62
65
  locale: string;
63
66
  defaultLocale: string;
64
67
  path: string;
65
- canonicalPath: string;
68
+ /** the resolved variant's route path before locale prefixing */
69
+ unprefixedPath: string;
66
70
  variants: ContentLocaleRoute[];
67
71
  localePaths: Record<string, LocalePathEntry>;
68
72
  resolved: ContentResolvedMeta;
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Internal query IR — NOT public, NOT the provider wire contract.
3
+ *
4
+ * `ContentQueryBuilderParams` / `ContentQueryBuilderWhere` and the fluent
5
+ * `ContentQueryBuilder` are the intermediate representation the unified query
6
+ * grammar (`src/types/query-parts/public.ts`, the public API) lowers through on
7
+ * its way to the `ContentQueryPlan` AST (`src/core/query/plan.ts`). They are a
8
+ * compiler IR: fine as internal plumbing, but not part of any boundary.
9
+ *
10
+ * - The public query vocabulary is the unified API (`one`/`many`/`paginate`/…
11
+ * with `QueryWhere`/`QueryOperators`).
12
+ * - The provider wire contract is `ContentProviderQuery`
13
+ * (`src/public/provider-query.ts`).
14
+ *
15
+ * Nothing in this file is exported from `#content/server` or `#content/client`.
16
+ * Do not re-add these to `meta/public-surface.json`. A future full fluent+IR
17
+ * cutover (retiring the string-operator API and this IR) is deferred post-0.2.0
18
+ * — see `future-decisions.md`.
19
+ */
1
20
  import type { ContentQueryResponse } from '../api';
2
21
  import type { ParsedContentInternalMeta, ParsedContentMeta } from '../content';
3
22
  export interface ContentQuerySortParams {
@@ -12,6 +12,12 @@ declare module '#content/virtual/providers' {
12
12
  export const loadExternalContentProvider: (name: string) => Promise<ContentProvider | undefined> | ContentProvider | undefined
13
13
  }
14
14
 
15
+ declare module '#content/virtual/transformers' {
16
+ import type { ContentTransformer } from './content'
17
+
18
+ export const transformers: ContentTransformer[]
19
+ }
20
+
15
21
  declare module '#content/virtual/cache-adapter' {
16
22
  import type { ContentCacheAdapter } from '../public/provider'
17
23
 
package/dist/types.d.mts CHANGED
@@ -6,6 +6,6 @@ declare module '@nuxt/schema' {
6
6
 
7
7
  export { type agentMetadataFields, type defineAgentAppPage, type defineAgentMarkdownPolicy, type defineAgentMetadataFields, type defineAgentSection, type defineCollection, type defineContentConfig, type reference } from '../dist/types/config'
8
8
 
9
- export { default, type normalizeContentConfigCollectionNames } from './module.mjs'
9
+ export { default } from './module.mjs'
10
10
 
11
- export { type AgentMetadataField, type AgentMetadataFieldList, type BacklinkFields, type BacklinkSource, type BacklinksOptions, type BacklinksResult, type CollectionQueryBuilder, type CollectionQueryField, type CollectionQueryFieldValue, type CollectionQueryKey, type CollectionQueryOperator, type CollectionQueryValue, type CollectionSchema, type ContentAgentAppPageConfig, type ContentAgentAppPageContext, type ContentAgentCollectionConfig, type ContentAgentConfig, type ContentAgentLocalizedValue, type ContentAgentMarkdownMetadataConfig, type ContentAgentMarkdownOptions, type ContentAgentMarkdownPolicyConfig, type ContentAgentRouteOptions, type ContentAgentSectionConfig, type ContentAgentSiteConfig, type ContentCacheArtifact, type ContentCmsCollectionConfig, type ContentCmsFieldConfig, type ContentCmsFieldType, type ContentCmsRelationConfig, type ContentCollectionConfig, type ContentCollectionHandle, type ContentCollectionI18nConfig, type ContentCollectionI18nMap, type ContentCollectionItem, type ContentCollectionItemSurroundingsOptions, type ContentCollectionKind, type ContentCollectionMap, type ContentCollectionName, type ContentCollectionNavigationOptions, type ContentCollectionPageOptions, type ContentCollectionRouteConfig, type ContentCollectionRouteMetaOptions, type ContentCollectionSearchSectionsOptions, type ContentCollectionSource, type ContentCollectionSourceObject, type ContentCollectionStringName, type ContentCollectionTarget, type ContentConfig, type ContentContext, type ContentI18nOptions, type ContentLinkRouteTarget, type ContentLinksOptions, type ContentLocaleEntry, type ContentLocaleRoute, type ContentManifest, type ContentMiniSearchOptions, type ContentNavigationItem, type ContentPageResult, type ContentPreviewOptions, type ContentProviderName, type ContentProviderSearchRequest, type ContentQueryBuilder, type ContentQueryBuilderParams, type ContentQueryBuilderWhere, type ContentQueryFetcher, type ContentQueryRequest, type ContentQuerySortFields, type ContentQuerySortOptions, type ContentQuerySortParams, type ContentReferenceSchema, type ContentResolvedMeta, type ContentRevalidateOptions, type ContentRouteMeta, type ContentSearchEngine, type ContentSearchIndexRecord, type ContentSearchOptions, type ContentSearchPublicRuntimeConfig, type ContentSearchResult, type ContentSearchSection, type ContentSelector, type ContentSeoImage, type ContentSeoMeta, type ContentSitemapAlternative, type ContentSitemapAssertOptions, type ContentSitemapAssertSitemapOptions, type ContentSitemapEntry, type ContentSitemapImage, type ContentSitemapOptions, type ContentTransformer, type ContentTreeItem, type ContentVariant, type DefineCollectionObject, type DefineCollectionOptions, type DocumentFromHandle, type LocaleFallback, type LocalePathEntry, type LocalizedContentDocument, type LocalizedDoc, type ManifestVariant, type ManyOptions, type MarkdownNode, type MarkdownOptions, type MarkdownParsedContent, type MarkdownPluginDescriptor, type MarkdownPluginOptions, type MarkdownRoot, type ModuleHooks, type ModuleOptions, type MountOptions, type NavItem, type NeighborsOptions, type NeighborsResult, type OneOptions, type PaginationOptions, type PaginationResult, type ParseContentOptions, type ParsedContent, type ParsedContentInternalMeta, type ParsedContentMeta, type PopulateFromOptions, type PopulateSpec, type PopulatedDocument, type QueryGroupBuilder, type QueryGroupFunction, type QueryMatchOperator, type QueryOperators, type QueryOrderDirection, type QueryOrderOptions, type QueryWhere, type ResolutionEnvelope, type ResolveContentReferenceOptions, type ResolveOneOptions, type ResolveOneResult, type ResolvedContentContext, type ResolvedContentI18nOptions, type ResolvedMarkdownPlugin, type ResolvedVariant, type SortDirection, type SortSpec, type StrictParsedContent, type StrictParsedContentMeta, type Toc, type TocLink, type TransformContentOptions, type TransformContentSource, type TreeOptions, type VariantsOptions } from './module.mjs'
11
+ export { type ContentCollectionHandle, type ContentCollectionI18nMap, type ContentCollectionMap, type ContentNavigationItem, type ModuleHooks, type ModuleOptions, type NavItem, type ParsedContent, type StrictParsedContent, type Toc, type TocLink } from './module.mjs'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "@lupinum/ginko-content",
4
- "version": "0.1.5",
4
+ "version": "0.2.0",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lupinum/ginko-content",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "Collection-first content engine for Nuxt",
5
5
  "homepage": "https://ginko-content.nuxt.dev",
6
6
  "bugs": {
@@ -21,6 +21,9 @@
21
21
  },
22
22
  "license": "MIT",
23
23
  "type": "module",
24
+ "main": "./dist/module.mjs",
25
+ "module": "./dist/module.mjs",
26
+ "types": "./dist/module.d.mts",
24
27
  "bin": {
25
28
  "ginko-content": "./dist/cli.mjs"
26
29
  },
@@ -40,15 +43,20 @@
40
43
  "import": "./dist/public/server.js",
41
44
  "default": "./dist/public/server.js"
42
45
  },
46
+ "./provider": {
47
+ "types": "./dist/public/provider.d.ts",
48
+ "import": "./dist/public/provider.js",
49
+ "default": "./dist/public/provider.js"
50
+ },
43
51
  "./client": {
44
52
  "types": "./dist/public/client.d.ts",
45
53
  "import": "./dist/public/client.js",
46
54
  "default": "./dist/public/client.js"
47
55
  },
48
- "./toc": {
49
- "types": "./dist/runtime/app/composables/toc.d.ts",
50
- "import": "./dist/runtime/app/composables/toc.js",
51
- "default": "./dist/runtime/app/composables/toc.js"
56
+ "./agent": {
57
+ "types": "./dist/public/agent.d.ts",
58
+ "import": "./dist/public/agent.js",
59
+ "default": "./dist/public/agent.js"
52
60
  },
53
61
  "./cms-contract": {
54
62
  "types": "./dist/cms-contract/index.d.ts",
@@ -75,7 +83,26 @@
75
83
  "import": "./dist/runtime/transformers/define.js",
76
84
  "default": "./dist/runtime/transformers/define.js"
77
85
  },
78
- "./transformers/*": "./dist/runtime/transformers/*.js"
86
+ "./transformers/markdown": {
87
+ "types": "./dist/runtime/transformers/markdown.d.ts",
88
+ "import": "./dist/runtime/transformers/markdown.js",
89
+ "default": "./dist/runtime/transformers/markdown.js"
90
+ },
91
+ "./transformers/yaml": {
92
+ "types": "./dist/runtime/transformers/yaml.d.ts",
93
+ "import": "./dist/runtime/transformers/yaml.js",
94
+ "default": "./dist/runtime/transformers/yaml.js"
95
+ },
96
+ "./transformers/json": {
97
+ "types": "./dist/runtime/transformers/json.d.ts",
98
+ "import": "./dist/runtime/transformers/json.js",
99
+ "default": "./dist/runtime/transformers/json.js"
100
+ },
101
+ "./transformers/csv": {
102
+ "types": "./dist/runtime/transformers/csv/index.d.ts",
103
+ "import": "./dist/runtime/transformers/csv/index.js",
104
+ "default": "./dist/runtime/transformers/csv/index.js"
105
+ }
79
106
  },
80
107
  "web-types": "./dist/web-types.json",
81
108
  "files": [
@@ -95,13 +122,12 @@
95
122
  "globby": "^16.2.0",
96
123
  "h3": "1.15.11",
97
124
  "jiti": "^2.7.0",
98
- "js-yaml": "^4.1.1",
125
+ "js-yaml": "^4.2.0",
99
126
  "json5": "^2.2.3",
100
127
  "knitwork": "^1.3.0",
101
128
  "minisearch": "^7.2.0",
102
129
  "nitropack": "^2.13.4",
103
130
  "ohash": "^2.0.11",
104
- "pagefind": "^1.5.2",
105
131
  "pathe": "^2.0.3",
106
132
  "picomatch": "^4.0.4",
107
133
  "scule": "^1.3.0",
@@ -109,7 +135,7 @@
109
135
  "slugify": "^1.6.9",
110
136
  "ufo": "^1.6.4",
111
137
  "unstorage": "^1.17.5",
112
- "ws": "^8.20.1",
138
+ "ws": "^8.21.0",
113
139
  "zod": "4.4.3"
114
140
  },
115
141
  "devDependencies": {
@@ -120,10 +146,14 @@
120
146
  },
121
147
  "peerDependencies": {
122
148
  "nuxt": ">=4.4.7",
149
+ "pagefind": "^1.5.2",
123
150
  "vitest": ">=4.1.6",
124
151
  "vue": "^3.5.0"
125
152
  },
126
153
  "peerDependenciesMeta": {
154
+ "pagefind": {
155
+ "optional": true
156
+ },
127
157
  "vitest": {
128
158
  "optional": true
129
159
  }
@@ -1 +0,0 @@
1
- export * from './markdown-components.js'
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,19 +0,0 @@
1
- import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
2
- export default defineNuxtPlugin(async (nuxtApp) => {
3
- const plugins = useRuntimeConfig().public.content?.markdown?.plugins || [];
4
- const names = new Set(plugins.map((plugin) => plugin.name));
5
- if (names.has("math")) {
6
- const { Math } = await import(
7
- /* @vite-ignore */
8
- ["@comark/vue", "plugins/math"].join("/")
9
- );
10
- nuxtApp.vueApp.component("Math", Math);
11
- }
12
- if (names.has("mermaid")) {
13
- const { Mermaid } = await import(
14
- /* @vite-ignore */
15
- ["@comark/vue", "plugins/mermaid"].join("/")
16
- );
17
- nuxtApp.vueApp.component("Mermaid", Mermaid);
18
- }
19
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes