From 454d9b80f10c1d0275e2af58a377721e9715b3d6 Mon Sep 17 00:00:00 2001 From: Tyler McDonald Date: Tue, 19 Dec 2023 18:37:59 -0700 Subject: [PATCH] build typedoc --- package-lock.json | 29 ++++++++++++++++++++++++++++- package.json | 4 +++- src/lib/dapp/index.ts | 2 ++ src/lib/wallet/index.ts | 9 +++++++-- typedoc.json | 10 ++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 typedoc.json diff --git a/package-lock.json b/package-lock.json index 50d7588..98310ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,8 +34,9 @@ "prettier": "^3.1.0", "rimraf": "^5.0.5", "ts-jest": "^29.1.1", - "ts-node": "^10.9.1", + "ts-node": "^10.9.2", "typedoc": "^0.25.4", + "typedoc-theme-hierarchy": "^4.1.2", "typescript": "^5.2.2" } }, @@ -9024,6 +9025,32 @@ "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" } }, + "node_modules/typedoc-theme-hierarchy": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/typedoc-theme-hierarchy/-/typedoc-theme-hierarchy-4.1.2.tgz", + "integrity": "sha512-X3H+zaDkg7wLNoaPJoqXs3rnMfZ9BZjmlXRwplWDciaPfn2hojHxJJ+yVKdqqmojgiHJgg7MYWGDVpOfNlOJ5A==", + "dev": true, + "dependencies": { + "fs-extra": "11.1.1" + }, + "peerDependencies": { + "typedoc": "^0.24.0 || ^0.25.0" + } + }, + "node_modules/typedoc-theme-hierarchy/node_modules/fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/typedoc/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", diff --git a/package.json b/package.json index 3a7a46a..11d14d9 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,9 @@ "prettier": "^3.1.0", "rimraf": "^5.0.5", "ts-jest": "^29.1.1", - "ts-node": "^10.9.1", + "ts-node": "^10.9.2", "typedoc": "^0.25.4", + "typedoc-theme-hierarchy": "^4.1.2", "typescript": "^5.2.2" }, "dependencies": { @@ -54,6 +55,7 @@ "build": "npm run build:types && node scripts/lib/build.mjs", "build:types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist/types", "build:example": "node scripts/examples/build.mjs", + "build:docs": "typedoc --options typedoc.json", "watch": "nodemon --watch src/lib/ --ext ts --exec \"npm run build\"", "dev": "rimraf dist && npm run build && concurrently --raw \"npm run watch\" \"node scripts/examples/dev.mjs\"", "test": "jest", diff --git a/src/lib/dapp/index.ts b/src/lib/dapp/index.ts index ab3f128..3934802 100644 --- a/src/lib/dapp/index.ts +++ b/src/lib/dapp/index.ts @@ -520,3 +520,5 @@ export class DAppConnector { }) } } + +export default DAppConnector diff --git a/src/lib/wallet/index.ts b/src/lib/wallet/index.ts index eccbff0..be67c12 100644 --- a/src/lib/wallet/index.ts +++ b/src/lib/wallet/index.ts @@ -27,8 +27,11 @@ import { proto } from '@hashgraph/proto' import Provider from './provider' import type { HederaNativeWallet } from './types' +export type { HederaNativeWallet } from './types' +export { default as WalletProvider } from './provider' + // https://github.com/WalletConnect/walletconnect-monorepo/blob/v2.0/packages/web3wallet/src/client.ts -export default class Wallet extends Web3Wallet implements HederaNativeWallet { +export class HederaWeb3Wallet extends Web3Wallet implements HederaNativeWallet { /* * Set default values for chains, methods, events */ @@ -49,7 +52,7 @@ export default class Wallet extends Web3Wallet implements HederaNativeWallet { methods?: string[], sessionEvents?: HederaSessionEvent[] | string[], ) { - const wallet = new Wallet( + const wallet = new HederaWeb3Wallet( { core: new Core({ projectId }), metadata }, chains, methods, @@ -396,3 +399,5 @@ export default class Wallet extends Web3Wallet implements HederaNativeWallet { return await this.respondSessionRequest(response) } } + +export default HederaWeb3Wallet diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 0000000..1781c9d --- /dev/null +++ b/typedoc.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPointStrategy": "expand", + "entryPoints": ["./src/lib"], + "plugin": ["typedoc-theme-hierarchy"], + "theme": "hierarchy", + "out": "dist/docs", + "sourceLinkExternal": true, + "basePath": "./docs" +}