Skip to content

Commit

Permalink
Merge pull request #640 from interlay/generate_docs
Browse files Browse the repository at this point in the history
chore: update docs generator and dev dependencies
  • Loading branch information
ns212 committed Jul 6, 2023
2 parents 944ff7c + 400946b commit 29f2f4b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 35 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ updates:
interval: "weekly"
labels:
- "dependencies"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
11 changes: 4 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Generate js docs

on:
push:
branches:
- master
on: push

jobs:
publish:
Expand All @@ -15,13 +12,13 @@ jobs:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: "14.x"
- run: npm install
node-version: "18"
- run: yarn install --frozen-lockfile
- run: npm run build
- run: sh generate_docs

- name: Deploy to GitHub Pages
if: success()
if: github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
- run: corepack enable
- run: yarn install
- name: Check versions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
registry-url: "https://registry.npmjs.org"
always-auth: true
- run: corepack enable
Expand Down
8 changes: 1 addition & 7 deletions generate_docs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#!/bin/sh

cp -r docs/helpers tmp_docs_helpers/
rm -rf ./docs
set -eux

# typedoc config is defined in typedoc.json
npx typedoc

cp -r tmp_docs_helpers docs/helpers
cp -r docs/helpers/* docs/

# The sidebar is a copy of the modules file (which summarises all project files).
# We only keep the links and remove the actual definitions, which will be displayed
# in the main section of the page
sed -n '/^### BTC Bridge Classes$/,$p' ./docs/modules.md > ./docs/tmp.md
sed -n '/^## Type aliases$/q;p' ./docs/tmp.md > ./docs/_sidebar.md
rm ./docs/tmp.md
rm -rf tmp_docs_helpers
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@interlay/interbtc-types": "1.12.0",
"@interlay/monetary-js": "0.7.3",
"@polkadot/api": "9.14.2",
"@types/bitcoinjs-lib": "^5.0.0",
"big.js": "6.1.1",
"bitcoin-core": "^3.0.0",
"bitcoinjs-lib": "^5.2.0",
Expand All @@ -70,32 +69,32 @@
"@types/big.js": "6.1.2",
"@types/chai": "^4.2.12",
"@types/chai-as-promised": "^7.1.3",
"@types/mocha": "^8.0.3",
"@types/node": "^14.6.4",
"@types/shelljs": "0.8.8",
"@types/sinon": "^9.0.5",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.9",
"@types/shelljs": "0.8.12",
"@types/sinon": "^10.0.15",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cli-table3": "0.6.3",
"eslint": "^7.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^5.1.1",
"mocha": "9.1.3",
"husky": "^8.0.3",
"mocha": "10.2.0",
"nock": "^13.0.4",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"shelljs": "0.8.4",
"sinon": "^9.0.3",
"shelljs": "0.8.5",
"sinon": "^15.1.0",
"ts-mock-imports": "^1.3.0",
"ts-node": "10.4.0",
"typedoc": "^0.22.9",
"typedoc-plugin-markdown": "^3.11.6",
"typescript": "4.3.2",
"ts-node": "10.9.1",
"typedoc": "^0.24.7",
"typedoc-plugin-markdown": "^3.15.3",
"typescript": "5.0.4",
"yargs": "^17.5.1"
},
"resolutions": {
Expand Down
4 changes: 2 additions & 2 deletions src/parachain/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class DefaultTransactionAPI implements TransactionAPI {
successEventType?: AugmentedEvent<ApiTypes, T>,
extrinsicStatus?: ExtrinsicStatus
): Promise<ISubmittableResult> {
const { unsubscribe, result } = await new Promise((resolve, reject) => {
const { unsubscribe, result } = await new Promise<{ unsubscribe: () => void; result: ISubmittableResult }>((resolve, reject) => {
let unsubscribe: () => void;
// When passing { nonce: -1 } to signAndSend the API will use system.accountNextIndex to determine the nonce
transaction
Expand Down Expand Up @@ -171,7 +171,7 @@ export class DefaultTransactionAPI implements TransactionAPI {
} else if (result.status.isFinalized) {
console.log(`Transaction finalized at blockHash ${result.status.asFinalized}`);
}
unsubscribe(result);
unsubscribe();

// Print all events for debugging
DefaultTransactionAPI.printEvents(api, result.events);
Expand Down

0 comments on commit 29f2f4b

Please sign in to comment.