Skip to content

Commit 4813ffb

Browse files
committed
project: add TypeDoc API reference generation and workflow
Add typedoc with all 4 entry points configured. Generated docs are deployed to the SDK docs CDN on pushes to main and tag creation. "treatWarningsAsErrors" is set to false for now as the public API surface needs more JSDoc coverage.
1 parent 85292f0 commit 4813ffb

File tree

5 files changed

+334
-1
lines changed

5 files changed

+334
-1
lines changed

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: API Reference
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
deployments: write
15+
id-token: write
16+
contents: read
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
- uses: actions/setup-node@v6
22+
with:
23+
node-version: 24
24+
cache: npm
25+
- run: npm ci
26+
- name: Build Documentation
27+
run: npm run docs
28+
# Only upload docs from the main repo (not forks or dependabot)
29+
- name: Configure AWS Credentials
30+
uses: aws-actions/configure-aws-credentials@v4
31+
if: >-
32+
github.repository == 'ably/ably-ai-transport-js' &&
33+
(github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) &&
34+
github.actor != 'dependabot[bot]'
35+
with:
36+
aws-region: eu-west-2
37+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-ai-transport-js
38+
role-session-name: ${{ github.run_id }}-${{ github.run_number }}
39+
- name: Upload Documentation
40+
uses: ably/sdk-upload-action@v2
41+
if: >-
42+
github.repository == 'ably/ably-ai-transport-js' &&
43+
(github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) &&
44+
github.actor != 'dependabot[bot]'
45+
with:
46+
sourcePath: typedoc/generated
47+
githubToken: ${{ secrets.GITHUB_TOKEN }}
48+
artifactName: typedoc

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
dist/
33
coverage/
4+
typedoc/
45
*.tsbuildinfo
56
.env
67
.env.local

package-lock.json

Lines changed: 243 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)