@meeovi/search 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
# 📦 `@meeovi/search` — README.md
|
|
5
|
+
|
|
6
|
+
```md
|
|
7
|
+
# @meeovi/search
|
|
8
|
+
|
|
9
|
+
A backend‑agnostic search abstraction for Meeovi.
|
|
10
|
+
Supports Searchkit, Meilisearch, Typesense, Algolia, and custom search engines.
|
|
11
|
+
|
|
12
|
+
## ✨ Features
|
|
13
|
+
|
|
14
|
+
- Unified `useSearch()` composable
|
|
15
|
+
- Pluggable search providers
|
|
16
|
+
- Runtime configuration
|
|
17
|
+
- Works with any search backend
|
|
18
|
+
|
|
19
|
+
## 📦 Installation
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install @meeovi/search
|
|
23
|
+
|
|
24
|
+
⚙️ Configuration
|
|
25
|
+
|
|
26
|
+
import { setSearchConfig } from '@meeovi/search'
|
|
27
|
+
|
|
28
|
+
setSearchConfig({
|
|
29
|
+
searchProvider: 'searchkit',
|
|
30
|
+
searchUrl: 'https://api.meeovi.com/search'
|
|
31
|
+
})
|
|
32
|
+
🧩 Usage
|
|
33
|
+
|
|
34
|
+
import { useSearch } from '@meeovi/search'
|
|
35
|
+
|
|
36
|
+
const { query, fetch } = useSearch()
|
|
37
|
+
|
|
38
|
+
const results = await fetch(query('laptops'))
|
|
39
|
+
🔌 Providers
|
|
40
|
+
|
|
41
|
+
export interface SearchProvider {
|
|
42
|
+
query(input: string): any
|
|
43
|
+
fetch(query: any): Promise<any>
|
|
44
|
+
}
|
|
45
|
+
Register:
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
registerSearchProvider('searchkit', { query, fetch })
|
|
49
|
+
🧱 Folder Structure
|
|
50
|
+
Code
|
|
51
|
+
src/
|
|
52
|
+
providers/
|
|
53
|
+
config.
|
|
54
|
+
registry.
|
|
55
|
+
useSearch.
|
package/package.json
CHANGED