Skip to content

Commit

Permalink
🐵
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Oct 31, 2024
1 parent 05fb629 commit 07e0280
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 31 deletions.
9 changes: 4 additions & 5 deletions examples/minimal/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"compilerOptions": {
"target": "es2016",
"lib": ["dom", "esnext"],
"allowJs": false,
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down
1 change: 1 addition & 0 deletions packages/notion-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"build": "tsup",
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
"clean": "del build",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit",
Expand Down
1 change: 1 addition & 0 deletions packages/notion-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"build": "tsup",
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
"clean": "del build",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit",
Expand Down
1 change: 1 addition & 0 deletions packages/notion-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"build": "tsup",
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
"clean": "del build",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
Expand Down
1 change: 1 addition & 0 deletions packages/notion-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"scripts": {
"build": "tsup",
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
"clean": "del build",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit",
Expand Down
29 changes: 29 additions & 0 deletions packages/react-notion-x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,34 @@
"module": "./build/index.js",
"types": "./build/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./build/index.d.ts",
"import": "./build/index.js"
},
"./build/third-party/code": {
"types": "./build//third-party/code.d.ts",
"import": "./build//third-party/code.js"
},
"./build/third-party/collection": {
"types": "./build//third-party/collection.d.ts",
"import": "./build//third-party/collection.js"
},
"./build/third-party/equation": {
"types": "./build//third-party/equation.d.ts",
"import": "./build//third-party/equation.js"
},
"./build/third-party/modal": {
"types": "./build//third-party/modal.d.ts",
"import": "./build//third-party/modal.js"
},
"./build/third-party/pdf": {
"types": "./build//third-party/pdf.d.ts",
"import": "./build//third-party/pdf.js"
},
"./styles.css": "./src/styles.css",
"./src/styles.css": "./src/styles.css"
},
"files": [
"build",
"src/styles.css"
Expand All @@ -20,6 +48,7 @@
"scripts": {
"build": "tsup",
"watch": "tsup --watch --silent --onSuccess 'echo build successful'",
"clean": "del build",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
Expand Down
1 change: 1 addition & 0 deletions packages/react-notion-x/src/components/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export function Text({
const externalObjectInstance = recordMap.block[blockId]
?.value as ExternalObjectInstance

console.log('eoi', blockId, externalObjectInstance)
return <EOI block={externalObjectInstance} inline={true} />
}

Expand Down
2 changes: 0 additions & 2 deletions packages/react-notion-x/src/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ const defaultComponents: NotionComponents = {
Embed: DefaultEmbed
}

console.log('DefaultHeader', { DefaultHeader, Header, defaultComponents })

const defaultNotionContext: NotionContext = {
recordMap: {
block: {},
Expand Down
1 change: 0 additions & 1 deletion packages/react-notion-x/src/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export function NotionBlockRenderer({

return null
}
console.log('NotionBlockRenderer', { id, block })

return (
<Block key={id} level={level} block={block} {...props}>
Expand Down
29 changes: 8 additions & 21 deletions packages/react-notion-x/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig, type Options } from 'tsup'
import { defineConfig } from 'tsup'

const baseConfig: Options = {
export default defineConfig({
entry: [
'src/index.tsx',
'src/third-party/code.tsx',
Expand All @@ -14,22 +14,9 @@ const baseConfig: Options = {
platform: 'browser',
format: ['esm'],
splitting: false,
shims: false
}

export default defineConfig([
{
...baseConfig,
outDir: 'build/dev',
minify: false,
sourcemap: true,
dts: true
},
{
...baseConfig,
outDir: 'build',
minify: false,
sourcemap: false,
dts: true
}
])
shims: false,
dts: true,
minify: false,
sourcemap: true,
external: ['react', 'react-dom']
})
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"moduleDetection": "force",
"noEmit": true,
"target": "es2020",
"outDir": "dist",
"outDir": "build",

"allowImportingTsExtensions": false,
"allowJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": false,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"noUncheckedIndexedAccess": true,
"resolveJsonModule": true,
"skipLibCheck": true,
Expand Down

0 comments on commit 07e0280

Please sign in to comment.