mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-04 18:13:03 +00:00
Adds a floating "Ask the docs" bubble to every docs page. docsgpt-react was already a dependency but nothing imported it, so no widget rendered. The widget reads window and navigator on mount, so it is lazy-loaded with ssr: false from a client wrapper. Its light/dark theme follows the site toggle via next-themes, promoted here from a transitive dependency to a declared one. The key comes from NEXT_PUBLIC_DOCSGPT_API_KEY and the host from NEXT_PUBLIC_DOCSGPT_API_HOST. With no key set the wrapper renders nothing rather than falling through to the demo key the package defaults to. Bumping docsgpt-react to ^0.7.0 also drops a duplicate React. The old ^0.6.3 pin depended on React 18 and npm installed a nested 18.3.1 beside the app's 19.2.8, which would have thrown an invalid hook call on first render.
24 lines
557 B
JSON
24 lines
557 B
JSON
{
|
|
"scripts": {
|
|
"dev": "next dev --webpack",
|
|
"build": "next build --webpack",
|
|
"postbuild": "pagefind --site .next/server/app --output-path public/_pagefind",
|
|
"start": "next start"
|
|
},
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"@vercel/analytics": "^2.0.1",
|
|
"docsgpt-react": "^0.7.0",
|
|
"next": "^16.3.0",
|
|
"next-themes": "^0.4.6",
|
|
"nextra": "^4.6.1",
|
|
"nextra-theme-docs": "^4.6.1",
|
|
"react": "^19.2.8",
|
|
"react-dom": "^19.2.8"
|
|
},
|
|
"devDependencies": {
|
|
"pagefind": "^1.5.2",
|
|
"typescript": "^6.0.3"
|
|
}
|
|
}
|