Skip to content

Commit cbddc7d

Browse files
feat: update deps; fix issue with collection data loading sometimes
1 parent f8cdd7e commit cbddc7d

Some content is hidden

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

41 files changed

+1923
-2511
lines changed

.eslintignore

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

.eslintrc.json

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

.prettierrc

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

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { config } from '@fisch0920/config/eslint'
2+
3+
export default [
4+
...config,
5+
{
6+
ignores: ['.snapshots/', '.next/', '.vercel/', 'build/', 'docs/']
7+
},
8+
{
9+
files: ['**/*.ts', '**/*.tsx'],
10+
rules: {
11+
'react/prop-types': 'off',
12+
'unicorn/no-array-reduce': 'off',
13+
'unicorn/prefer-global-this': 'off',
14+
'unicorn/filename-case': 'off',
15+
'no-process-env': 'off',
16+
'array-callback-return': 'off',
17+
'jsx-a11y/click-events-have-key-events': 'off',
18+
'jsx-a11y/no-static-element-interactions': 'off',
19+
'jsx-a11y/media-has-caption': 'off',
20+
'jsx-a11y/interactive-supports-focus': 'off',
21+
'@typescript-eslint/naming-convention': 'off'
22+
}
23+
}
24+
]

examples/cra/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"eject": "DISABLE_ESLINT_PLUGIN=true GENERATE_SOURCEMAP=false react-scripts eject"
1010
},
1111
"dependencies": {
12-
"@types/node": "^22.13.10",
13-
"@types/react": "^19.0.11",
14-
"@types/react-dom": "^19.0.4",
12+
"@types/node": "catalog:",
13+
"@types/react": "catalog:",
14+
"@types/react-dom": "catalog:",
1515
"notion-types": "workspace:*",
16-
"react": "^19.0.0",
17-
"react-dom": "^19.0.0",
16+
"react": "catalog:",
17+
"react-dom": "catalog:",
1818
"react-notion-x": "workspace:*",
19-
"react-scripts": "5.0.1"
19+
"react-scripts": "catalog:"
2020
},
2121
"browserslist": {
2222
"production": [

examples/cra/tsconfig.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
{
2+
"extends": "@fisch0920/config/tsconfig-react",
23
"compilerOptions": {
34
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"esModuleInterop": true,
8-
"allowSyntheticDefaultImports": true,
9-
"strict": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"moduleResolution": "node",
14-
"resolveJsonModule": true,
15-
"isolatedModules": true,
16-
"noEmit": true,
17-
"jsx": "react-jsx"
5+
"jsx": "react-jsx",
6+
"moduleResolution": "node"
187
},
19-
"include": ["src"]
8+
"include": ["src"],
9+
"exclude": ["node_modules"]
2010
}

examples/full/components/NotionPage.tsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,67 @@ const Code = dynamic(() =>
1818
import('react-notion-x/build/third-party/code').then(async (m) => {
1919
// additional prism syntaxes
2020
await Promise.all([
21+
// @ts-expect-error ignore no prisma types
2122
import('prismjs/components/prism-markup-templating.js'),
23+
// @ts-expect-error ignore no prisma types
2224
import('prismjs/components/prism-markup.js'),
25+
// @ts-expect-error ignore no prisma types
2326
import('prismjs/components/prism-bash.js'),
27+
// @ts-expect-error ignore no prisma types
2428
import('prismjs/components/prism-c.js'),
29+
// @ts-expect-error ignore no prisma types
2530
import('prismjs/components/prism-cpp.js'),
31+
// @ts-expect-error ignore no prisma types
2632
import('prismjs/components/prism-csharp.js'),
33+
// @ts-expect-error ignore no prisma types
2734
import('prismjs/components/prism-docker.js'),
35+
// @ts-expect-error ignore no prisma types
2836
import('prismjs/components/prism-java.js'),
37+
// @ts-expect-error ignore no prisma types
2938
import('prismjs/components/prism-js-templates.js'),
39+
// @ts-expect-error ignore no prisma types
3040
import('prismjs/components/prism-coffeescript.js'),
41+
// @ts-expect-error ignore no prisma types
3142
import('prismjs/components/prism-diff.js'),
43+
// @ts-expect-error ignore no prisma types
3244
import('prismjs/components/prism-git.js'),
45+
// @ts-expect-error ignore no prisma types
3346
import('prismjs/components/prism-go.js'),
47+
// @ts-expect-error ignore no prisma types
3448
import('prismjs/components/prism-graphql.js'),
49+
// @ts-expect-error ignore no prisma types
3550
import('prismjs/components/prism-handlebars.js'),
51+
// @ts-expect-error ignore no prisma types
3652
import('prismjs/components/prism-less.js'),
53+
// @ts-expect-error ignore no prisma types
3754
import('prismjs/components/prism-makefile.js'),
55+
// @ts-expect-error ignore no prisma types
3856
import('prismjs/components/prism-markdown.js'),
57+
// @ts-expect-error ignore no prisma types
3958
import('prismjs/components/prism-objectivec.js'),
59+
// @ts-expect-error ignore no prisma types
4060
import('prismjs/components/prism-ocaml.js'),
61+
// @ts-expect-error ignore no prisma types
4162
import('prismjs/components/prism-python.js'),
63+
// @ts-expect-error ignore no prisma types
4264
import('prismjs/components/prism-reason.js'),
65+
// @ts-expect-error ignore no prisma types
4366
import('prismjs/components/prism-rust.js'),
67+
// @ts-expect-error ignore no prisma types
4468
import('prismjs/components/prism-sass.js'),
69+
// @ts-expect-error ignore no prisma types
4570
import('prismjs/components/prism-scss.js'),
71+
// @ts-expect-error ignore no prisma types
4672
import('prismjs/components/prism-solidity.js'),
73+
// @ts-expect-error ignore no prisma types
4774
import('prismjs/components/prism-sql.js'),
75+
// @ts-expect-error ignore no prisma types
4876
import('prismjs/components/prism-stylus.js'),
77+
// @ts-expect-error ignore no prisma types
4978
import('prismjs/components/prism-swift.js'),
79+
// @ts-expect-error ignore no prisma types
5080
import('prismjs/components/prism-wasm.js'),
81+
// @ts-expect-error ignore no prisma types
5182
import('prismjs/components/prism-yaml.js')
5283
])
5384
return m.Code
@@ -99,12 +130,12 @@ export function NotionPage({
99130
return null
100131
}
101132

102-
const title = getPageTitle(recordMap)
133+
const title = getPageTitle(recordMap) ?? ''
103134

104135
// useful for debugging from the dev console
105136
if (typeof window !== 'undefined') {
106137
const keys = Object.keys(recordMap?.block || {})
107-
const block = recordMap?.block?.[keys[0]]?.value
138+
const block = recordMap?.block?.[keys[0]!]?.value
108139
const g = window as any
109140
g.recordMap = recordMap
110141
g.block = block

examples/full/lib/config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export const previewImagesEnabled = true
1414
// and is currently not as well-supported.
1515
// If you want to use the official API, you must provide a NOTION_TOKEN env var.
1616
export const useOfficialNotionAPI =
17-
false ||
18-
(process.env.USE_OFFICIAL_NOTION_API === 'true' && process.env.NOTION_TOKEN)
17+
process.env.USE_OFFICIAL_NOTION_API === 'true' && !!process.env.NOTION_TOKEN
1918

2019
export const isDev =
2120
process.env.NODE_ENV === 'development' || !process.env.NODE_ENV

examples/full/package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@
1212
"test:lint": "eslint ."
1313
},
1414
"dependencies": {
15-
"@notionhq/client": "^2.3.0",
16-
"classnames": "^2.5.1",
17-
"ky": "^1.7.5",
18-
"lqip-modern": "^2.1.0",
19-
"next": "^15.2.3",
15+
"@notionhq/client": "catalog:",
16+
"classnames": "catalog:",
17+
"ky": "catalog:",
18+
"lqip-modern": "catalog:",
19+
"next": "catalog:",
2020
"notion-client": "workspace:*",
2121
"notion-compat": "workspace:*",
2222
"notion-types": "workspace:*",
2323
"notion-utils": "workspace:*",
24-
"p-map": "^7.0.3",
25-
"p-memoize": "^7.1.1",
26-
"prismjs": "^1.30.0",
27-
"react": "^19.0.0",
28-
"react-dom": "^19.0.0",
24+
"p-map": "catalog:",
25+
"p-memoize": "catalog:",
26+
"prismjs": "catalog:",
27+
"react": "catalog:",
28+
"react-dom": "catalog:",
2929
"react-notion-x": "workspace:*",
30-
"react-tweet-embed": "^2.0.0"
30+
"react-tweet-embed": "catalog:"
3131
},
3232
"devDependencies": {
33-
"cross-env": "^7.0.3"
33+
"@types/prismjs": "catalog:",
34+
"cross-env": "catalog:"
3435
}
3536
}

examples/full/tsconfig.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
{
2+
"extends": "@fisch0920/config/tsconfig-react",
23
"compilerOptions": {
3-
"target": "ES2017",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"strict": false,
8-
"forceConsistentCasingInFileNames": true,
9-
"noEmit": true,
10-
"esModuleInterop": true,
11-
"module": "esnext",
12-
"moduleResolution": "bundler",
13-
"resolveJsonModule": true,
14-
"isolatedModules": true,
15-
"jsx": "preserve",
16-
"incremental": true
4+
"target": "ES2017"
175
},
18-
"exclude": ["node_modules"],
19-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
6+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
7+
"exclude": ["node_modules"]
208
}

0 commit comments

Comments
 (0)