Skip to content

Commit c2f1122

Browse files
committed
adapt remaining packages
1 parent c91781a commit c2f1122

File tree

120 files changed

+1032
-1828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1032
-1828
lines changed

β€Ž.changeset/config.jsonβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
"baseBranch": "main",
1818
"updateInternalDependencies": "patch",
1919
"ignore": [
20-
"examples",
21-
"@langchain/build",
22-
"@langchain/eslint"
20+
"examples"
2321
],
2422
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
2523
"onlyUpdatePeerDependentsWhenOutOfRange": true
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
"@langchain/azure-dynamic-sessions": patch
3+
"@langchain/google-cloud-sql-pg": patch
4+
"@langchain/google-vertexai-web": patch
5+
"@langchain/google-vertexai": patch
6+
"@langchain/azure-cosmosdb": patch
7+
"@langchain/google-webauth": patch
8+
"@langchain/baidu-qianfan": patch
9+
"@langchain/google-common": patch
10+
"@langchain/mixedbread-ai": patch
11+
"@langchain/google-gauth": patch
12+
"@langchain/google-genai": patch
13+
"@langchain/cloudflare": patch
14+
"@langchain/anthropic": patch
15+
"@langchain/mistralai": patch
16+
"@langchain/cerebras": patch
17+
"@langchain/deepseek": patch
18+
"@langchain/pinecone": patch
19+
"@langchain/weaviate": patch
20+
"@langchain/mongodb": patch
21+
"@langchain/cohere": patch
22+
"@langchain/ollama": patch
23+
"@langchain/openai": patch
24+
"@langchain/qdrant": patch
25+
"@langchain/tavily": patch
26+
"@langchain/yandex": patch
27+
"@langchain/nomic": patch
28+
"@langchain/redis": patch
29+
"@langchain/standard-tests": patch
30+
"@langchain/groq": patch
31+
"@langchain/textsplitters": patch
32+
"@langchain/aws": patch
33+
"@langchain/exa": patch
34+
"@langchain/xai": patch
35+
"@langchain/mcp-adapters": patch
36+
"@langchain/community": patch
37+
"@langchain/classic": patch
38+
"@langchain/core": patch
39+
"@langchain/eslint": patch
40+
"@langchain/build": patch
41+
"langchain": patch
42+
---
43+
44+
fix commonjs compatibility

β€Ž.github/workflows/platform-compatibility.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
node-version-file: ".nvmrc"
3737
cache: "pnpm"
38-
- name: Install dependencies for build and core workspaces
39-
run: pnpm install --filter @langchain/build --filter @langchain/core
38+
- name: Install dependencies
39+
run: pnpm install --no-frozen-lockfile
4040
- name: Build `@langchain/core`
4141
run: pnpm --filter @langchain/core build

β€Ždependency_range_tests/scripts/langchain/node/update_resolutions_latest.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const currentPackageJson = JSON.parse(
66
);
77
currentPackageJson.pnpm = { overrides: {} };
88

9-
const INTERNAL_PACKAGES = ["@langchain/eslint"];
9+
const INTERNAL_PACKAGES = ["@langchain/build", "@langchain/eslint"];
1010

1111
if (
1212
currentPackageJson.peerDependencies?.["@langchain/core"] &&

β€Žinternal/build/index.tsβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import fs from "node:fs";
22
import { resolve } from "node:path";
33
import { Options as BuildOptions } from "tsdown";
4-
import { type PackageJson } from "type-fest";
4+
import type { PackageJson } from "type-fest";
55
import { extname } from "node:path";
6-
import { barrelDtsPlugin } from "./plugins/barrel-dts";
6+
import { barrelDtsPlugin } from "./plugins/barrel-dts.js";
77

88
export {
99
type ImportConstantsPluginOptions,
1010
importConstantsPlugin,
11-
} from "./plugins/import-constants";
11+
} from "./plugins/import-constants.js";
1212
export {
1313
type ImportMapPluginOptions,
1414
importMapPlugin,
15-
} from "./plugins/import-map";
15+
} from "./plugins/import-map.js";
1616
export {
1717
type SecretPluginOptions,
1818
lcSecretsPlugin,
19-
} from "./plugins/lc-secrets";
19+
} from "./plugins/lc-secrets.js";
2020
export {
2121
type BarrelDtsPluginOptions,
2222
barrelDtsPlugin,
23-
} from "./plugins/barrel-dts";
23+
} from "./plugins/barrel-dts.js";
2424

