From 26cbdf9e42b5b6e4af386998afdb03460ac9b1fe Mon Sep 17 00:00:00 2001 From: clayton neal Date: Thu, 2 Nov 2023 09:14:43 +0000 Subject: [PATCH 1/6] chore: setup --- package.json | 1 + typedoc.json | 5 +++++ yarn.lock | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 typedoc.json diff --git a/package.json b/package.json index 5831b93e4..f562bae8b 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "ts-jest": "^29.1.1", "tsup": "^7.2.0", "turbo": "^1.10.15", + "typedoc": "^0.25.3", "typescript": "*" } } diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 000000000..44a8e2bec --- /dev/null +++ b/typedoc.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPoints": ["./packages/index.ts", "./src/secondary-entry.ts"], + "out": "doc" +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 125996551..fad92a7c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1414,6 +1414,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-sequence-parser@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz#e0aa1cdcbc8f8bb0b5bca625aac41f5f056973cf" + integrity sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -4110,6 +4115,11 @@ json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -4299,6 +4309,11 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +lunr@^2.3.9: + version "2.3.9" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== + make-dir@^3.0.0, make-dir@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -4335,6 +4350,11 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +marked@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== + meow@^12.0.1: version "12.1.1" resolved "https://registry.yarnpkg.com/meow/-/meow-12.1.1.tgz#e558dddbab12477b69b2e9a2728c327f191bace6" @@ -4426,6 +4446,13 @@ minimatch@^5.1.0: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -5234,6 +5261,16 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +shiki@^0.14.1: + version "0.14.5" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.5.tgz#375dd214e57eccb04f0daf35a32aa615861deb93" + integrity sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw== + dependencies: + ansi-sequence-parser "^1.1.0" + jsonc-parser "^3.2.0" + vscode-oniguruma "^1.7.0" + vscode-textmate "^8.0.0" + side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -5920,6 +5957,16 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typedoc@^0.25.3: + version "0.25.3" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.25.3.tgz#53c6d668e1001b3d488e9a750fcdfb05433554c0" + integrity sha512-Ow8Bo7uY1Lwy7GTmphRIMEo6IOZ+yYUyrc8n5KXIZg1svpqhZSWgni2ZrDhe+wLosFS8yswowUzljTAV/3jmWw== + dependencies: + lunr "^2.3.9" + marked "^4.3.0" + minimatch "^9.0.3" + shiki "^0.14.1" + typescript@*, typescript@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" @@ -6018,6 +6065,16 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +vscode-oniguruma@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" + integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== + +vscode-textmate@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-8.0.0.tgz#2c7a3b1163ef0441097e0b5d6389cd5504b59e5d" + integrity sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg== + wait-on@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-7.0.1.tgz#5cff9f8427e94f4deacbc2762e6b0a489b19eae9" From cda714ab0f6684d127843f5200be3fbf61ad8884 Mon Sep 17 00:00:00 2001 From: clayton neal Date: Mon, 6 Nov 2023 09:27:37 +0000 Subject: [PATCH 2/6] chore: wip --- .gitignore | 3 ++- packages/core/typedoc.json | 4 ++++ packages/errors/typedoc.json | 4 ++++ packages/network/typedoc.json | 4 ++++ typedoc.base.json | 15 +++++++++++++++ typedoc.json | 6 ++++-- 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packages/core/typedoc.json create mode 100644 packages/errors/typedoc.json create mode 100644 packages/network/typedoc.json create mode 100644 typedoc.base.json diff --git a/.gitignore b/.gitignore index 8663d547e..5dbe7f155 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ junit.xml .turbo # docs -docs/build/*.md \ No newline at end of file +docs/build/*.md +api-docs/ \ No newline at end of file diff --git a/packages/core/typedoc.json b/packages/core/typedoc.json new file mode 100644 index 000000000..2e72d0e51 --- /dev/null +++ b/packages/core/typedoc.json @@ -0,0 +1,4 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/core.ts"] + } \ No newline at end of file diff --git a/packages/errors/typedoc.json b/packages/errors/typedoc.json new file mode 100644 index 000000000..e6f120662 --- /dev/null +++ b/packages/errors/typedoc.json @@ -0,0 +1,4 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/errors.ts"] + } \ No newline at end of file diff --git a/packages/network/typedoc.json b/packages/network/typedoc.json new file mode 100644 index 000000000..4fc888931 --- /dev/null +++ b/packages/network/typedoc.json @@ -0,0 +1,4 @@ +{ + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/network.ts"] + } \ No newline at end of file diff --git a/typedoc.base.json b/typedoc.base.json new file mode 100644 index 000000000..5ac41dd95 --- /dev/null +++ b/typedoc.base.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "compilerOptions":{ + "strictNullChecks": false + }, + "skipErrorChecking": true, + "excludeExternals": true, + "exclude": [ "**/*+(index|.spec|.e2e|test).ts" ], + "externalPattern": [ + "**/node_modules/**" + ], + "readme": "none", + "excludeReferences": true, + "excludePrivate": true, +} \ No newline at end of file diff --git a/typedoc.json b/typedoc.json index 44a8e2bec..c778798df 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,5 +1,7 @@ { "$schema": "https://typedoc.org/schema.json", - "entryPoints": ["./packages/index.ts", "./src/secondary-entry.ts"], - "out": "doc" + "entryPoints": ["./packages/*"], + "entryPointStrategy": "packages", + "out": "./api-docs", + "readme": "none" } \ No newline at end of file From 119d3f0011a5a3ff9abe1924af51c1c2b1c08757 Mon Sep 17 00:00:00 2001 From: clayton neal Date: Mon, 6 Nov 2023 10:43:28 +0000 Subject: [PATCH 3/6] chore: gha --- .github/workflows/typedoc.yml | 63 ++++++++++++++++++++++++ package.json | 3 +- packages/core/src/certificate/types.d.ts | 2 +- typedoc.json | 8 ++- 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/typedoc.yml diff --git a/.github/workflows/typedoc.yml b/.github/workflows/typedoc.yml new file mode 100644 index 000000000..5717f443f --- /dev/null +++ b/.github/workflows/typedoc.yml @@ -0,0 +1,63 @@ +name: Publish TypeDoc + +on: + push: + branches: + - 'feat/127' + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one instance of wf to run at once +concurrency: + group: "pages" + cancel-in-progress: false + +env: + BUILD_PATH: "./api-docs/" + +jobs: + build-api-docs: + name: Sonar Scan + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + + - name: Install packages + run: yarn install + + - name: Build + run: yarn build + + - name: Generate api docs + run: yarn generate:apidocs + + - name: Setup pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ${{ env.BUILD_PATH }} + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build-api-docs + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/package.json b/package.json index be39a2c8e..66188f151 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "format": "turbo format", "test:docs": "turbo test:docs", "test:examples": "turbo test:examples", - "merge-coverage": "ts-node scripts/merge-coverage.ts" + "merge-coverage": "ts-node scripts/merge-coverage.ts", + "generate:apidocs": "typedoc --options typedoc.json --logLevel Verbose" }, "private": true, "workspaces": [ diff --git a/packages/core/src/certificate/types.d.ts b/packages/core/src/certificate/types.d.ts index a8b62be66..6bdf4cb64 100644 --- a/packages/core/src/certificate/types.d.ts +++ b/packages/core/src/certificate/types.d.ts @@ -18,7 +18,7 @@ * @field signature - The signature field contains the cryptographic signature generated by the issuer's private key. * This signature ensures the integrity and authenticity of the certificate's content. */ -export interface Certificate { +interface Certificate { purpose: string; payload: { type: string; diff --git a/typedoc.json b/typedoc.json index c778798df..849899497 100644 --- a/typedoc.json +++ b/typedoc.json @@ -3,5 +3,11 @@ "entryPoints": ["./packages/*"], "entryPointStrategy": "packages", "out": "./api-docs", - "readme": "none" + "readme": "README.md", + "name": "vechain-sdk", + "navigationLinks": { + "vechain": "https://www.vechain.org/", + "docs": "https://docs.vechain.org/", + "github": "https://github.com/vechainfoundation" + } } \ No newline at end of file From 8561fe83c74017330ae6cb64a75fa71e5c911428 Mon Sep 17 00:00:00 2001 From: clayton neal Date: Mon, 6 Nov 2023 10:49:56 +0000 Subject: [PATCH 4/6] chore: fix gha --- .github/workflows/typedoc.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/typedoc.yml b/.github/workflows/typedoc.yml index 5717f443f..8d4c6b969 100644 --- a/.github/workflows/typedoc.yml +++ b/.github/workflows/typedoc.yml @@ -21,7 +21,6 @@ env: jobs: build-api-docs: - name: Sonar Scan runs-on: ubuntu-latest timeout-minutes: 5 steps: From 1bc29d0a40f43685d2383b33c8543de799c34a4d Mon Sep 17 00:00:00 2001 From: clayton neal Date: Mon, 6 Nov 2023 11:21:02 +0000 Subject: [PATCH 5/6] chore: gha manual --- .github/workflows/typedoc.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/typedoc.yml b/.github/workflows/typedoc.yml index 8d4c6b969..8f99c65ee 100644 --- a/.github/workflows/typedoc.yml +++ b/.github/workflows/typedoc.yml @@ -1,9 +1,7 @@ name: Publish TypeDoc on: - push: - branches: - - 'feat/127' + workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: From 8f12e12b79cf27e6475e05bd616b9238ed077bed Mon Sep 17 00:00:00 2001 From: clayton neal Date: Mon, 6 Nov 2023 11:24:39 +0000 Subject: [PATCH 6/6] chore: gha --- .github/workflows/typedoc.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/typedoc.yml b/.github/workflows/typedoc.yml index 8f99c65ee..f69131eaa 100644 --- a/.github/workflows/typedoc.yml +++ b/.github/workflows/typedoc.yml @@ -1,8 +1,12 @@ name: Publish TypeDoc on: + push: + branches: + - 'githubpages' workflow_dispatch: + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read