Skip to content

Commit

Permalink
Merge pull request #1504 from oasisprotocol/matevz/feature/typedoc
Browse files Browse the repository at this point in the history
api-reference: Add typedoc support, refactor
  • Loading branch information
matevz authored Sep 21, 2023
2 parents 54f5df8 + 861ffe9 commit e57d909
Show file tree
Hide file tree
Showing 11 changed files with 282 additions and 13 deletions.
74 changes: 65 additions & 9 deletions .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ concurrency:

jobs:

publish-docs:
rust-docs:
# NOTE: This name appears in GitHub's Checks API.
name: publish-docs
name: rust-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -39,11 +39,67 @@ jobs:
--package oasis-contract-sdk-types \
--package oasis-contract-sdk-storage
- name: Publish docs
uses: crazy-max/ghaction-github-pages@v3
- name: Deploy rust to api-reference branch
uses: peaceiris/actions-gh-pages@v3
with:
target_branch: api-reference
build_dir: target/doc
commit_message: Deploy API reference
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
publish_branch: api-reference
destination_dir: rust
commit_message: Deploy rust API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

js-docs:
name: js-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js LTS
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: npm
cache-dependency-path: 'client-sdk/ts-web/package-lock.json'

- name: Install dependencies and build
working-directory: client-sdk/ts-web
run: npm ci --foreground-scripts

- name: core
working-directory: client-sdk/ts-web/core
run: npx typedoc

- name: rt
working-directory: client-sdk/ts-web/rt
run: npx typedoc

- name: ext-utils
working-directory: client-sdk/ts-web/ext-utils
run: npx typedoc

- name: signer-ledger
working-directory: client-sdk/ts-web/signer-ledger
run: npx typedoc

- name: Merge docs
working-directory: client-sdk/ts-web
run: |
mkdir docs
mv core/docs/api docs/client
mv rt/docs/api docs/client-rt
mv ext-utils/docs/api docs/client-ext-utils
mv signer-ledger/docs/api docs/client-signer-ledger
- name: Deploy js to api-reference branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: client-sdk/ts-web/docs
publish_branch: api-reference
destination_dir: js
commit_message: Deploy js API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
16 changes: 16 additions & 0 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,26 @@ jobs:
working-directory: client-sdk/ts-web/core
run: npm run-script check-playground

- name: Check ts-web/core typedoc
working-directory: client-sdk/ts-web/core
run: npx typedoc

- name: Check ts-web/signer-ledger playground
working-directory: client-sdk/ts-web/signer-ledger
run: npm run-script check-playground

- name: Check ts-web/signer-ledger typedoc
working-directory: client-sdk/ts-web/signer-ledger
run: npx typedoc

- name: Check ts-web/rt playground
working-directory: client-sdk/ts-web/rt
run: npm run-script check-playground

- name: Check ts-web/rt typedoc
working-directory: client-sdk/ts-web/rt
run: npx typedoc

- name: Check ts-web/ext-utils sample-page
working-directory: client-sdk/ts-web/ext-utils
run: npm run-script check-sample-page
Expand All @@ -165,6 +177,10 @@ jobs:
working-directory: client-sdk/ts-web/ext-utils
run: npm run-script check-sample-ext

- name: Check ts-web/ext-utils typedoc
working-directory: client-sdk/ts-web/ext-utils
run: npx typedoc

e2e-ts-web-core:
# NOTE: This name appears in GitHub's Checks API.
name: e2e-ts-web-core
Expand Down
1 change: 1 addition & 0 deletions client-sdk/ts-web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"protobufjs-cli": "^1.1.2",
"stream-browserify": "^3.0.0",
"ts-jest": "^29.1.1",
"typedoc": "^0.25.1",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
Expand Down
8 changes: 7 additions & 1 deletion client-sdk/ts-web/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
},
"include": [
"src/**/*"
]
],
"typedocOptions": {
"entryPoints": ["src/index.ts"],
"out": "docs/api",
"excludeInternal": true,
"excludePrivate": true
}
}
1 change: 1 addition & 0 deletions client-sdk/ts-web/ext-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prettier": "^3.0.3",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"typedoc": "^0.25.1",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
Expand Down
8 changes: 7 additions & 1 deletion client-sdk/ts-web/ext-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
},
"include": [
"src/**/*"
]
],
"typedocOptions": {
"entryPoints": ["src/index.ts"],
"out": "docs/api",
"excludeInternal": true,
"excludePrivate": true
}
}
Loading

0 comments on commit e57d909

Please sign in to comment.