Skip to content

Commit 514495f

Browse files
committed
Try again
1 parent 7f7eb27 commit 514495f

File tree

3 files changed

+43
-38
lines changed

3 files changed

+43
-38
lines changed

website/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import './.next/types/routes.d.ts';
44

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

website/next.config.ts

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
1+
import type { NextConfig } from 'next';
12
import { withGuildDocs } from '@theguild/components/next.config';
23

3-
const config = withGuildDocs({
4-
redirects: async () =>
5-
Object.entries({
6-
'/docs/quick-start': '/docs',
7-
'/tutorial': '/tutorial/basic',
8-
'/tutorial/basic/00-introduction': '/tutorial/basic',
9-
'/docs/testing': '/docs/features/testing',
10-
'/docs/integrations': '/docs',
11-
'/docs/features': '/docs',
12-
'/v2/features/health-check': '/v2',
13-
'/v2/features/defer-stream': '/v2',
14-
'/v2/features/automatic-persisted-queries': '/v2',
15-
'/v2/features/response-caching': '/v2',
16-
'/v2/features/introspection': '/v2',
17-
'/v2/features/persisted-operations': '/v2',
18-
'/features/graphiql': '/docs/features/graphiql',
19-
'/examples/graphql-ws': '/docs/features/subscriptions',
20-
'/changelog': '/changelogs/graphql-yoga',
21-
}).map(([from, to]) => ({
22-
source: from,
23-
destination: to,
24-
permanent: true,
25-
})),
26-
eslint: {
27-
ignoreDuringBuilds: true,
28-
},
29-
env: {
30-
SITE_URL: 'https://the-guild.dev/graphql/yoga-server',
31-
},
32-
output: 'export',
33-
});
4+
let config: NextConfig;
345

35-
if (config.experimental?.turbo) {
36-
// TODO: Migrate this in @theguild/components
37-
config.turbopack = config.experimental!.turbo;
38-
delete config.experimental!.turbo;
6+
try {
7+
config = withGuildDocs({
8+
redirects: async () =>
9+
Object.entries({
10+
'/docs/quick-start': '/docs',
11+
'/tutorial': '/tutorial/basic',
12+
'/tutorial/basic/00-introduction': '/tutorial/basic',
13+
'/docs/testing': '/docs/features/testing',
14+
'/docs/integrations': '/docs',
15+
'/docs/features': '/docs',
16+
'/v2/features/health-check': '/v2',
17+
'/v2/features/defer-stream': '/v2',
18+
'/v2/features/automatic-persisted-queries': '/v2',
19+
'/v2/features/response-caching': '/v2',
20+
'/v2/features/introspection': '/v2',
21+
'/v2/features/persisted-operations': '/v2',
22+
'/features/graphiql': '/docs/features/graphiql',
23+
'/examples/graphql-ws': '/docs/features/subscriptions',
24+
'/changelog': '/changelogs/graphql-yoga',
25+
}).map(([from, to]) => ({
26+
source: from,
27+
destination: to,
28+
permanent: true,
29+
})),
30+
env: {
31+
SITE_URL: 'https://the-guild.dev/graphql/yoga-server',
32+
},
33+
output: 'export',
34+
});
35+
} catch (e) {
36+
console.error('Error configuring Next.js:', e);
37+
process.exit(1);
3938
}
4039

4140
export default config;

website/tsconfig.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212
"moduleResolution": "bundler",
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,
15-
"jsx": "preserve",
15+
"jsx": "react-jsx",
1616
"incremental": true,
1717
"plugins": [
1818
{
1919
"name": "next"
2020
}
2121
]
2222
},
23-
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts"],
23+
"include": [
24+
"**/*.ts",
25+
"**/*.tsx",
26+
"next-env.d.ts",
27+
".next/types/**/*.ts",
28+
".next/dev/types/**/*.ts"
29+
],
2430
"exclude": ["node_modules"]
2531
}

0 commit comments

Comments
 (0)