From 18498d2882b992d681e24c6274b8520292dc0c01 Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Mon, 2 Oct 2023 14:43:03 -0700 Subject: [PATCH 1/3] fix: add build-types command and run prior to building mocks. --- packages/shared/common/package.json | 1 + packages/shared/mocks/package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/shared/common/package.json b/packages/shared/common/package.json index ade47c22c..dce77af8a 100644 --- a/packages/shared/common/package.json +++ b/packages/shared/common/package.json @@ -20,6 +20,7 @@ ], "scripts": { "test": "npx jest --ci", + "build-types": "npx tsc --declaration true --emitDeclarationOnly true --declarationDir dist", "build": "npx tsc", "clean": "npx tsc --build --clean", "lint": "npx eslint . --ext .ts", diff --git a/packages/shared/mocks/package.json b/packages/shared/mocks/package.json index 47ce02e41..aa8ceb63f 100644 --- a/packages/shared/mocks/package.json +++ b/packages/shared/mocks/package.json @@ -24,7 +24,8 @@ ], "scripts": { "test": "", - "build": "npx tsc", + "build-types": "yarn workspace @launchdarkly/js-sdk-common build-types", + "build": "yarn build-types && npx tsc", "clean": "npx tsc --build --clean", "lint": "npx eslint --ext .ts", "lint:fix": "yarn run lint -- --fix" From b4ce1a609f727d7d2adb0dff20f73722f24bc361 Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Mon, 2 Oct 2023 15:33:21 -0700 Subject: [PATCH 2/3] fix: incorrect ga workflow name. don't run typedoc for mocks. --- .github/workflows/mocks.yml | 2 +- actions/ci/action.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mocks.yml b/.github/workflows/mocks.yml index 0a2c39269..59ade4b21 100644 --- a/.github/workflows/mocks.yml +++ b/.github/workflows/mocks.yml @@ -1,4 +1,4 @@ -name: sdk/cloudflare +name: shared/mocks on: push: diff --git a/actions/ci/action.yml b/actions/ci/action.yml index 439e4a3d5..ff4decb97 100644 --- a/actions/ci/action.yml +++ b/actions/ci/action.yml @@ -40,4 +40,5 @@ runs: - name: Build Docs shell: bash + if: ${{inputs.workspace_name != '@launchdarkly/private-js-mocks'}} run: yarn build:doc -- ${{ inputs.workspace_path }} From aa596fb7a61dc9be56dba5d2f1b49708b5d43eff Mon Sep 17 00:00:00 2001 From: Yusinto Ngadiman Date: Mon, 2 Oct 2023 15:44:39 -0700 Subject: [PATCH 3/3] fix: parameterize build-docs step --- .github/workflows/mocks.yml | 1 + actions/ci/action.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mocks.yml b/.github/workflows/mocks.yml index 59ade4b21..674aa7a70 100644 --- a/.github/workflows/mocks.yml +++ b/.github/workflows/mocks.yml @@ -22,3 +22,4 @@ jobs: with: workspace_name: '@launchdarkly/private-js-mocks' workspace_path: packages/shared/mocks + should_build_docs: false diff --git a/actions/ci/action.yml b/actions/ci/action.yml index ff4decb97..6751d0cbd 100644 --- a/actions/ci/action.yml +++ b/actions/ci/action.yml @@ -11,7 +11,9 @@ inputs: workspace_path: description: 'Path to the package to release.' required: true - + should_build_docs: + description: 'Whether docs should be built. It will be by default.' + default: true runs: using: composite steps: @@ -40,5 +42,5 @@ runs: - name: Build Docs shell: bash - if: ${{inputs.workspace_name != '@launchdarkly/private-js-mocks'}} + if: ${{inputs.should_build_docs == 'true'}} run: yarn build:doc -- ${{ inputs.workspace_path }}