From 1da4e66e52bc4d4b1c4446d676ea8d93f2ea825f Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Sun, 5 Nov 2023 21:44:25 -0800 Subject: [PATCH] conditonal api docs build --- .github/workflows/test-exports.yml | 18 +++++++++--------- langchain/package.json | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-exports.yml b/.github/workflows/test-exports.yml index 208afa4e608a..dc4c51dd640e 100644 --- a/.github/workflows/test-exports.yml +++ b/.github/workflows/test-exports.yml @@ -1,8 +1,8 @@ name: Environment tests on: - workflow_dispatch: # Allows triggering the workflow manually in GitHub UI - workflow_call: # Allows triggering the workflow from another workflow + workflow_dispatch: # Allows triggering the workflow manually in GitHub UI + workflow_call: # Allows triggering the workflow from another workflow # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test esbuild exports run: docker compose -f docker-compose.yml run test-exports-esbuild @@ -51,7 +51,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test esm exports run: docker compose -f docker-compose.yml run test-exports-esm @@ -68,7 +68,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test cjs exports run: docker compose -f docker-compose.yml run test-exports-cjs @@ -85,7 +85,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test cf exports run: docker compose -f docker-compose.yml run test-exports-cf @@ -102,7 +102,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test vercel exports run: docker compose -f docker-compose.yml run test-exports-vercel @@ -119,7 +119,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test vite exports run: docker compose -f docker-compose.yml run test-exports-vite @@ -136,7 +136,7 @@ jobs: - name: Install dependencies run: yarn install --immutable - name: Build - run: yarn workspace langchain build + run: SKIP_API_DOCS=true yarn workspace langchain build - name: Test bun exports run: docker compose -f docker-compose.yml run test-exports-bun diff --git a/langchain/package.json b/langchain/package.json index 82099f3db6a5..7acbb150d38b 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -793,10 +793,11 @@ "url": "git@github.com:langchain-ai/langchainjs.git" }, "scripts": { - "build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js && yarn build:api-docs", + "build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js && yarn conditional:api-docs", "build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/ && rimraf dist/tests dist/**/tests", "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs", "build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch", + "conditional:api-docs": "if [ -z \"$SKIP_API_DOCS\" ]; then yarn build:api-docs; fi", "build:api-docs": "cd ../api-docs && yarn gen:typedoc", "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", "lint:fix": "yarn lint --fix",