Skip to content

Commit

Permalink
infra[patch]: Use latest turbo repo and build setup (#271)
Browse files Browse the repository at this point in the history
* infra[patch]: Use latest turbo repo and build setup

* bruh

* fix script

* try this

* cr

* cr

* cr

* cr

* cr

* cr

* cr

* new unit test

* cr

* drop ubuntu test env

* try sum new for cache

* bruh

* fast fail false

* cr

* cr

* cr

* bump turbo version

* tmp try canary

* cr

* cr

* cr

* cr

* cr

* upgrade langchain/scripts

* cr

* cr

* cr

* cr
  • Loading branch information
bracesproul authored Jul 24, 2024
1 parent 653887d commit d5c8a51
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 119 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NODE_VERSION: "22.4.1"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js "22.4.1"
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "22.4.1"
cache: "yarn"
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Build
run: yarn build

Expand All @@ -40,13 +45,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js "22.4.1"
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "22.4.1"
cache: "yarn"
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Check linting
run: yarn run lint

Expand All @@ -55,13 +62,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js "22.4.1"
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "22.4.1"
cache: "yarn"
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Check formatting
run: yarn run format:check

Expand Down
15 changes: 4 additions & 11 deletions langgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,19 @@
"url": "[email protected]:langchain-ai/langgraphjs.git"
},
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 rm -f src/package.json && tsc --outDir dist/",
"build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 echo '{}' > src/package.json && tsc --outDir dist-cjs/ -p tsconfig.cjs.json && yarn move-cjs-to-dist && rm -rf dist-cjs/ src/package.json",
"build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
"build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
"build": "yarn turbo:command build:internal --filter=@langchain/langgraph",
"build:internal": "yarn lc_build_v2 --create-entrypoints --pre --tree-shaking",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
"lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
"lint": "yarn lint:eslint && yarn lint:dpdm",
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
"clean": "rm -rf dist/ dist-cjs/ src/package.json && NODE_OPTIONS=--max-old-space-size=4096 yarn create-entrypoints -- --pre",
"prepack": "yarn build",
"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:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
"format": "prettier --config .prettierrc --write \"src\"",
"format:check": "prettier --config .prettierrc --check \"src\"",
"move-cjs-to-dist": "yarn lc-build --config ./langchain.config.js --move-cjs-dist",
"create-entrypoints": "yarn lc-build --config ./langchain.config.js --create-entrypoints",
"check-tree-shaking": "yarn lc-build --config ./langchain.config.js --tree-shaking"
"format:check": "prettier --config .prettierrc --check \"src\""
},
"author": "LangChain",
"license": "MIT",
Expand All @@ -46,7 +39,7 @@
"@langchain/anthropic": "^0.2.6",
"@langchain/community": "^0.2.19",
"@langchain/openai": "^0.2.4",
"@langchain/scripts": "^0.0.18",
"@langchain/scripts": "0.0.19-rc.0",
"@swc/core": "^1.3.90",
"@swc/jest": "^0.2.29",
"@tsconfig/recommended": "^1.0.3",
Expand Down
1 change: 1 addition & 0 deletions langgraph/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": ["node_modules", "dist", "docs", "**/tests"]
Expand Down
11 changes: 11 additions & 0 deletions langgraph/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["**/dist/**"]
},
"build:internal": {
"dependsOn": ["^build:internal"]
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"langgraph"
],
"scripts": {
"build": "turbo run build --concurrency=1",
"build": "turbo run build",
"turbo:command": "turbo",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
Expand All @@ -44,7 +44,7 @@
"semver": "^7.5.4",
"tslab": "^1.0.21",
"tsx": "^4.7.0",
"turbo": "latest",
"turbo": "canary",
"typedoc": "^0.25.13",
"typescript": "^4.9.5 || ^5.4.5"
},
Expand Down
52 changes: 22 additions & 30 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env"],
"pipeline": {
"@langchain/langgraph#build": {
"outputs": ["langgraph/dist/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": [
"langgraph/src/**/*.ts",
"langgraph/scripts/**/*.js",
"langgraph/package.json",
"langgraph/tsconfig.json"
]
},
"tasks": {
"build": {
"dependsOn": ["@langchain/langgraph#build", "^build"],
"outputs": ["langgraph/dist/**", "*.js", "*.cjs", "*.d.ts"],
"inputs": [
"langgraph/src/**/*.ts",
"langgraph/scripts/**/*.js",
"langgraph/package.json",
"langgraph/tsconfig.json"
]
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"build:internal": {
"dependsOn": ["^build:internal"]
},
"lint": {
"outputs": []
"dependsOn": ["^lint"]
},
"lint:fix": {
"outputs": ["langgraph/src/**/*.ts", "**/*.eslintcache"],
"inputs": ["langgraph/src/**/*.ts"]
"dependsOn": ["^lint:fix"]
},
"format": {
"outputs": []
"dependsOn": ["^format"]
},
"format:check": {
"outputs": []
},
"clean": {
"outputs": []
"dependsOn": ["^format:check"]
},
"test": {
"outputs": [],
"dependsOn": ["^build"]
"cache": false,
"dependsOn": ["^build", "build"]
},
"test:single": {
"dependsOn": ["^build", "build"]
},
"test:int": {
"dependsOn": ["^build", "build"]
},
"test:integration": {
"outputs": [],
"dependsOn": ["^build"]
"dependsOn": ["^build", "build", "test:int"]
},
"clean": {
"dependsOn": ["^clean"]
},
"precommit": {},
"start": {
Expand Down
Loading

0 comments on commit d5c8a51

Please sign in to comment.