Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL-Codegen x Nextra 3 #9704

Merged
merged 8 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions website/next-sitemap.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
module.exports = {
siteUrl: process.env.SITE_URL || 'https://the-guild.dev/graphql/codegen',
generateIndexSitemap: false,
exclude: ['*/_meta'],
};
8 changes: 4 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
"@graphql-codegen/client-preset": "4.1.0",
"@mendable/search": "0.0.155",
"@monaco-editor/react": "4.5.2",
"@theguild/components": "5.2.1",
"@theguild/components": "^6.0.1",
"classnames": "2.3.2",
"date-fns": "2.29.3",
"dedent": "0.7.0",
"graphql": "16.8.0",
"js-yaml": "4.1.0",
"next": "13.4.2",
"next": "^13.5.4",
"next-mdx-remote": "4.4.1",
"next-sitemap": "4.2.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "8.0.7",
"react-select": "5.7.4",
"typescript-json-schema": "0.56.0"
Expand Down
8 changes: 4 additions & 4 deletions website/src/components/plugin.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ReactElement } from 'react';
import { useSSG, Tab, Tabs, Callout } from '@theguild/components';
import { useData, Tabs, Callout } from '@theguild/components';
import { MDXRemote } from 'next-mdx-remote';

export function PluginHeader(): ReactElement {
// Get the data from SSG, and render it as a component.
const { compiledHeader } = useSSG();
return <MDXRemote compiledSource={compiledHeader} components={{ $Tab: Tab, $Tabs: Tabs, Callout }} />;
const { compiledHeader } = useData();
return <MDXRemote compiledSource={compiledHeader} components={{ $Tabs: Tabs, Callout }} />;
}

export const PluginApiDocs = (): ReactElement => {
// Get the data from SSG, and render it as a component.
const { compiledSource } = useSSG();
const { compiledSource } = useData();
return <MDXRemote compiledSource={compiledSource} />;
};
8 changes: 3 additions & 5 deletions website/src/components/plugins-page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { fetchPackageInfo, MarketplaceSearch, useSSG } from '@theguild/components';
import { fetchPackageInfo, MarketplaceSearch, useData } from '@theguild/components';
import { compareDesc } from 'date-fns';
import { CategoryToPackages } from '@/category-to-packages.mjs';
import { ALL_TAGS, Icon, icons, PACKAGES } from '@/lib/plugins';
Expand Down Expand Up @@ -39,16 +39,14 @@ export const getStaticProps = async () => {
return {
props: {
// We add an `ssg` field to the page props,
// which will be provided to the Nextra's `useSSG` hook.
// which will be provided to the Nextra's `useData` hook.
ssg: plugins,
},
// Revalidate at most once every 1 hour
revalidate: 60 * 60,
};
};

export function PluginsPage() {
const plugins = useSSG() as Plugin[];
const plugins = useData() as Plugin[];

const marketplaceItems = useMemo(
() =>
Expand Down
5 changes: 0 additions & 5 deletions website/src/pages/_app.mdx

This file was deleted.

6 changes: 6 additions & 0 deletions website/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@theguild/components/style.css';
import { AppProps } from 'next/app';

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
}
21 changes: 0 additions & 21 deletions website/src/pages/_meta.json

This file was deleted.

21 changes: 21 additions & 0 deletions website/src/pages/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default {
index: {
title: 'Home',
type: 'page',
display: 'hidden',
theme: {
layout: 'raw',
},
},
docs: {
title: 'Docs',
type: 'page',
},
plugins: {
title: 'Plugins',
type: 'page',
theme: {
layout: 'raw',
},
},
};
9 changes: 0 additions & 9 deletions website/src/pages/docs/_meta.json

This file was deleted.

9 changes: 9 additions & 0 deletions website/src/pages/docs/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default {
'getting-started': 'Getting Started',
guides: 'Guides',
'config-reference': 'Config Reference',
advanced: 'Advanced Usage',
integrations: 'Integrations',
'custom-codegen': 'Writing Plugins',
migration: 'Migration Guides',
};
7 changes: 0 additions & 7 deletions website/src/pages/docs/advanced/_meta.json

This file was deleted.

7 changes: 7 additions & 0 deletions website/src/pages/docs/advanced/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
'generated-files-colocation': 'Generated files colocation',
'programmatic-usage': 'Programmatic Usage',
'how-does-it-work': 'How does it work?',
profiler: 'Profiler',
'document-transform': 'Document Transform',
};
10 changes: 0 additions & 10 deletions website/src/pages/docs/config-reference/_meta.json

This file was deleted.

10 changes: 10 additions & 0 deletions website/src/pages/docs/config-reference/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
'codegen-config': 'codegen.ts',
'schema-field': 'schema field',
'documents-field': 'documents field',
'config-field': 'plugin config',
'require-field': 'require field',
'naming-convention': 'Naming Convention',
'lifecycle-hooks': 'Lifecycle Hooks',
'multiproject-config': 'Multi Project',
};
8 changes: 0 additions & 8 deletions website/src/pages/docs/custom-codegen/_meta.json

This file was deleted.

8 changes: 8 additions & 0 deletions website/src/pages/docs/custom-codegen/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
index: 'What are Plugins?',
'plugin-structure': 'Plugin structure',
'validate-configuration': 'Validate Configuration',
'extend-schema': 'Extend Schema',
'using-visitor': 'Using Visitor Pattern',
contributing: 'Contributing',
};
6 changes: 0 additions & 6 deletions website/src/pages/docs/getting-started/_meta.json

This file was deleted.

6 changes: 6 additions & 0 deletions website/src/pages/docs/getting-started/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
index: 'Introduction',
installation: 'Installation',
'development-workflow': 'Development workflow',
'esm-typescript-usage': 'ESM TypeScript usage',
};
Loading
Loading