Skip to content

Commit 1388c49

Browse files
committed
chore(fork): restore Typesense package identity
1 parent 8c1bf3f commit 1388c49

22 files changed

Lines changed: 174 additions & 326 deletions

File tree

README.md

Lines changed: 13 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,25 @@
1-
<div align="center">
1+
# Typesense DocSearch.js
22

3-
[![DocSearch](.github/logo.svg)](https://docsearch.algolia.com)
3+
This is a fork of Algolia's awesome [DocSearch.js](https://github.com/algolia/docsearch) library, customized to send queries to [Typesense](https://typesense.org).
44

5-
The easiest way to add search to your documentation – for free.
5+
To be able to use this, you'd first need to setup and run the [Typesense DocSearch Scraper](https://github.com/typesense/typesense-docsearch-scraper).
66

7-
[![Netlify Status](https://api.netlify.com/api/v1/badges/30eacc09-d4b2-4a53-879b-04d40aaea454/deploy-status)](https://app.netlify.com/sites/docsearch/deploys) [![npm version](https://img.shields.io/npm/v/@docsearch/js.svg?style=flat-square)](https://www.npmjs.com/package/@docsearch/js/v/alpha) [![Used by](https://img.shields.io/endpoint?style=flat-square&url=https://api.usedby.dev/npm/@docsearch/js/shield.json)](https://github.com/algolia/docsearch/network/dependents) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](./LICENSE)
7+
#### What is Typesense?
88

9-
<p align="center">
10-
<strong>
11-
<a href="https://docsearch.algolia.com">Documentation</a> •
12-
<a href="https://codesandbox.io/s/docsearchjs-v3-playground-z9oxj">JavaScript Playground</a> •
13-
<a href="https://codesandbox.io/s/docsearch-react-v3-playground-619yg">React Playground</a>
14-
</strong>
15-
</p>
9+
If you're new to Typesense, it is an **open source** search engine that is simple to use, run and scale, with clean APIs and documentation.
1610

17-
</div>
18-
19-
---
20-
21-
DocSearch crawls your documentation, pushes the content to an Algolia index and provides a dropdown search experience on your website.
22-
23-
## Preview
24-
25-
![Ask AI demo](packages/website/static/img/resources/askai_demo.gif)
11+
Think of it as an open source alternative to Algolia and an easier-to-use, batteries-included alternative to ElasticSearch. Get a quick overview from [this guide](https://typesense.org/guide/).
2612

2713
## Usage
2814

29-
> Don't have your Algolia credentials yet? [Apply to DocSearch](https://docsearch.algolia.com/apply)!
30-
31-
### JavaScript
32-
33-
#### Installation
34-
35-
```sh
36-
yarn add @docsearch/js@4
37-
# or
38-
npm install @docsearch/js@4
39-
```
40-
41-
If you don’t want to use a package manager, you can use a standalone endpoint:
42-
43-
```html
44-
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@4"></script>
45-
```
46-
47-
#### Get started
48-
49-
To get started, you need a [`container`](https://docsearch.algolia.com/docs/api#container) for your DocSearch component to go in. If you don’t have one already, you can insert one into your markup:
50-
51-
```html
52-
<div id="docsearch"></div>
53-
```
54-
55-
Then, insert DocSearch into it by calling the [`docsearch`](https://docsearch.algolia.com/docs/api) function and providing the container. It can be a [CSS selector](https://developer.mozilla.org/en-us/docs/web/css/css_selectors) or an [Element](https://developer.mozilla.org/en-us/docs/web/api/htmlelement).
56-
57-
Make sure to provide a [`container`](https://docsearch.algolia.com/docs/api#container) (for example, a `div`), not an `input`. DocSearch generates a fully accessible search box for you.
58-
59-
```js app.js
60-
import docsearch from '@docsearch/js';
61-
62-
import '@docsearch/css';
63-
64-
docsearch({
65-
container: '#docsearch',
66-
appId: 'YOUR_APP_ID',
67-
indexName: 'YOUR_INDEX_NAME',
68-
apiKey: 'YOUR_SEARCH_API_KEY',
69-
});
70-
```
71-
72-
### React
73-
74-
#### Installation
75-
76-
```bash
77-
yarn add @docsearch/react@4
78-
# or
79-
npm install @docsearch/react@4
80-
```
81-
82-
If you don’t want to use a package manager, you can use a standalone endpoint:
83-
84-
```html
85-
<script src="https://cdn.jsdelivr.net/npm/@docsearch/react@4"></script>
86-
```
87-
88-
#### Get started
89-
90-
DocSearch generates a fully accessible search box for you.
91-
92-
```jsx App.js
93-
import { DocSearch } from '@docsearch/react';
94-
95-
import '@docsearch/css';
96-
97-
function App() {
98-
return (
99-
<DocSearch
100-
appId="YOUR_APP_ID"
101-
apiKey="YOUR_SEARCH_API_KEY"
102-
indices=["YOUR_ALGOLIA_INDEX"]
103-
/>
104-
);
105-
}
106-
107-
export default App;
108-
```
109-
110-
## Styling
111-
112-
[Read documentation →](https://docsearch.algolia.com/docs/styling)
113-
114-
## Related projects
115-
116-
DocSearch is made of the following repositories:
117-
118-
- **[algolia/docsearch](https://github.com/algolia/docsearch)**: DocSearch source code.
119-
- **[algolia/docsearch/packages/website](https://github.com/algolia/docsearch/tree/main/packages/website)**: DocSearch website and documentation.
120-
- **[algolia/docsearch-configs](https://github.com/algolia/docsearch-configs)**: DocSearch websites configurations that DocSearch powers.
121-
- **[algolia/docsearch-scraper](https://github.com/algolia/docsearch-scraper)**: DocSearch crawler that extracts data from your documentation.
122-
123-
## Used by
15+
Read detailed step-by-step instructions on how to configure and setup this version of DocSearch.js on Typesense's dedicated documentation site: https://typesense.org/docs/latest/guide/docsearch.html.
12416

125-
DocSearch is used by [Bootstrap](https://github.com/twbs/bootstrap), [Cheerio](https://github.com/cheeriojs/cheerio), [Element Plus](https://github.com/element-plus/element-plus), [Authelia](https://github.com/authelia/authelia), [MDX](https://github.com/mdx-js/mdx), [VitePress](https://github.com/vuejs/vitepress) and [many more](https://github.com/algolia/docsearch/network/dependents).
17+
## Packages
12618

127-
[![Used by](https://api.usedby.dev/npm/@docsearch/js?max=50&sort=stars)](https://github.com/algolia/docsearch/network/dependents)
128-
Generated with [usedby.dev](https://usedby.dev/)
19+
- `typesense-docsearch.js`
20+
- `typesense-docsearch-react`
21+
- `typesense-docsearch-css`
12922

130-
## License
23+
## Help
13124

132-
[MIT](LICENSE)
25+
If you have any questions or run into any problems, please create a Github issue and we'll try our best to help.

adapters/docusaurus-theme-search-algolia/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# `@docsearch/docusaurus-adapter`
1+
# `typesense-docsearch-docusaurus-adapter`
22

3-
Algolia search component for Docusaurus.
3+
Typesense DocSearch component for Docusaurus.
44

55
## Usage
66

adapters/docusaurus-theme-search-algolia/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@docsearch/docusaurus-adapter",
2+
"name": "typesense-docsearch-docusaurus-adapter",
33
"version": "4.6.0",
4-
"description": "Algolia search component for Docusaurus.",
4+
"description": "Typesense DocSearch component for Docusaurus.",
55
"main": "lib/index.js",
66
"sideEffects": [
77
"*.css"
@@ -22,7 +22,7 @@
2222
},
2323
"repository": {
2424
"type": "git",
25-
"url": "https://github.com/algolia/docsearch.git",
25+
"url": "https://github.com/typesense/typesense-docsearch.js.git",
2626
"directory": "adapters/docusaurus-theme-search-algolia"
2727
},
2828
"license": "MIT",
@@ -35,7 +35,7 @@
3535
"copy:watch": "node ./scripts/copy-assets.mjs --watch"
3636
},
3737
"dependencies": {
38-
"@docsearch/react": "4.6.0",
38+
"typesense-docsearch-react": "4.6.0",
3939
"@docusaurus/core": "^3.9.2",
4040
"@docusaurus/plugin-content-docs": "^3.9.2",
4141
"@docusaurus/theme-common": "^3.9.2",

examples/demo-js/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@docsearch/css": "4.6.0",
14-
"@docsearch/js": "4.6.0",
15-
"@docsearch/sidepanel-js": "4.6.0"
13+
"typesense-docsearch-css": "4.6.0",
14+
"typesense-docsearch.js": "4.6.0",
15+
"typesense-docsearch-sidepanel-js": "4.6.0"
1616
},
1717
"devDependencies": {
1818
"vite": "^6.0.7"

examples/demo-react/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@docsearch/core": "workspace:*",
15-
"@docsearch/css": "workspace:*",
16-
"@docsearch/modal": "workspace:*",
17-
"@docsearch/react": "workspace:*",
18-
"@docsearch/sidepanel": "workspace:*",
14+
"typesense-docsearch-core": "workspace:*",
15+
"typesense-docsearch-css": "workspace:*",
16+
"typesense-docsearch-modal": "workspace:*",
17+
"typesense-docsearch-react": "workspace:*",
18+
"typesense-docsearch-sidepanel": "workspace:*",
1919
"react": "^19.0.0",
2020
"react-dom": "^19.0.0"
2121
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"cy:run:chrome": "yarn run cy:run --browser chrome",
1616
"cy:run:edge": "yarn run cy:run --browser edge",
1717
"cy:run:firefox": "yarn run cy:run --browser firefox",
18-
"cy:run": "start-server-and-test 'yarn workspace @docsearch/docusaurus-adapter build && yarn website:test' http://localhost:3000 'cypress run --headless'",
18+
"cy:run": "start-server-and-test 'yarn workspace typesense-docsearch-docusaurus-adapter build && yarn website:test' http://localhost:3000 'cypress run --headless'",
1919
"cy:verify": "cypress verify",
2020
"lint:css": "stylelint **/src/**/*.css",
2121
"lint": "eslint .",

packages/docsearch-core/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# @docsearch/core
1+
# typesense-docsearch-core
22

3-
Core logic and state package for [DocSearch](http://docsearch.algolia.com/), the best search experience for docs.
3+
Core logic and state package for the Typesense DocSearch fork.

packages/docsearch-core/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@docsearch/core",
3-
"description": "Core package logic for DocSearch",
2+
"name": "typesense-docsearch-core",
3+
"description": "Core package logic for the Typesense DocSearch fork",
44
"version": "4.6.0",
55
"license": "MIT",
66
"type": "module",
7-
"homepage": "https://docsearch.algolia.com",
7+
"homepage": "https://typesense.org/docs/latest/guide/docsearch.html",
88
"repository": {
99
"type": "git",
10-
"url": "git+https://github.com/algolia/docsearch.git",
10+
"url": "git+https://github.com/typesense/typesense-docsearch.js.git",
1111
"directory": "packages/docsearch-core"
1212
},
1313
"author": {

packages/docsearch-css/README.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
# @docsearch/css
1+
# Typesense DocSearch Styles
22

3-
Style package for [DocSearch](http://docsearch.algolia.com/), the best search experience for docs.
3+
This is a fork of Algolia's awesome [DocSearch.js](https://github.com/algolia/docsearch) library, customized to send queries to [Typesense](https://typesense.org).
44

5-
## Installation
5+
This repo contains styles.
66

7-
```bash
8-
yarn add @docsearch/css@4
9-
# or
10-
npm install @docsearch/css@4
11-
```
7+
To be able to use this, you'd first need to setup and run the [Typesense DocSearch Scraper](https://github.com/typesense/typesense-docsearch-scraper).
128

13-
If you don’t want to use a package manager, you can use a standalone endpoint:
9+
#### What is Typesense?
1410

15-
```html
16-
<script src="https://cdn.jsdelivr.net/npm/@docsearch/css@4"></script>
17-
```
11+
If you're new to Typesense, it is an **open source** search engine that is simple to use, run and scale, with clean APIs and documentation.
1812

19-
## Get started
13+
Think of it as an open source alternative to Algolia and an easier-to-use, batteries-included alternative to ElasticSearch. Get a quick overview from [this guide](https://typesense.org/guide/).
2014

21-
```js
22-
import '@docsearch/css';
23-
```
15+
## Usage
2416

25-
## Documentation
17+
Read detailed step-by-step instructions on how to configure and setup this version of DocSearch.js on Typesense's dedicated documentation site: https://typesense.org/docs/latest/guide/docsearch.html.
2618

27-
[Read documentation →](https://docsearch.algolia.com/docs/styling)
19+
## Help
20+
21+
If you have any questions or run into any problems, please create a Github issue and we'll try our best to help.

packages/docsearch-css/package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{
2-
"name": "@docsearch/css",
3-
"description": "Styles for DocSearch.",
2+
"name": "typesense-docsearch-css",
3+
"description": "Styles for DocSearch, customized for Typesense",
44
"version": "4.6.0",
55
"license": "MIT",
6-
"homepage": "https://docsearch.algolia.com",
7-
"repository": {
8-
"type": "git",
9-
"url": "git+https://github.com/algolia/docsearch.git",
10-
"directory": "packages/docsearch-css"
11-
},
12-
"author": {
13-
"name": "Algolia, Inc.",
14-
"url": "https://www.algolia.com"
15-
},
6+
"homepage": "https://typesense.org/docs/latest/guide/docsearch.html",
7+
"repository": "typesense/docsearch.js",
8+
"contributors": [
9+
{
10+
"name": "Algolia, Inc.",
11+
"url": "https://www.algolia.com"
12+
},
13+
{
14+
"name": "Typesense, Inc.",
15+
"url": "https://typesense.org"
16+
}
17+
],
1618
"files": [
1719
"dist/"
1820
],

0 commit comments

Comments
 (0)