Skip to content

Commit eac2132

Browse files
Merge pull request #641 from transitive-bullshit/feature/maintenance-fall-2024
2 parents 0e40674 + d314d88 commit eac2132

Some content is hidden

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

52 files changed

+5459
-4179
lines changed

.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: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,44 @@
1-
name: Build
1+
name: CI
22

33
on: [push, pull_request]
44

55
jobs:
6-
Build:
6+
test:
7+
name: Test Node.js ${{ matrix.node-version }}
78
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
node-version:
13+
- 18
14+
- 22
15+
816
steps:
9-
- uses: actions/checkout@v3
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v3
22+
id: pnpm-install
23+
with:
24+
version: 9.12.2
25+
run_install: false
1026

11-
- uses: actions/setup-node@v3
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
1229
with:
13-
node-version: 16
14-
cache: yarn
15-
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
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
35+
36+
- name: Run test
37+
run: pnpm test
38+
39+
# TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets
40+
# env:
41+
# REDIS_HOST: ${{ secrets.REDIS_HOST }}
42+
# REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
43+
# - name: Build
44+
# run: pnpm build

.prettierrc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,5 @@
77
"bracketSpacing": true,
88
"bracketSameLine": false,
99
"arrowParens": "always",
10-
"trailingComma": "none",
11-
"importOrder": [
12-
"^(react/(.*)$)|^(react$)|^(next/(.*)$)|^(next$)",
13-
"<THIRD_PARTY_MODULES>",
14-
"^(@/lib/(.*)$)|^(@/components/(.*)$)|^(@/styles/(.*)$)",
15-
"^[./]"
16-
],
17-
"importOrderSeparation": true,
18-
"importOrderSortSpecifiers": true,
19-
"importOrderGroupNamespaceSpecifiers": true
10+
"trailingComma": "none"
2011
}

.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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import * as React from 'react'
2-
31
import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText'
42
import { FaGithub } from '@react-icons/all-files/fa/FaGithub'
53
import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin'
@@ -9,6 +7,7 @@ import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube'
97
import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu'
108
import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp'
119
import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline'
10+
import * as React from 'react'
1211

1312
import * as config from '@/lib/config'
1413
import { useDarkMode } from '@/lib/use-dark-mode'
@@ -17,7 +16,7 @@ import styles from './styles.module.css'
1716

1817
// TODO: merge the data and icons from PageSocial with the social links in Footer
1918

20-
export const FooterImpl: React.FC = () => {
19+
export function FooterImpl() {
2120
const [hasMounted, setHasMounted] = React.useState(false)
2221
const { isDarkMode, toggleDarkMode } = useDarkMode()
2322
const currentYear = new Date().getFullYear()
@@ -36,7 +35,9 @@ export const FooterImpl: React.FC = () => {
3635

3736
return (
3837
<footer className={styles.footer}>
39-
<div className={styles.copyright}>Copyright {currentYear} {config.author}</div>
38+
<div className={styles.copyright}>
39+
Copyright {currentYear} {config.author}
40+
</div>
4041

4142
<div className={styles.settings}>
4243
{hasMounted && (

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

components/NotionPage.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import * as React from 'react'
1+
import cs from 'classnames'
22
import dynamic from 'next/dynamic'
3-
import Image from 'next/image'
3+
import Image from 'next/legacy/image'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
6-
7-
import cs from 'classnames'
8-
import { PageBlock } from 'notion-types'
6+
import { type PageBlock } from 'notion-types'
97
import { formatDate, getBlockTitle, getPageProperty } from 'notion-utils'
8+
import * as React from 'react'
109
import BodyClassName from 'react-body-classname'
1110
import { NotionRenderer } from 'react-notion-x'
1211
import TweetEmbed from 'react-tweet-embed'
1312
import { useSearchParam } from 'react-use'
1413

14+
import type * as types from '@/lib/types'
1515
import * as config from '@/lib/config'
16-
import * as types from '@/lib/types'
1716
import { mapImageUrl } from '@/lib/map-image-url'
1817
import { getCanonicalPageUrl, mapPageUrl } from '@/lib/map-page-url'
1918
import { searchNotion } from '@/lib/search-notion'
@@ -97,7 +96,7 @@ const Modal = dynamic(
9796
}
9897
)
9998

100-
const Tweet = ({ id }: { id: string }) => {
99+
function Tweet({ id }: { id: string }) {
101100
return <TweetEmbed tweetId={id} />
102101
}
103102

@@ -142,12 +141,12 @@ const propertyTextValue = (
142141
return defaultFn()
143142
}
144143

145-
export const NotionPage: React.FC<types.PageProps> = ({
144+
export function NotionPage({
146145
site,
147146
recordMap,
148147
error,
149148
pageId
150-
}) => {
149+
}: types.PageProps) {
151150
const router = useRouter()
152151
const lite = useSearchParam('lite')
153152

0 commit comments

Comments
 (0)