Skip to content

Commit 3506ce2

Browse files
amit-kshcurquiza
andauthored
Add JS hosted documentation (#1678)
* Add JS hosted documentation * Update .github/workflows/docs.yml * Update .github/workflows/docs.yml --------- Co-authored-by: Clémentine <[email protected]>
1 parent 71dcebe commit 3506ce2

File tree

9 files changed

+681
-3
lines changed

9 files changed

+681
-3
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
# @TODO: I'm not sure what's going on here, we're importing
66
# in JS file from TS files, better left ignored for now
77
/playgrounds
8+
/docs

.github/workflows/docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
run: yarn install
18+
19+
- name: Generate Documentation
20+
run: yarn build:docs
21+
22+
- name: Deploy to GitHub Pages
23+
uses: peaceiris/actions-gh-pages@v4
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: ./docs
27+
force_orphan: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ typings/
6565
# Output of 'npm pack'
6666
*.tgz
6767

68+
# Generated Docs
69+
docs/
70+
6871
# Yarn Integrity file
6972
.yarn-integrity
7073

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
## 📖 Documentation
4646

47-
This readme contains all the documentation you need to start using this Meilisearch SDK.
47+
This readme and [Meilisearch JS documentation website](https://meilisearch.github.io/meilisearch-js/) contains all the information you need to start using this Meilisearch SDK.
4848

4949
For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/).
5050

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"clear_jest": "jest --clearCache",
3434
"cleanup": "shx rm -rf dist/",
3535
"build": "yarn cleanup && rollup -c && rollup -c --environment NODE_ENV:production",
36+
"build:docs": "typedoc",
3637
"watch": "yarn cleanup && rollup -c --watch",
3738
"postbuild": "yarn size && yarn typingsheader",
3839
"test": "yarn clear_jest && jest --runInBand --verbose",
@@ -105,6 +106,7 @@
105106
"rollup-plugin-typescript2": "^0.35.0",
106107
"shx": "^0.3.2",
107108
"ts-jest": "^29.1.1",
109+
"typedoc": "^0.25.13",
108110
"typescript": "^5.3.3"
109111
}
110112
}

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"target": "es2022",
2323
"lib": ["ESNext", "dom"],
2424
"strict": true,
25-
"noImplicitReturns": true
26-
}
25+
"noImplicitReturns": true,
26+
},
27+
"include": ["src"],
2728
}

typedoc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Meilisearch JS",
3+
"entryPoints": ["./src"],
4+
"out": "./docs",
5+
"customCss": "./typedoc/style.css",
6+
"groupOrder": [
7+
"References",
8+
"Modules",
9+
"Namespaces",
10+
"Enumerations",
11+
"Enumeration Members",
12+
"Classes",
13+
"Interfaces",
14+
"Type Aliases",
15+
"Constructors",
16+
"Properties",
17+
"Variables",
18+
"Functions",
19+
"Accessors",
20+
"Methods"
21+
],
22+
"navigation": {
23+
"includeCategories": true,
24+
"includeGroups": true
25+
},
26+
"navigationLinks": {
27+
"Docs": "https://www.meilisearch.com/docs",
28+
"GitHub": "https://github.com/meilisearch/meilisearch-js"
29+
},
30+
"githubPages": true
31+
}

0 commit comments

Comments
 (0)