wigolo
wigolo copied to clipboard
Add a crates.io search engine adapter
Same shape as the npm-registry adapter issue: crates.io exposes a public JSON search API (https://crates.io/api/v1/crates?q=..., requires a descriptive User-Agent per their crawler policy), which makes a clean, scrape-free engine adapter for the code vertical.
Where to look
- Reference adapter:
src/search/engines/mojeek.ts(theSearchEngineinterface) orsrc/search/engines/hn-algolia.ts(API-based) - Register in
src/search/core/verticals/code.ts
Acceptance
- New
src/search/engines/crates-io.ts, registered in thecodevertical - Sets a descriptive User-Agent (crates.io policy)
- Respects
timeoutMs/maxResults; unit test included npm testandnpm run lintgreen