Skip to content

Commit 5d5f33a

Browse files
Merge pull request #571 from NotionX/feature/maintenance-fall-2024
2 parents 65534d1 + 245844b commit 5d5f33a

File tree

197 files changed

+17422
-19745
lines changed

Some content is hidden

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

197 files changed

+17422
-19745
lines changed

.eslintrc.json

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
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+
"@typescript-eslint/naming-convention": "off"
2615
}
2716
}

.github/workflows/test.yml

Lines changed: 26 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,44 @@ 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
1019

11-
- uses: actions/setup-node@v3
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v3
22+
id: pnpm-install
1223
with:
13-
node-version: 16
14-
cache: yarn
15-
16-
- run: yarn install --frozen-lockfile
17-
- run: yarn test
18-
19-
build-minimal:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v3
24+
version: 9.12.2
25+
run_install: false
2326

24-
- uses: actions/setup-node@v3
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
2529
with:
26-
node-version: 16
27-
cache: yarn
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
2832

29-
- run: yarn install --frozen-lockfile
30-
- run: yarn build
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
35+
36+
- name: Run test
37+
run: pnpm test
3138

3239
- name: Build minimal example
3340
run: |
3441
cd examples/minimal
35-
yarn build
36-
37-
build-full:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v3
41-
42-
- uses: actions/setup-node@v3
43-
with:
44-
node-version: 16
45-
cache: yarn
46-
47-
- run: yarn install --frozen-lockfile
48-
- run: yarn build
42+
pnpm build
4943
5044
- name: Build full example
5145
run: |
5246
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
47+
pnpm build

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ yarn-error.log*
2424

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

.husky/pre-commit

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

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
enable-pre-post-scripts=true
2+
package-manager-strict=false

.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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Next.js: debug server-side",
6+
"type": "node-terminal",
7+
"request": "launch",
8+
"command": "./node_modules/.bin/next dev",
9+
"cwd": "${workspaceFolder}/examples/minimal"
10+
},
11+
{
12+
"name": "Next.js: debug client-side",
13+
"type": "chrome",
14+
"request": "launch",
15+
"url": "http://localhost:3000"
16+
},
17+
{
18+
"name": "Next.js: debug full stack",
19+
"type": "node",
20+
"request": "launch",
21+
"program": "${workspaceFolder}/examples/minimal/node_modules/.bin/next",
22+
"cwd": "${workspaceFolder}/examples/minimal",
23+
"runtimeArgs": ["--inspect"],
24+
"skipFiles": ["<node_internals>/**"],
25+
"serverReadyAction": {
26+
"action": "debugWithEdge",
27+
"killOnServerStop": true,
28+
"pattern": "- Local:.+(https?://.+)",
29+
"uriFormat": "%s",
30+
"webRoot": "${workspaceFolder}/examples/minimal"
31+
}
32+
}
33+
]
34+
}

contributing.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ Suggestions and pull requests are highly encouraged. Have a look at the [open is
44

55
## Development
66

7-
To develop the project locally, you'll need a recent version of Node.js and `yarn` v1 installed globally.
7+
To develop the project locally, you'll need a recent version of Node.js and `pnpm` installed globally.
88

9-
To get started, clone the repo and run `yarn` from the root directory:
9+
To get started, clone the repo and run `pnpm` from the root directory:
1010

1111
```bash
1212
git clone https://github.com/NotionX/react-notion-x.git
1313
cd react-notion-x
14-
yarn
14+
pnpm
1515
```
1616

1717
This will install dependencies and link all of the local packages together using `lerna`. This includes the example projects which will now point to the local version of your packages.
1818

1919
```bash
20-
yarn dev
20+
pnpm dev
2121
```
2222

23-
This starts compiling the packages into their respective `build` folders. Under the hood, it is running `tsc --watch` and `tsup --watch`, so every time you make a change to one of the packages, the build will be updated automatically as long as this command is running.
23+
This starts compiling the packages into their respective `build` folders
2424

25-
With `yarn dev` running in one tab, we recommend opening a second tab and navigating to the `examples/minimal` directory.
25+
With `pnpm dev` running in one tab, we recommend opening a second tab and navigating to the `examples/minimal` directory.
2626

2727
```bash
2828
cd examples/minimal
29-
yarn dev
29+
pnpm dev
3030
```
3131

32-
Running `yarn dev` from the `examples/minimal` directory will start the example project's Next.js dev server. This project should be using your locally built version of the libraries because they have been linked using `lerna`.
32+
Running `pnpm dev` from the `examples/minimal` directory will start the example project's Next.js dev server. This project ill be using your locally built version of the libraries.
3333

3434
You should now be able to open `http://localhost:3000` to view and debug the example project.
3535

3636
### Gotchas
3737

38-
Whenever you make a change to one of the packages, the `yarn dev` from the project root will re-compile that package, and the `yarn dev` from the example project's Next.js dev server should hot-reload it in the browser.
38+
Whenever you make a change to one of the packages, the `pnpm dev` from the project root will re-compile that package, and the `pnpm dev` from the example project's Next.js dev server should hot-reload it in the browser.
3939

40-
Sometimes, this process gets a little out of whack, and if you're not sure what's going on, I usually just quit one or both of the `yarn dev` commands and restart them.
40+
Sometimes, this process gets a little out of whack, and if you're not sure what's going on, I usually just quit one or both of the `pnpm dev` commands and restart them.
4141

42-
If you're seeing something unexpected while debugging one of the Next.js demos, try running `rm -rf .next` to refresh the Next.js cache before running `yarn dev` again.
42+
If you're seeing something unexpected while debugging one of the Next.js demos, try running `rm -rf .next` to refresh the Next.js cache before running `pnpm dev` again.

examples/cra/package.json

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,20 @@
33
"version": "6.16.1",
44
"private": true,
55
"scripts": {
6-
"dev": "GENERATE_SOURCEMAP=false react-scripts start",
7-
"start": "GENERATE_SOURCEMAP=false react-scripts start",
8-
"build": "GENERATE_SOURCEMAP=false react-scripts build",
9-
"eject": "GENERATE_SOURCEMAP=false react-scripts eject"
6+
"dev": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-scripts start",
7+
"start": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-scripts start",
8+
"build": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-scripts build",
9+
"eject": "DISABLE_ESLINT_PLUGIN=true 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"
21-
},
22-
"eslintConfig": {
23-
"extends": [
24-
"react-app",
25-
"react-app/jest"
26-
]
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"
2720
},
2821
"browserslist": {
2922
"production": [

0 commit comments

Comments
 (0)