feat: add Signature-Agent markdown auto-rewrite for docs#170
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
Contributor
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/next/src/config.ts">
<violation number="1" location="packages/next/src/config.ts:1884">
P2: `outputFileTracingIncludes` uses an invalid dynamic route key (`:path*`) for the markdown catch-all route. Use the Next route-path form (`[[...slug]]`) so required docs files are actually traced.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| sitemapManifestTraceFile, | ||
| ]), | ||
| ], | ||
| "/api/docs/markdown/:path*": [ |
Contributor
There was a problem hiding this comment.
P2: outputFileTracingIncludes uses an invalid dynamic route key (:path*) for the markdown catch-all route. Use the Next route-path form ([[...slug]]) so required docs files are actually traced.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/next/src/config.ts, line 1884:
<comment>`outputFileTracingIncludes` uses an invalid dynamic route key (`:path*`) for the markdown catch-all route. Use the Next route-path form (`[[...slug]]`) so required docs files are actually traced.</comment>
<file context>
@@ -1805,6 +1873,22 @@ export function withDocs(nextConfig: NextConfig = {}): NextConfig {
+ sitemapManifestTraceFile,
+ ]),
+ ],
+ "/api/docs/markdown/:path*": [
+ ...new Set([
+ ...(existingTracingIncludes["/api/docs/markdown/:path*"] ?? []),
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds automatic markdown responses for docs when requests include the Signature-Agent header. Agents can read canonical
/docs/<slug>URLs without using.mdorAccept: text/markdown.withDocs()rewritesSignature-Agentrequests on/docsand/docs/:slug*to a generated/api/docs/markdown/[[...slug]]bridge route./api/docswithformat=markdown, derivespathfrom the slug, and preserves incoming headers. Implemented via@farming-labs/next/api.DOCS_MARKDOWN_SIGNATURE_AGENT_HEADER,hasDocsMarkdownSignatureAgent(), andmarkdown.signatureAgentHeaderin the discovery spec.output: "export") skips the rewrites and the bridge route.Written for commit 7ce1d4d. Summary will update on new commits.