Skip to content

Commit

Permalink
add entrypoints (#7)
Browse files Browse the repository at this point in the history
* add entrypoints

* update tsconfig

* fix circ dep
  • Loading branch information
bracesproul authored Jan 16, 2024
1 parent 2285860 commit e7709fd
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ node_modules
dist
.yarn
.turbo
**/.turbo
**/.eslintcache
5 changes: 3 additions & 2 deletions langgraph/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
index.cjs
index.js
index.d.ts
pregel.cjs
pregel.js
pregel.d.ts
node_modules
dist
.yarn
.turbo
.eslintcache
10 changes: 9 additions & 1 deletion langgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
1 change: 1 addition & 0 deletions langgraph/scripts/create-entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion langgraph/src/graph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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__";

Expand Down
2 changes: 1 addition & 1 deletion langgraph/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { type PregelInterface, Pregel, Channel } from "./pregel/index.js";
export { END, Graph } from "./graph/index.js";
19 changes: 1 addition & 18 deletions langgraph/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
16 changes: 1 addition & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
22 changes: 22 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit e7709fd

Please sign in to comment.