Skip to content

Commit

Permalink
fix: next.js build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Nov 1, 2024
1 parent da105b1 commit d346324
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/full/lib/preview-images.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import got from 'got'
import ky from 'ky'
import lqip from 'lqip-modern'
import {
type ExtendedRecordMap,
Expand Down Expand Up @@ -34,7 +34,7 @@ export async function getPreviewImageMap(

async function createPreviewImage(url: string): Promise<PreviewImage | null> {
try {
const { body } = await got(url, { responseType: 'buffer' })
const body = await ky(url).arrayBuffer()
const result = await lqip(body)
console.log('lqip', { originalUrl: url, ...result.metadata })

Expand Down
12 changes: 6 additions & 6 deletions packages/react-notion-x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
"exports": {
".": {
"types": "./build/index.d.ts",
"import": "./build/index.js"
"default": "./build/index.js"
},
"./build/third-party/code": {
"types": "./build/third-party/code.d.ts",
"import": "./build/third-party/code.js"
"default": "./build/third-party/code.js"
},
"./build/third-party/collection": {
"types": "./build/third-party/collection.d.ts",
"import": "./build/third-party/collection.js"
"default": "./build/third-party/collection.js"
},
"./build/third-party/equation": {
"types": "./build/third-party/equation.d.ts",
"import": "./build/third-party/equation.js"
"default": "./build/third-party/equation.js"
},
"./build/third-party/modal": {
"types": "./build/third-party/modal.d.ts",
"import": "./build/third-party/modal.js"
"default": "./build/third-party/modal.js"
},
"./build/third-party/pdf": {
"types": "./build/third-party/pdf.d.ts",
"import": "./build/third-party/pdf.js"
"default": "./build/third-party/pdf.js"
},
"./styles.css": "./src/styles.css",
"./src/styles.css": "./src/styles.css"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function getCollectionGroups(
...rest: any[]
): any[] {
const elems = collectionView?.format?.collection_groups || []
return elems?.map(({ property, hidden, value: { value, type } }: any) => {
return elems.map(({ property, hidden, value: { value, type } }: any) => {
const isUncategorizedValue = value === undefined
const isDateValue = value?.range
// TODO: review dates reducers
Expand Down
5 changes: 2 additions & 3 deletions packages/react-notion-x/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'tsup'

export default defineConfig({
entry: [
'src/index.tsx',
'src/index.ts',
'src/third-party/code.tsx',
'src/third-party/collection.tsx',
'src/third-party/equation.tsx',
Expand All @@ -17,6 +17,5 @@ export default defineConfig({
shims: false,
dts: true,
minify: false,
sourcemap: true,
external: ['react', 'react-dom']
sourcemap: true
})

0 comments on commit d346324

Please sign in to comment.