Skip to content

Commit 654d140

Browse files
morezhoumorezhou
authored andcommitted
Merge upstream Next.js Notion starter kit updates
2 parents 8d0830e + 379c735 commit 654d140

74 files changed

Lines changed: 6585 additions & 4771 deletions

Some content is hidden

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

.eslintrc.json

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
{
22
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint", "react", "react-hooks"],
5-
"extends": [
6-
"eslint:recommended",
7-
"plugin:@typescript-eslint/recommended",
8-
"plugin:react/recommended",
9-
"plugin:react-hooks/recommended",
10-
"prettier"
11-
],
12-
"settings": {
13-
"react": {
14-
"version": "detect"
15-
}
16-
},
17-
"env": {
18-
"browser": true,
19-
"node": true
20-
},
3+
"extends": ["@fisch0920/eslint-config"],
214
"rules": {
22-
"@typescript-eslint/no-explicit-any": 0,
23-
"@typescript-eslint/no-non-null-assertion": 0,
24-
"@typescript-eslint/no-unused-vars": 2,
25-
"react/prop-types": 0
5+
"react/prop-types": "off",
6+
"unicorn/no-array-reduce": "off",
7+
"unicorn/filename-case": "off",
8+
"no-process-env": "off",
9+
"array-callback-return": "off",
10+
"jsx-a11y/click-events-have-key-events": "off",
11+
"jsx-a11y/no-static-element-interactions": "off",
12+
"jsx-a11y/media-has-caption": "off",
13+
"jsx-a11y/interactive-supports-focus": "off",
14+
"jsx-a11y/anchor-is-valid": "off",
15+
"@typescript-eslint/naming-convention": "off"
2616
}
2717
}

.github/workflows/build.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
name: Build
1+
name: CI
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
6-
Build:
6+
test:
7+
name: Test Node.js ${{ matrix.node-version }}
78
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v3
109

11-
- uses: actions/setup-node@v3
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
node-version:
14+
- 20
15+
- 22
16+
- 24
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: pnpm/action-setup@v4
21+
- uses: actions/setup-node@v4
1222
with:
13-
node-version: 16
14-
cache: yarn
23+
node-version: ${{ matrix.node-version }}
24+
cache: "pnpm"
25+
26+
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
27+
- run: pnpm test
1528

16-
- run: yarn install --frozen-lockfile
17-
- name: build
18-
# TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets
19-
# env:
20-
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
21-
# REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
22-
run: yarn build
29+
# TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets
30+
# env:
31+
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
32+
# REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
33+
# - name: Build
34+
# run: pnpm build

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ dist/
44
node_modules/
55
.next/
66
.vercel/
7-
8-
.demo/
9-
.renderer/
7+
next-env.d.ts

.prettierrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next",
99
"runtimeArgs": ["dev"],
1010
"cwd": "${workspaceFolder}",
11-
"port": 9229,
1211
"smartStep": true,
1312
"console": "integratedTerminal",
1413
"skipFiles": ["<node_internals>/**"],

components/ErrorPage.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import * as React from 'react'
2-
31
import { PageHead } from './PageHead'
42
import styles from './styles.module.css'
53

