Thank you for your interest in contributing!
- Node.js 20 or later
- pnpm 9 or later
- Clone the repository:
git clone https://github.com/elastic/elasticsearch-dsl-js.git
cd elasticsearch-dsl-js- Install dependencies:
pnpm install- Run the tests:
pnpm test| Command | Description |
|---|---|
pnpm run build |
Build all packages |
pnpm run test |
Run tests for all packages |
pnpm run test:watch |
Run tests in watch mode |
pnpm run test:coverage |
Run tests with coverage |
pnpm run lint |
Check for linting errors |
pnpm run lint:fix |
Fix linting errors |
pnpm run typecheck |
Check TypeScript types |
pnpm run ci |
Run full CI pipeline |
# Build a specific package
pnpm --filter @elastic/elasticsearch-query-builder build
# Test a specific package
pnpm --filter @elastic/elasticsearch-esql-dsl testThis project uses Biome for linting and formatting. The configuration enforces:
- 2-space indentation
- Single quotes
- No semicolons (except where required)
- Trailing commas in ES5 contexts
- 100-character line width
Run npm run lint:fix to automatically fix formatting issues.
We use Vitest for testing. Tests are located in the test/ directory.
- Write tests for all new features
- Ensure existing tests pass before submitting a PR
- Aim for high code coverage
- Enable strict mode
- Add types for all public APIs
- Export types from
src/types.ts
- Fork the repository and create your branch from
main - Make your changes following the code style guidelines
- Add tests for any new functionality
- Update documentation if needed
- Run all checks:
npm run ci - Submit a pull request with a clear description of the changes
Use clear, descriptive commit messages:
feat: add multi_match query supportfix: correct range query date handlingdocs: update README with new examplestest: add tests for bool querychore: update dependencies
All source files must include the SPDX license header:
/*
* Copyright Elasticsearch B.V. and contributors
* SPDX-License-Identifier: Apache-2.0
*/- Use the issue templates
- Include a minimal reproducible example
- Provide version information (Node.js, library version)
This project follows the Elastic Community Code of Conduct.
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.