Skip to content

Commit

Permalink
all[patch]: Ensure other subpackages are built before test/build (#3624)
Browse files Browse the repository at this point in the history
* Ensure other subpackages are built before test/build

* Fix test

* Fix API ref build

* Fix docs build

* Fix build

* Fix build

* Build serially

* Fix build
  • Loading branch information
jacoblee93 authored and bracesproul committed Dec 12, 2023
1 parent 3f3e6c0 commit 079530f
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 56 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -114,7 +114,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build:deps && yarn workspace langchain build
run: yarn workspace langchain build
shell: bash
env:
SKIP_API_DOCS: true
Expand All @@ -154,7 +154,7 @@ jobs:
# - name: Install dependencies
# run: yarn install --immutable
# - name: Build
# run: yarn run build:deps && yarn workspace langchain build
# run: yarn workspace langchain build
# shell: bash
# env:
# SKIP_API_DOCS: true
Expand Down
3 changes: 2 additions & 1 deletion docs/api_refs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev -p 3001",
"typedoc": "npx typedoc --options typedoc.json",
"build:scripts": "node ./scripts/generate-api-refs.js && node ./scripts/update-typedoc-css.js",
"build": "yarn run build:deps && yarn workspace langchain build && yarn build:scripts && next build",
"build": "yarn run build:deps && yarn build:scripts && next build",
"build:deps": "yarn run turbo:command build --filter=@langchain/core --filter=@langchain/anthropic --filter=@langchain/openai --filter=@langchain/community --filter=langchain --concurrency=1",
"start": "yarn build && next start -p 3001",
"lint": "next lint"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"docusaurus": "docusaurus",
"start": "yarn build:typedoc && rimraf ./docs/api && NODE_OPTIONS=--max-old-space-size=7168 docusaurus start",
"build": "yarn build:typedoc && rimraf ./build && NODE_OPTIONS=--max-old-space-size=7168 DOCUSAURUS_SSR_CONCURRENCY=4 docusaurus build",
"build:typedoc": "cd ../api_refs && yarn build",
"build:typedoc": "yarn run turbo:command build --filter=api_refs",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down
3 changes: 1 addition & 2 deletions langchain-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"url": "git@github.com:langchain-ai/langchainjs.git"
},
"scripts": {
"build": "yarn turbo run build:scripts",
"build:envs": "yarn build:esm && yarn build:cjs",
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn run build:scripts",
"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",
Expand Down
23 changes: 0 additions & 23 deletions langchain-core/turbo.json

This file was deleted.

11 changes: 6 additions & 5 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,8 @@
"url": "git@github.com:langchain-ai/langchainjs.git"
},
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build": "yarn run build:deps && yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build:deps": "yarn run turbo:command build --filter=@langchain/core --filter=@langchain/anthropic --filter=@langchain/openai --filter=@langchain/community --concurrency=1",
"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",
Expand All @@ -872,10 +873,10 @@
"clean": "rimraf .turbo/ dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
"prepack": "yarn build",
"release": "release-it --only-version --config .release-it.json",
"test": "cd ../ && yarn build:deps && cd ./langchain/ && yarn build && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:integration": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"test": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:integration": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
"test:single": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"format": "prettier --write \"src\"",
"format:check": "prettier --check \"src\""
},
Expand Down
9 changes: 5 additions & 4 deletions libs/langchain-anthropic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"url": "git@github.com:langchain-ai/langchainjs.git"
},
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build": "yarn run build:deps && yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build:deps": "yarn run turbo:command build --filter=@langchain/core",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/",
"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",
Expand All @@ -25,9 +26,9 @@
"clean": "rimraf .turbo/ dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
"prepack": "yarn build",
"release": "release-it --only-version --config .release-it.json",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"test": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"format": "prettier --write \"src\"",
"format:check": "prettier --check \"src\""
},
Expand Down
9 changes: 5 additions & 4 deletions libs/langchain-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"url": "git@github.com:langchain-ai/langchainjs.git"
},
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build": "yarn run build:deps && yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build:deps": "yarn run turbo:command build --filter=@langchain/core --filter=@langchain/anthropic --filter=@langchain/openai --concurrency=1",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/ && rm -rf 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 && rm -rf dist-cjs",
"build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch",
Expand All @@ -23,9 +24,9 @@
"clean": "rm -rf dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
"prepack": "yarn build",
"release": "release-it --only-version --config .release-it.json",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"test": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"test:integration": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
"format": "prettier --write \"src\"",
"format:check": "prettier --check \"src\""
Expand Down
9 changes: 5 additions & 4 deletions libs/langchain-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"url": "git@github.com:langchain-ai/langchainjs.git"
},
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build": "yarn run build:deps && yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build:deps": "yarn run turbo:command build --filter=@langchain/core",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist/",
"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",
Expand All @@ -25,9 +26,9 @@
"clean": "rimraf .turbo/ dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
"prepack": "yarn build",
"release": "release-it --only-version --config .release-it.json",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"test": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
"test:watch": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
"test:single": "yarn run build:deps && NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000",
"format": "prettier --write \"src\"",
"format:check": "prettier --check \"src\""
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"packageManager": "yarn@3.4.1",
"scripts": {
"build": "turbo run build --filter=\"!test-exports-*\" --concurrency 1",
"build:deps": "yarn workspace @langchain/core build && yarn workspace @langchain/anthropic build && yarn workspace @langchain/openai build && yarn workspace @langchain/community build",
"turbo:command": "turbo",
"format": "turbo run format",
"format:check": "turbo run format:check",
"lint": "turbo run lint --concurrency 1",
Expand Down
17 changes: 13 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env"],
"pipeline": {
"@langchain/core#build": {},
"@langchain/core#build": {
"outputs": ["dist/**", "dist-cjs/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"]
},
"@langchain/anthropic#build": {
"dependsOn": ["@langchain/core#build"]
"dependsOn": ["@langchain/core#build"],
"outputs": ["dist/**", "dist-cjs/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"]
},
"@langchain/openai#build": {
"dependsOn": ["@langchain/core#build"]
"dependsOn": ["@langchain/core#build"],
"outputs": ["dist/**", "dist-cjs/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"]
},
"@langchain/community#build": {
"dependsOn": ["@langchain/openai#build"]
"dependsOn": ["@langchain/openai#build"],
"outputs": ["dist/**", "dist-cjs/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"]
},
"build": {
"dependsOn": ["@langchain/core#build", "@langchain/community#build", "^build"],
Expand Down

0 comments on commit 079530f

Please sign in to comment.