Skip to content
API ReferenceZilliz CloudMilvusAttu

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.

Install the documentation dependencies separately from SDK dependencies:

Terminal window
yarn --cwd docs install --frozen-lockfile
npm run doc
npm run doc:dev

The 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.