Skip to content

(WIP) [MMB-156] Add documentation comments and generate HTML documentation #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e4a4641
Remove ability to pass array of event names to EventEmitter.prototype…
lawrence-forooghian Sep 28, 2023
a3cd2bf
Remove unused type `Provider`
lawrence-forooghian Sep 27, 2023
ad4e916
Make naming of event map types consistent
lawrence-forooghian Sep 20, 2023
c51b23e
Mark non-public API where we haven’t already
lawrence-forooghian Sep 20, 2023
aaf47a2
Export all types that are referenced by exported types
lawrence-forooghian Sep 20, 2023
f4a9498
Extract a couple of events to their own types
lawrence-forooghian Sep 21, 2023
9e27b5e
Get rid of EventMap and EventKey types
lawrence-forooghian Sep 27, 2023
b70d185
Improve typing of callListener function
lawrence-forooghian Sep 27, 2023
18f1d2b
Convert *EventMap types to interfaces
lawrence-forooghian Sep 21, 2023
87e1eba
Split LockStatus’s allowed values into separate types
lawrence-forooghian Sep 26, 2023
f5a8b6e
Create overload signatures for event-related methods
lawrence-forooghian Sep 27, 2023
02f8f04
Add `this` type parameter to EventListener
lawrence-forooghian Sep 28, 2023
beb605c
Remove unnecessary use of isFunction
lawrence-forooghian Sep 28, 2023
7d9e217
(WIP) Add notes on class-definitions stuff that's missing in codebase
lawrence-forooghian Sep 20, 2023
eb3f1b3
Add website documentation as TSDoc comments
lawrence-forooghian Sep 18, 2023
e9d733e
(TODO backport to docs repo) Fix description of lock status values
lawrence-forooghian Sep 26, 2023
e0c31fe
(TODO backport to docs repo) Fix documentation: "instance" refers to …
lawrence-forooghian Sep 27, 2023
9d24f6a
Add class-definitions.md documentation as TSDoc comments
lawrence-forooghian Sep 20, 2023
f3b8392
Split </p> from end of link
lawrence-forooghian Sep 21, 2023
bff065b
Add a script to convert website documentation from Textile to Markdown
lawrence-forooghian Sep 26, 2023
60d482e
Convert website documentation from Textile to Markdown
lawrence-forooghian Sep 20, 2023
8a03caf
Remove scripts/convert_website_documentation.ts
lawrence-forooghian Sep 26, 2023
2cf88ba
Convert <aside> elements into quotes with strong text
lawrence-forooghian Sep 21, 2023
ffdd226
Make links to external documentation absolute
lawrence-forooghian Sep 21, 2023
d14f7f9
(WIP) Turn some stuff into @link
lawrence-forooghian Sep 21, 2023
d057368
(WIP) Tweak references to "namespace"
lawrence-forooghian Sep 21, 2023
e2b9971
(WIP) Move parts of documentation to more appropriate places
lawrence-forooghian Sep 26, 2023
4652459
(WIP) Write documentation where none currently exists
lawrence-forooghian Sep 26, 2023
84dae05
(WIP) Use TypeDoc to generate HTML documentation
lawrence-forooghian Sep 18, 2023
58266b7
(TODO remove) Don't treat TypeDoc warnings as errors
lawrence-forooghian Sep 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,31 @@ jobs:
node-version: 18
- run: npm ci
- run: npm run build
docs:
runs-on: ubuntu-latest
permissions:
id-token: write
deployments: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
- name: Install Package Dependencies
run: npm ci
- name: Build SDK
run: npm run build
- name: Build Documentation
run: npm run docs
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-2
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-spaces
role-session-name: "${{ github.run_id }}-${{ github.run_number }}"
- name: Upload Documentation
uses: ably/sdk-upload-action@v1
with:
sourcePath: docs/typedoc/generated
githubToken: ${{ secrets.GITHUB_TOKEN }}
artifactName: typedoc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
.vscode
coverage
.env
docs/typedoc/generated/

# Local Netlify folder
.netlify
Expand Down
6 changes: 6 additions & 0 deletions docs/class-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ The most recent event emitted by [presence](https://ably.com/docs/presence-occup

#### PresenceEvent

TODO This type doesn’t exist in the codebase; it's defined inline in SpaceMember

```ts
type PresenceEvent = {
name: 'enter' | 'leave' | 'update' | 'present';
Expand Down Expand Up @@ -416,6 +418,8 @@ const otherLocations = await space.locations.getOthers()

#### Location

TODO this type doesn’t exist in the codebase; `unknown` is used

Represents a location in an application.

```ts
Expand All @@ -424,6 +428,8 @@ type Location = string | Record<string, unknown> | null;

#### LocationUpdate

TODO this type doesn’t exist in the codebase; it’s defined inline in LocationEventMap

Represents a change between locations for a given [`SpaceMember`](#spacemember).

```ts
Expand Down
7 changes: 7 additions & 0 deletions docs/typedoc/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ably Spaces SDK

<!-- TODO needs proper content -->

This is the documentation for Ably’s Spaces SDK. Start with the documentation for the SDK’s {@link default | default export}.

For alternative documentation, see our [documentation website](https://ably.com/docs/spaces).
168 changes: 156 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"build:cjs": "npx tsc --project tsconfig.cjs.json && cp res/package.cjs.json dist/cjs/package.json",
"build:iife": "rm -rf dist/iife && npx tsc --project tsconfig.iife.json && rollup -c",
"prepare": "husky install",
"examples:locks": "ts-node ./examples/locks.ts"
"examples:locks": "ts-node ./examples/locks.ts",
"docs": "typedoc"
},
"exports": {
"import": "./dist/mjs/index.js",
Expand Down Expand Up @@ -57,7 +58,8 @@
"vitest": "^0.34.3"
},
"dependencies": {
"nanoid": "^4.0.2"
"nanoid": "^4.0.2",
"typedoc": "^0.25.1"
},
"peerDependencies": {
"ably": "^1.2.43"
Expand Down
Loading