Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all[minor]: Bump TS to ^5.4.5 #5263

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ docs/api_refs/typedoc.json

.tool-versions
credentials.json

# Auto-generated during cjs build
# Should always be removed, adding this as a fallback.
**/**/src/package.json
langchain/src/package.json
langchain-core/src/package.json
2 changes: 1 addition & 1 deletion docs/api_refs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"prettier": "^2.8.3",
"tailwindcss": "^3.3.0",
"typedoc": "^0.25.6",
"typescript": "~5.1.6"
"typescript": "^5.4.5"
}
}
2 changes: 1 addition & 1 deletion environment_tests/test-exports-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
"@types/node": "^18.15.11",
"typescript": "^5.0.0"
"typescript": "^5.4.5"
}
}
2 changes: 1 addition & 1 deletion environment_tests/test-exports-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"d3-dsv": "2",
"hnswlib-node": "^3.0.0",
"langchain": "workspace:*",
"typescript": "^5.0.0"
"typescript": "^5.4.5"
},
"devDependencies": {
"@types/node": "^18.15.11",
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"esbuild": "^0.17.18",
"hnswlib-node": "^3.0.0",
"langchain": "workspace:*",
"typescript": "^5.0.0"
"typescript": "^5.4.5"
},
"devDependencies": {
"@types/node": "^18.15.11",
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"d3-dsv": "2",
"hnswlib-node": "^3.0.0",
"langchain": "workspace:*",
"typescript": "^5.0.0"
"typescript": "^5.4.5"
},
"devDependencies": {
"@types/node": "^18.15.11",
Expand Down
2 changes: 1 addition & 1 deletion environment_tests/test-exports-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"next": "13.4.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "^5.0.0"
"typescript": "^5.4.5"
}
}
2 changes: 1 addition & 1 deletion environment_tests/test-exports-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@langchain/core": "workspace:*",
"@langchain/openai": "workspace:*",
"langchain": "workspace:*",
"typescript": "^5.0.0",
"typescript": "^5.4.5",
"vite": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@
"eslint-plugin-unused-imports": "^3.0.0",
"prettier": "^2.8.3",
"tsx": "^3.12.3",
"typescript": "~5.1.6"
"typescript": "^5.4.5"
}
}
10 changes: 5 additions & 5 deletions langchain-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"scripts": {
"build": "yarn build:deps && yarn clean && yarn build:esm && yarn build:cjs && yarn run build:scripts",
"build:deps": "yarn turbo:command build --filter=@langchain/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 && yarn move-cjs-to-dist && rimraf dist-cjs",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 rm -f src/package.json && tsc --outDir dist/ && rimraf dist/tests dist/**/tests",
"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 && rimraf dist-cjs src/package.json",
"build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
"build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
Expand All @@ -43,8 +43,8 @@
"ansi-styles": "^5.0.0",
"camelcase": "6",
"decamelize": "1.2.0",
"js-tiktoken": "^1.0.8",
"langsmith": "~0.1.7",
"js-tiktoken": "file:/Users/bracesproul/code/lang-chain-ai/js-tiktoken/js",
"langsmith": "latest",
"ml-distance": "^4.0.0",
"mustache": "^4.2.0",
"p-queue": "^6.6.2",
Expand Down Expand Up @@ -74,7 +74,7 @@
"release-it": "^15.10.1",
"rimraf": "^5.0.1",
"turbo": "latest",
"typescript": "~5.1.6",
"typescript": "^5.4.5",
"web-streams-polyfill": "^3.3.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion langchain-core/src/callbacks/promises.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let queue: typeof import("p-queue")["default"]["prototype"];
*/
function createQueue() {
const PQueue = "default" in PQueueMod ? PQueueMod.default : PQueueMod;
return new PQueue({
return new (PQueue as typeof import("p-queue")["default"])({
autoStart: true,
concurrency: 1,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@cfworker/json-schema",
"type": "module",
"version": "1.12.5",
"description": "A JSON schema validator that will run on Cloudflare workers. Supports drafts 4, 7, 2019-09, and 2020-12.",
"keywords": [
Expand Down
4 changes: 3 additions & 1 deletion langchain-core/src/utils/async_caller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export class AsyncCaller {
params.onFailedAttempt ?? defaultFailedAttemptHandler;

const PQueue = "default" in PQueueMod ? PQueueMod.default : PQueueMod;
this.queue = new PQueue({ concurrency: this.maxConcurrency });
this.queue = new (PQueue as typeof import("p-queue")["default"])({
concurrency: this.maxConcurrency,
});
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
1 change: 0 additions & 1 deletion langchain-core/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": [
Expand Down
4 changes: 2 additions & 2 deletions langchain-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ES2022.Object",
"DOM"
],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand All @@ -30,4 +30,4 @@
"dist",
"docs"
]
}
}
10 changes: 5 additions & 5 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,8 @@
"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/openai --filter=@langchain/community --filter=@langchain/textsplitters --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 && yarn move-cjs-to-dist && rimraf dist-cjs",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 rm -f src/package.json && tsc --outDir dist/ && rimraf dist/tests dist/**/tests",
"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 && rimraf dist-cjs src/package.json",
"build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
"build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
Expand Down Expand Up @@ -1306,7 +1306,7 @@
"srt-parser-2": "^1.2.3",
"ts-jest": "^29.1.0",
"typeorm": "^0.3.12",
"typescript": "~5.1.6",
"typescript": "^5.4.5",
"weaviate-ts-client": "^2.0.0",
"web-auth-library": "^1.0.3",
"wikipedia": "^2.1.2",
Expand Down Expand Up @@ -1538,8 +1538,8 @@
"js-tiktoken": "^1.0.7",
"js-yaml": "^4.1.0",
"jsonpointer": "^5.0.1",
"langchainhub": "~0.0.8",
"langsmith": "~0.1.7",
"langchainhub": "^0.0.10",
"langsmith": "^0.1.22",
"ml-distance": "^4.0.0",
"openapi-types": "^12.1.3",
"p-retry": "4",
Expand Down
1 change: 1 addition & 0 deletions langchain/src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion langchain/src/smith/runner_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CallbackManagerRunTree extends RunTree {
this.callbackManager = callbackManager;
}

async createChild(config: RunTreeConfig): Promise<CallbackManagerRunTree> {
createChild(config: RunTreeConfig): CallbackManagerRunTree {
const child = new CallbackManagerRunTree(
{
...config,
Expand Down
10 changes: 8 additions & 2 deletions langchain/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": [
"node_modules",
"dist",
"docs",
"**/tests"
"**/tests",
"src/chains/sql_db/sql_db_chain.ts",
"src/document_loaders/fs/srt.ts",
"src/document_loaders/web/browserbase.ts",
"src/document_loaders/web/firecrawl.ts",
"",
"",
""
]
}
4 changes: 2 additions & 2 deletions langchain/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ES2022.Object",
"DOM"
],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand All @@ -30,4 +30,4 @@
"dist",
"docs"
]
}
}
2 changes: 1 addition & 1 deletion libs/create-langchain-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"picocolors": "^1.0.0",
"prettier": "^2.8.3",
"prompts": "^2.4.2",
"typescript": "~5.1.6",
"typescript": "^5.4.5",
"update-check": "^1.5.4",
"validate-npm-package-name": "^5.0.0"
}
Expand Down
6 changes: 3 additions & 3 deletions libs/create-langchain-integration/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-INTEGRATION_NAME/",
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"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 && yarn move-cjs-to-dist && rm -rf dist-cjs",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 rm -f src/package.json && tsc --outDir dist/ && rm -rf dist/tests dist/**/tests",
"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 && rimraf dist-cjs src/package.json",
"build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
"build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
Expand Down Expand Up @@ -62,7 +62,7 @@
"prettier": "^2.8.3",
"rollup": "^4.5.2",
"ts-jest": "^29.1.0",
"typescript": "<5.2.0"
"typescript": "^5.4.5"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": ["node_modules", "dist", "docs", "**/tests"]
Expand Down
2 changes: 1 addition & 1 deletion libs/create-langchain-integration/template/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"rootDir": "./src",
"target": "ES2021",
"lib": ["ES2021", "ES2022.Object", "DOM"],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion libs/create-langchain-integration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"rootDir": "./",
"target": "ES2021",
"lib": ["ES2021", "ES2022.Object", "DOM"],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion libs/langchain-anthropic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"prettier": "^2.8.3",
"release-it": "^15.10.1",
"rimraf": "^5.0.1",
"typescript": "~5.1.6"
"typescript": "^5.4.5"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion libs/langchain-anthropic/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": [
Expand Down
4 changes: 2 additions & 2 deletions libs/langchain-anthropic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ES2022.Object",
"DOM"
],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand All @@ -30,4 +30,4 @@
"dist",
"docs"
]
}
}
2 changes: 1 addition & 1 deletion libs/langchain-azure-openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"prettier": "^2.8.3",
"release-it": "^15.10.1",
"rimraf": "^5.0.1",
"typescript": "~5.1.6"
"typescript": "^5.4.5"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion libs/langchain-azure-openai/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"declaration": false
},
"exclude": [
Expand Down
4 changes: 2 additions & 2 deletions libs/langchain-azure-openai/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ES2022.Object",
"DOM"
],
"module": "ES2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"declaration": true,
Expand All @@ -30,4 +30,4 @@
"dist",
"docs"
]
}
}
7 changes: 4 additions & 3 deletions libs/langchain-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-cloudflare/",
"scripts": {
"build": "yarn clean && yarn build:esm && yarn build:cjs && yarn build:scripts",
"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 && yarn move-cjs-to-dist && rm -rf dist-cjs",
"build:esm": "NODE_OPTIONS=--max-old-space-size=4096 rm -f src/package.json && tsc --outDir dist/ && rm -rf dist/tests dist/**/tests",
"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 && rimraf dist-cjs src/package.json",
"build:watch": "yarn create-entrypoints && tsc --outDir dist/ --watch",
"build:scripts": "yarn create-entrypoints && yarn check-tree-shaking",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
Expand Down Expand Up @@ -64,9 +64,10 @@
"jest-environment-node": "^29.6.4",
"prettier": "^2.8.3",
"release-it": "^15.10.1",
"rimraf": "^5.0.1",
"rollup": "^4.5.2",
"ts-jest": "^29.1.0",
"typescript": "<5.2.0"
"typescript": "^5.4.5"
},
"publishConfig": {
"access": "public"
Expand Down