Skip to content

Commit a4bde7c

Browse files
authored
Modules x Nextra 4 (#2527)
* more * aa * add * aa * aa * aa * aa * aa * aa * aa * more * more * more * more * more * more * more * more * adjust header * polish * Merge branch 'master' into nextra-4 # Conflicts: # yarn.lock * Merge branch 'master' into nextra-4 # Conflicts: # yarn.lock
1 parent dd2ed92 commit a4bde7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+596
-431
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
'graphql-modules': patch
33
---
4+
45
dependencies updates:
5-
- Updated dependency [`ramda@^0.30.0` ↗︎](https://www.npmjs.com/package/ramda/v/0.30.0) (from `^0.29.0`, in `dependencies`)
6+
7+
- Updated dependency [`ramda@^0.30.0` ↗︎](https://www.npmjs.com/package/ramda/v/0.30.0) (from `^0.29.0`, in `dependencies`)

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ node_modules
2424
.env
2525

2626
# Builds
27-
dist
27+
dist/
2828

2929
# IDE
30-
.idea
30+
.idea/
3131

3232
.bob
3333
tsconfig.tsbuildinfo
3434

35-
.next
35+
.next/
36+
out/

.prettierignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
website/src/pages/docs/advanced/middlewares.mdx
2-
website/src/pages/docs/advanced/subscriptions.mdx
3-
website/src/pages/docs/di/providers.mdx
4-
website/src/pages/docs/recipes/migration.mdx
5-
website/out

website/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

website/next.config.js renamed to website/next.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { withGuildDocs } from '@theguild/components/next.config';
22

33
export default withGuildDocs({
4-
redirects: () =>
4+
redirects: async () =>
55
Object.entries({
66
'/di/introduction': '/docs/di/introduction',
77
'/docs/di': '/docs/di/introduction',
@@ -27,4 +27,10 @@ export default withGuildDocs({
2727
permanent: true,
2828
})),
2929
output: 'export',
30+
env: {
31+
SITE_URL: 'https://the-guild.dev/graphql/modules',
32+
},
33+
nextraConfig: {
34+
contentDirBasePath: '/docs',
35+
},
3036
});

website/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"build": "next build && next-sitemap",
8-
"dev": "next",
7+
"build": "next build",
8+
"dev": "next --turbopack",
9+
"pagefind": "pagefind --site .next/server/app --output-path out/_pagefind",
10+
"postbuild": "next-sitemap && yarn pagefind",
911
"start": "next start",
1012
"analyze": "cross-env ANALYZE=true next build"
1113
},
1214
"dependencies": {
13-
"@theguild/components": "^7.0.0",
15+
"@theguild/components": "^9.1.2",
1416
"next": "15.1.6",
1517
"next-sitemap": "4.2.3",
1618
"react": "^19.0.0",
@@ -29,13 +31,14 @@
2931
]
3032
},
3133
"devDependencies": {
34+
"pagefind": "1.3.0",
3235
"@theguild/tailwind-config": "0.6.2",
3336
"@types/node": "22.10.7",
3437
"@types/react": "19.0.7",
3538
"cross-env": "7.0.3",
3639
"postcss-import": "16.1.0",
37-
"postcss-lightningcss": "1.0.1",
3840
"tailwindcss": "3.4.17",
41+
"postcss-lightningcss": "1.0.1",
3942
"typescript": "5.7.3"
4043
}
4144
}

website/postcss.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@theguild/tailwind-config/postcss.config';
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
export default {
22
index: {
3-
title: 'Home',
4-
type: 'page',
53
display: 'hidden',
6-
theme: {
7-
layout: 'raw',
8-
},
94
},
105
docs: {
116
title: 'Documentation',
127
type: 'page',
138
},
149
changelog: {
15-
type: 'page',
10+
theme: {
11+
toc: false,
12+
timestamp: false,
13+
sidebar: false,
14+
breadcrumb: false,
15+
},
1616
},
1717
};

website/src/app/changelog/page.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
searchable: false
3+
---
4+
5+
import fs from 'node:fs/promises'
6+
import { compileMdx, MDXRemote } from '@theguild/components/server'
7+
8+
# Changelog
9+
10+
<MDXRemote
11+
compiledSource={await compileMdx(
12+
(await fs.readFile('../packages/graphql-modules/CHANGELOG.md', 'utf8'))
13+
// Remove first line
14+
.replace(/^# .+/, '')
15+
)}
16+
/>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { NextPageProps } from '@theguild/components';
2+
import {
3+
generateStaticParamsFor,
4+
importPage,
5+
} from '@theguild/components/pages';
6+
import { Giscus } from '../../../giscus';
7+
import { useMDXComponents } from '../../../mdx-components';
8+
9+
export const generateStaticParams = generateStaticParamsFor('mdxPath');
10+
11+
export async function generateMetadata(props: NextPageProps<'...mdxPath'>) {
12+
const params = await props.params;
13+
const { metadata } = await importPage(params.mdxPath);
14+
return metadata;
15+
}
16+
17+
const Wrapper = useMDXComponents().wrapper;
18+
19+
export default async function Page(props: NextPageProps<'...mdxPath'>) {
20+
const params = await props.params;
21+
const result = await importPage(params.mdxPath);
22+
const { default: MDXContent, toc, metadata } = result;
23+
return (
24+
<Wrapper toc={toc} metadata={metadata} bottomContent={<Giscus />}>
25+
<MDXContent {...props} params={params} />
26+
</Wrapper>
27+
);
28+
}

0 commit comments

Comments
 (0)