@farming-labs/next 0.0.7 → 0.0.9-beta.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/dist/config.d.mts CHANGED
@@ -17,6 +17,11 @@ import * as next from "next";
17
17
  * export default withDocs({
18
18
  * images: { remotePatterns: [{ hostname: "example.com" }] },
19
19
  * });
20
+ *
21
+ * @example
22
+ * // Full static export (Cloudflare Pages, etc.) — no server; API route is skipped.
23
+ * // In docs.config set ai.enabled: false and staticExport: true.
24
+ * export default withDocs({ output: "export" });
20
25
  */
21
26
  declare function withDocs(nextConfig?: Record<string, unknown>): next.NextConfig;
22
27
  //#endregion
package/dist/config.mjs CHANGED
@@ -19,6 +19,11 @@ import createMDX from "@next/mdx";
19
19
  * export default withDocs({
20
20
  * images: { remotePatterns: [{ hostname: "example.com" }] },
21
21
  * });
22
+ *
23
+ * @example
24
+ * // Full static export (Cloudflare Pages, etc.) — no server; API route is skipped.
25
+ * // In docs.config set ai.enabled: false and staticExport: true.
26
+ * export default withDocs({ output: "export" });
22
27
  */
23
28
  const GENERATED_BANNER = "// Auto-generated by @farming-labs/next — do not edit manually.\n";
24
29
  const MDX_COMPONENTS_TEMPLATE = `\
@@ -98,8 +103,9 @@ function withDocs(nextConfig = {}) {
98
103
  mkdirSync(layoutDir, { recursive: true });
99
104
  writeFileSync(join(layoutDir, "layout.tsx"), DOCS_LAYOUT_TEMPLATE);
100
105
  }
106
+ const isStaticExport = nextConfig.output === "export";
101
107
  const docsApiRouteDir = join(root, "app", "api", "docs");
102
- if (!hasFile(docsApiRouteDir, "route")) {
108
+ if (!isStaticExport && !hasFile(docsApiRouteDir, "route")) {
103
109
  mkdirSync(docsApiRouteDir, { recursive: true });
104
110
  writeFileSync(join(docsApiRouteDir, "route.ts"), DOCS_API_ROUTE_TEMPLATE);
105
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/next",
3
- "version": "0.0.7",
3
+ "version": "0.0.9-beta.1",
4
4
  "description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
5
5
  "keywords": [
6
6
  "docs",