2525
/**
2626
* Extracts entry point paths from a package.json exports field.

β€Žinternal/build/plugins/barrel-dts.tsβ€Ž

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async function generateBarrelFiles(
177177
packagePath: string,
178178
barrelFiles: Record<string, string>
179179
): Promise<void> {
180-
for (const [barrelPath] of Object.entries(barrelFiles)) {
180+
for (const [barrelPath, typesPath] of Object.entries(barrelFiles)) {
181181
const barrelFilePath = resolve(packagePath, `${barrelPath}.d.ts`);
182182

183183
// Ensure parent directory exists
@@ -186,8 +186,8 @@ async function generateBarrelFiles(
186186
fs.mkdirSync(parentDir, { recursive: true });
187187
}
188188

189-
// Calculate relative path from barrel file to the dist path
190-
const relativePath = calculateRelativePath(barrelPath);
189+
// Calculate relative path from barrel file to the dist types file (without extension)
190+
const relativePath = calculateRelativePath(barrelPath, typesPath);
191191

192192
// Generate the barrel file content
193193
const content = `export * from "${relativePath}";`;
@@ -198,16 +198,25 @@ async function generateBarrelFiles(
198198
}
199199

200200
/**
201-
* Calculate the relative path from barrel file location to the dist path
201+
* Calculate the relative path from barrel file location to the dist types file
202202
* Returns path without file extension for proper TypeScript module resolution
203203
*/
204-
function calculateRelativePath(barrelPath: string): string {
204+
function calculateRelativePath(barrelPath: string, typesPath: string): string {
205205
const barrelDepth = barrelPath.split("/").length - 1;
206206

207207
// Build the relative path with appropriate ../
208208
const upLevels = barrelDepth > 0 ? "../".repeat(barrelDepth) : "./";
209209

210-
return `${upLevels}dist/${barrelPath}`;
210+
// Remove the leading ./ and file extension from typesPath
211+
const cleanPath = typesPath
212+
.replace(/^\.\//, "")
213+
.replace(/\.d\.cts$/, "")
214+
.replace(/\.d\.ts$/, "")
215+
.replace(/\.cts$/, "")
216+
.replace(/\.ts$/, "")
217+
.replace(/\.js$/, "");
218+
219+
return `${upLevels}${cleanPath}`;
211220
}
212221

213222
/**
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/*.d.ts
2+
!src/**/*.d.ts
3+
node_modules
4+
dist

β€Žlibs/langchain-classic/package.jsonβ€Ž

Lines changed: 95 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,100 @@
1212
"dist/",
1313
"CHANGELOG.md",
1414
"README.md",
15-
"LICENSE"
15+
"LICENSE",
16+
"load.d.ts",
17+
"load/serializable.d.ts",
18+
"agents.d.ts",
19+
"agents/load.d.ts",
20+
"agents/toolkits.d.ts",
21+
"agents/toolkits/sql.d.ts",
22+
"agents/format_scratchpad.d.ts",
23+
"agents/format_scratchpad/openai_tools.d.ts",
24+
"agents/format_scratchpad/log.d.ts",
25+
"agents/format_scratchpad/xml.d.ts",
26+
"agents/format_scratchpad/log_to_message.d.ts",
27+
"agents/react/output_parser.d.ts",
28+
"agents/xml/output_parser.d.ts",
29+
"agents/openai/output_parser.d.ts",
30+
"tools.d.ts",
31+
"tools/chain.d.ts",
32+
"tools/render.d.ts",
33+
"tools/retriever.d.ts",
34+
"tools/sql.d.ts",
35+
"tools/webbrowser.d.ts",
36+
"chains.d.ts",
37+
"chains/combine_documents.d.ts",
38+
"chains/combine_documents/reduce.d.ts",
39+
"chains/history_aware_retriever.d.ts",
40+
"chains/load.d.ts",
41+
"chains/openai_functions.d.ts",
42+
"chains/query_constructor.d.ts",
43+
"chains/query_constructor/ir.d.ts",
44+
"chains/retrieval.d.ts",
45+
"chains/sql_db.d.ts",
46+
"chains/graph_qa/cypher.d.ts",
47+
"chat_models/universal.d.ts",
48+
"embeddings/cache_backed.d.ts",
49+
"embeddings/fake.d.ts",
50+
"vectorstores/memory.d.ts",
51+
"text_splitter.d.ts",
52+
"memory.d.ts",
53+
"memory/chat_memory.d.ts",
54+
"document.d.ts",
55+
"document_loaders/base.d.ts",
56+
"document_loaders/fs/buffer.d.ts",
57+
"document_loaders/fs/directory.d.ts",
58+
"document_loaders/fs/json.d.ts",
59+
"document_loaders/fs/multi_file.d.ts",
60+
"document_loaders/fs/text.d.ts",
61+
"document_transformers/openai_functions.d.ts",
62+
"sql_db.d.ts",
63+
"callbacks.d.ts",
64+
"output_parsers.d.ts",
65+
"output_parsers/expression.d.ts",
66+
"retrievers/contextual_compression.d.ts",
67+
"retrievers/document_compressors.d.ts",
68+
"retrievers/ensemble.d.ts",
69+
"retrievers/multi_query.d.ts",
70+
"retrievers/multi_vector.d.ts",
71+
"retrievers/parent_document.d.ts",
72+
"retrievers/time_weighted.d.ts",
73+
"retrievers/document_compressors/chain_extract.d.ts",
74+
"retrievers/document_compressors/embeddings_filter.d.ts",
75+
"retrievers/hyde.d.ts",
76+
"retrievers/score_threshold.d.ts",
77+
"retrievers/self_query.d.ts",
78+
"retrievers/self_query/functional.d.ts",
79+
"retrievers/matryoshka_retriever.d.ts",
80+
"cache/file_system.d.ts",
81+
"stores/doc/base.d.ts",
82+
"stores/doc/in_memory.d.ts",
83+
"stores/file/in_memory.d.ts",
84+
"stores/file/node.d.ts",
85+
"stores/message/in_memory.d.ts",
86+
"storage/encoder_backed.d.ts",
87+
"storage/in_memory.d.ts",
88+
"storage/file_system.d.ts",
89+
"hub.d.ts",
90+
"hub/node.d.ts",
91+
"util/document.d.ts",
92+
"util/math.d.ts",
93+
"util/time.d.ts",
94+
"experimental/autogpt.d.ts",
95+
"experimental/openai_assistant.d.ts",
96+
"experimental/openai_files.d.ts",
97+
"experimental/babyagi.d.ts",
98+
"experimental/generative_agents.d.ts",
99+
"experimental/plan_and_execute.d.ts",
100+
"experimental/chains/violation_of_expectations.d.ts",
101+
"experimental/masking.d.ts",
102+
"experimental/prompts/custom_format.d.ts",
103+
"experimental/prompts/handlebars.d.ts",
104+
"evaluation.d.ts",
105+
"smith.d.ts",
106+
"indexes.d.ts",
107+
"schema/query_constructor.d.ts",
108+
"schema/prompt_template.d.ts"
16109
],
17110
"repository": {
18111
"type": "git",
@@ -1232,4 +1325,4 @@
12321325
},
12331326
"./package.json": "./package.json"
12341327
}
1235-
}
1328+
}

β€Žlibs/langchain-classic/tsdown.config.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
importMapPlugin,
66
lcSecretsPlugin,
77
} from "@langchain/build";
8-
import packageJson from "./package.json";
98

109
export default defineConfig([
1110
getBuildConfig({

β€Žlibs/langchain-community/.env.exampleβ€Ž

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
Β (0)