Skip to content
API Reference Zilliz Cloud Milvus Attu

Contributing

Thank you for your interest in contributing to the Milvus Node.js SDK!

  • Node.js 18+
  • Yarn package manager
  • Git
Terminal window
git clone https://github.com/milvus-io/milvus-sdk-node.git
cd milvus-sdk-node
Terminal window
yarn install
Terminal window
# Initialize submodules (first time)
git submodule init
# Update submodules
git submodule update --remote
Terminal window
yarn build
Terminal window
# Run all tests
yarn test
# Run specific test file
yarn test -- test/Collection.spec.ts
# Run with coverage
yarn coverage

Tests are located in the test/ directory:

  • test/grpc/: gRPC client tests
  • test/http/: HTTP client tests
  • test/utils/: Utility tests
  • Use TypeScript strict mode
  • Follow existing code style
  • Use meaningful variable names
  • Add JSDoc comments for public APIs

Code is automatically formatted. Ensure your editor uses the project’s formatting settings.

Terminal window
# Check linting
yarn lint
Terminal window
git checkout -b feature/your-feature-name
  • Add code in appropriate directory
  • Write tests for your feature
  • Update documentation if needed
Terminal window
yarn test
yarn build

Follow conventional commit format:

feat: add new feature
fix: fix bug
docs: update documentation
test: add tests
Terminal window
git push origin feature/your-feature-name

Then create a pull request on GitHub.

  1. Update Tests: Ensure all tests pass
  2. Update Documentation: Add/update docs for new features
  3. Check Linting: Fix any linting errors
  4. Review Changes: Review your own changes
  • Clear description of changes
  • Reference to related issues
  • Tests for new features
  • Documentation updates
  • Maintainers will review your PR
  • Address any feedback
  • Once approved, your PR will be merged
milvus-sdk-node/
├── milvus/ # Main SDK code
│ ├── grpc/ # gRPC client
│ ├── http/ # HTTP client
│ ├── types/ # TypeScript types
│ └── utils/ # Utilities
├── test/ # Tests
├── examples/ # Examples
└── docs/ # Documentation
  • milvus/MilvusClient.ts: Main client class
  • milvus/grpc/: gRPC implementation
  • milvus/http/: HTTP implementation
  • milvus/types/: TypeScript type definitions
  • Test happy paths
  • Test error cases
  • Test edge cases
  • Mock external dependencies
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');
});
});

When adding features:

  1. Update relevant documentation files
  2. Add code examples
  3. Update API reference if needed
  • docs/src/content/docs/: Documentation source files
  • Use MDX format
  • Include code examples

Include:

  • SDK version
  • Node.js version
  • Steps to reproduce
  • Expected vs actual behavior
  • Error messages/logs

Include:

  • Use case description
  • Proposed solution
  • Benefits

Please follow the Code of Conduct.