diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index e470ca47d..c14774325 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -23,7 +23,7 @@ jobs: with: node-version: 18 registry-url: https://registry.npmjs.org/ - cache: 'npm' + cache: "npm" - name: Install dependencies run: npm ci @@ -38,10 +38,17 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} report_changed_scope_only: false fail_on_error: false + group_docs: true entry_points: | - file: packages/api/src/index.ts docsReporter: api-extractor - docsGenerator: typedoc-markdown + docsGenerator: typedoc-html + - file: packages/crypto/src/index.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + - file: packages/crypto-aws-kms/src/index.ts + docsReporter: api-extractor + docsGenerator: typedoc-html - name: Save Artifacts uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index d39ccf0ec..164590f2e 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -2,10 +2,10 @@ name: Build and Deploy Docs on: - # Runs on pushes targeting the default branch - # push: - # branches: - # - main + # Runs on new released versions + release: + types: + - published # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -32,26 +32,36 @@ jobs: with: node-version: 18 registry-url: https://registry.npmjs.org/ - cache: 'npm' + cache: "npm" - name: Install dependencies - run: | - npm ci - npm i jsdoc - npm i clean-jsdoc-theme - - - name: Generate documentation - run: | - echo "# Web5 JS SDK" > README-docs.md - echo "Select from the menu on the left to view API reference documentation." >> README-docs.md - npx jsdoc -c jsdoc.json - curl -o docs/favicon.ico https://developer.tbd.website/img/favicon.ico + run: npm ci + + - name: Build all workspace packages + run: npm run build + + - name: TBDocs Reporter + id: tbdocs-reporter-protocol + uses: TBD54566975/tbdocs@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + fail_on_error: true + entry_points: | + - file: packages/api/src/index.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + - file: packages/crypto/src/index.ts + docsReporter: api-extractor + docsGenerator: typedoc-html + - file: packages/crypto-aws-kms/src/index.ts + docsReporter: api-extractor + docsGenerator: typedoc-html - name: Upload documentation artifacts uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 with: - name: jsdoc - path: ./docs + name: tbdocs-output + path: ./.tbdocs deploy: # Add a dependency to the build job @@ -77,16 +87,16 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v3 - - name: Download JSDoc artifacts + - name: Download TBDocs Artifacts uses: actions/download-artifact@v3 with: - name: jsdoc - path: ./docs + name: tbdocs-output + path: ./tbdocs - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: "./docs" + path: "./.tbdocs/docs" - name: Deploy to GitHub Pages id: deployment diff --git a/packages/crypto/src/index.ts b/packages/crypto/src/index.ts index d2952615e..309e5dcc2 100644 --- a/packages/crypto/src/index.ts +++ b/packages/crypto/src/index.ts @@ -1,6 +1,7 @@ export * from './jose.js'; export * from './local-kms-crypto.js'; -export * as utils from './utils.js'; +import * as utils from './utils.js'; +export { utils }; export * from './algorithms/aes-ctr.js'; export * from './algorithms/aes-gcm.js'; @@ -38,4 +39,4 @@ export type * from './types/key-wrapper.js'; export type * from './types/params-direct.js'; export type * from './types/params-enclosed.js'; export type * from './types/params-kms.js'; -export type * from './types/signer.js'; \ No newline at end of file +export type * from './types/signer.js'; diff --git a/packages/dids/src/index.ts b/packages/dids/src/index.ts index f3ff1808b..04864b9d1 100644 --- a/packages/dids/src/index.ts +++ b/packages/dids/src/index.ts @@ -6,4 +6,6 @@ export * from './did-resolver.js'; export * from './resolver-cache-level.js'; export * from './resolver-cache-noop.js'; export * from './types.js'; -export * as utils from './utils.js'; \ No newline at end of file + +import * as utils from './utils.js'; +export { utils };