diff --git a/.gitignore b/.gitignore index b2b9d6fa..1766895c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ node_modules dist .yarn .turbo +**/.turbo +**/.eslintcache diff --git a/langgraph/.gitignore b/langgraph/.gitignore index 4d8ace58..b03842a2 100644 --- a/langgraph/.gitignore +++ b/langgraph/.gitignore @@ -1,8 +1,9 @@ index.cjs index.js index.d.ts +pregel.cjs +pregel.js +pregel.d.ts node_modules dist .yarn -.turbo -.eslintcache diff --git a/langgraph/package.json b/langgraph/package.json index 85057ba1..c73e0dda 100644 --- a/langgraph/package.json +++ b/langgraph/package.json @@ -70,12 +70,20 @@ "import": "./index.js", "require": "./index.cjs" }, + "./pregel": { + "types": "./pregel.d.ts", + "import": "./pregel.js", + "require": "./pregel.cjs" + }, "./package.json": "./package.json" }, "files": [ "dist/", "index.cjs", "index.js", - "index.d.ts" + "index.d.ts", + "pregel.cjs", + "pregel.js", + "pregel.d.ts" ] } diff --git a/langgraph/scripts/create-entrypoints.js b/langgraph/scripts/create-entrypoints.js index 01a4daeb..dc0b6610 100644 --- a/langgraph/scripts/create-entrypoints.js +++ b/langgraph/scripts/create-entrypoints.js @@ -11,6 +11,7 @@ const DEFAULT_GITIGNORE_PATHS = ["node_modules", "dist", ".yarn"]; // Order is not important. const entrypoints = { index: "index", + pregel: "pregel/index", }; // Entrypoints in this list require an optional dependency to be installed. diff --git a/langgraph/src/graph/index.ts b/langgraph/src/graph/index.ts index df6e09a8..6ba2447c 100644 --- a/langgraph/src/graph/index.ts +++ b/langgraph/src/graph/index.ts @@ -4,8 +4,8 @@ import { RunnableLike, _coerceToRunnable, } from "@langchain/core/runnables"; -import { Channel, Pregel } from "../index.js"; import { ChannelBatch, ChannelInvoke } from "../pregel/read.js"; +import { Channel, Pregel } from "../pregel/index.js"; export const END = "__end__"; diff --git a/langgraph/src/index.ts b/langgraph/src/index.ts index 59818a0a..6895ab2e 100644 --- a/langgraph/src/index.ts +++ b/langgraph/src/index.ts @@ -1 +1 @@ -export { type PregelInterface, Pregel, Channel } from "./pregel/index.js"; +export { END, Graph } from "./graph/index.js"; diff --git a/langgraph/tsconfig.json b/langgraph/tsconfig.json index e31d50de..6b5fed2f 100644 --- a/langgraph/tsconfig.json +++ b/langgraph/tsconfig.json @@ -1,22 +1,5 @@ { - "extends": "@tsconfig/recommended", - "compilerOptions": { - "outDir": "../dist", - "target": "ES2021", - "lib": ["ES2021", "ES2022.Object", "DOM"], - "module": "ES2020", - "moduleResolution": "nodenext", - "esModuleInterop": true, - "declaration": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "useDefineForClassFields": true, - "strictPropertyInitialization": false, - "allowJs": true, - "strict": true - }, + "extends": "../tsconfig.json", "include": ["src/**/*.ts", "examples/**/*.ts"], "exclude": ["node_modules", "dist", "docs"] } diff --git a/package.json b/package.json index cdcf49d2..43ec9778 100644 --- a/package.json +++ b/package.json @@ -55,19 +55,5 @@ }, "publishConfig": { "access": "public" - }, - "exports": { - ".": { - "types": "./index.d.ts", - "import": "./index.js", - "require": "./index.cjs" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist/", - "index.cjs", - "index.js", - "index.d.ts" - ] + } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..50d06e11 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/recommended", + "compilerOptions": { + "outDir": "./langgraph/dist", + "rootDir": "./langgraph/src", + "target": "ES2021", + "lib": ["ES2021", "ES2022.Object", "DOM"], + "module": "ES2020", + "moduleResolution": "nodenext", + "esModuleInterop": true, + "declaration": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "useDefineForClassFields": true, + "strictPropertyInitialization": false, + "allowJs": true, + "strict": true + }, + "exclude": ["node_modules"] +}