Skip to content

Commit c039a89

Browse files
feat: major refactor for maintenance
1 parent 65534d1 commit c039a89

File tree

164 files changed

+17764
-19177
lines changed

Some content is hidden

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

164 files changed

+17764
-19177
lines changed

Diff for: .eslintrc.json

+12-22
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/function-component-definition": "off",
6+
"react/prop-types": "off",
7+
"unicorn/no-array-reduce": "off",
8+
"unicorn/filename-case": "off",
9+
"no-process-env": "off",
10+
"array-callback-return": "off",
11+
"jsx-a11y/click-events-have-key-events": "off",
12+
"jsx-a11y/no-static-element-interactions": "off",
13+
"jsx-a11y/media-has-caption": "off",
14+
"jsx-a11y/interactive-supports-focus": "off",
15+
"@typescript-eslint/naming-convention": "off"
2616
}
2717
}

Diff for: .github/workflows/test.yml

+75-46
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,104 @@ on: [push, pull_request]
44

55
jobs:
66
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
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
1532

16-
- run: yarn install --frozen-lockfile
17-
- run: yarn test
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
35+
36+
- name: Run test
37+
run: pnpm test
1838

1939
build-minimal:
40+
name: Build Minimal Example ${{ matrix.node-version }}
2041
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: true
44+
matrix:
45+
node-version:
46+
- 18
47+
- 22
48+
2149
steps:
22-
- uses: actions/checkout@v3
50+
- name: Checkout
51+
uses: actions/checkout@v4
2352

24-
- uses: actions/setup-node@v3
53+
- name: Install pnpm
54+
uses: pnpm/action-setup@v3
55+
id: pnpm-install
2556
with:
26-
node-version: 16
27-
cache: yarn
57+
version: 9.12.2
58+
run_install: false
2859

29-
- run: yarn install --frozen-lockfile
30-
- run: yarn build
60+
- name: Install Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ matrix.node-version }}
64+
cache: 'pnpm'
65+
66+
- name: Install dependencies
67+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
3168

3269
- name: Build minimal example
3370
run: |
3471
cd examples/minimal
35-
yarn build
72+
pnpm build
3673
3774
build-full:
75+
name: Build Full Example ${{ matrix.node-version }}
3876
runs-on: ubuntu-latest
77+
strategy:
78+
fail-fast: true
79+
matrix:
80+
node-version:
81+
- 18
82+
- 22
83+
3984
steps:
40-
- uses: actions/checkout@v3
85+
- name: Checkout
86+
uses: actions/checkout@v4
4187

42-
- uses: actions/setup-node@v3
88+
- name: Install pnpm
89+
uses: pnpm/action-setup@v3
90+
id: pnpm-install
4391
with:
44-
node-version: 16
45-
cache: yarn
92+
version: 9.12.2
93+
run_install: false
4694

47-
- run: yarn install --frozen-lockfile
48-
- run: yarn build
95+
- name: Install Node.js
96+
uses: actions/setup-node@v4
97+
with:
98+
node-version: ${{ matrix.node-version }}
99+
cache: 'pnpm'
49100

50-
- name: Build full example
101+
- name: Install dependencies
102+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
103+
104+
- name: Build minimal example
51105
run: |
52106
cd examples/full
53-
yarn build
54-
55-
# TODO: using the official API with GitHub Actions results in too much rate
56-
# limiting and false negative build failures, so we're disabling it for now.
57-
# build-full-official-api:
58-
# runs-on: ubuntu-latest
59-
# steps:
60-
# - uses: actions/checkout@v3
61-
62-
# - uses: actions/setup-node@v3
63-
# with:
64-
# node-version: 16
65-
# cache: yarn
66-
67-
# - run: yarn install --frozen-lockfile
68-
# - run: yarn build
69-
70-
# - name: Build full example using the official Notion API
71-
72-
# env:
73-
# USE_OFFICIAL_NOTION_API: true
74-
# NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
75-
76-
# run: |
77-
# cd examples/full
78-
# yarn build
107+
pnpm build

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ yarn-error.log*
2424

2525
.next/
2626
.vercel/
27+
.turbo/
28+
.tsimp/

Diff for: .husky/pre-commit

-4
This file was deleted.

Diff for: .npmignore

-1
This file was deleted.

Diff for: .npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enable-pre-post-scripts=true
2+
package-manager-strict=false

Diff for: .prettierrc

+1-10
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
}

Diff for: examples/cra/package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
"eject": "GENERATE_SOURCEMAP=false react-scripts eject"
1010
},
1111
"dependencies": {
12-
"@types/node": "^16.11.26",
13-
"@types/react": "^17.0.43",
14-
"@types/react-dom": "^17.0.14",
15-
"notion-types": "^6.16.1",
16-
"react": "^17.0.2",
17-
"react-dom": "^17.0.2",
18-
"react-notion-x": "^6.16.1",
19-
"react-scripts": "5.0.0",
20-
"typescript": "^4.6.3"
12+
"@types/node": "^22.8.4",
13+
"@types/react": "^18.3.12",
14+
"@types/react-dom": "^18.3.1",
15+
"notion-types": "workspace:*",
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1",
18+
"react-notion-x": "workspace:*",
19+
"react-scripts": "5.0.1"
2120
},
2221
"eslintConfig": {
2322
"extends": [

Diff for: examples/full/components/LoadingIcon.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import * as React from 'react'
2-
31
import cs from 'classnames'
2+
import * as React from 'react'
43

54
import styles from './styles.module.css'
65

7-
export const LoadingIcon = (props) => {
6+
export const LoadingIcon = (props: any) => {
87
const { className, ...rest } = props
98
return (
109
<svg

Diff for: examples/full/package.json

+15-17
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@
1313
"deploy": "vercel deploy"
1414
},
1515
"dependencies": {
16-
"@notionhq/client": "^1.0.4",
17-
"classnames": "^2.3.1",
18-
"got": "^12.0.2",
19-
"lqip-modern": "^1.2.0",
20-
"next": "^12.1.0",
21-
"notion-client": "^6.16.1",
22-
"notion-compat": "^6.16.1",
23-
"notion-utils": "^6.16.1",
24-
"p-map": "^5.3.0",
25-
"p-memoize": "^6.0.1",
26-
"react": "^17.0.2",
27-
"react-dom": "^17.0.2",
28-
"react-notion-x": "^6.16.1",
16+
"@notionhq/client": "^2.2.15",
17+
"classnames": "^2.5.1",
18+
"got": "^14.4.3",
19+
"lqip-modern": "^2.1.0",
20+
"next": "^15.0.2",
21+
"notion-client": "workspace:*",
22+
"notion-compat": "workspace:*",
23+
"notion-utils": "workspace:*",
24+
"p-map": "^7.0.2",
25+
"p-memoize": "^7.1.1",
26+
"react": "^18.3.1",
27+
"react-dom": "^18.3.1",
28+
"react-notion-x": "workspace:*",
2929
"react-tweet-embed": "^2.0.0"
3030
},
3131
"devDependencies": {
32-
"@next/bundle-analyzer": "^12.1.0",
33-
"@types/node": "^16.11.2",
34-
"cross-env": "^7.0.3",
35-
"typescript": "^4.6.2"
32+
"@next/bundle-analyzer": "^15.0.2",
33+
"cross-env": "^7.0.3"
3634
}
3735
}

0 commit comments

Comments
 (0)