Skip to content

Commit b1d06e4

Browse files
committed
cr
1 parent a7af4ce commit b1d06e4

File tree

6 files changed

+28
-22
lines changed

6 files changed

+28
-22
lines changed

internal/build/plugins/import-map.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ export function importMapPlugin(param: ImportMapPluginOptions = {}): Plugin {
124124
);
125125

126126
// Transform slashes to double underscores for export names
127-
const exportName = key.replace(/\//g, "__");
127+
let normalizedKey = key;
128+
if (normalizedKey.endsWith("/index")) {
129+
normalizedKey = normalizedKey.substring(
130+
0,
131+
normalizedKey.length - "/index".length
132+
);
133+
}
134+
const exportName = normalizedKey.replace(/\//g, "__");
128135

129136
// Transform the path to the compiled output
130137
// if path ends with .ts, replace with .js, otherwise append .js

libs/langchain-core/src/load/import_map.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/** Auto-generated by import-map plugin. Do not edit manually */
22

33
export * as load__serializable from "../load/serializable.js";
4-
export * as prompts__index from "../prompts/index.js";
4+
export * as prompts from "../prompts/index.js";
55
export * as utils__hash from "../utils/hash.js";
6-
export * as output_parsers__openai_tools__index from "../output_parsers/openai_tools/index.js";
6+
export * as output_parsers__openai_tools from "../output_parsers/openai_tools/index.js";
77
export * as types__stream from "../types/stream.js";
88
export * as language_models__chat_models from "../language_models/chat_models.js";
99
export * as utils__stream from "../utils/stream.js";
@@ -12,42 +12,41 @@ export * as caches__base from "../caches/base.js";
1212
export * as utils__json_patch from "../utils/json_patch.js";
1313
export * as tracers__run_collector from "../tracers/run_collector.js";
1414
export * as tracers__log_stream from "../tracers/log_stream.js";
15-
export * as example_selectors__index from "../example_selectors/index.js";
15+
export * as example_selectors from "../example_selectors/index.js";
1616
export * as utils__async_caller from "../utils/async_caller.js";
17-
export * as output_parsers__openai_functions__index from "../output_parsers/openai_functions/index.js";
17+
export * as output_parsers__openai_functions from "../output_parsers/openai_functions/index.js";
1818
export * as chat_history from "../chat_history.js";
1919
export * as language_models__base from "../language_models/base.js";
2020
export * as language_models__profile from "../language_models/profile.js";
2121
export * as utils__chunk_array from "../utils/chunk_array.js";
2222
export * as tracers__base from "../tracers/base.js";
2323
export * as utils__function_calling from "../utils/function_calling.js";
24-
export * as structured_query__index from "../structured_query/index.js";
24+
export * as structured_query from "../structured_query/index.js";
2525
export * as callbacks__promises from "../callbacks/promises.js";
26-
export * as callbacks__dispatch__index from "../callbacks/dispatch/index.js";
2726
export * as stores from "../stores.js";
2827
export * as language_models__llms from "../language_models/llms.js";
29-
export * as utils__testing__index from "../utils/testing/index.js";
28+
export * as utils__testing from "../utils/testing/index.js";
3029
export * as utils__json_schema from "../utils/json_schema.js";
3130
export * as tracers__console from "../tracers/console.js";
32-
export * as singletons__index from "../singletons/index.js";
33-
export * as indexing__index from "../indexing/index.js";
31+
export * as singletons from "../singletons/index.js";
32+
export * as indexing from "../indexing/index.js";
3433
export * as retrievers__document_compressors__base from "../retrievers/document_compressors/base.js";
35-
export * as utils__types__index from "../utils/types/index.js";
34+
export * as utils__types from "../utils/types/index.js";
3635
export * as callbacks__manager from "../callbacks/manager.js";
37-
export * as documents__index from "../documents/index.js";
38-
export * as messages__index from "../messages/index.js";
36+
export * as documents from "../documents/index.js";
37+
export * as messages from "../messages/index.js";
3938
export * as runnables__graph from "../runnables/graph.js";
4039
export * as callbacks__base from "../callbacks/base.js";
4140
export * as utils__event_source_parse from "../utils/event_source_parse.js";
42-
export * as output_parsers__index from "../output_parsers/index.js";
41+
export * as output_parsers from "../output_parsers/index.js";
4342
export * as prompt_values from "../prompt_values.js";
4443
export * as document_loaders__base from "../document_loaders/base.js";
45-
export * as retrievers__index from "../retrievers/index.js";
44+
export * as retrievers from "../retrievers/index.js";
4645
export * as utils__format from "../utils/format.js";
4746
export * as memory from "../memory.js";
4847
export * as tracers__tracer_langchain from "../tracers/tracer_langchain.js";
49-
export * as runnables__index from "../runnables/index.js";
50-
export * as tools__index from "../tools/index.js";
48+
export * as runnables from "../runnables/index.js";
49+
export * as tools from "../tools/index.js";
5150
export * as utils__env from "../utils/env.js";
5251
export * as vectorstores from "../vectorstores.js";
5352
export * as index from "../index.js";

libs/langchain-core/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default getBuildConfig({
7777
"load/index",
7878
"context",
7979
"callbacks/dispatch/web",
80-
"callbacks/dispatch",
80+
"callbacks/dispatch/index",
8181
],
8282
}),
8383
importConstantsPlugin(),

libs/langchain/src/load/import_constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export const optionalImportEntrypoints: string[] = [
55
"langchain_langchain/cache/file_system",
66
"langchain_langchain/storage/file_system",
77
"langchain_langchain/load/index",
8-
"langchain_langchain/hub",
8+
"langchain_langchain/hub/index",
99
"langchain_langchain/hub/node",
1010
];

libs/langchain/src/load/import_map.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export * as storage__file_system from "../storage/file_system.js";
44
export * as storage__encoder_backed from "../storage/encoder_backed.js";
55
export * as storage__in_memory from "../storage/in_memory.js";
66
export * as load__serializable from "../load/serializable.js";
7-
export * as load__index from "../load/index.js";
7+
export * as load from "../load/index.js";
88
export * as chat_models__universal from "../chat_models/universal.js";
99
export * as index from "../index.js";
10-
export * as hub__index from "../hub/index.js";
10+
export * as hub from "../hub/index.js";
1111
import { PromptTemplate } from "@langchain/core/prompts";
1212
import {
1313
AIMessage,

libs/langchain/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default getBuildConfig({
108108
"cache/file_system",
109109
"storage/file_system",
110110
"load/index",
111-
"hub",
111+
"hub/index",
112112
"hub/node",
113113
],
114114
}),

0 commit comments

Comments
 (0)