Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/canonical-config-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"leadtype": minor
---

Add a canonical config vocabulary and one resolved-config normalizer.

`defineLeadtypeConfig` names the project/site config in `leadtype.config.ts`, alongside `defineDocsConfig` for a source repo's content-owned `docs.config.ts`. Three collection fields are renamed: `prefix` → `routePrefix`, `sourceConfig` → `inheritConfig`, `schema` → `frontmatterSchema`.

Every existing config keeps working. Both spellings normalize to one internal `ResolvedDocsConfig` that generate, sync, lint, score, and the runtime source all read, so no subsystem re-derives the project from raw config. The resolved shape adds a deduped source graph — collections sharing a `(repository, ref)` resolve to one acquisition — and per-field provenance recording whether each value was authored, inherited from a source repo, inferred, or defaulted.

Deprecated fields carry `@deprecated` guidance in the IDE and warn once per config file at load. Setting an old name and its replacement together is an error naming both rather than a silent precedence rule. Nothing is removed before 1.0.
8 changes: 4 additions & 4 deletions apps/next-example/leadtype.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineCollection, defineDocsConfig } from "leadtype";
import { defineCollection, defineLeadtypeConfig } from "leadtype";

const appDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(appDir, "../..");
Expand Down Expand Up @@ -33,7 +33,7 @@ function resolveExampleSourceRef(): string {
}
}

export default defineDocsConfig({
export default defineLeadtypeConfig({
product: {
name: "Leadtype",
tagline:
Expand All @@ -53,8 +53,8 @@ export default defineDocsConfig({
cacheDir: ".leadtype",
dir: "docs",
mounts: [{ pathPrefix: "changelog", urlPrefix: "/changelog" }],
prefix: "/docs",
sourceConfig: true,
routePrefix: "/docs",
inheritConfig: true,
}),
},
feeds: [
Expand Down
55 changes: 55 additions & 0 deletions apps/sveltekit-example/static/feeds/schema.jsonl

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions apps/sveltekit-example/static/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json",
"version": "1.0",
"protocolVersion": "2025-06-18",
"name": "leadtype-docs",
"description": "A docs pipeline that turns one MDX source into a website, agent-readable artifacts, and a search index.",
"serverUrl": "http://localhost:5173/mcp",
"tools": [
{
"name": "search-docs",
"title": "Search documentation",
"description": "Search the documentation and return ranked results ({ title, urlPath, snippet }). Use get-page to read a full result.",
"annotations": {
"idempotentHint": true,
"readOnlyHint": true
}
},
{
"name": "get-page",
"title": "Get a documentation page",
"description": "Return the full Markdown of one documentation page by its urlPath (e.g. the urlPath from a search-docs result).",
"annotations": {
"idempotentHint": true,
"readOnlyHint": true
}
}
],
"serverInfo": {
"name": "leadtype-docs",
"version": "1.0.0",
"description": "A docs pipeline that turns one MDX source into a website, agent-readable artifacts, and a search index.",
"instructions": "Search and read the documentation for A docs pipeline that turns one MDX source into a website, agent-readable artifacts, and a search index."
},
"transport": {
"type": "streamable-http",
"endpoint": "http://localhost:5173/mcp"
},
"capabilities": {
"tools": {}
},
"authentication": {
"required": false
}
}
211 changes: 211 additions & 0 deletions apps/sveltekit-example/static/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
User-agent: *
Content-Signal: ai-train=no, search=yes, ai-input=yes
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: OAI-SearchBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: ChatGPT-User
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: PerplexityBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Perplexity-User
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: ClaudeBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Claude-SearchBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Claude-User
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Claude-Web
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Gemini-Deep-Research
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: DeepSeekBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Meta-ExternalFetcher
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: AmazonBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Amazonbot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Bingbot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: MistralBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: AppleBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: YouBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: GPTBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Google-Extended
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: CCBot
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: ByteSpider
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Bytespider
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: anthropic-ai
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: MetaExternalAgent
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

User-agent: Applebot-Extended
Allow: /
Allow: /docs/
Allow: /llms.txt
Allow: /docs/llms.txt
Allow: /sitemap.xml
Allow: /sitemap.md

Sitemap: http://localhost:5173/sitemap.xml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These six files are build output, not source. apps/sveltekit-example/package.json runs leadtype generate --src ../.. --docs-dir docs --out static --base-url http://localhost:5173, and dev, build, and check-types all invoke it — so every one of these files is rewritten (with fresh dateModified timestamps) the moment anyone runs the example, and every URL inside them now has http://localhost:5173 committed into git.

Root cause is the root .gitignore: it maintains two parallel generated-output lists, but the apps/sveltekit-example/static/* block has only 5 entries where the apps/*/public/* block has 11. git check-ignore --no-index confirms the asymmetry — apps/next-example/public/robots.txt is ignored via .gitignore:46, and none of the six sveltekit files are ignored at all. Nothing else has ever been tracked in that directory, and CI never builds the example apps, so this drift cannot be caught automatically.

Technical details
apps/sveltekit-example/static/robots.txt         (Sitemap: http://localhost:5173/sitemap.xml)
apps/sveltekit-example/static/sitemap.xml        (223 lines of http://localhost:5173/... locs)
apps/sveltekit-example/static/sitemap.md
apps/sveltekit-example/static/schema-map.xml
apps/sveltekit-example/static/mcp.json
apps/sveltekit-example/static/feeds/schema.jsonl

Affected sites: .gitignore:39-54, apps/sveltekit-example/package.json

Required outcome: nothing generated is tracked under apps/sveltekit-example/static/, and git status stays clean after running the example.

Suggested approach: git rm --cached the six files and add the six missing entries (feeds/, mcp.json, robots.txt, schema-map.xml, sitemap.md, sitemap.xml) to the sveltekit block — or drop both hand-maintained lists in favour of an app-local .gitignore, which is what apps/c15t-example and apps/tanstack already do.

Open question: were these swept in accidentally while regenerating docs for the new config-model page?

Schemamap: http://localhost:5173/schema-map.xml
8 changes: 8 additions & 0 deletions apps/sveltekit-example/static/schema-map.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemamap>
<feed>
<loc>http://localhost:5173/feeds/schema.jsonl</loc>
<format>application/jsonl</format>
<itemType>https://schema.org/TechArticle</itemType>
</feed>
</schemamap>
Loading
Loading