-
Notifications
You must be signed in to change notification settings - Fork 31
fix!: Change to ES Modules to improve support of dynamic loading #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
3a14126
52bae95
04fad45
5e117c8
dbaf40d
d177bd4
0028e08
46a645d
576fe06
0d9b6ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,39 @@ | ||
| { | ||
| "name": "@launchdarkly/server-sdk-ai-langchain", | ||
| "version": "0.3.1", | ||
| "version": "0.3.3", | ||
| "description": "LaunchDarkly AI SDK LangChain Provider for Server-Side JavaScript", | ||
| "homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/ai-providers/server-ai-langchain", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/launchdarkly/js-core.git" | ||
| }, | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "type": "commonjs", | ||
| "main": "./dist/index.cjs", | ||
| "module": "./dist/index.js", | ||
| "types": "./dist/index.d.cts", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": { | ||
| "require": { | ||
| "types": "./dist/index.d.cts", | ||
| "default": "./dist/index.cjs" | ||
| }, | ||
| "import": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| } | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "build": "npx tsc", | ||
| "build": "tsup", | ||
| "lint": "npx eslint . --ext .ts", | ||
| "prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore", | ||
| "lint:fix": "yarn run lint --fix", | ||
| "check": "yarn prettier && yarn lint && yarn build && yarn test", | ||
| "test": "jest" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "keywords": [ | ||
| "launchdarkly", | ||
| "ai", | ||
|
|
@@ -27,6 +43,7 @@ | |
| "author": "LaunchDarkly", | ||
| "license": "Apache-2.0", | ||
| "devDependencies": { | ||
| "@langchain/community": "^0.3.0", | ||
| "@langchain/core": "^0.3.0", | ||
| "@launchdarkly/server-sdk-ai": "^0.14.1", | ||
| "@trivago/prettier-plugin-sort-imports": "^4.1.1", | ||
|
|
@@ -44,9 +61,11 @@ | |
| "langchain": "^0.3.0", | ||
| "prettier": "^3.0.0", | ||
| "ts-jest": "^29.1.1", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "5.1.6" | ||
| }, | ||
| "peerDependencies": { | ||
| "@langchain/community": "^0.2.0 || ^0.3.0", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The community packages are nested (@langchain/community/chat_models/fireworks vs @langchain/aws) which causes runtime compile errors in Next.js when trying to load our langchain package. It's possible when we upgrade to langchain v1 this issue might go away but I was not able to get it to load without this additional dependency, even if it is not being used. |
||
| "@langchain/core": "^0.2.0 || ^0.3.0", | ||
| "@launchdarkly/server-sdk-ai": "^0.14.0", | ||
| "langchain": "^0.2.0 || ^0.3.0" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "include": ["/**/*.ts"], | ||
| "include": ["**/*.ts", "**/*.js"], | ||
| "exclude": ["node_modules"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // It is a dev dependency and the linter doesn't understand. | ||
| // eslint-disable-next-line import/no-extraneous-dependencies | ||
| import { defineConfig } from 'tsup'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: { | ||
| index: 'src/LangChainProvider.ts', | ||
| }, | ||
| format: ['esm', 'cjs'], | ||
| splitting: false, | ||
| sourcemap: true, | ||
| clean: true, | ||
| dts: true, | ||
| external: [/^@launchdarkly\//], | ||
kinyoklion marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "include": ["/**/*.ts"], | ||
| "include": ["**/*.ts", "**/*.js"], | ||
| "exclude": ["node_modules"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // It is a dev dependency and the linter doesn't understand. | ||
| // eslint-disable-next-line import/no-extraneous-dependencies | ||
| import { defineConfig } from 'tsup'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: { | ||
| index: 'src/OpenAIProvider.ts', | ||
| }, | ||
| format: ['esm', 'cjs'], | ||
| splitting: false, | ||
| sourcemap: true, | ||
| clean: true, | ||
| dts: true, | ||
| external: [/^@launchdarkly\//], | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "include": ["/**/*.ts"], | ||
| "include": ["**/*.ts", "**/*.js"], | ||
| "exclude": ["node_modules"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // It is a dev dependency and the linter doesn't understand. | ||
| // eslint-disable-next-line import/no-extraneous-dependencies | ||
| import { defineConfig } from 'tsup'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: { | ||
| index: 'src/VercelProvider.ts', | ||
jsonbailey marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| format: ['esm', 'cjs'], | ||
| splitting: false, | ||
| sourcemap: true, | ||
| clean: true, | ||
| dts: true, | ||
| external: [/^@launchdarkly\//], | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.