Contributing to LanceDB Typescript¶
This document outlines the process for contributing to LanceDB Typescript. For general contribution guidelines, see CONTRIBUTING.md.
Project layout¶
The Typescript package is a wrapper around the Rust library, lancedb. We use
the napi-rs library to create the bindings between Rust and
Typescript.
src/: Rust bindings source codelancedb/: Typescript package source code__test__/: Unit testsexamples/: A pnpm package with the examples shown in the documentation
Development environment¶
To set up your development environment, you will need to install the following:
- Node.js 22 or later (required by pnpm 11)
- pnpm 11 or later (or run via
corepack enable, which uses thepackageManagerfield inpackage.json) - Rust's package manager, Cargo. Use rustup to install.
- protoc (Protocol Buffers compiler)
Initial setup:
Commit Hooks¶
It is highly recommended to install the pre-commit hooks to ensure that your code is formatted correctly and passes basic checks before committing:
Development¶
Most common development commands can be run using the pnpm scripts.
Build the package
Lint:
Format and fix lints:
Run tests:
To run a single test: