Skip to content

Commit 7be75aa

Browse files
authored
Setup API docs on GH pages (#493)
1 parent 33e12ca commit 7be75aa

File tree

5 files changed

+89
-21
lines changed

5 files changed

+89
-21
lines changed

.github/workflows/api-docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: API docs
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "20"
27+
cache: "npm"
28+
- name: Install dependencies
29+
run: npm ci
30+
- name: Generate API docs site
31+
run: npx typedoc
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: ./docs/api
36+
37+
deploy:
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ dist
129129
.yarn/install-state.gz
130130
.pnp.*
131131

132-
docs/api/source/
132+
docs/api/
133133

134134
# Playwright test results
135-
test-results/
135+
test-results/

SECURITY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Reporting a vulnerability
2+
3+
If you discover a vulnerability in our code, or experience a bug related to security,
4+
please report it following the instructions provided on [Inrupt’s security page](https://inrupt.com/security/).

tsconfig.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,6 @@
1515
// Advanced Options
1616
"stripInternal": true
1717
},
18-
"typedocOptions": {
19-
"out": "docs/api/source/api",
20-
"hideInPageTOC": true,
21-
"entryPoints": [],
22-
"exclude": [
23-
"node_modules/**",
24-
"**/*.test.ts",
25-
// End-to-end tests:
26-
"e2e/**"
27-
],
28-
"theme": "markdown",
29-
"readme": "none",
30-
"entryDocument": "index.rst",
31-
"plugin": [
32-
"typedoc-plugin-markdown",
33-
"@typhonjs-typedoc/ts-lib-docs/typedoc/ts-links/dom/2023",
34-
"@typhonjs-typedoc/ts-lib-docs/typedoc/ts-links/esm/2023"
35-
]
36-
},
3718
"include": ["src/**/*.ts"],
3819
"exclude": [
3920
"**/node_modules",

typedoc.config.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// MIT License
2+
//
3+
// Copyright (c) Inrupt
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in all
13+
// copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
// SOFTWARE.
22+
//
23+
24+
export default {
25+
out: "docs/api/",
26+
entryPoints: ["./src/index.ts"],
27+
exclude: [
28+
"node_modules/**",
29+
"**/*.test.ts",
30+
// End-to-end tests:
31+
"e2e/**",
32+
],
33+
plugin: [
34+
"@typhonjs-typedoc/ts-lib-docs/typedoc/ts-links/dom/2023",
35+
"@typhonjs-typedoc/ts-lib-docs/typedoc/ts-links/esm/2023",
36+
],
37+
};

0 commit comments

Comments
 (0)