Skip to content

Commit

Permalink
conditonal api docs build
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Nov 6, 2023
1 parent 6a44bc0 commit 1da4e66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test-exports.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,11 @@
"url": "[email protected]: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",
Expand Down

0 comments on commit 1da4e66

Please sign in to comment.