Thank you for your interest in contributing to Vectra! This project is an open-source local vector database, licensed under the MIT License. These guidelines are intended to help you understand how to contribute effectively, maintain code quality, and foster a welcoming and productive community. Please read them carefully before making contributions.
All contributors are expected to adhere to our Code of Conduct. Please read it to understand the standards of behavior expected in this community.
- If you find a bug, please open an issue and provide as much detail as possible, including steps to reproduce, expected behavior, and your environment (Node.js version, OS, etc.).
- To suggest a new feature or enhancement, open an issue and describe your idea clearly. Include your use case and any relevant examples.
- Fork the repository and create your branch from
main. - Make your changes in a logical, self-contained commit.
- Ensure your code follows the project’s coding standards and passes all tests.
- Submit a pull request (PR) with a clear description of your changes and reference any related issues.
- Node.js: Version 20.x or higher is required.
- Package Manager: Yarn is recommended (see
packageManagerinpackage.json).
-
Clone the repository:
git clone https://github.com/Stevenic/vectra.git cd vectra -
Install dependencies:
yarn install
-
Build the project:
yarn build
-
Run tests:
yarn test -
Run linter and auto-fix issues:
yarn lint
- Use consistent code style as enforced by the linter (
yarn lint). - Prefer TypeScript for all source files.
- Follow the existing file and folder structure in the
src/directory.
- Write clear, concise commit messages.
- Use the present tense (“Add feature” not “Added feature”).
- Reference issues or PRs when relevant (e.g.,
Fix #123: Correct vector normalization).
- Place all source code in the
src/directory. - Tests should be placed alongside source files as a
*.spec.tsfile. - Keep documentation and configuration files in the project root or as specified by existing structure.
- Create a feature or fix branch from
main(e.g.,feature/add-metadata-filterorfix/vector-similarity-bug). - Keep your branch focused on a single topic or issue.
- Push your branch to your forked repository.
- Open a pull request (PR) against the
mainbranch of the upstream repository. - Provide a clear and descriptive title and summary for your PR.
- Reference any related issues by number (e.g.,
Closes #45).
- All PRs will be reviewed by maintainers or other contributors.
- Address any requested changes and update your PR as needed.
- PRs must pass all tests and linting checks before being merged.
- Once approved, a maintainer will merge your PR.
- To run the full test suite, use:
yarn test - This will build the project and run all tests using Mocha and NYC for coverage.
- Add new tests for any new features or bug fixes.
- Place test files alongside the relevant source files or in the
src/directory with a.spec.tssuffix. - Use Mocha and Sinon for writing and mocking in tests.
- Ensure all tests pass before submitting a pull request.
- Update the
README.mdor other relevant documentation files when you add features or make changes. - Ensure that usage examples and API references are clear and accurate.
- API documentation can be generated using TypeDoc.
- To generate docs, run:
yarn build-docs
- Generated documentation will be output as specified in the
build-docsscript inpackage.json.
By contributing to this project, you agree that your contributions will be licensed under the MIT License. Please ensure that you have the right to submit your code and that it does not violate any third-party licenses or agreements.
If you have questions, need help, or want to discuss ideas, please open an issue on GitHub. For sensitive matters, you may contact the maintainer at ickman@gmail.com.