Skip to content

Commit

Permalink
Move generated files to their own dir (docs) (#838)
Browse files Browse the repository at this point in the history
* Move generated files to their own dir

* Keep that dir
  • Loading branch information
webpro authored Aug 31, 2023
1 parent 0ad0680 commit 7986906
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 17 deletions.
6 changes: 1 addition & 5 deletions packages/apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

2 changes: 1 addition & 1 deletion packages/apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/apps/docs/src/pages/api/blog.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/docs/src/pages/api/semanticsearch.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/docs/src/scripts/getdocstree.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []) => {
Expand Down
5 changes: 4 additions & 1 deletion packages/apps/docs/src/utils/getMostPopularPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export default async function getMostPopularPages(
slug = '/',
limit = 5,
): Promise<IMostPopularPage[]> {
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 =
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/docs/src/utils/staticGeneration/getData.mjs
Original file line number Diff line number Diff line change
@@ -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));
Expand Down
7 changes: 1 addition & 6 deletions packages/apps/docs/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down

2 comments on commit 7986906

@vercel
Copy link

@vercel vercel bot commented on 7986906 Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

alpha-docs – ./packages/apps/docs

alpha-docs-kadena-js.vercel.app
alpha-docs-git-main-kadena-js.vercel.app
alpha-docs.kadena.io
docs-silk-two.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 7986906 Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-storybook – ./packages/apps/docs

docs-storybook-git-main-kadena-js.vercel.app
docs-storybook-kadena-js.vercel.app
kadena-js-docs.vercel.app

Please sign in to comment.