Skip to content

Commit a70e81c

Browse files
fix: update nextjs to fix website build (#342)
1 parent 12ce992 commit a70e81c

File tree

14 files changed

+296
-1288
lines changed

14 files changed

+296
-1288
lines changed

.github/workflows-src/website.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,20 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
3131

3232
run('yarn workspace @databases/website build');
3333

34+
run(`npm install [email protected] -g`);
35+
const netlifyDeploy = [
36+
`netlify deploy`,
37+
`--cwd .`,
38+
`--filter @databases/website`,
39+
`--dir packages/website/out`,
40+
`--site ${secrets.NETLIFY_SITE_ID}`,
41+
`--auth ${secrets.NETLIFY_AUTH_TOKEN}`,
42+
].join(' ');
3443
when(eq(github.event_name, `push`), () => {
35-
run(
36-
`netlify deploy --cwd . --filter @databases/website --prod --dir=packages/website/out`,
37-
{
38-
env: {
39-
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
40-
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
41-
},
42-
},
43-
);
44+
run(netlifyDeploy + ` --prod`);
4445
});
4546
when(neq(github.event_name, `push`), () => {
46-
run(
47-
`netlify deploy --cwd . --filter @databases/website --dir=packages/website/out`,
48-
{
49-
env: {
50-
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
51-
NETLIFY_AUTH_TOKEN: secrets.NETLIFY_AUTH_TOKEN,
52-
},
53-
},
54-
);
47+
run(netlifyDeploy);
5548
});
5649
});
5750
});

.github/workflows/website.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,12 @@ jobs:
154154
key: next-${{ hashFiles('yarn.lock') }}
155155
restore-keys: next-
156156
- run: yarn workspace @databases/website build
157+
- run: npm install [email protected] -g
157158
- if: ${{ github.event_name == 'push' }}
158-
run: netlify deploy --cwd . --filter @databases/website --prod
159-
--dir=packages/website/out
160-
env:
161-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
162-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
159+
run: netlify deploy --cwd . --filter @databases/website --dir
160+
packages/website/out --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{
161+
secrets.NETLIFY_AUTH_TOKEN }} --prod
163162
- if: ${{ github.event_name != 'push' }}
164-
run: netlify deploy --cwd . --filter @databases/website
165-
--dir=packages/website/out
166-
env:
167-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
168-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
163+
run: netlify deploy --cwd . --filter @databases/website --dir
164+
packages/website/out --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{
165+
secrets.NETLIFY_AUTH_TOKEN }}

packages/website/components/HeroUnit.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ export default function HeroUnit() {
2121
</p>
2222
<div tw="mt-5 max-w-md mx-auto sm:flex sm:justify-center md:mt-8">
2323
<div tw="rounded-md shadow">
24-
<Link href="/docs/sql">
25-
<a
26-
href="/docs/sql"
27-
tw="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-red-800 hover:bg-red-700 md:py-4 md:text-lg md:px-10"
28-
>
29-
Get started
30-
</a>
24+
<Link
25+
href="/docs/sql"
26+
tw="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-red-800 hover:bg-red-700 md:py-4 md:text-lg md:px-10"
27+
>
28+
Get started
3129
</Link>
3230
</div>
3331
</div>

packages/website/components/NavBar.tsx

Lines changed: 55 additions & 67 deletions
Large diffs are not rendered by default.

packages/website/components/Sidebar/SidebarLink.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ const SidebarLink = memo<SidebarLinkProps>(
1414
({children, id, activeDoc}) => {
1515
return (
1616
<li>
17-
<Link href={`/docs/${id}`}>
18-
<a
19-
tw="py-1 mt-1 -mb-1 block rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-300"
20-
css={[
21-
activeDoc === id && tw`text-red-800 font-semibold`,
22-
activeDoc !== id && tw`text-gray-500 hover:text-gray-700`,
23-
]}
24-
href={`/docs/${id}`}
25-
>
26-
{children}
27-
</a>
17+
<Link
18+
href={`/docs/${id}`}
19+
tw="py-1 mt-1 -mb-1 block rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-gray-300"
20+
css={[
21+
activeDoc === id && tw`text-red-800 font-semibold`,
22+
activeDoc !== id && tw`text-gray-500 hover:text-gray-700`,
23+
]}
24+
>
25+
{children}
2826
</Link>
2927
</li>
3028
);

packages/website/next-env.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

packages/website/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"mdast-util-from-markdown": "^0.8.5",
2525
"mdast-util-gfm-table": "^0.1.6",
2626
"micromark-extension-gfm-table": "^0.4.3",
27-
"next": "10.0.9",
28-
"react": "17.0.1",
29-
"react-dom": "17.0.1"
27+
"next": "13.5.2",
28+
"react": "19.1.1",
29+
"react-dom": "19.1.1"
3030
},
3131
"devDependencies": {
3232
"@emotion/babel-plugin": "^11.2.0",

packages/website/pages/blog/[year]/[month]/[day]/[id].tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ const BlogPost = ({post: doc}: Props) => {
7676
<Document document={doc.body} />
7777
</article>
7878
<div tw="flex md:justify-center mt-12 mx-4 md:mx-0">
79-
<Link href="/blog">
80-
<a
81-
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100"
82-
href="/blog"
83-
>
84-
Recent posts
85-
</a>
79+
<Link
80+
href="/blog"
81+
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100"
82+
>
83+
Recent posts
8684
</Link>
8785
</div>
8886
</div>

packages/website/pages/blog/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ const Blog = ({recentPosts}: Props) => {
3737
<Document document={post.body} />
3838

3939
<div tw="flex md:justify-center mt-12 mx-4 md:mx-0">
40-
<Link href={post.pathname}>
41-
<a
42-
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100"
43-
href={post.pathname}
44-
>
45-
Read More
46-
</a>
40+
<Link
41+
href={post.pathname}
42+
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100"
43+
>
44+
Read More
4745
</Link>
4846
</div>
4947
</article>

packages/website/pages/docs/[slug].tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,21 @@ const Post = ({nav, doc}: Props) => {
165165
</article>
166166
<div tw="flex flex-col md:flex-row mt-12 mx-4 md:mx-0">
167167
{doc.previous && (
168-
<Link href={`/docs/${doc.previous.id}`} prefetch={false}>
169-
<a
170-
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-gray-400"
171-
href={`/docs/${doc.previous.id}`}
172-
>
173-
{doc.previous.label}
174-
</a>
168+
<Link
169+
href={`/docs/${doc.previous.id}`}
170+
prefetch={false}
171+
tw="rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-gray-400"
172+
>
173+
{doc.previous.label}
175174
</Link>
176175
)}
177176
<div tw="flex-grow h-4" />
178177
{doc.next && (
179-
<Link href={`/docs/${doc.next.id}`}>
180-
<a
181-
tw="text-right rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-gray-400"
182-
href={`/docs/${doc.next.id}`}
183-
>
184-
{doc.next.label}
185-
</a>
178+
<Link
179+
href={`/docs/${doc.next.id}`}
180+
tw="text-right rounded-md px-6 py-4 border border-red-900 text-red-900 bg-white shadow-md hover:bg-red-900 hover:text-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-gray-400"
181+
>
182+
{doc.next.label}
186183
</Link>
187184
)}
188185
</div>

0 commit comments

Comments
 (0)