Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@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: |
There was a problem hiding this comment.
2 issues found across 16 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="examples/next/docs.config.tsx">
<violation number="1" location="examples/next/docs.config.tsx:78">
P1: `searchConfig` is never applied, so `DOCS_SEARCH_PROVIDER` and external search provider selection no longer work.</violation>
<violation number="2" location="examples/next/docs.config.tsx:197">
P1: MCP is never enabled because the conditional `mcp` block is commented out, so `DOCS_SEARCH_PROVIDER=mcp` cannot work as documented.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| mcp: { | ||
| enabled: true, | ||
| }, | ||
| // ...(docsSearchProvider === "mcp" ? { mcp: { enabled: true } } : {}), |
There was a problem hiding this comment.
P1: MCP is never enabled because the conditional mcp block is commented out, so DOCS_SEARCH_PROVIDER=mcp cannot work as documented.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/next/docs.config.tsx, line 197:
<comment>MCP is never enabled because the conditional `mcp` block is commented out, so `DOCS_SEARCH_PROVIDER=mcp` cannot work as documented.</comment>
<file context>
@@ -192,9 +194,7 @@ export default defineDocs({
- mcp: {
- enabled: true,
- },
+ // ...(docsSearchProvider === "mcp" ? { mcp: { enabled: true } } : {}),
ordering: "numeric",
metadata: {
</file context>
| // ...(docsSearchProvider === "mcp" ? { mcp: { enabled: true } } : {}), | |
| ...(docsSearchProvider === "mcp" ? { mcp: { enabled: true } } : {}), |
| export default defineDocs({ | ||
| entry: "docs", | ||
| search: searchConfig, | ||
| // ...(searchConfig ? { search: searchConfig } : {}), |
There was a problem hiding this comment.
P1: searchConfig is never applied, so DOCS_SEARCH_PROVIDER and external search provider selection no longer work.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/next/docs.config.tsx, line 78:
<comment>`searchConfig` is never applied, so `DOCS_SEARCH_PROVIDER` and external search provider selection no longer work.</comment>
<file context>
@@ -58,22 +55,27 @@ const searchConfig =
export default defineDocs({
entry: "docs",
- search: searchConfig,
+ // ...(searchConfig ? { search: searchConfig } : {}),
github: {
url: "https://github.com/farming-labs/docs",
</file context>
| // ...(searchConfig ? { search: searchConfig } : {}), | |
| ...(searchConfig ? { search: searchConfig } : {}), |
There was a problem hiding this comment.
2 issues found across 19 files (changes from recent commits).
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.test.ts">
<violation number="1" location="packages/next/src/config.test.ts:242">
P1: The `resolveAlias` paths in `turbopack` configuration are incorrectly hardcoded as relative to the monorepo root, which fails when the Next.js project is in a subdirectory (e.g., `examples/next`).</violation>
</file>
<file name="packages/next/src/api.ts">
<violation number="1" location="packages/next/src/api.ts:46">
P2: The regex requires at least one segment between `api/` and `/route`, so root-level routes like `app/api/route.ts` won’t be detected and `rootDir` inference will fail for those handlers. Allow the segment to be optional.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -1,5 +1,13 @@ | |||
| import { describe, it, expect, beforeEach, afterEach } from "vitest"; | |||
There was a problem hiding this comment.
P1: The resolveAlias paths in turbopack configuration are incorrectly hardcoded as relative to the monorepo root, which fails when the Next.js project is in a subdirectory (e.g., examples/next).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/next/src/config.test.ts, line 242:
<comment>The `resolveAlias` paths in `turbopack` configuration are incorrectly hardcoded as relative to the monorepo root, which fails when the Next.js project is in a subdirectory (e.g., `examples/next`).</comment>
<file context>
@@ -193,12 +199,50 @@ describe("withDocs (app dir: src/app vs app)", () => {
+ | undefined;
+
+ expect(turbopack?.root).toBe(realpathSync(workspaceRoot));
+ expect(turbopack?.resolveAlias?.["@farming-labs/docs"]).toBe("./packages/docs/src/index.ts");
+ expect(turbopack?.resolveAlias?.["@farming-labs/next/api"]).toBe("./packages/next/src/api.ts");
+ expect(turbopack?.resolveAlias?.["@farming-labs/theme/search"]).toBe(
</file context>
|
|
||
| function isNextRouteFile(filePath: string): boolean { | ||
| const normalized = filePath.replaceAll("\\", "/"); | ||
| return /\/(?:src\/)?app\/api\/.+\/route\.[cm]?[jt]sx?$/.test(normalized); |
There was a problem hiding this comment.
P2: The regex requires at least one segment between api/ and /route, so root-level routes like app/api/route.ts won’t be detected and rootDir inference will fail for those handlers. Allow the segment to be optional.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/next/src/api.ts, line 46:
<comment>The regex requires at least one segment between `api/` and `/route`, so root-level routes like `app/api/route.ts` won’t be detected and `rootDir` inference will fail for those handlers. Allow the segment to be optional.</comment>
<file context>
@@ -34,3 +40,44 @@ export function resolveNextProjectRoot(metaUrl: string): string {
+
+function isNextRouteFile(filePath: string): boolean {
+ const normalized = filePath.replaceAll("\\", "/");
+ return /\/(?:src\/)?app\/api\/.+\/route\.[cm]?[jt]sx?$/.test(normalized);
+}
+
</file context>
| return /\/(?:src\/)?app\/api\/.+\/route\.[cm]?[jt]sx?$/.test(normalized); | |
| return /\/(?:src\/)?app\/api(?:\/.+)?\/route\.[cm]?[jt]sx?$/.test(normalized); |
Summary by cubic
Add auto project-root detection to
@farming-labs/next/apiand supportcontentDirso docs APIs work in monorepos and production builds. Default to simple search when no provider is set, and improve build tracing and Turbopack setup.New Features
resolveNextProjectRoot(metaUrl)and auto-infer the project root insidecreateDocsAPI/createDocsMCPAPIfrom@farming-labs/next/api(generated routes no longer passrootDir).@farming-labs/theme/apicreateDocsAPIacceptsrootDirandcontentDir; GET search usescontentDirand scans multiple candidates (app/, configuredcontentDir,.next/server, custom dist dirs) with fallback to traced server files.searchconfig is set; Typesense/Algolia/MCP remain opt-in viaDOCS_SEARCH_PROVIDER.Refactors
contentDir; examples and website updated; env/README simplified for default simple search.withDocsaddsoutputFileTracingIncludesfor docs content and auto-configures Turbopack root/aliases when inside the workspace; removed manual aliases from app configs.@farming-labs/theme/apiremains for compatibility but prefer@farming-labs/next/api; minor Next.js type path tweak.contentDirrouting, traced.nextfallback, and Turbopack/tracing behavior.Written for commit 4e7cc93. Summary will update on new commits.