langchainjs
langchainjs copied to clipboard
Move code into langchain/src
@sullivan-sean what do you think? The current setup makes the tsconfig "invalid" after yarn build
is run, because of the generated top-level entrypoints, if we could scope tsconfig to src/
would be easier?
The generated entrypoints should all be .js
or .d.ts
, can we just ignore those in the tsconfig
? Open to introducing src
too but I like having things not too deeply nested.
I tried that, but it didn't fix it
Can we actually move to a monorepo structure with turborepo & pnpm with that I believe we can solve the tree shaking much more smartly for edge code.
We're currently using turborepo and have multiple yarn workspaces in the monorepo as it stands -- is there anything more you'd like to see besides pnpm
in place of yarn
?
Oh sorry didn't notice the turbo.json as it's a bit of an odd structure right now IMO. perhaps my main point is breaking every service to it's own package.json to be able to isolate it's deps.
so community prs adding new functionality with it's deps won't make pnpm add langchain
adding 3 gb node_modules
more modular
Oh yeah! Right now we're including any optional external modules in peerDepedencies
with peerDependencyMeta
set to optional
. This makes sure things like openai
aren't installed unless the consuming package installs it alongside langchain
.
I don't think langchain should be adding anywhere near 3gb of node_modules (I just installed in an empty project and it's about 3.5 mb)
Done in #124