mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-20 13:08:23 +00:00
ed6be12ad6
`mkdocs build` emitted 61 warnings on main, and rendering the previously undocumented classes in this PR pushed that to 158. That backlog is what blocks turning on strict mode (#3707), so clear it here rather than leave it worse than we found it. Most of it was one systematic false positive: griffe cannot see the generated `__init__` of a pydantic dataclass, so every documented parameter looked unknown. `warn_unknown_params` turns that check off. The rest were real docstring bugs, in 15 docstrings: * Prose trailing a `Parameters` section is read as parameter names, which invented parameters called `The`, `you` and `To`. Moved into `Notes` or the summary. * numpydoc only reads a type when the colon has spaces around it. Where the documented name is a pydantic attribute rather than a signature parameter, griffe has no signature to fall back on and the type was dropped. Affects nine embedding classes. * `num_partitions, default sqrt(num_rows)` and friends parse as a list of names, rendering a bogus `default` parameter. * One parameter indented five spaces instead of four. `nodejs/CONTRIBUTING.md` links to the repo-root CONTRIBUTING.md, which does not resolve once typedoc copies the file into `docs/src/js/_media/`; an absolute URL works from both places. `mkdocs build --strict` now exits 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
79 lines
1.8 KiB
Markdown
79 lines
1.8 KiB
Markdown
# Contributing to LanceDB Typescript
|
|
|
|
This document outlines the process for contributing to LanceDB Typescript.
|
|
For general contribution guidelines, see [CONTRIBUTING.md](https://github.com/lancedb/lancedb/blob/main/CONTRIBUTING.md).
|
|
|
|
## Project layout
|
|
|
|
The Typescript package is a wrapper around the Rust library, `lancedb`. We use
|
|
the [napi-rs](https://napi.rs/) library to create the bindings between Rust and
|
|
Typescript.
|
|
|
|
* `src/`: Rust bindings source code
|
|
* `lancedb/`: Typescript package source code
|
|
* `__test__/`: Unit tests
|
|
* `examples/`: 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:
|
|
|
|
1. Node.js 22 or later (required by pnpm 11)
|
|
2. [pnpm](https://pnpm.io/installation) 11 or later (or run via `corepack enable`,
|
|
which uses the `packageManager` field in `package.json`)
|
|
3. Rust's package manager, Cargo. Use [rustup](https://rustup.rs/) to install.
|
|
4. [protoc](https://grpc.io/docs/protoc-installation/) (Protocol Buffers compiler)
|
|
|
|
Initial setup:
|
|
|
|
```shell
|
|
pnpm install
|
|
```
|
|
|
|
### Commit Hooks
|
|
|
|
It is **highly recommended** to install the [pre-commit](https://pre-commit.com/) hooks to ensure that your
|
|
code is formatted correctly and passes basic checks before committing:
|
|
|
|
```shell
|
|
pre-commit install
|
|
```
|
|
|
|
## Development
|
|
|
|
Most common development commands can be run using the pnpm scripts.
|
|
|
|
Build the package
|
|
|
|
```shell
|
|
pnpm install
|
|
pnpm build
|
|
```
|
|
|
|
Lint:
|
|
|
|
```shell
|
|
pnpm lint
|
|
```
|
|
|
|
Format and fix lints:
|
|
|
|
```shell
|
|
pnpm lint-fix
|
|
```
|
|
|
|
Run tests:
|
|
|
|
```shell
|
|
pnpm test
|
|
```
|
|
|
|
To run a single test:
|
|
|
|
```shell
|
|
# Single file: table.test.ts
|
|
pnpm test -- table.test.ts
|
|
# Single test: 'merge insert' in table.test.ts
|
|
pnpm test -- table.test.ts --testNamePattern=merge\ insert
|
|
```
|