langchainjs-integration-template
Template repo for LangChain.js integration packages.
Usage
Source code lives in the src/
directory.
By default, there is a single entrypoint under langchain_integration/src/index.ts
that you should re-export all relevant classes and functions from.
If you want to add more entrypoints, add them in langchain_integration/scripts/create-entrypoints.js
.
To build your source code, run the following commands:
$ yarn build
The build process will automatically create build artifacts for both ESM and CJS.
Note that because of the way compiled files are created and ignored, the .gitignore
will be dynamically generated by scripts/create-entrypoints.js
whenever you run yarn build
.
This means that if you want to add more ignored files, you'll need to add them under DEFAULT_GITIGNORE_PATHS
in that script.
After running yarn build
, publish a new version with:
$ npm publish
Prettier and ESLint are also configured:
$ yarn format
$ yarn lint
As well as Jest for testing. Test files should live within a tests/
file in the src/
folder. Unit tests should end in .test.ts
and integration tests should
end in .int.test.ts
:
$ yarn test
$ yarn test:int