diff --git a/examples/document-types/index.js b/examples/document-types/index.js index af59cdc..6395c89 100644 --- a/examples/document-types/index.js +++ b/examples/document-types/index.js @@ -24,7 +24,7 @@ const schemas = { await client.indexFolder({ folderPath: contentPath, ignorePatterns: ignorePatterns, - schemas: schemas + schemas: schemas, }); process.exit(0); diff --git a/examples/nextjs-blog/next.config.js b/examples/nextjs-blog/next.config.js index a843cbe..91ef62f 100644 --- a/examples/nextjs-blog/next.config.js +++ b/examples/nextjs-blog/next.config.js @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, -} +}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/examples/nextjs-blog/src/pages/_app.js b/examples/nextjs-blog/src/pages/_app.js index cf06318..39b86cd 100644 --- a/examples/nextjs-blog/src/pages/_app.js +++ b/examples/nextjs-blog/src/pages/_app.js @@ -1,3 +1,3 @@ export default function App({ Component, pageProps }) { - return + return ; } diff --git a/examples/nextjs-blog/src/pages/_document.js b/examples/nextjs-blog/src/pages/_document.js index 54e8bf3..b2fff8b 100644 --- a/examples/nextjs-blog/src/pages/_document.js +++ b/examples/nextjs-blog/src/pages/_document.js @@ -1,4 +1,4 @@ -import { Html, Head, Main, NextScript } from 'next/document' +import { Html, Head, Main, NextScript } from "next/document"; export default function Document() { return ( @@ -9,5 +9,5 @@ export default function Document() { - ) + ); } diff --git a/examples/nextjs-blog/src/pages/index.js b/examples/nextjs-blog/src/pages/index.js index 520b38a..d322918 100644 --- a/examples/nextjs-blog/src/pages/index.js +++ b/examples/nextjs-blog/src/pages/index.js @@ -1,4 +1,4 @@ -import fs from "fs" +import fs from "fs"; export default function Home({ posts }) { return ( @@ -16,12 +16,12 @@ export default function Home({ posts }) { - ) + ); } export async function getStaticProps() { - const filePath = 'src/.markdowndb/files.json'; - const fileContent = fs.readFileSync(filePath, 'utf-8'); + const filePath = "src/.markdowndb/files.json"; + const fileContent = fs.readFileSync(filePath, "utf-8"); const posts = JSON.parse(fileContent); return { diff --git a/markdowndb.config.js b/markdowndb.config.js index cd8dfb2..4999a53 100644 --- a/markdowndb.config.js +++ b/markdowndb.config.js @@ -1,8 +1,8 @@ export default { - computedFields: [], // Array of functions to computed fields - schemas: { - // Add zod schemas - }, - include: [], // Pattern for files to be included - exclude: [] // Patten for files to be excluded -}; \ No newline at end of file + computedFields: [], // Array of functions to computed fields + schemas: { + // Add zod schemas + }, + include: [], // Pattern for files to be included + exclude: [], // Patten for files to be excluded +}; diff --git a/src/bin/index.js b/src/bin/index.js index 238214f..c99f3ab 100755 --- a/src/bin/index.js +++ b/src/bin/index.js @@ -9,7 +9,7 @@ let watchFlag; const args = process.argv.slice(2); // Check for the watch flag and its position -const watchIndex = args.indexOf('--watch'); +const watchIndex = args.indexOf("--watch"); if (watchIndex !== -1) { watchFlag = args[watchIndex]; args.splice(watchIndex, 1); // Remove the watch flag from the array @@ -19,7 +19,7 @@ if (watchIndex !== -1) { const [contentPath, configFilePath] = args; if (!contentPath) { - console.error('Invalid/Missing path to markdown content folder'); + console.error("Invalid/Missing path to markdown content folder"); process.exit(1); } @@ -36,7 +36,7 @@ await client.indexFolder({ folderPath: contentPath, ignorePatterns: ignorePatterns, watch: watchFlag, - configFilePath: configFilePath + configFilePath: configFilePath, }); if (!watchFlag) { diff --git a/src/tests/markdowndb.spec.ts b/src/tests/markdowndb.spec.ts index 3c5f31b..e388275 100644 --- a/src/tests/markdowndb.spec.ts +++ b/src/tests/markdowndb.spec.ts @@ -134,7 +134,9 @@ describe("MarkdownDB - default config", () => { }); const dbFilesPaths = dbFiles.map((f) => f.file_path); - const expectedPaths = [`${pathToContentFixture}/blog/blog1.mdx`].map(normalizePathSeparator); + const expectedPaths = [`${pathToContentFixture}/blog/blog1.mdx`].map( + normalizePathSeparator + ); expect(dbFilesPaths).toHaveLength(expectedPaths.length); dbFilesPaths.forEach((p) => { @@ -148,7 +150,9 @@ describe("MarkdownDB - default config", () => { }); const dbFilesPaths = dbFiles.map((f) => f.file_path); - const expectedPaths = [`${pathToContentFixture}/blog/blog2.mdx`].map(normalizePathSeparator); + const expectedPaths = [`${pathToContentFixture}/blog/blog2.mdx`].map( + normalizePathSeparator + ); expect(dbFilesPaths).toHaveLength(expectedPaths.length); dbFilesPaths.forEach((p) => { @@ -163,7 +167,9 @@ describe("MarkdownDB - default config", () => { extensions: ["md", "mdx"], }); const dbFilesPaths = dbFiles.map((f) => f.file_path); - const expectedPaths = [`${pathToContentFixture}/news/news1.mdx`].map(normalizePathSeparator); + const expectedPaths = [`${pathToContentFixture}/news/news1.mdx`].map( + normalizePathSeparator + ); expect(dbFilesPaths).toHaveLength(expectedPaths.length); dbFilesPaths.forEach((p) => {