Skip to content
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

Generate docs with TBDocs #352

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: npm ci
Expand All @@ -38,10 +38,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
report_changed_scope_only: false
fail_on_error: false
group_docs: true
entry_points: |
- file: packages/api/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-markdown
docsGenerator: typedoc-html
- file: packages/crypto/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html
- file: packages/crypto-aws-kms/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html

- name: Save Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
Expand Down
54 changes: 32 additions & 22 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
name: Build and Deploy Docs

on:
# Runs on pushes targeting the default branch
# push:
# branches:
# - main
# Runs on new released versions
release:
types:
- published

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -32,26 +32,36 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache: "npm"

- name: Install dependencies
run: |
npm ci
npm i jsdoc
npm i clean-jsdoc-theme

- name: Generate documentation
run: |
echo "# Web5 JS SDK" > README-docs.md
echo "Select from the menu on the left to view API reference documentation." >> README-docs.md
npx jsdoc -c jsdoc.json
curl -o docs/favicon.ico https://developer.tbd.website/img/favicon.ico
run: npm ci

- name: Build all workspace packages
run: npm run build

- name: TBDocs Reporter
id: tbdocs-reporter-protocol
uses: TBD54566975/tbdocs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
entry_points: |
- file: packages/api/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html
- file: packages/crypto/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html
- file: packages/crypto-aws-kms/src/index.ts
docsReporter: api-extractor
docsGenerator: typedoc-html

- name: Upload documentation artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
with:
name: jsdoc
path: ./docs
name: tbdocs-output
path: ./.tbdocs

deploy:
# Add a dependency to the build job
Expand All @@ -77,16 +87,16 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Download JSDoc artifacts
- name: Download TBDocs Artifacts
uses: actions/download-artifact@v3
with:
name: jsdoc
path: ./docs
name: tbdocs-output
path: ./tbdocs

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./docs"
path: "./.tbdocs/docs"

- name: Deploy to GitHub Pages
id: deployment
Expand Down
5 changes: 3 additions & 2 deletions packages/crypto/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './jose.js';
export * from './local-kms-crypto.js';
export * as utils from './utils.js';
import * as utils from './utils.js';
export { utils };

export * from './algorithms/aes-ctr.js';
export * from './algorithms/aes-gcm.js';
Expand Down Expand Up @@ -38,4 +39,4 @@ export type * from './types/key-wrapper.js';
export type * from './types/params-direct.js';
export type * from './types/params-enclosed.js';
export type * from './types/params-kms.js';
export type * from './types/signer.js';
export type * from './types/signer.js';
4 changes: 3 additions & 1 deletion packages/dids/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export * from './did-resolver.js';
export * from './resolver-cache-level.js';
export * from './resolver-cache-noop.js';
export * from './types.js';
export * as utils from './utils.js';

import * as utils from './utils.js';
export { utils };
Loading