diff --git a/apps/docs/content/docs/mdx/search-index.mdx b/apps/docs/content/docs/mdx/search-index.mdx index d379713ba..4318e88e3 100644 --- a/apps/docs/content/docs/mdx/search-index.mdx +++ b/apps/docs/content/docs/mdx/search-index.mdx @@ -29,6 +29,6 @@ You can access them with `JSON.parse`. import type { SearchIndex } from 'fumadocs-mdx'; const indexes = JSON.parse( - readFileSync('./.next/server/chunks/fumadocs_search.json').toString() + readFileSync('./.next/server/chunks/fumadocs_search.json').toString(), ) as SearchIndex[]; -``` \ No newline at end of file +``` diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index e16f135b8..355298f4a 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -25,10 +25,10 @@ const config = { const withMDX = createMDX({ buildSearchIndex: { filter: (v) => { - if (v.match(/.+\.model\.mdx/)) return false - - return true - } + if (v.match(/.+\.model\.mdx/)) return false; + + return true; + }, }, mdxOptions: { rehypeCodeOptions: { diff --git a/apps/docs/utils/source.ts b/apps/docs/utils/source.ts index 578364703..59f50ae84 100644 --- a/apps/docs/utils/source.ts +++ b/apps/docs/utils/source.ts @@ -23,4 +23,4 @@ export const utils = loader({ }); export type Page = InferPageType; -export type Meta = InferMetaType; \ No newline at end of file +export type Meta = InferMetaType; diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 671315cfc..ed7bcf622 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -74,7 +74,7 @@ ````md ```ts /config/ {1} - const config = "Hello"; + const config = 'Hello'; something.call(config); ``` @@ -85,7 +85,7 @@ ````md ```ts // [!code word:config] - const config = "Hello"; // [!code highlight] + const config = 'Hello'; // [!code highlight] something.call(config); ``` @@ -144,13 +144,13 @@ It's no longer encouraged to access `allDocs` directly because they will not include `url` property anymore. Please consider `getPages` instead. ```ts - import { allDocs, allMeta } from "contentlayer/generated"; - import { createContentlayerSource } from "next-docs-zeta/contentlayer"; - import { loader } from "next-docs-zeta/source"; + import { allDocs, allMeta } from 'contentlayer/generated'; + import { createContentlayerSource } from 'next-docs-zeta/contentlayer'; + import { loader } from 'next-docs-zeta/source'; export const { getPage, pageTree, getPages } = loader({ - baseUrl: "/docs", - rootDir: "docs", + baseUrl: '/docs', + rootDir: 'docs', source: createContentlayerSource(allMeta, allDocs), }); ``` @@ -171,13 +171,13 @@ The interface is now unified, you can easily plug in a content source. ```ts - import { map } from "@/.map"; - import { createMDXSource } from "next-docs-mdx"; - import { loader } from "next-docs-zeta/source"; + import { map } from '@/.map'; + import { createMDXSource } from 'next-docs-mdx'; + import { loader } from 'next-docs-zeta/source'; export const { getPage, getPages, pageTree } = loader({ - baseUrl: "/docs", - rootDir: "docs", + baseUrl: '/docs', + rootDir: 'docs', source: createMDXSource(map), }); ``` @@ -221,7 +221,7 @@ If you want to include other document types, or override the output configuration, the `create` function can return the fields and document types you need. ```ts - import { create } from "next-docs-zeta/contentlayer/configuration"; + import { create } from 'next-docs-zeta/contentlayer/configuration'; const config = create(options); diff --git a/packages/mdx/CHANGELOG.md b/packages/mdx/CHANGELOG.md index 83a9ce077..17d6a897e 100644 --- a/packages/mdx/CHANGELOG.md +++ b/packages/mdx/CHANGELOG.md @@ -85,7 +85,7 @@ Become: ```mdx - import img_banner from "../../public/image.png"; + import img_banner from '../../public/image.png'; banner ``` @@ -146,13 +146,13 @@ `fromMap` has been removed. Please use `createMDXSource` instead. ```ts - import { map } from "@/.map"; - import { createMDXSource } from "next-docs-mdx"; - import { loader } from "next-docs-zeta/source"; + import { map } from '@/.map'; + import { createMDXSource } from 'next-docs-mdx'; + import { loader } from 'next-docs-zeta/source'; export const { getPage, getPages, pageTree } = loader({ - baseUrl: "/docs", - rootDir: "docs", + baseUrl: '/docs', + rootDir: 'docs', source: createMDXSource(map), }); ``` @@ -166,7 +166,7 @@ ```js const withNextDocs = createNextDocs({ mdxOptions: { - lastModifiedTime: "git", + lastModifiedTime: 'git', }, }); ``` @@ -215,7 +215,7 @@ ```ts const utils = fromMap(map, { - rootDir: "ui", + rootDir: 'ui', schema: { frontmatter: frontmatterSchema, }, @@ -246,11 +246,11 @@ The `validate` options is now renamed to `schema`. ```ts - import { defaultSchemas, fromMap } from "next-docs-mdx/map"; + import { defaultSchemas, fromMap } from 'next-docs-mdx/map'; const utils = fromMap(map, { - rootDir: "docs/ui", - baseUrl: "/docs/ui", + rootDir: 'docs/ui', + baseUrl: '/docs/ui', schema: { frontmatter: defaultSchemas.frontmatter.extend({ preview: z.string().optional(), @@ -269,7 +269,7 @@ ```js const withNextDocs = createNextDocs({ - rootContentPath: "./content/docs", + rootContentPath: './content/docs', }); ``` diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 530265a7c..67bdb453f 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -142,8 +142,8 @@ @@ -156,15 +156,15 @@ migrate: Use `createPreset` instead ```js - const { createPreset } = require("fumadocs-ui/tailwind-plugin"); + const { createPreset } = require('fumadocs-ui/tailwind-plugin'); /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - "./components/**/*.{ts,tsx}", - "./app/**/*.{ts,tsx}", - "./content/**/*.mdx", - "./node_modules/fumadocs-ui/dist/**/*.js", + './components/**/*.{ts,tsx}', + './app/**/*.{ts,tsx}', + './content/**/*.mdx', + './node_modules/fumadocs-ui/dist/**/*.js', ], presets: [createPreset()], }; @@ -177,7 +177,7 @@ Before: ```tsx - import { CodeBlock, Pre } from "fumadocs-ui/mdx/pre"; + import { CodeBlock, Pre } from 'fumadocs-ui/mdx/pre';
;
   ```
@@ -185,7 +185,7 @@
   After:
 
   ```tsx
-  import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
+  import { CodeBlock, Pre } from 'fumadocs-ui/components/codeblock';
 
   
     
@@ -306,14 +306,14 @@
   Add theme presets for the Tailwind CSS plugin, the default and ocean presets are available now.
 
   ```js
-  const { docsUi, docsUiPlugins } = require("next-docs-ui/tailwind-plugin");
+  const { docsUi, docsUiPlugins } = require('next-docs-ui/tailwind-plugin');
 
   /** @type {import('tailwindcss').Config} */
   module.exports = {
     plugins: [
       ...docsUiPlugins,
       docsUi({
-        preset: "ocean",
+        preset: 'ocean',
       }),
     ],
   };
@@ -349,7 +349,7 @@
   Same as Docs Layout but doesn't include a sidebar. It can be used outside of the docs, a page tree is not required.
 
   ```jsx
-  import { Layout } from "next-docs-ui/layout";
+  import { Layout } from 'next-docs-ui/layout';
 
   export default function HomeLayout({ children }) {
     return {children};
@@ -406,16 +406,16 @@
   If you are using Tailwind CSS for your docs, it's now recommended to use the official plugin instead.
 
   ```js
-  const { docsUi, docsUiPlugins } = require("next-docs-ui/tailwind-plugin");
+  const { docsUi, docsUiPlugins } = require('next-docs-ui/tailwind-plugin');
 
   /** @type {import('tailwindcss').Config} */
   module.exports = {
-    darkMode: "class",
+    darkMode: 'class',
     content: [
-      "./components/**/*.{ts,tsx}",
-      "./app/**/*.{ts,tsx}",
-      "./content/**/*.mdx",
-      "./node_modules/next-docs-ui/dist/**/*.js",
+      './components/**/*.{ts,tsx}',
+      './app/**/*.{ts,tsx}',
+      './content/**/*.mdx',
+      './node_modules/next-docs-ui/dist/**/*.js',
     ],
     plugins: [...docsUiPlugins, docsUi],
   };