@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.
- package/compatibility.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cms-contract/build.js +15 -20
- package/dist/cms-contract/types.d.ts +12 -7
- package/dist/core/content/document +1 -0
- package/dist/core/content/document.d.ts +16 -0
- package/dist/core/content/document.js +2 -0
- package/dist/core/content/graph.d.ts +3 -1
- package/dist/core/content/graph.js +21 -20
- package/dist/core/content/locale.d.ts +6 -1
- package/dist/core/content/locale.js +17 -6
- package/dist/core/content/path.d.ts +5 -5
- package/dist/core/content/path.js +8 -8
- package/dist/core/content/snapshot +1 -0
- package/dist/core/content/snapshot.d.ts +25 -0
- package/dist/core/content/snapshot.js +99 -0
- package/dist/core/provider-errors.d.ts +1 -1
- package/dist/core/provider-errors.js +1 -0
- package/dist/core/query/builder.js +3 -3
- package/dist/core/query/execute.js +75 -36
- package/dist/core/query/filter.js +2 -2
- package/dist/core/query/lower.js +79 -3
- package/dist/core/query/params.js +7 -7
- package/dist/core/query/plan.d.ts +18 -0
- package/dist/core/query/plan.js +7 -0
- package/dist/core/references/resolve.js +6 -9
- package/dist/features/agent/agent-markdown +1 -0
- package/dist/features/agent/agent-markdown.d.ts +116 -0
- package/dist/features/agent/agent-markdown.js +138 -0
- package/dist/features/agent/walker +1 -0
- package/dist/features/agent/walker.d.ts +10 -0
- package/dist/features/agent/walker.js +174 -0
- package/dist/features/collections/resolve.d.ts +2 -2
- package/dist/features/collections/resolve.js +19 -16
- package/dist/features/localization/links.js +1 -1
- package/dist/features/localization/results.d.ts +3 -3
- package/dist/features/localization/results.js +46 -41
- package/dist/features/localization/translated-slugs.js +5 -5
- package/dist/features/navigation/build.d.ts +2 -2
- package/dist/features/navigation/build.js +23 -26
- package/dist/features/navigation/canonical.d.ts +10 -11
- package/dist/features/navigation/canonical.js +26 -21
- package/dist/features/navigation/resolve.js +4 -4
- package/dist/features/navigation/tree.js +3 -3
- package/dist/{runtime → features}/query/backlinks.js +3 -5
- package/dist/{runtime → features}/query/documents.js +1 -1
- package/dist/{runtime → features}/query/localized-docs.d.ts +1 -1
- package/dist/{runtime → features}/query/localized-docs.js +3 -6
- package/dist/{runtime → features}/query/navigation.d.ts +1 -1
- package/dist/{runtime → features}/query/navigation.js +8 -8
- package/dist/{runtime → features}/query/populate.js +6 -14
- package/dist/{runtime → features}/query/unified.d.ts +4 -4
- package/dist/{runtime → features}/query/unified.js +4 -2
- package/dist/{runtime → features}/query/variants.js +4 -4
- package/dist/features/search/navigation.js +2 -2
- package/dist/features/search/sections.d.ts +1 -1
- package/dist/features/search/sections.js +1 -1
- package/dist/features/sitemap/query.d.ts +5 -5
- package/dist/features/sitemap/query.js +6 -6
- package/dist/integrations/nitro/ingest.js +9 -20
- package/dist/integrations/nitro/storage.d.ts +1 -0
- package/dist/integrations/nitro/storage.js +21 -34
- package/dist/module.d.mts +135 -803
- package/dist/module.json +1 -1
- package/dist/module.mjs +143 -51
- package/dist/parsers/csv.js +3 -3
- package/dist/parsers/index.js +3 -3
- package/dist/parsers/json.js +8 -6
- package/dist/parsers/markdown-plugins.js +9 -5
- package/dist/parsers/markdown.js +7 -6
- package/dist/parsers/path-meta.js +21 -19
- package/dist/parsers/reserved +1 -0
- package/dist/parsers/reserved.d.ts +15 -0
- package/dist/parsers/reserved.js +35 -0
- package/dist/parsers/yaml.js +6 -4
- package/dist/public/agent +1 -0
- package/dist/public/agent.d.ts +17 -0
- package/dist/public/agent.js +34 -0
- package/dist/public/client.d.ts +2 -3
- package/dist/public/client.js +1 -2
- package/dist/public/provider-query +1 -0
- package/dist/public/provider-query.d.ts +58 -0
- package/dist/public/provider-query.js +5 -0
- package/dist/public/provider.d.ts +8 -3
- package/dist/public/provider.js +2 -0
- package/dist/public/server.d.ts +7 -12
- package/dist/public/server.js +5 -36
- package/dist/runtime/app/components/ContentRenderer.d.vue.ts +3 -3
- package/dist/runtime/app/components/ContentRenderer.vue +2 -2
- package/dist/runtime/app/components/ContentRenderer.vue.d.ts +3 -3
- package/dist/runtime/app/components/ContentRendererInline.d.vue.ts +1 -1
- package/dist/runtime/app/components/ContentRendererInline.vue.d.ts +1 -1
- package/dist/runtime/app/components/Prose/ProseImg.d.vue.ts +4 -4
- package/dist/runtime/app/components/Prose/ProseImg.vue.d.ts +4 -4
- package/dist/runtime/app/components/Prose/ProsePre.d.vue.ts +1 -1
- package/dist/runtime/app/components/Prose/ProsePre.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.d.vue.ts +1 -1
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue +4 -4
- package/dist/runtime/app/components/internal/ContentRendererMarkdown.vue.d.ts +1 -1
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +3 -3
- package/dist/runtime/app/composables/preview.d.ts +1 -1
- package/dist/runtime/app/composables/query-api.d.ts +5 -5
- package/dist/runtime/app/composables/query-api.js +5 -3
- package/dist/runtime/app/composables/route.d.ts +1 -1
- package/dist/runtime/app/composables/route.js +4 -4
- package/dist/runtime/app/composables/search.js +1 -1
- package/dist/runtime/app/composables/use-content-document.js +1 -1
- package/dist/runtime/app/composables/use-content-list.js +1 -1
- package/dist/runtime/app/composables/use-content-navigation.js +2 -2
- package/dist/runtime/app/composables/use-content-page.js +4 -4
- package/dist/runtime/app/pages/content.vue +2 -1
- package/dist/runtime/markdown/plugins.js +6 -8
- package/dist/runtime/server/agent-markdown.d.ts +5 -65
- package/dist/runtime/server/agent-markdown.js +40 -315
- package/dist/runtime/server/agent-site.js +9 -2
- package/dist/runtime/server/api/agent-raw.js +1 -1
- package/dist/runtime/server/api/cache.d.ts +1 -1
- package/dist/runtime/server/api/cache.js +43 -4
- package/dist/runtime/server/api/locales.js +3 -3
- package/dist/runtime/server/api/navigation.d.ts +1 -1
- package/dist/runtime/server/api/navigation.js +3 -1
- package/dist/runtime/server/api/query.js +2 -2
- package/dist/runtime/server/api/search-index.d.ts +1 -1
- package/dist/runtime/server/api/sitemap.d.ts +1 -1
- package/dist/runtime/server/cache-adapters.d.ts +18 -0
- package/dist/runtime/server/cache-adapters.js +12 -0
- package/dist/runtime/server/collection-helpers.d.ts +2 -2
- package/dist/runtime/server/collection-helpers.js +15 -11
- package/dist/runtime/server/index.d.ts +6 -4
- package/dist/runtime/server/index.js +10 -3
- package/dist/runtime/server/middleware/agent-link-headers.js +1 -1
- package/dist/runtime/server/middleware/agent-markdown.js +1 -1
- package/dist/runtime/server/navigation-query.d.ts +2 -2
- package/dist/runtime/server/navigation-query.js +52 -7
- package/dist/runtime/server/navigation.d.ts +1 -1
- package/dist/runtime/server/provider-document +1 -0
- package/dist/runtime/server/provider-document.d.ts +59 -0
- package/dist/runtime/server/provider-document.js +48 -0
- package/dist/runtime/server/provider-query-wire +1 -0
- package/dist/runtime/server/provider-query-wire.d.ts +32 -0
- package/dist/runtime/server/provider-query-wire.js +27 -0
- package/dist/runtime/server/provider-query.d.ts +18 -9
- package/dist/runtime/server/provider-query.js +62 -28
- package/dist/runtime/server/provider-result.d.ts +4 -4
- package/dist/runtime/server/providers/filesystem.js +3 -11
- package/dist/runtime/server/providers/index.d.ts +18 -1
- package/dist/runtime/server/providers/index.js +72 -20
- package/dist/runtime/server/query-api.d.ts +5 -5
- package/dist/runtime/server/query-api.js +9 -6
- package/dist/runtime/server/query-executor.d.ts +3 -3
- package/dist/runtime/server/query-executor.js +43 -59
- package/dist/runtime/server/search.d.ts +1 -1
- package/dist/runtime/server/search.js +4 -4
- package/dist/runtime/server/sitemap.js +5 -5
- package/dist/runtime/server/storage-access.d.ts +4 -1
- package/dist/runtime/server/storage-access.js +27 -2
- package/dist/runtime/transformers/component-resolver.d.ts +1 -1
- package/dist/storage/content.d.ts +2 -6
- package/dist/storage/content.js +19 -8
- package/dist/storage/contents.d.ts +9 -1
- package/dist/storage/contents.js +26 -19
- package/dist/storage/driver.d.ts +2 -2
- package/dist/storage/driver.js +2 -1
- package/dist/storage/graph.js +4 -0
- package/dist/storage/manifest.js +3 -1
- package/dist/storage/references.js +9 -5
- package/dist/storage/snapshot-runtime +1 -0
- package/dist/storage/snapshot-runtime.d.ts +11 -0
- package/dist/storage/snapshot-runtime.js +46 -0
- package/dist/storage/validation.d.ts +1 -1
- package/dist/storage/validation.js +79 -105
- package/dist/testing/provider-contract.d.ts +14 -4
- package/dist/testing/provider-contract.js +121 -68
- package/dist/testing/provider-fixture.d.ts +1 -1
- package/dist/testing/provider-fixture.js +124 -120
- package/dist/types/config.d.ts +17 -4
- package/dist/types/content.d.ts +104 -70
- package/dist/types/fields.js +1 -1
- package/dist/types/module.d.ts +1 -1
- package/dist/types/query-parts/public.d.ts +14 -5
- package/dist/types/query-parts/results.d.ts +6 -2
- package/dist/types/query-parts/transport.d.ts +19 -0
- package/dist/types/virtual.d.ts +6 -0
- package/dist/types.d.mts +2 -2
- package/dist/web-types.json +1 -1
- package/package.json +39 -9
- package/dist/runtime/app/plugins/markdown-components +0 -1
- package/dist/runtime/app/plugins/markdown-components.d.ts +0 -2
- package/dist/runtime/app/plugins/markdown-components.js +0 -19
- /package/dist/{runtime → features/agent}/agent-paths +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.d.ts +0 -0
- /package/dist/{runtime → features/agent}/agent-paths.js +0 -0
- /package/dist/{runtime → features}/query/backlinks +0 -0
- /package/dist/{runtime → features}/query/backlinks.d.ts +0 -0
- /package/dist/{runtime → features}/query/context +0 -0
- /package/dist/{runtime → features}/query/context.d.ts +0 -0
- /package/dist/{runtime → features}/query/context.js +0 -0
- /package/dist/{runtime → features}/query/documents +0 -0
- /package/dist/{runtime → features}/query/documents.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors +0 -0
- /package/dist/{runtime → features}/query/errors.d.ts +0 -0
- /package/dist/{runtime → features}/query/errors.js +0 -0
- /package/dist/{runtime → features}/query/handles +0 -0
- /package/dist/{runtime → features}/query/handles.d.ts +0 -0
- /package/dist/{runtime → features}/query/handles.js +0 -0
- /package/dist/{runtime → features}/query/locale-options +0 -0
- /package/dist/{runtime → features}/query/locale-options.d.ts +0 -0
- /package/dist/{runtime → features}/query/locale-options.js +0 -0
- /package/dist/{runtime → features}/query/localized-docs +0 -0
- /package/dist/{runtime → features}/query/navigation +0 -0
- /package/dist/{runtime → features}/query/pagination +0 -0
- /package/dist/{runtime → features}/query/pagination.d.ts +0 -0
- /package/dist/{runtime → features}/query/pagination.js +0 -0
- /package/dist/{runtime → features}/query/populate +0 -0
- /package/dist/{runtime → features}/query/populate.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits +0 -0
- /package/dist/{runtime → features}/query/public-limits.d.ts +0 -0
- /package/dist/{runtime → features}/query/public-limits.js +0 -0
- /package/dist/{runtime → features}/query/resolve +0 -0
- /package/dist/{runtime → features}/query/resolve.d.ts +0 -0
- /package/dist/{runtime → features}/query/resolve.js +0 -0
- /package/dist/{runtime → features}/query/responses +0 -0
- /package/dist/{runtime → features}/query/responses.d.ts +0 -0
- /package/dist/{runtime → features}/query/responses.js +0 -0
- /package/dist/{runtime → features}/query/routes +0 -0
- /package/dist/{runtime → features}/query/routes.d.ts +0 -0
- /package/dist/{runtime → features}/query/routes.js +0 -0
- /package/dist/{runtime → features}/query/unified +0 -0
- /package/dist/{runtime → features}/query/variants +0 -0
- /package/dist/{runtime → features}/query/variants.d.ts +0 -0
package/dist/types/content.d.ts
CHANGED
|
@@ -12,22 +12,80 @@ export interface ContentSeoMeta {
|
|
|
12
12
|
image?: string | ContentSeoImage;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
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
|
|
18
|
+
export interface ContentFileMeta {
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Backing source name when multiple content sources are configured.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
source?: string;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
+
draft?: boolean;
|
|
51
109
|
/**
|
|
52
110
|
* Marks the document as a partial that should not become a page by default.
|
|
53
111
|
*/
|
|
54
|
-
|
|
112
|
+
partial?: boolean;
|
|
55
113
|
/**
|
|
56
114
|
* Locale code for the concrete variant.
|
|
57
115
|
*/
|
|
58
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
122
|
+
canonicalKey?: string;
|
|
79
123
|
/**
|
|
80
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
133
|
+
collection?: string;
|
|
103
134
|
/**
|
|
104
|
-
*
|
|
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
|
-
|
|
139
|
+
navigationFile?: boolean;
|
|
107
140
|
/**
|
|
108
141
|
* Parsed document kind.
|
|
109
142
|
*/
|
|
110
|
-
|
|
143
|
+
type?: 'markdown' | 'yaml' | 'json' | 'csv';
|
|
111
144
|
/**
|
|
112
|
-
*
|
|
145
|
+
* File-provenance metadata. Optional: absent for providers with no backing file.
|
|
113
146
|
*/
|
|
114
|
-
|
|
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
|
-
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
}
|
package/dist/types/fields.js
CHANGED
|
@@ -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;
|
package/dist/types/module.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ export interface ContentSearchOptions {
|
|
|
218
218
|
/**
|
|
219
219
|
* Query predicate applied before records are indexed.
|
|
220
220
|
*
|
|
221
|
-
* @default {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
package/dist/types/virtual.d.ts
CHANGED
|
@@ -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
|
|
9
|
+
export { default } from './module.mjs'
|
|
10
10
|
|
|
11
|
-
export { type
|
|
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'
|
package/dist/web-types.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lupinum/ginko-content",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"./
|
|
49
|
-
"types": "./dist/
|
|
50
|
-
"import": "./dist/
|
|
51
|
-
"default": "./dist/
|
|
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
|
|
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.
|
|
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.
|
|
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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|