@farming-labs/next 0.0.2-beta.3 → 0.0.2-beta.5
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.mjs +9 -9
- package/package.json +1 -1
package/dist/config.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import createMDX from "@next/mdx";
|
|
|
23
23
|
const GENERATED_BANNER = "// Auto-generated by @farming-labs/next — do not edit manually.\n";
|
|
24
24
|
const MDX_COMPONENTS_TEMPLATE = `\
|
|
25
25
|
${GENERATED_BANNER}
|
|
26
|
-
import { getMDXComponents } from "@farming-labs/
|
|
26
|
+
import { getMDXComponents } from "@farming-labs/theme/mdx";
|
|
27
27
|
import type { MDXComponents } from "mdx/types";
|
|
28
28
|
import docsConfig from "@/docs.config";
|
|
29
29
|
|
|
@@ -37,16 +37,16 @@ export function useMDXComponents(components?: MDXComponents): MDXComponents {
|
|
|
37
37
|
const DOCS_LAYOUT_TEMPLATE = `\
|
|
38
38
|
${GENERATED_BANNER}
|
|
39
39
|
import docsConfig from "@/docs.config";
|
|
40
|
-
import { createDocsLayout, createDocsMetadata } from "@farming-labs/
|
|
40
|
+
import { createDocsLayout, createDocsMetadata } from "@farming-labs/theme";
|
|
41
41
|
|
|
42
42
|
export const metadata = createDocsMetadata(docsConfig);
|
|
43
43
|
export default createDocsLayout(docsConfig);
|
|
44
44
|
`;
|
|
45
|
-
const
|
|
45
|
+
const DOCS_API_ROUTE_TEMPLATE = `\
|
|
46
46
|
${GENERATED_BANNER}
|
|
47
|
-
import {
|
|
47
|
+
import { createDocsAPI } from "@farming-labs/theme/api";
|
|
48
48
|
|
|
49
|
-
export const { GET } =
|
|
49
|
+
export const { GET, POST } = createDocsAPI();
|
|
50
50
|
|
|
51
51
|
export const revalidate = false;
|
|
52
52
|
`;
|
|
@@ -79,10 +79,10 @@ function withDocs(nextConfig = {}) {
|
|
|
79
79
|
mkdirSync(layoutDir, { recursive: true });
|
|
80
80
|
writeFileSync(join(layoutDir, "layout.tsx"), DOCS_LAYOUT_TEMPLATE);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
if (!hasFile(
|
|
84
|
-
mkdirSync(
|
|
85
|
-
writeFileSync(join(
|
|
82
|
+
const docsApiRouteDir = join(root, "app", "api", "docs");
|
|
83
|
+
if (!hasFile(docsApiRouteDir, "route")) {
|
|
84
|
+
mkdirSync(docsApiRouteDir, { recursive: true });
|
|
85
|
+
writeFileSync(join(docsApiRouteDir, "route.ts"), DOCS_API_ROUTE_TEMPLATE);
|
|
86
86
|
}
|
|
87
87
|
const withMDX = createMDX({
|
|
88
88
|
extension: /\.mdx?$/,
|