From 264a0783f2ade9883fca5f5dc6357709dca419fa Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 15 Dec 2023 10:26:12 -0500 Subject: [PATCH 1/5] Generates the HTML to publish to GH Pages --- .github/workflows/docs-ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index 5fe8b5b0..cff7e074 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -41,15 +41,22 @@ jobs: - name: TBDocs Reporter id: tbdocs-reporter-protocol - uses: TBD54566975/tbdocs@main + uses: TBD54566975/tbdocs@leordev/gh-pages-html with: + group_docs: true entry_points: | - file: packages/protocol/src/main.ts docsReporter: api-extractor - docsGenerator: typedoc-markdown + docsGenerator: typedoc-html - file: packages/http-client/src/main.ts docsReporter: api-extractor - docsGenerator: typedoc-markdown + docsGenerator: typedoc-html - file: packages/http-server/src/main.ts docsReporter: api-extractor - docsGenerator: typedoc-markdown + docsGenerator: typedoc-html + + - name: Upload documentation artifacts + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + with: + name: tbdex-js-docs + path: ./tbdocs/docs From 1c092c0f07ed131a9d1cc8023812eb6a7c43e108 Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 15 Dec 2023 10:29:06 -0500 Subject: [PATCH 2/5] fix commenter --- .github/workflows/docs-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index cff7e074..2d93ca10 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -58,5 +58,5 @@ jobs: - name: Upload documentation artifacts uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 with: - name: tbdex-js-docs - path: ./tbdocs/docs + name: tbdocs-reporter-output + path: ./.tbdocs From 5976c260d669af94a8abb32dadda713acdd013ec Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 15 Dec 2023 11:04:36 -0500 Subject: [PATCH 3/5] Publish Docs to GH Pages --- .github/workflows/docs-ci.yml | 2 +- .github/workflows/docs-publish.yml | 105 +++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs-publish.yml diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index 2d93ca10..2bebde6c 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -41,7 +41,7 @@ jobs: - name: TBDocs Reporter id: tbdocs-reporter-protocol - uses: TBD54566975/tbdocs@leordev/gh-pages-html + uses: TBD54566975/tbdocs@main with: group_docs: true entry_points: | diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml new file mode 100644 index 00000000..7a985c5b --- /dev/null +++ b/.github/workflows/docs-publish.yml @@ -0,0 +1,105 @@ +# Workflow that deploys project documentation to GitHub Pages +name: Publish Docs to GH Pages + +on: + workflow_run: + workflows: ["Create GH Release"] + types: + - completed + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build-docs: + permissions: + contents: write # to write documentation files to the repo + + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + + - name: install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Set up Node.js + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + + - name: Install dependencies + run: pnpm install + + - name: Build all workspace packages + run: pnpm build + + - name: TBDocs Reporter + id: tbdocs-reporter-protocol + uses: TBD54566975/tbdocs@main + with: + group_docs: true + fail_on_error: true + entry_points: | + - file: packages/protocol/src/main.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + - file: packages/http-client/src/main.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + - file: packages/http-server/src/main.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + + - name: Upload documentation artifacts + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + with: + name: tbdocs-output + path: ./.tbdocs + + deploy-gh-pages: + # Add a dependency to the build job + needs: build-docs + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + contents: read # to read from project repo + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Download TBDocs Artifacts + uses: actions/download-artifact@v3 + with: + name: tbdocs-output + path: ./tbdocs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: "./tbdocs/docs" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 From 6f7228e0811f09a9ece241ca265858fceb6751a6 Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 15 Dec 2023 11:09:26 -0500 Subject: [PATCH 4/5] test Publish Docs to GH Pages --- .github/workflows/docs-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 7a985c5b..8c59142b 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -2,6 +2,10 @@ name: Publish Docs to GH Pages on: + # TODO: remove test + push: + branches: + - leordev/* workflow_run: workflows: ["Create GH Release"] types: From e5c73a4c9af14171418872d9ee5e5c4feb633e5e Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Fri, 15 Dec 2023 11:14:09 -0500 Subject: [PATCH 5/5] fix issues --- .github/workflows/docs-publish.yml | 4 ---- packages/http-server/src/callback-error.ts | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 8c59142b..7a985c5b 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -2,10 +2,6 @@ name: Publish Docs to GH Pages on: - # TODO: remove test - push: - branches: - - leordev/* workflow_run: workflows: ["Create GH Release"] types: diff --git a/packages/http-server/src/callback-error.ts b/packages/http-server/src/callback-error.ts index b5547c77..c9030778 100644 --- a/packages/http-server/src/callback-error.ts +++ b/packages/http-server/src/callback-error.ts @@ -6,7 +6,10 @@ import type { ErrorDetail } from '@tbdex/http-client' * @beta */ export class CallbackError extends Error { + /** Error HTTP Response status code: 400 - Bad Request, 401 - Unauthorized, 500 etc. */ public readonly statusCode: number + + /** List with full error details objects received from the PFI server response */ public readonly details: ErrorDetail[] constructor(statusCode: number, details: ErrorDetail[] = []) {