@farming-labs/svelte 0.1.79 → 0.1.81
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/dist/server.js +10 -3
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import fs from "node:fs";
|
|
31
31
|
import path from "node:path";
|
|
32
32
|
import matter from "gray-matter";
|
|
33
|
-
import { applySidebarFolderIndexBehavior, buildDocsAskAIContext, buildDocsAgentDiscoverySpec, createDocsSitemapResponse, createDocsAgentTraceContext, createDocsAgentTraceId, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, formatDocsAskAIPackageHints, findDocsMarkdownPage, isDocsAgentDiscoveryRequest, isDocsSkillRequest, normalizeDocsRelated, performDocsSearch, renderDocsMarkdownDocument, renderDocsSkillDocument, readDocsSitemapManifestFromContentMap, stripGeneratedAgentProvenance, resolveDocsAgentMdxContent, resolvePageSidebarFolderIndexBehavior, resolveAskAISearchRequestConfig, resolveSearchRequestConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolvePageReadingTime, resolveReadingTimeOptions, resolveDocsSkillFormat, } from "@farming-labs/docs";
|
|
33
|
+
import { applySidebarFolderIndexBehavior, buildDocsAskAIContext, buildDocsAgentDiscoverySpec, createDocsSitemapResponse, createDocsAgentTraceContext, createDocsAgentTraceId, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, formatDocsAskAIPackageHints, findDocsMarkdownPage, getDocsMarkdownVaryHeader, isDocsAgentDiscoveryRequest, isDocsSkillRequest, normalizeDocsRelated, performDocsSearch, renderDocsMarkdownDocument, renderDocsMarkdownNotFound, renderDocsSkillDocument, readDocsSitemapManifestFromContentMap, stripGeneratedAgentProvenance, resolveDocsAgentMdxContent, resolvePageSidebarFolderIndexBehavior, resolveAskAISearchRequestConfig, resolveSearchRequestConfig, resolveDocsI18n, resolveDocsLlmsTxtFormat, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsPath, resolvePageReadingTime, resolveReadingTimeOptions, resolveDocsSkillFormat, } from "@farming-labs/docs";
|
|
34
34
|
import { createDocsMcpHttpHandler, readDocsSitemapManifest, resolveDocsMcpConfig, serializeDocsIconRegistry, serializeOpenDocsProviders, } from "@farming-labs/docs/server";
|
|
35
35
|
import { loadDocsNavTree, loadDocsContent, flattenNavTree } from "./content.js";
|
|
36
36
|
import { renderMarkdown } from "./markdown.js";
|
|
@@ -671,11 +671,17 @@ export function createDocsServer(config = {}) {
|
|
|
671
671
|
const markdownRequest = resolveDocsMarkdownRequest(entry, event.url, event.request);
|
|
672
672
|
if (markdownRequest) {
|
|
673
673
|
const document = getMarkdownDocument(ctx, markdownRequest.requestedPath);
|
|
674
|
+
const varyHeader = getDocsMarkdownVaryHeader(event.request);
|
|
674
675
|
if (!document) {
|
|
675
|
-
return new Response(
|
|
676
|
+
return new Response(renderDocsMarkdownNotFound({
|
|
677
|
+
entry,
|
|
678
|
+
requestedPath: markdownRequest.requestedPath,
|
|
679
|
+
sitemap: config.sitemap,
|
|
680
|
+
}), {
|
|
676
681
|
status: 404,
|
|
677
682
|
headers: {
|
|
678
|
-
"Content-Type": "text/
|
|
683
|
+
"Content-Type": "text/markdown; charset=utf-8",
|
|
684
|
+
...(varyHeader ? { Vary: varyHeader } : {}),
|
|
679
685
|
"X-Robots-Tag": "noindex",
|
|
680
686
|
},
|
|
681
687
|
});
|
|
@@ -684,6 +690,7 @@ export function createDocsServer(config = {}) {
|
|
|
684
690
|
headers: {
|
|
685
691
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
686
692
|
"Cache-Control": "public, max-age=0, s-maxage=3600",
|
|
693
|
+
...(varyHeader ? { Vary: varyHeader } : {}),
|
|
687
694
|
"X-Robots-Tag": "noindex",
|
|
688
695
|
},
|
|
689
696
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/svelte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.81",
|
|
4
4
|
"description": "SvelteKit adapter for @farming-labs/docs — content loading and navigation utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^22.10.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
|
-
"@farming-labs/docs": "0.1.
|
|
59
|
+
"@farming-labs/docs": "0.1.81"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@farming-labs/docs": "*"
|