6-
export const ErrorPage: React.FC<{ statusCode: number }> = ({ statusCode }) => {
4+
export function ErrorPage({ statusCode }: { statusCode: number }) {
75
const title = 'Error'
86

97
return (

components/Footer.tsx

Lines changed: 16 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
import * as React from 'react'
22

3-
import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
4-
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
5-
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
6-
import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon'
7-
import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter'
8-
import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
9-
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
10-
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
11-
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
12-
133
import * as config from '@/lib/config'
4+
import { GitHubIcon } from '@/lib/icons/github'
5+
import { LinkedInIcon } from '@/lib/icons/linkedin'
6+
import { MoonIcon } from '@/lib/icons/moon'
7+
import { SunIcon } from '@/lib/icons/sun'
8+
import { TwitterIcon } from '@/lib/icons/twitter'
149
import { useDarkMode } from '@/lib/use-dark-mode'
1510

1611
import styles from './styles.module.css'
1712

18-
// TODO: merge the data and icons from PageSocial with the social links in Footer
19-
20-
export const FooterImpl: React.FC = () => {
13+
export function FooterImpl() {
2114
const [hasMounted, setHasMounted] = React.useState(false)
2215
const { isDarkMode, toggleDarkMode } = useDarkMode()
2316
const currentYear = new Date().getFullYear()
2417

2518
const onToggleDarkMode = React.useCallback(
26-
(e) => {
19+
(e: any) => {
2720
e.preventDefault()
2821
toggleDarkMode()
2922
},
@@ -36,7 +29,9 @@ export const FooterImpl: React.FC = () => {
3629

3730
return (
3831
<footer className={styles.footer}>
39-
<div className={styles.copyright}>Copyright {currentYear} {config.author}</div>
32+
<div className={styles.copyright}>
33+
Copyright {currentYear} {config.author}
34+
</div>
4035

4136
<div className={styles.settings}>
4237
{hasMounted && (
@@ -47,7 +42,7 @@ export const FooterImpl: React.FC = () => {
4742
onClick={onToggleDarkMode}
4843
title='Toggle dark mode'
4944
>
50-
{isDarkMode ? <IoMoonSharp /> : <IoSunnyOutline />}
45+
{isDarkMode ? <MoonIcon /> : <SunIcon />}
5146
</a>
5247
)}
5348
</div>
@@ -56,35 +51,12 @@ export const FooterImpl: React.FC = () => {
5651
{config.twitter && (
5752
<a
5853
className={styles.twitter}
59-
href={`https://twitter.com/${config.twitter}`}
60-
title={`Twitter @${config.twitter}`}
61-
target='_blank'
62-
rel='noopener noreferrer'
63-
>
64-
<FaTwitter />
65-
</a>
66-
)}
67-
68-
{config.mastodon && (
69-
<a
70-
className={styles.mastodon}
71-
href={config.mastodon}
72-
title={`Mastodon ${config.getMastodonHandle()}`}
73-
rel='me'
74-
>
75-
<FaMastodon />
76-
</a>
77-
)}
78-
79-
{config.zhihu && (
80-
<a
81-
className={styles.zhihu}
82-
href={`https://zhihu.com/people/${config.zhihu}`}
83-
title={`Zhihu @${config.zhihu}`}
54+
href={`https://x.com/${config.twitter}`}
55+
title={`X @${config.twitter}`}
8456
target='_blank'
8557
rel='noopener noreferrer'
8658
>
87-
<FaZhihu />
59+
<TwitterIcon />
8860
</a>
8961
)}
9062

@@ -96,7 +68,7 @@ export const FooterImpl: React.FC = () => {
9668
target='_blank'
9769
rel='noopener noreferrer'
9870
>
99-
<FaGithub />
71+
<GitHubIcon />
10072
</a>
10173
)}
10274

@@ -108,31 +80,7 @@ export const FooterImpl: React.FC = () => {
10880
target='_blank'
10981
rel='noopener noreferrer'
11082
>
111-
<FaLinkedin />
112-
</a>
113-
)}
114-
115-
{config.newsletter && (
116-
<a
117-
className={styles.newsletter}
118-
href={`${config.newsletter}`}
119-
title={`Newsletter ${config.author}`}
120-
target='_blank'
121-
rel='noopener noreferrer'
122-
>
123-
<FaEnvelopeOpenText />
124-
</a>
125-
)}
126-
127-
{config.youtube && (
128-
<a
129-
className={styles.youtube}
130-
href={`https://www.youtube.com/${config.youtube}`}
131-
title={`YouTube ${config.author}`}
132-
target='_blank'
133-
rel='noopener noreferrer'
134-
>
135-
<FaYoutube />
83+
<LinkedInIcon />
13684
</a>
13785
)}
13886
</div>

components/GitHubShareButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import * as React from 'react'
2-
31
import styles from './styles.module.css'
42

5-
export const GitHubShareButton: React.FC = () => {
3+
export function GitHubShareButton() {
64
return (
75
<a
86
href='https://github.com/transitive-bullshit/nextjs-notion-starter-kit'

components/Loading.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as React from 'react'
2-
31
import { LoadingIcon } from './LoadingIcon'
42
import styles from './styles.module.css'
53

6-
export const Loading: React.FC = () => (
7-
<div className={styles.container}>
8-
<LoadingIcon />
9-
</div>
10-
)
4+
export function Loading() {
5+
return (
6+
<div className={styles.container}>
7+
<LoadingIcon />
8+
</div>
9+
)
10+
}

components/LoadingIcon.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import * as React from 'react'
2-
31
import cs from 'classnames'
42

53
import styles from './styles.module.css'
64

7-
export const LoadingIcon = (props) => {
5+
export function LoadingIcon(props: any) {
86
const { className, ...rest } = props
97
return (
108
<svg

0 commit comments

Comments
 (0)