Skip to content

Commit e109e59

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 03bebd4 commit e109e59

File tree

5 files changed

+339
-1
lines changed

5 files changed

+339
-1
lines changed

.github/workflows/docs.yml

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