@lupinum/ginko-content 0.1.6 → 0.2.1
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 +22 -8
- package/dist/module.d.mts +135 -812
- package/dist/module.json +1 -1
- package/dist/module.mjs +75 -28
- 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 +10 -3
- package/dist/public/provider.js +3 -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 +1 -1
- 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 +47 -102
- package/dist/testing/provider-contract.d.ts +31 -4
- package/dist/testing/provider-contract.js +241 -81
- package/dist/testing/provider-fixture.d.ts +1 -1
- package/dist/testing/provider-fixture.js +124 -120
- package/dist/types/config.d.ts +8 -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/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -22,15 +22,16 @@ import { transformContent } from '../dist/parsers/index';
|
|
|
22
22
|
import { resolveCollectionI18n, prefixPathWithLocale } from '../dist/features/localization/path';
|
|
23
23
|
import { resolveContentSitemapSource, GINKO_SITEMAP_SOURCE_NAME } from '../dist/runtime/utils/sitemap-source';
|
|
24
24
|
import { normalizeRouteMounts, normalizeContentPath } from '../dist/core/content/path';
|
|
25
|
-
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
25
|
+
import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
26
26
|
import { pathToFileURL } from 'node:url';
|
|
27
|
+
import { isContentSnapshot } from '../dist/core/content/snapshot';
|
|
27
28
|
import { withTrailingSlash } from 'ufo';
|
|
28
29
|
import { normalizeContentConfigCollectionNames } from '../dist/types/config';
|
|
29
30
|
export { agentMetadataFields, defineAgentAppPage, defineAgentMarkdownPolicy, defineAgentMetadataFields, defineAgentSection, defineCollection, defineContentConfig, reference } from '../dist/types/config';
|
|
30
31
|
import { collectTopLevelReferenceFieldsByTarget } from '../dist/core/references/schema';
|
|
31
32
|
|
|
32
33
|
const name = "@lupinum/ginko-content";
|
|
33
|
-
const version = "0.1
|
|
34
|
+
const version = "0.2.1";
|
|
34
35
|
|
|
35
36
|
const CONFIG_FILES = [
|
|
36
37
|
"content.config.ts",
|
|
@@ -52,13 +53,13 @@ async function loadContentConfig(nuxt) {
|
|
|
52
53
|
return loaded?.default || loaded || {};
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
const createVirtualContentTemplates = (contentContext, nuxt,
|
|
56
|
+
const createVirtualContentTemplates = (contentContext, nuxt, contentConfigPath, addTemplateImpl) => {
|
|
56
57
|
const transformersTemplate = addTemplateImpl({
|
|
57
58
|
filename: "content/virtual-transformers.mjs",
|
|
58
59
|
write: true,
|
|
59
60
|
getContents: () => {
|
|
60
61
|
const transformers = contentContext.transformers.map((transformer) => {
|
|
61
|
-
const name = genSafeVariableName(relative(nuxt.options.rootDir, transformer)).replace(/_(45|46|47)/g, "_") + "_" + hash(transformer);
|
|
62
|
+
const name = genSafeVariableName(relative(nuxt.options.rootDir, transformer)).replace(/_(45|46|47)/g, "_") + "_" + hash(transformer).replace(/[^a-z0-9_$]/gi, "_");
|
|
62
63
|
return { name, import: genImport(transformer, name) };
|
|
63
64
|
});
|
|
64
65
|
return [
|
|
@@ -73,7 +74,15 @@ const createVirtualContentTemplates = (contentContext, nuxt, _contentConfigPath,
|
|
|
73
74
|
const virtualConfigTemplate = addTemplateImpl({
|
|
74
75
|
filename: "content/virtual-config.mjs",
|
|
75
76
|
write: true,
|
|
76
|
-
getContents: () =>
|
|
77
|
+
getContents: () => {
|
|
78
|
+
if (!contentConfigPath) {
|
|
79
|
+
return "export default {}";
|
|
80
|
+
}
|
|
81
|
+
return [
|
|
82
|
+
`import config from ${JSON.stringify(contentConfigPath)}`,
|
|
83
|
+
"export default config"
|
|
84
|
+
].join("\n");
|
|
85
|
+
}
|
|
77
86
|
}).dst;
|
|
78
87
|
const virtualProvidersTemplate = addTemplateImpl({
|
|
79
88
|
filename: "content/virtual-providers.mjs",
|
|
@@ -257,11 +266,17 @@ const generatedContentServerValueNames = [
|
|
|
257
266
|
"contentCacheHeaders",
|
|
258
267
|
"noopContentCache",
|
|
259
268
|
"vercelContentCache",
|
|
269
|
+
"headersContentCache",
|
|
260
270
|
"clearContentCacheHint",
|
|
261
271
|
"collectContentCacheHint",
|
|
262
272
|
"getContentCacheHint",
|
|
263
273
|
"withContentCache",
|
|
264
|
-
"
|
|
274
|
+
"PROVIDER_QUERY_VERSION",
|
|
275
|
+
"toContentProviderQuery",
|
|
276
|
+
"toContentProviderNavigationQuery",
|
|
277
|
+
"createContentProviderError",
|
|
278
|
+
"normalizeProviderDocument",
|
|
279
|
+
"shapeProviderDocument"
|
|
265
280
|
];
|
|
266
281
|
const generatedContentServerTypeSpecs = [
|
|
267
282
|
{ local: "ContentCacheAdapter", exported: "ContentCacheAdapter" },
|
|
@@ -270,9 +285,13 @@ const generatedContentServerTypeSpecs = [
|
|
|
270
285
|
{ local: "ContentCacheInvalidateInput", exported: "ContentCacheInvalidateInput" },
|
|
271
286
|
{ local: "ContentProvider", exported: "ContentProvider" },
|
|
272
287
|
{ local: "ContentProviderCapabilities", exported: "ContentProviderCapabilities" },
|
|
288
|
+
{ local: "ContentProviderQuery", exported: "ContentProviderQuery" },
|
|
289
|
+
{ local: "ContentProviderNavigationOptions", exported: "ContentProviderNavigationOptions" },
|
|
273
290
|
{ local: "ContentProviderResult<T>", exported: "ContentProviderResult<T>" },
|
|
274
291
|
{ local: "MaybeContentProviderResult<T>", exported: "MaybeContentProviderResult<T>" },
|
|
275
292
|
{ local: "ContentProviderErrorCode", exported: "ContentProviderErrorCode" },
|
|
293
|
+
{ local: "ProviderDocumentInput", exported: "ProviderDocumentInput" },
|
|
294
|
+
{ local: "ShapeProviderDocumentOptions", exported: "ShapeProviderDocumentOptions" },
|
|
276
295
|
{ local: "VercelContentCacheOptions", exported: "VercelContentCacheOptions" }
|
|
277
296
|
];
|
|
278
297
|
const registerRuntimeImports = (resolveRuntimeModule) => {
|
|
@@ -390,11 +409,12 @@ const registerGeneratedTypes = (contentConfigPath, resolveRuntimeModuleRoot, col
|
|
|
390
409
|
const key = JSON.stringify(name);
|
|
391
410
|
return ` ${key}: StrictParsedContent & __GeneratedCollectionSchema<__ContentCollectionExport<${key}>>`;
|
|
392
411
|
});
|
|
412
|
+
const serverModuleLiteral = JSON.stringify(resolveRuntimeModuleRoot("./server"));
|
|
393
413
|
const contentServerValueDeclarations = generatedContentServerValueNames.map(
|
|
394
|
-
(name) => ` const ${name}: typeof import(
|
|
414
|
+
(name) => ` const ${name}: typeof import(${serverModuleLiteral}).${name}`
|
|
395
415
|
);
|
|
396
416
|
const contentServerTypeDeclarations = generatedContentServerTypeSpecs.map(
|
|
397
|
-
(spec) => ` type ${spec.local} = import(
|
|
417
|
+
(spec) => ` type ${spec.local} = import(${serverModuleLiteral}).${spec.exported}`
|
|
398
418
|
);
|
|
399
419
|
return addTypeTemplate({
|
|
400
420
|
filename: "types/content.d.ts",
|
|
@@ -632,7 +652,7 @@ const registerContentComponentsTemplate = (addTemplateImpl) => {
|
|
|
632
652
|
const pathLiteral = JSON.stringify(path);
|
|
633
653
|
const exportLiteral = JSON.stringify(exp);
|
|
634
654
|
const nameLiteral = JSON.stringify(pascalName);
|
|
635
|
-
return ` ${
|
|
655
|
+
return ` ${nameLiteral}: () => import(${pathLiteral}).then(mod => pickExport(mod, ${exportLiteral}, ${nameLiteral}, ${pathLiteral})),`;
|
|
636
656
|
}),
|
|
637
657
|
"}",
|
|
638
658
|
`export const globalComponents = ${JSON.stringify(globalComponents)}`,
|
|
@@ -888,7 +908,7 @@ const parseDerivedCollectionFiles = async (rootDir, collections, collectionNames
|
|
|
888
908
|
collectionResolver: (filePath) => resolveCollection(filePath, collections, contentContext.locales || [])
|
|
889
909
|
}
|
|
890
910
|
});
|
|
891
|
-
const collection = typeof parsed.
|
|
911
|
+
const collection = typeof parsed.collection === "string" ? collections[parsed.collection] : void 0;
|
|
892
912
|
documents.push(...expandDataLocaleVariants(parsed, collection?.i18n === true ? void 0 : collection?.i18n));
|
|
893
913
|
}
|
|
894
914
|
return documents;
|
|
@@ -921,17 +941,17 @@ const collectDerivedPrerenderRoutes = async (rootDir, contentContext) => {
|
|
|
921
941
|
const seenCanonicalKeys = /* @__PURE__ */ new Set();
|
|
922
942
|
for (const contentId of graph.byCollection[collection] || []) {
|
|
923
943
|
const document = graph.byId[contentId];
|
|
924
|
-
if (!document || !document.
|
|
944
|
+
if (!document || !document.canonicalKey || document.partial || document.navigationFile) {
|
|
925
945
|
continue;
|
|
926
946
|
}
|
|
927
|
-
if (document.
|
|
947
|
+
if (document.draft && !includeDrafts) {
|
|
928
948
|
continue;
|
|
929
949
|
}
|
|
930
|
-
if (seenCanonicalKeys.has(document.
|
|
950
|
+
if (seenCanonicalKeys.has(document.canonicalKey)) {
|
|
931
951
|
continue;
|
|
932
952
|
}
|
|
933
|
-
seenCanonicalKeys.add(document.
|
|
934
|
-
const variants = graph.byCanonical[document.
|
|
953
|
+
seenCanonicalKeys.add(document.canonicalKey);
|
|
954
|
+
const variants = graph.byCanonical[document.canonicalKey] || {};
|
|
935
955
|
for (const [locale, variant] of Object.entries(variants)) {
|
|
936
956
|
if (!variant.path) {
|
|
937
957
|
continue;
|
|
@@ -954,20 +974,20 @@ const collectSitemapCollectionRouteCounts = async (rootDir, contentContext) => {
|
|
|
954
974
|
const seenCanonicalKeys = /* @__PURE__ */ new Set();
|
|
955
975
|
for (const contentId of graph.byCollection[collection] || []) {
|
|
956
976
|
const document = graph.byId[contentId];
|
|
957
|
-
if (!document || !document.
|
|
977
|
+
if (!document || !document.canonicalKey || document.partial || document.navigationFile) {
|
|
958
978
|
continue;
|
|
959
979
|
}
|
|
960
|
-
if (document.
|
|
980
|
+
if (document.draft && !includeDrafts) {
|
|
961
981
|
continue;
|
|
962
982
|
}
|
|
963
|
-
if (seenCanonicalKeys.has(document.
|
|
983
|
+
if (seenCanonicalKeys.has(document.canonicalKey)) {
|
|
964
984
|
continue;
|
|
965
985
|
}
|
|
966
|
-
const variants = Object.values(graph.byCanonical[document.
|
|
986
|
+
const variants = Object.values(graph.byCanonical[document.canonicalKey] || {});
|
|
967
987
|
if (!variants.some((variant) => variant.path)) {
|
|
968
988
|
continue;
|
|
969
989
|
}
|
|
970
|
-
seenCanonicalKeys.add(document.
|
|
990
|
+
seenCanonicalKeys.add(document.canonicalKey);
|
|
971
991
|
counts[collection] += 1;
|
|
972
992
|
}
|
|
973
993
|
}
|
|
@@ -1132,13 +1152,23 @@ function normalizeSearchOptions(options) {
|
|
|
1132
1152
|
return {
|
|
1133
1153
|
engine: options.search?.engine || "minisearch",
|
|
1134
1154
|
ignoredTags: options.search?.ignoredTags || ["script", "style", "pre"],
|
|
1135
|
-
filterQuery: options.search?.filterQuery || {
|
|
1155
|
+
filterQuery: options.search?.filterQuery || { draft: false, partial: false },
|
|
1136
1156
|
collections: options.search?.collections,
|
|
1137
1157
|
extraFields: options.search?.extraFields || [],
|
|
1138
1158
|
apiBaseURL: options.search?.apiBaseURL,
|
|
1139
1159
|
minisearch: normalizeMiniSearchOptions(options.search?.minisearch)
|
|
1140
1160
|
};
|
|
1141
1161
|
}
|
|
1162
|
+
async function assertPagefindAvailable(search, importPagefind = () => import('pagefind')) {
|
|
1163
|
+
if (search === false || search.engine !== "pagefind") {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
try {
|
|
1167
|
+
await importPagefind();
|
|
1168
|
+
} catch {
|
|
1169
|
+
throw new Error('Content search engine "pagefind" is enabled but the optional "pagefind" package is not installed. Install it: pnpm add -D pagefind');
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1142
1172
|
const defaultMiniSearchOptions = {
|
|
1143
1173
|
fields: ["title", "content", "headings"],
|
|
1144
1174
|
storeFields: ["path", "title", "excerpt", "anchor", "locale", "collection"],
|
|
@@ -1328,6 +1358,19 @@ const collectRawMarkdownRoutesFromGeneratedFrontmatter = (markdown) => {
|
|
|
1328
1358
|
};
|
|
1329
1359
|
const publicOutputPath = (publicDir, route) => join(publicDir, normalizeStaticRoutePath(route).replace(/^\//, ""));
|
|
1330
1360
|
|
|
1361
|
+
const assertPrerenderedContentSnapshot = (buildDir) => {
|
|
1362
|
+
const snapshotPath = resolve$1(buildDir, "content-cache/snapshot.json");
|
|
1363
|
+
let raw;
|
|
1364
|
+
try {
|
|
1365
|
+
raw = readFileSync(snapshotPath, "utf8");
|
|
1366
|
+
} catch {
|
|
1367
|
+
throw new Error("[content] production snapshot missing from prerendered content cache. Ensure the content cache route is prerendered.");
|
|
1368
|
+
}
|
|
1369
|
+
const snapshot = JSON.parse(raw);
|
|
1370
|
+
if (!isContentSnapshot(snapshot)) {
|
|
1371
|
+
throw new Error("[content] production snapshot is invalid in prerendered content cache.");
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1331
1374
|
const hookNuxtBoundary$2 = (nuxt, name, callback) => {
|
|
1332
1375
|
const hook = nuxt.hook;
|
|
1333
1376
|
hook(name, callback);
|
|
@@ -1343,6 +1386,12 @@ const registerStaticOutputGeneration = ({
|
|
|
1343
1386
|
}) => {
|
|
1344
1387
|
if (nuxt.options.dev) return;
|
|
1345
1388
|
hookNuxtBoundary$2(nuxt, "nitro:build:before", (nitro) => {
|
|
1389
|
+
const usesFilesystemProvider = !contentContext.provider || contentContext.provider === "filesystem";
|
|
1390
|
+
if (usesFilesystemProvider) {
|
|
1391
|
+
nitro.hooks.hook("prerender:done", () => {
|
|
1392
|
+
assertPrerenderedContentSnapshot(nuxt.options.buildDir);
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1346
1395
|
nitro.hooks.hook("prerender:init", (prerenderer) => {
|
|
1347
1396
|
prerenderer.hooks.hook("compiled", async () => {
|
|
1348
1397
|
const searchRuntime = getSearchRuntime();
|
|
@@ -1350,7 +1399,7 @@ const registerStaticOutputGeneration = ({
|
|
|
1350
1399
|
const serverFilename = typeof prerenderer.options.rollupConfig?.output?.entryFileNames === "string" ? prerenderer.options.rollupConfig.output.entryFileNames : "index.mjs";
|
|
1351
1400
|
const serverEntrypoint = resolve$1(prerenderer.options.output.serverDir, serverFilename);
|
|
1352
1401
|
const { localFetch } = await import(pathToFileURL(serverEntrypoint).href);
|
|
1353
|
-
if (searchRuntime !== false && searchRuntime.engine !== "cms" &&
|
|
1402
|
+
if (searchRuntime !== false && searchRuntime.engine !== "cms" && usesFilesystemProvider) {
|
|
1354
1403
|
const response = await localFetch(searchRuntime.indexURL);
|
|
1355
1404
|
if (!response.ok) {
|
|
1356
1405
|
throw new Error(`Failed to generate search index: [${response.status}] ${response.statusText}`);
|
|
@@ -1553,7 +1602,7 @@ const contentModuleDefaults = {
|
|
|
1553
1602
|
search: {
|
|
1554
1603
|
engine: "minisearch",
|
|
1555
1604
|
ignoredTags: ["script", "style", "pre"],
|
|
1556
|
-
filterQuery: {
|
|
1605
|
+
filterQuery: { draft: false, partial: false },
|
|
1557
1606
|
extraFields: [],
|
|
1558
1607
|
minisearch: {
|
|
1559
1608
|
fields: [...defaultMiniSearchOptions.fields],
|
|
@@ -1808,12 +1857,9 @@ const registerContentContextFinalization = ({
|
|
|
1808
1857
|
return [name, runtimeCollection, collection];
|
|
1809
1858
|
});
|
|
1810
1859
|
const runtimeCollections = Object.fromEntries(collectionEntries.map(([name, runtimeCollection]) => [name, runtimeCollection]));
|
|
1811
|
-
const privateRuntimeCollections = Object.fromEntries(collectionEntries.map(([name, runtimeCollection
|
|
1860
|
+
const privateRuntimeCollections = Object.fromEntries(collectionEntries.map(([name, runtimeCollection]) => [
|
|
1812
1861
|
name,
|
|
1813
|
-
|
|
1814
|
-
...runtimeCollection,
|
|
1815
|
-
...nuxt.options.dev && collection.schema ? { schema: collection.schema } : {}
|
|
1816
|
-
}
|
|
1862
|
+
runtimeCollection
|
|
1817
1863
|
]));
|
|
1818
1864
|
const cacheIntegrity = hash({
|
|
1819
1865
|
locales: resolvedContentContext.locales,
|
|
@@ -1883,6 +1929,7 @@ const module$1 = defineNuxtModule({
|
|
|
1883
1929
|
const resolvedI18n = resolveModuleI18nOptions(options, nuxt);
|
|
1884
1930
|
const resolvedSitemap = normalizeSitemapOptions(options);
|
|
1885
1931
|
const resolvedSearch = normalizeSearchOptions(options);
|
|
1932
|
+
await assertPagefindAvailable(resolvedSearch);
|
|
1886
1933
|
validateCollectionNames(appContentConfig.collections);
|
|
1887
1934
|
if (!hasAgentSurface(appContentConfig)) {
|
|
1888
1935
|
options.agent = false;
|
package/dist/parsers/csv.js
CHANGED
|
@@ -22,7 +22,7 @@ function toJsonArray(tree) {
|
|
|
22
22
|
export default defineTransformer({
|
|
23
23
|
name: "csv",
|
|
24
24
|
extensions: [".csv"],
|
|
25
|
-
parse: async (
|
|
25
|
+
parse: async (id, content, options = {}) => {
|
|
26
26
|
const csvOptions = typeof options === "object" && options !== null ? options : {};
|
|
27
27
|
const tree = fromCSV(String(content ?? ""), {
|
|
28
28
|
delimiter: ",",
|
|
@@ -31,8 +31,8 @@ export default defineTransformer({
|
|
|
31
31
|
});
|
|
32
32
|
const result = csvOptions.json === false ? toJsonArray(tree) : toJsonObject(tree);
|
|
33
33
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
id,
|
|
35
|
+
type: "csv",
|
|
36
36
|
body: result
|
|
37
37
|
};
|
|
38
38
|
}
|
package/dist/parsers/index.js
CHANGED
|
@@ -27,15 +27,15 @@ function getTransformers(ext, additionalTransformers = []) {
|
|
|
27
27
|
}
|
|
28
28
|
export async function transformContent(id, content, options = {}) {
|
|
29
29
|
const { transformers = [] } = options;
|
|
30
|
-
const file = {
|
|
30
|
+
const file = { id, body: content };
|
|
31
31
|
const ext = extname(id);
|
|
32
32
|
const parser = getParser(ext, transformers);
|
|
33
33
|
if (!parser) {
|
|
34
34
|
console.warn(`${ext} files are not supported, "${id}" storing body as null`);
|
|
35
|
-
return {
|
|
35
|
+
return { id: file.id, body: null, missing: true };
|
|
36
36
|
}
|
|
37
37
|
const parserOptions = options[camelCase(parser.name)] || {};
|
|
38
|
-
const parsed = await parser.parse(file.
|
|
38
|
+
const parsed = await parser.parse(file.id, file.body, parserOptions);
|
|
39
39
|
const matchedTransformers = getTransformers(ext, transformers);
|
|
40
40
|
const result = await matchedTransformers.reduce(async (prev, cur) => {
|
|
41
41
|
const next = await prev || parsed;
|
package/dist/parsers/json.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { destr } from "destr";
|
|
2
2
|
import { defineTransformer } from "./utils.js";
|
|
3
|
+
import { stripReservedContentKeys } from "./reserved.js";
|
|
3
4
|
export default defineTransformer({
|
|
4
5
|
name: "Json",
|
|
5
6
|
extensions: [".json", ".json5"],
|
|
6
|
-
parse: async (
|
|
7
|
+
parse: async (id, content) => {
|
|
7
8
|
let parsed;
|
|
8
9
|
if (typeof content === "string") {
|
|
9
|
-
if (
|
|
10
|
+
if (id.endsWith("json5")) {
|
|
10
11
|
parsed = (await import("json5").then((m) => m.default || m)).parse(content);
|
|
11
|
-
} else if (
|
|
12
|
+
} else if (id.endsWith("json")) {
|
|
12
13
|
parsed = destr(content);
|
|
13
14
|
}
|
|
14
15
|
} else {
|
|
15
16
|
parsed = content;
|
|
16
17
|
}
|
|
17
18
|
if (Array.isArray(parsed)) {
|
|
18
|
-
console.warn(`JSON array is not supported in ${
|
|
19
|
+
console.warn(`JSON array is not supported in ${id}, moving the array into the \`body\` key`);
|
|
19
20
|
parsed = {
|
|
20
21
|
body: parsed
|
|
21
22
|
};
|
|
22
23
|
}
|
|
24
|
+
parsed = stripReservedContentKeys(parsed, id);
|
|
23
25
|
return {
|
|
24
26
|
...parsed,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
id,
|
|
28
|
+
type: "json"
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
});
|
|
@@ -82,10 +82,10 @@ const resolveMarkdownPluginOptions = async (plugin) => {
|
|
|
82
82
|
};
|
|
83
83
|
const builtinMarkdownPlugins = {
|
|
84
84
|
breaks: {
|
|
85
|
-
load: () =>
|
|
85
|
+
load: () => loadBuiltinModule(() => import("comark/plugins/breaks"))
|
|
86
86
|
},
|
|
87
87
|
emoji: {
|
|
88
|
-
load: () =>
|
|
88
|
+
load: () => loadBuiltinModule(() => import("comark/plugins/emoji"))
|
|
89
89
|
},
|
|
90
90
|
footnotes: {
|
|
91
91
|
load: async () => footnotesPlugin
|
|
@@ -94,7 +94,7 @@ const builtinMarkdownPlugins = {
|
|
|
94
94
|
load: async () => highlightPlugin
|
|
95
95
|
},
|
|
96
96
|
"json-render": {
|
|
97
|
-
load: () =>
|
|
97
|
+
load: () => loadBuiltinModule(() => import("comark/plugins/json-render"))
|
|
98
98
|
},
|
|
99
99
|
math: {
|
|
100
100
|
load: () => loadModule("comark/plugins/math")
|
|
@@ -103,10 +103,10 @@ const builtinMarkdownPlugins = {
|
|
|
103
103
|
load: () => loadModule("comark/plugins/mermaid")
|
|
104
104
|
},
|
|
105
105
|
punctuation: {
|
|
106
|
-
load: () =>
|
|
106
|
+
load: () => loadBuiltinModule(() => import("comark/plugins/punctuation"))
|
|
107
107
|
},
|
|
108
108
|
security: {
|
|
109
|
-
load: () =>
|
|
109
|
+
load: () => loadBuiltinModule(() => import("comark/plugins/security"))
|
|
110
110
|
},
|
|
111
111
|
summary: {
|
|
112
112
|
load: async () => summaryPlugin
|
|
@@ -135,6 +135,10 @@ async function loadModule(specifier) {
|
|
|
135
135
|
);
|
|
136
136
|
return resolveModule(imported);
|
|
137
137
|
}
|
|
138
|
+
async function loadBuiltinModule(loader) {
|
|
139
|
+
const imported = await loader();
|
|
140
|
+
return resolveModule(imported);
|
|
141
|
+
}
|
|
138
142
|
function resolveModule(imported) {
|
|
139
143
|
return imported.default || imported;
|
|
140
144
|
}
|
package/dist/parsers/markdown.js
CHANGED
|
@@ -3,16 +3,18 @@ import { isRelative } from "ufo";
|
|
|
3
3
|
import { defineTransformer } from "./utils.js";
|
|
4
4
|
import { generatePath } from "./path-meta.js";
|
|
5
5
|
import { resolveMarkdownPlugins } from "./markdown-plugins.js";
|
|
6
|
+
import { stripReservedContentKeys } from "./reserved.js";
|
|
6
7
|
import { mapMarkdownNodes, toMarkdownRoot } from "../core/markdown/tree";
|
|
7
8
|
export default defineTransformer({
|
|
8
9
|
name: "markdown",
|
|
9
10
|
extensions: [".md"],
|
|
10
|
-
parse: async (
|
|
11
|
+
parse: async (id, content, options = {}) => {
|
|
11
12
|
const config = { ...typeof options === "object" && options !== null ? options : {} };
|
|
12
13
|
const plugins = await resolveMarkdownPlugins(config.plugins || []);
|
|
13
14
|
const tree = await parse(content, {
|
|
14
15
|
plugins
|
|
15
16
|
});
|
|
17
|
+
const frontmatter = stripReservedContentKeys(tree.frontmatter, id);
|
|
16
18
|
const body = normalizeMarkdownBody({
|
|
17
19
|
...toMarkdownRoot(tree.nodes),
|
|
18
20
|
toc: tree.meta?.toc
|
|
@@ -21,13 +23,12 @@ export default defineTransformer({
|
|
|
21
23
|
...toMarkdownRoot(tree.meta.summary)
|
|
22
24
|
}) : void 0;
|
|
23
25
|
return {
|
|
24
|
-
...
|
|
25
|
-
|
|
26
|
-
description: typeof tree.frontmatter.description === "string" ? tree.frontmatter.description : "",
|
|
26
|
+
...frontmatter,
|
|
27
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : "",
|
|
27
28
|
excerpt,
|
|
28
29
|
body,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
type: "markdown",
|
|
31
|
+
id
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
});
|
|
@@ -5,32 +5,34 @@ export default defineTransformer({
|
|
|
5
5
|
extensions: [".*"],
|
|
6
6
|
transform(content, options = {}) {
|
|
7
7
|
const { locales = [], defaultLocale = "en", respectPathCase = false, translatedSlugs = false } = options;
|
|
8
|
-
const {
|
|
9
|
-
const parts =
|
|
10
|
-
const
|
|
11
|
-
const isNavigation =
|
|
8
|
+
const { source, file, path, extension, basename } = describeId(content.id);
|
|
9
|
+
const parts = path.split("/");
|
|
10
|
+
const locale = locales.includes(parts[0]) ? parts.shift() : defaultLocale;
|
|
11
|
+
const isNavigation = basename === ".navigation";
|
|
12
12
|
const rawPath = isNavigation ? parts.slice(0, -1).join("/") : parts.join("/");
|
|
13
13
|
const filePath = generatePath(rawPath, { respectPathCase });
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const canonicalKey = generateCanonicalKey(isNavigation ? parts.slice(0, -1) : parts, { translatedSlugs, respectPathCase });
|
|
15
|
+
const collection = options.collectionResolver?.(file);
|
|
16
16
|
return {
|
|
17
17
|
...content,
|
|
18
18
|
// Fallback title synthesis lives here (not in the markdown parser) so it
|
|
19
19
|
// applies uniformly to every parser output. Moving it into the markdown
|
|
20
20
|
// parser would duplicate the logic in the yaml / json / csv parsers.
|
|
21
|
-
title: content.title || (isNavigation ? void 0 : generateTitle(refineUrlPart(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
title: content.title || (isNavigation ? void 0 : generateTitle(refineUrlPart(basename))),
|
|
22
|
+
path: filePath,
|
|
23
|
+
draft: content.draft || isDraftPath(path),
|
|
24
|
+
partial: isNavigation || isPartialPath(path),
|
|
25
|
+
locale,
|
|
26
|
+
canonicalKey,
|
|
27
|
+
collection,
|
|
28
|
+
navigationFile: isNavigation,
|
|
29
|
+
file: {
|
|
30
|
+
source,
|
|
31
|
+
path: file,
|
|
32
|
+
stem: path,
|
|
33
|
+
dir: filePath.split("/").slice(-2)[0],
|
|
34
|
+
extension
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './reserved.js'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System-computed identity keys on the content envelope. User frontmatter may
|
|
3
|
+
* not define these: the system value always wins and a dev/build warning is
|
|
4
|
+
* emitted so authors notice the shadowed key.
|
|
5
|
+
*
|
|
6
|
+
* The former user-facing "explicit id" alias has been retired — authors who
|
|
7
|
+
* want a stable, rename-proof alias for internal links should use `ref`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RESERVED_CONTENT_KEYS: readonly ["id", "collection", "locale", "path", "canonicalKey", "type", "file", "resolved", "variants", "localePaths", "unprefixedPath", "dir"];
|
|
10
|
+
/**
|
|
11
|
+
* Strip reserved system keys from raw user frontmatter/data. Identity keys are
|
|
12
|
+
* stamped later by path-meta; derived localization keys would otherwise be
|
|
13
|
+
* trusted as system state.
|
|
14
|
+
*/
|
|
15
|
+
export declare const stripReservedContentKeys: <T extends Record<string, unknown>>(source: Record<string, unknown> | null | undefined, fileId: string) => Partial<T>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const RESERVED_CONTENT_KEYS = [
|
|
2
|
+
"id",
|
|
3
|
+
"collection",
|
|
4
|
+
"locale",
|
|
5
|
+
"path",
|
|
6
|
+
"canonicalKey",
|
|
7
|
+
"type",
|
|
8
|
+
"file",
|
|
9
|
+
"resolved",
|
|
10
|
+
"variants",
|
|
11
|
+
"localePaths",
|
|
12
|
+
"unprefixedPath",
|
|
13
|
+
// Query-time only: `execute.ts`'s `withDirConfig` stamps the directory
|
|
14
|
+
// `.navigation` config onto variant-resolution (`resolveVariant`) results
|
|
15
|
+
// as a top-level `dir`, so an authored `dir:` frontmatter key would be
|
|
16
|
+
// silently clobbered there. It is not stamped at parse time (path-meta
|
|
17
|
+
// writes the directory name to `file.dir`, not top-level `dir`), so we
|
|
18
|
+
// reserve it here to strip+warn like the other system keys.
|
|
19
|
+
"dir"
|
|
20
|
+
];
|
|
21
|
+
export const stripReservedContentKeys = (source, fileId) => {
|
|
22
|
+
if (!source || typeof source !== "object") {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
const reserved = new Set(RESERVED_CONTENT_KEYS);
|
|
26
|
+
for (const key of RESERVED_CONTENT_KEYS) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
28
|
+
const hint = key === "id" ? " Use `ref` for a stable authored alias." : "";
|
|
29
|
+
console.warn(
|
|
30
|
+
`[content] Ignoring reserved frontmatter key "${key}" in "${fileId}"; the system value wins.${hint}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return Object.fromEntries(Object.entries(source).filter(([key]) => !reserved.has(key)));
|
|
35
|
+
};
|
package/dist/parsers/yaml.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { load } from "js-yaml";
|
|
2
2
|
import { defineTransformer } from "./utils.js";
|
|
3
|
+
import { stripReservedContentKeys } from "./reserved.js";
|
|
3
4
|
export default defineTransformer({
|
|
4
5
|
name: "Yaml",
|
|
5
6
|
extensions: [".yml", ".yaml"],
|
|
6
|
-
parse: (
|
|
7
|
+
parse: (id, content) => {
|
|
7
8
|
const data = load(String(content));
|
|
8
9
|
let parsed = data;
|
|
9
10
|
if (Array.isArray(data)) {
|
|
10
|
-
console.warn(`YAML array is not supported in ${
|
|
11
|
+
console.warn(`YAML array is not supported in ${id}, moving the array into the \`body\` key`);
|
|
11
12
|
parsed = { body: data };
|
|
12
13
|
}
|
|
14
|
+
parsed = stripReservedContentKeys(parsed, id);
|
|
13
15
|
return {
|
|
14
16
|
...parsed,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
id,
|
|
18
|
+
type: "yaml"
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agent.js'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM markdown output public API surface (Nitro / H3 contexts).
|
|
3
|
+
*
|
|
4
|
+
* The "agent" feature serves agent-readable content output — `/raw/*.md`,
|
|
5
|
+
* `/llms.txt`, `/llms-full.txt`, and the component→markdown serializers /
|
|
6
|
+
* registration primitives. It lives on its own subpath (`@lupinum/ginko-content/agent`)
|
|
7
|
+
* so it does not share the `./server` query facade. The `agent` code identifiers
|
|
8
|
+
* match the shipped module option name (`agent: {...}`).
|
|
9
|
+
*
|
|
10
|
+
* This is a PURE re-export: the registration API was reshaped once (per-app
|
|
11
|
+
* registry) in T4.2b — the moved names keep their call signatures.
|
|
12
|
+
*/
|
|
13
|
+
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from '../features/agent/agent-paths.js';
|
|
14
|
+
export { clearAgentMarkdownSerializers, blockquoteMarkdown, createAgentMarkdownRegistry, defineAgentMarkdownComponent, getMarkdownProp, jsonFenceMarkdown, linkMarkdown, queryMarkdownEnabledContent, registerAgentMarkdownComponent, registerAgentMarkdownComponents, registerAgentMarkdownSerializer, registerAgentMarkdownSerializers, renderMarkdownChildren, resolveAgentMarkdownOptions, resolveContentMarkdown, resolveContentMarkdownByRoute, xmlComponentMarkdown } from '../runtime/server/agent-markdown.js';
|
|
15
|
+
export { buildAgentPageIndex, collectAgentMarkdownPrerenderRoutes, getAgentLocales, isSupportedAgentLocale, localeFromAgentPath, renderAgentMarkdownFrontmatter, renderAgentMarkdownPage, renderLlmsFullTxt, renderLlmsTxt, resolveMarkdownForPublicRoute, routePathFromIndexSlug, routePathFromRawSlug } from '../runtime/server/agent-site.js';
|
|
16
|
+
export type { AgentMarkdown, AgentMarkdownComponent, AgentMarkdownComponentMap, AgentMarkdownContext, AgentMarkdownMeta, AgentMarkdownPublicSignals, AgentMarkdownRegistry, AgentMarkdownSerializer, AgentMarkdownSerializerMap, ResolvedAgentMarkdownOptions } from '../runtime/server/agent-markdown.js';
|
|
17
|
+
export type { AgentPage, AgentPageSource } from '../runtime/server/agent-site.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from "../features/agent/agent-paths.js";
|
|
2
|
+
export {
|
|
3
|
+
clearAgentMarkdownSerializers,
|
|
4
|
+
blockquoteMarkdown,
|
|
5
|
+
createAgentMarkdownRegistry,
|
|
6
|
+
defineAgentMarkdownComponent,
|
|
7
|
+
getMarkdownProp,
|
|
8
|
+
jsonFenceMarkdown,
|
|
9
|
+
linkMarkdown,
|
|
10
|
+
queryMarkdownEnabledContent,
|
|
11
|
+
registerAgentMarkdownComponent,
|
|
12
|
+
registerAgentMarkdownComponents,
|
|
13
|
+
registerAgentMarkdownSerializer,
|
|
14
|
+
registerAgentMarkdownSerializers,
|
|
15
|
+
renderMarkdownChildren,
|
|
16
|
+
resolveAgentMarkdownOptions,
|
|
17
|
+
resolveContentMarkdown,
|
|
18
|
+
resolveContentMarkdownByRoute,
|
|
19
|
+
xmlComponentMarkdown
|
|
20
|
+
} from "../runtime/server/agent-markdown.js";
|
|
21
|
+
export {
|
|
22
|
+
buildAgentPageIndex,
|
|
23
|
+
collectAgentMarkdownPrerenderRoutes,
|
|
24
|
+
getAgentLocales,
|
|
25
|
+
isSupportedAgentLocale,
|
|
26
|
+
localeFromAgentPath,
|
|
27
|
+
renderAgentMarkdownFrontmatter,
|
|
28
|
+
renderAgentMarkdownPage,
|
|
29
|
+
renderLlmsFullTxt,
|
|
30
|
+
renderLlmsTxt,
|
|
31
|
+
resolveMarkdownForPublicRoute,
|
|
32
|
+
routePathFromIndexSlug,
|
|
33
|
+
routePathFromRawSlug
|
|
34
|
+
} from "../runtime/server/agent-site.js";
|
package/dist/public/client.d.ts
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* pages use the thin `useContentPage` convenience helper built on top of it.
|
|
6
6
|
*/
|
|
7
7
|
export { one, many, paginate, backlinks, resolveOne, variants, tree, neighbors } from '../runtime/app/composables/query-api.js';
|
|
8
|
-
export { getCollectionPath } from '../
|
|
9
|
-
export type { CollectionPathOptions } from '../
|
|
10
|
-
export { agentMarkdownPathForRoute, agentRawPathForRoute, normalizeAgentRoutePath } from '../runtime/agent-paths.js';
|
|
8
|
+
export { getCollectionPath } from '../features/query/routes.js';
|
|
9
|
+
export type { CollectionPathOptions } from '../features/query/routes.js';
|
|
11
10
|
export { useContentHead } from '../runtime/app/composables/head.js';
|
|
12
11
|
export { useContentPage, useContentOne, useContentMany, useContentPagination, useContentBacklinks, useContentResolveOne, useContentVariants, useContentTree, useContentNavigation, useContentNeighbors } from '../runtime/app/composables/use-content.js';
|
|
13
12
|
export type { UseContentPageOptions } from '../runtime/app/composables/use-content.js';
|