From a3f33a6f6a01ecf08a5f47fac5d850b08c658592 Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Tue, 5 Dec 2023 09:47:46 -0800 Subject: [PATCH] core[infra]: Adds turbo to core (#3551) --- docs/api_refs/package.json | 2 +- langchain-core/package.json | 4 +++- langchain-core/turbo.json | 23 +++++++++++++++++++++++ yarn.lock | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 langchain-core/turbo.json diff --git a/docs/api_refs/package.json b/docs/api_refs/package.json index c14730aabf79..63785f5673a5 100644 --- a/docs/api_refs/package.json +++ b/docs/api_refs/package.json @@ -6,7 +6,7 @@ "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 turbo run build:next", + "build": "yarn turbo run build --filter=@langchain/core --no-cache && yarn turbo run build:next", "build:next": "next build", "start": "yarn build && next start -p 3001", "lint": "next lint" diff --git a/langchain-core/package.json b/langchain-core/package.json index 09a6759cd513..00c5fa943c83 100644 --- a/langchain-core/package.json +++ b/langchain-core/package.json @@ -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 turbo run build:scripts", + "build:envs": "yarn build:esm && yarn build:cjs", "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", @@ -61,6 +62,7 @@ "prettier": "^2.8.3", "release-it": "^15.10.1", "rimraf": "^5.0.1", + "turbo": "latest", "typescript": "^5.0.0" }, "publishConfig": { diff --git a/langchain-core/turbo.json b/langchain-core/turbo.json new file mode 100644 index 000000000000..5fe0abbb4ad8 --- /dev/null +++ b/langchain-core/turbo.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "pipeline": { + "build:scripts": { + "outputs": [ + "tsconfig.json", + "package.json", + "**/*.js", + "**/*.d.ts", + "**/*.cjs", + "dist-cjs/**" + ], + "dependsOn": ["build:envs"] + }, + "build:envs": { + "dependsOn": ["clean"] + }, + "clean": { + "outputs": [".turbo/**", "dist/**"] + } + } +} diff --git a/yarn.lock b/yarn.lock index 9a079463e64a..ec00a845eef2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8045,6 +8045,7 @@ __metadata: prettier: ^2.8.3 release-it: ^15.10.1 rimraf: ^5.0.1 + turbo: latest typescript: ^5.0.0 uuid: ^9.0.0 zod: ^3.22.3