Skip to content

Commit 59fa064

Browse files
authored
fix(plugin-nextra): move next/react to peerDependencies for Next 14-16 + React 18/19 (#1025)
1 parent d184b20 commit 59fa064

4 files changed

Lines changed: 315 additions & 330 deletions

File tree

packages/plugin-nextra/package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@
2424
],
2525
"scripts": {
2626
"build": "swc --delete-dir-on-start --extensions .ts,.tsx,.cts -d dist src",
27-
"lint": "eslint src --ext .js,.ts,.cts"
27+
"lint": "eslint src --ext .js,.ts,.cts",
28+
"test": "tsc --noEmit"
2829
},
2930
"dependencies": {
3031
"@orama/orama": "workspace:*",
3132
"@orama/plugin-match-highlight": "workspace:*",
32-
"classnames": "^2.5.1",
33-
"next": "^14.2.30",
34-
"react": "^18.3.1",
35-
"react-dom": "^18.3.1"
33+
"classnames": "^2.5.1"
34+
},
35+
"peerDependencies": {
36+
"next": "^14.2.30 || ^15.0.0 || ^16.0.0",
37+
"react": "^18.3.1 || ^19.0.0",
38+
"react-dom": "^18.3.1 || ^19.0.0"
3639
},
3740
"publishConfig": {
3841
"access": "public"
@@ -43,6 +46,11 @@
4346
"devDependencies": {
4447
"@swc/cli": "^0.1.59",
4548
"@swc/core": "^1.3.27",
49+
"@types/react": "^19.2.0",
50+
"@types/react-dom": "^19.2.0",
51+
"next": "^16.1.5",
52+
"react": "^19.2.0",
53+
"react-dom": "^19.2.0",
4654
"typescript": "^5.0.0"
4755
}
4856
}

packages/plugin-nextra/src/components/Result.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react'
22
import { listItem, resultText } from '../utils/classNames.js'
3-
import NextLink from 'next/link.js'
3+
import NextLink from 'next/link'
44
import { HighlightedDocument } from './HighlightedDocument.js'
55
import { Result, TypedDocument } from '@orama/orama'
66
import { NextraOrama } from '../utils/index.js'

packages/plugin-nextra/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"allowJs": true,
44
"target": "ES5",
5-
"module": "NodeNext",
5+
"module": "ESNext",
66
"outDir": "dist",
77
"jsx": "react",
88
"noImplicitAny": false,
@@ -14,7 +14,7 @@
1414
"skipLibCheck": true,
1515
"resolveJsonModule": true,
1616
"sourceMap": true,
17-
"moduleResolution": "nodenext"
17+
"moduleResolution": "bundler"
1818
},
1919
"include": ["src/*.ts", "src/**/*.ts", "src/*.tsx", "src/**/*.tsx"]
2020
}

0 commit comments

Comments
 (0)