diff --git a/packages/apps/docs/.gitignore b/packages/apps/docs/.gitignore index 2c17464761..619c9769ea 100644 --- a/packages/apps/docs/.gitignore +++ b/packages/apps/docs/.gitignore @@ -1,7 +1,5 @@ # generated resources -src/data/searchIndex.json -src/data/menu.mjs -src/data/mostPopular.json +src/_generated src/pages/docs/kadena/kadenajs src/pages/docs/kadena/client src/pages/docs/pact/cli @@ -18,7 +16,5 @@ src/pages/docs/chainweb/stream-client src/pages/docs/chainweb/node-client src/pages/docs/chainweb/js-bindings - next-env.d.ts .env.local - diff --git a/packages/apps/docs/package.json b/packages/apps/docs/package.json index 83a0e06994..0757f0ca82 100644 --- a/packages/apps/docs/package.json +++ b/packages/apps/docs/package.json @@ -11,7 +11,7 @@ "build:brokenLinks": "node src/scripts/detectBrokenLinks.mjs", "build:checkForHeaders": "node src/scripts/checkForHeaders.mjs && prettier ./src/pages/docs --write", "build:createSpecJson": "node ./src/scripts/createSpec.mjs && prettier ./src/specs/**/*.json --write", - "build:createtree": "node ./src/scripts/getdocstree.mjs && prettier ./src/data/menu.mjs --write", + "build:createtree": "node ./src/scripts/getdocstree.mjs && prettier ./src/_generated/menu.mjs --write", "build:importReadMe": "node ./src/scripts/importReadme.mjs && prettier ./src/pages/docs --write", "build:next": "pnpm run build:scripts && next build", "build:scripts": "pnpm run build:importReadMe && pnpm run build:createtree && pnpm run build:createSpecJson && pnpm run build:brokenLinks && pnpm run build:checkForHeaders", diff --git a/packages/apps/docs/src/_generated/.gitkeep b/packages/apps/docs/src/_generated/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/apps/docs/src/pages/api/blog.ts b/packages/apps/docs/src/pages/api/blog.ts index 8f671dd7a4..c9d57d67c8 100644 --- a/packages/apps/docs/src/pages/api/blog.ts +++ b/packages/apps/docs/src/pages/api/blog.ts @@ -1,4 +1,4 @@ -import { menuData } from '@/data/menu.mjs'; +import { menuData } from '@/_generated/menu.mjs'; import { getInitBlogPosts } from '@/hooks/useBlog/utils'; import type { IResponseError } from '@/types'; import type { IMenuData } from '@/types/Layout'; diff --git a/packages/apps/docs/src/pages/api/semanticsearch.ts b/packages/apps/docs/src/pages/api/semanticsearch.ts index e45917ae90..3caeb4e305 100644 --- a/packages/apps/docs/src/pages/api/semanticsearch.ts +++ b/packages/apps/docs/src/pages/api/semanticsearch.ts @@ -1,4 +1,4 @@ -import { menuData } from '@/data/menu.mjs'; +import { menuData } from '@/_generated/menu.mjs'; import { IFrontmatterData } from '@/types'; import { IMenuData } from '@/types/Layout'; import type { StreamMetaData } from '@7-docs/edge'; diff --git a/packages/apps/docs/src/scripts/getdocstree.mjs b/packages/apps/docs/src/scripts/getdocstree.mjs index 33a45ac493..4b21b2f962 100644 --- a/packages/apps/docs/src/scripts/getdocstree.mjs +++ b/packages/apps/docs/src/scripts/getdocstree.mjs @@ -86,7 +86,7 @@ const findPath = (dir) => { }; const INITIALPATH = './src/pages/docs'; -const MENUFILE = './src/data/menu.mjs'; +const MENUFILE = './src/_generated/menu.mjs'; const TREE = []; const createTree = (rootDir, parent = []) => { diff --git a/packages/apps/docs/src/utils/getMostPopularPages.ts b/packages/apps/docs/src/utils/getMostPopularPages.ts index d60ce3cbd4..15a21c1ebd 100644 --- a/packages/apps/docs/src/utils/getMostPopularPages.ts +++ b/packages/apps/docs/src/utils/getMostPopularPages.ts @@ -108,7 +108,10 @@ export default async function getMostPopularPages( slug = '/', limit = 5, ): Promise { - const dataFilePath = path.join(process.cwd(), 'src/data/mostPopular.json'); + const dataFilePath = path.join( + process.cwd(), + 'src/_generated/mostPopular.json', + ); const GOOGLE_ANALYTICS_PROPERTY_ID = process.env.GOOGLE_ANALYTICS_PROPERTY_ID; const GOOGLE_APPLICATION_CREDENTIALS = diff --git a/packages/apps/docs/src/utils/staticGeneration/getData.mjs b/packages/apps/docs/src/utils/staticGeneration/getData.mjs index 2d14936117..07cf49fc13 100644 --- a/packages/apps/docs/src/utils/staticGeneration/getData.mjs +++ b/packages/apps/docs/src/utils/staticGeneration/getData.mjs @@ -1,4 +1,4 @@ -import { menuData } from './../../data/menu.mjs'; +import { menuData } from './../../_generated/menu.mjs'; export const getData = () => { const data = JSON.parse(JSON.stringify(menuData)); diff --git a/packages/apps/docs/turbo.json b/packages/apps/docs/turbo.json index d79614f82c..1263c00514 100644 --- a/packages/apps/docs/turbo.json +++ b/packages/apps/docs/turbo.json @@ -4,12 +4,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": [ - ".next/**", - "!.next/cache/**", - "./src/data/menu.mjs", - "./src/data/searchIndex.json" - ], + "outputs": [".next/**", "!.next/cache/**"], "outputMode": "new-only" } }