Contributing
Thank you for your interest in contributing to the Milvus Node.js SDK!
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- Node.js 18+
- Yarn package manager
- Git
Clone Repository
Section titled “Clone Repository”git clone https://github.com/milvus-io/milvus-sdk-node.gitcd milvus-sdk-nodeInstall Dependencies
Section titled “Install Dependencies”yarn installFetch Milvus Proto
Section titled “Fetch Milvus Proto”# Initialize submodules (first time)git submodule init
# Update submodulesgit submodule update --remoteyarn buildTesting
Section titled “Testing”Run Tests
Section titled “Run Tests”# Run all testsyarn test
# Run specific test fileyarn test -- test/Collection.spec.ts
# Run with coverageyarn coverageTest Structure
Section titled “Test Structure”Tests are located in the test/ directory:
test/grpc/: gRPC client teststest/http/: HTTP client teststest/utils/: Utility tests
Code Style
Section titled “Code Style”TypeScript
Section titled “TypeScript”- Use TypeScript strict mode
- Follow existing code style
- Use meaningful variable names
- Add JSDoc comments for public APIs
Formatting
Section titled “Formatting”Code is automatically formatted. Ensure your editor uses the project’s formatting settings.
Linting
Section titled “Linting”# Check lintingyarn lintAdding Features
Section titled “Adding Features”1. Create Feature Branch
Section titled “1. Create Feature Branch”git checkout -b feature/your-feature-name2. Implement Feature
Section titled “2. Implement Feature”- Add code in appropriate directory
- Write tests for your feature
- Update documentation if needed
3. Test Your Changes
Section titled “3. Test Your Changes”yarn testyarn build4. Commit Changes
Section titled “4. Commit Changes”Follow conventional commit format:
feat: add new featurefix: fix bugdocs: update documentationtest: add tests5. Push and Create PR
Section titled “5. Push and Create PR”git push origin feature/your-feature-nameThen create a pull request on GitHub.
Pull Request Process
Section titled “Pull Request Process”Before Submitting
Section titled “Before Submitting”- Update Tests: Ensure all tests pass
- Update Documentation: Add/update docs for new features
- Check Linting: Fix any linting errors
- Review Changes: Review your own changes
PR Requirements
Section titled “PR Requirements”- Clear description of changes
- Reference to related issues
- Tests for new features
- Documentation updates
Review Process
Section titled “Review Process”- Maintainers will review your PR
- Address any feedback
- Once approved, your PR will be merged
Code Structure
Section titled “Code Structure”Directory Structure
Section titled “Directory Structure”milvus-sdk-node/├── milvus/ # Main SDK code│ ├── grpc/ # gRPC client│ ├── http/ # HTTP client│ ├── types/ # TypeScript types│ └── utils/ # Utilities├── test/ # Tests├── examples/ # Examples└── docs/ # DocumentationKey Files
Section titled “Key Files”milvus/MilvusClient.ts: Main client classmilvus/grpc/: gRPC implementationmilvus/http/: HTTP implementationmilvus/types/: TypeScript type definitions
Testing Guidelines
Section titled “Testing Guidelines”Write Tests
Section titled “Write Tests”- Test happy paths
- Test error cases
- Test edge cases
- Mock external dependencies
Test Example
Section titled “Test Example”describe('createCollection', () => { it('should create collection successfully', async () => { const result = await client.createCollection({ collection_name: 'test_collection', fields: schema, });
expect(result.error_code).toBe('Success'); });});Documentation
Section titled “Documentation”Update Documentation
Section titled “Update Documentation”When adding features:
- Update relevant documentation files
- Add code examples
- Update API reference if needed
Documentation Structure
Section titled “Documentation Structure”docs/src/content/docs/: Documentation source files- Use MDX format
- Include code examples
Reporting Issues
Section titled “Reporting Issues”Bug Reports
Section titled “Bug Reports”Include:
- SDK version
- Node.js version
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
Feature Requests
Section titled “Feature Requests”Include:
- Use case description
- Proposed solution
- Benefits
Code of Conduct
Section titled “Code of Conduct”Please follow the Code of Conduct.
Getting Help
Section titled “Getting Help”Next Steps
Section titled “Next Steps”- Read Best Practices
- Check API Reference
- Explore Examples & Tutorials
Build and preview the documentation site
Section titled “Build and preview the documentation site”Install the documentation dependencies separately from SDK dependencies:
yarn --cwd docs install --frozen-lockfilenpm run docnpm run doc:devThe site uses Astro/Starlight and writes production output to docs/out/. Edit MDX under docs/src/content/docs/; npm run doc preserves these source files. For production preview, run npm --prefix docs run preview after building. Use Node.js 22.12.0 or newer, as required by the installed Astro version; the documentation toolchain can require a newer runtime than the SDK.
When releasing, compare the published tag with the last documented version, update guides and API reference, add release notes, and synchronize README compatibility and llms.txt. Verify example imports against package exports and check site links after building.