Thank you for your interest in contributing to text-to-cypher-node! This document provides guidelines and instructions for contributing.
- Node.js >= 18
- Rust toolchain (install from rustup.rs)
- C++ compiler (platform-specific)
- Windows: Visual Studio 2019 or later with C++ tools
- macOS: Xcode Command Line Tools
- Linux: GCC or Clang
- Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/text-to-cypher-node.git
cd text-to-cypher-node- Install dependencies:
npm install- Build the native module:
npm run build- Run tests:
npm testtext-to-cypher-node/
├── src/
│ └── lib.rs # Rust NAPI bindings
├── __test__/
│ └── index.test.ts # TypeScript tests
├── examples/
│ ├── basic-usage.js # JavaScript examples
│ └── typescript-usage.ts
├── index.js # Native module loader
├── index.d.ts # TypeScript definitions
├── Cargo.toml # Rust dependencies
├── package.json # NPM package config
└── README.md # Documentation
- Rust: Follow standard Rust formatting with
rustfmt - TypeScript/JavaScript: Follow the existing code style
- Add comments for complex logic
- Update documentation for API changes
Follow conventional commits format:
type(scope): subject
body
footer
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringchore: Maintenance tasks
Examples:
feat(api): add support for conversation history
fix(build): resolve Windows compilation issue
docs(readme): update installation instructions
- Write tests for new features
- Ensure all tests pass before submitting PR
- Add integration tests when applicable
Run tests:
npm testRun tests in watch mode:
npm run test:watch- Update README.md for user-facing changes
- Update TypeScript definitions (index.d.ts) for API changes
- Add examples for new features
- Update INTEGRATION.md for integration changes
- Create a feature branch:
git checkout -b feat/your-feature-name- Make your changes and commit:
git add .
git commit -m "feat: add your feature"- Push to your fork:
git push origin feat/your-feature-name-
Create a Pull Request on GitHub
-
Ensure CI passes:
- All tests pass
- Code builds successfully on all platforms
- No linting errors
-
Address review comments
npm run buildnpm run buildnpm run buildFor cross-platform builds, use the CI pipeline or Docker:
# Linux x64 musl
docker run --rm -v $(pwd):/build -w /build \
ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine \
sh -c "npm install && npm run build"RUST_BACKTRACE=1 npm testDEBUG=napi:* npm testnpm run build:debugReleases are automated through GitHub Actions when a version tag is pushed:
- Update version in
package.jsonandCargo.toml - Update CHANGELOG.md
- Commit changes:
git commit -am "chore: release v0.2.0" - Create and push tag:
git tag v0.2.0 && git push origin v0.2.0 - GitHub Actions will build and publish to npm
The release workflow uses npm Trusted Publishing (OIDC-based authentication) instead of traditional access tokens. To set this up:
-
On npm (one-time setup):
- Go to your package settings on npmjs.com
- Navigate to "Publishing access" → "Automation tokens"
- Click "Configure trusted publishers"
- Add GitHub as a trusted publisher with:
- Provider: GitHub Actions
- Repository: FalkorDB/text-to-cypher-node
- Workflow: release.yml
- Environment: (leave empty or specify if using environments)
-
On GitHub:
- Still requires
NPM_TOKENsecret for backward compatibility - The workflow uses
NODE_AUTH_TOKENwith OIDC permissions - Permissions are automatically granted through
id-token: write
- Still requires
This approach provides better security as:
- No long-lived tokens are needed
- Authentication is scoped to specific workflows
- Automatic token rotation
- Built-in provenance attestation
When reporting bugs, please include:
- Node.js version
- Operating system and version
- Rust version
- Steps to reproduce
- Expected vs actual behavior
- Error messages and stack traces
Create an issue at: https://github.com/FalkorDB/text-to-cypher-node/issues
We welcome feature requests! Please:
- Check existing issues first
- Describe the use case clearly
- Explain why it would be useful
- Provide examples if possible
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help maintain a positive community
- Open a discussion on GitHub
- Join the FalkorDB Discord
- Check existing documentation and issues
By contributing, you agree that your contributions will be licensed under the MIT License.