Skip to content

Commit

Permalink
Merge pull request #2376 from langchain-ai/dqbd/js-0.0.23-lc_build
Browse files Browse the repository at this point in the history
fix(sdk-js): move to `@langchain/scripts` for building, bump to 0.0.23
  • Loading branch information
dqbd authored Nov 11, 2024
2 parents b7f2389 + 72239d2 commit 366b5e0
Show file tree
Hide file tree
Showing 7 changed files with 649 additions and 191 deletions.
24 changes: 11 additions & 13 deletions libs/sdk-js/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/docs
/*.tgz
/*.tar
## GENERATED create-entrypoints.js
/client.cjs
/client.js
/client.d.ts
/client.d.cts
/index.cjs
/index.js
/index.d.ts
/index.d.cts
## END GENERATED create-entrypoints.js
index.cjs
index.js
index.d.ts
index.d.cts
client.cjs
client.js
client.d.ts
client.d.cts
node_modules
dist
.yarn
19 changes: 19 additions & 0 deletions libs/sdk-js/langchain.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";

/**
* @param {string} relativePath
* @returns {string}
*/
function abs(relativePath) {
return resolve(dirname(fileURLToPath(import.meta.url)), relativePath);
}

export const config = {
internals: [],
entrypoints: { index: "index", client: "client" },
tsConfigPath: resolve("./tsconfig.json"),
cjsSource: "./dist-cjs",
cjsDestination: "./dist",
abs,
};
19 changes: 9 additions & 10 deletions libs/sdk-js/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"name": "@langchain/langgraph-sdk",
"version": "0.0.22",
"version": "0.0.23",
"description": "Client library for interacting with the LangGraph API",
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"clean": "rm -rf dist/ && node scripts/create-entrypoints.js clean",
"build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js",
"build:esm": "rm -f src/package.json && tsc --outDir dist/ && rm -rf dist/tests dist/**/tests",
"build:cjs": "echo '{}' > src/package.json && tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rm -r dist-cjs src/package.json",
"clean": "rm -rf dist/ dist-cjs/",
"build": "yarn clean && yarn lc_build --create-entrypoints --pre --tree-shaking",
"prepublish": "yarn run build",
"format": "prettier --write src",
"lint": "prettier --check src && tsc --noEmit"
Expand All @@ -22,6 +20,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@langchain/scripts": "^0.1.4",
"@tsconfig/recommended": "^1.0.2",
"@types/node": "^20.12.12",
"@types/uuid": "^9.0.1",
Expand Down Expand Up @@ -54,13 +53,13 @@
},
"files": [
"dist/",
"client.cjs",
"client.js",
"client.d.ts",
"client.d.cts",
"index.cjs",
"index.js",
"index.d.ts",
"index.d.cts"
"index.d.cts",
"client.cjs",
"client.js",
"client.d.ts",
"client.d.cts"
]
}
129 changes: 0 additions & 129 deletions libs/sdk-js/scripts/create-entrypoints.js

This file was deleted.

38 changes: 0 additions & 38 deletions libs/sdk-js/scripts/move-cjs-to-dist.js

This file was deleted.

2 changes: 2 additions & 0 deletions libs/sdk-js/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node",
"declaration": false
},
"exclude": ["node_modules", "dist", "**/tests"]
Expand Down
Loading

0 comments on commit 366b5e0

Please sign in to comment.