Files
Jeremias Menichelli 8b4be6cdfd feat: Add search to kb (#52089)
## Problem

There's currently no search on kb.

## Solution

- Move components used in Docs' Search V2 project to a common package
for re-usage.
 - Use these components on the Search V2 on docs
 - Refactor useDocsSearchV2 to accept endpoint for other solutions
 - Connect the search with the new `kb_search` table

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

For both, the kb preview and the docs preview with the search v2
experiment active using the `?docs-search-v2=search-v2-active`:

 - Open the preview link of the project
 - On the homepage, press cmd/ctrl + k or click the search trigger
- A search panel should open, type something, for example "edge
functions" and wait for results to appear
 - Clicking a result should lead to the desired page

<img width="1173" height="832" alt="Screenshot 2026-10-22 at 13 34 43"
src="https://github.com/user-attachments/assets/1c3a3d7f-2fe3-452a-91dd-20ba7be3ef1b"
/>

_Search modal working on kb preview_

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-22 17:30:49 +02:00

46 lines
1.1 KiB
JSON

{
"name": "docs-search",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf .turbo tsconfig.tsbuildinfo",
"typecheck": "tsc --noEmit",
"test": "vitest --run"
},
"dependencies": {
"common": "workspace:*",
"fast-glob": "^3.3.3",
"lucide-react": "catalog:",
"mdast-util-to-string": "^3.1.1",
"radix-ui": "catalog:",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"remark-parse": "^11.0.0",
"ui": "workspace:*",
"unified": "^11.0.5"
},
"devDependencies": {
"@supabase/supabase-js": "catalog:",
"@types/mdast": "^3.0.0",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@typescript/native": "catalog:",
"cheerio": "^1.0.0-rc.12",
"react": "catalog:",
"react-dom": "catalog:",
"tsconfig": "workspace:*",
"typescript": "catalog:",
"vitest": "catalog:"
},
"exports": {
"./ingest": "./src/ingest.ts",
"./components": "./src/components/index.ts",
"./styles.css": "./src/styles.css"
},
"peerDependencies": {
"react": "catalog:"
}
}