Thank you for your interest in contributing! This guide covers how to set up your development environment, build, test, and submit changes.
- Node.js (20+)
- npm (included with Node.js)
- Docker (for proto generation only)
# Clone the repository
git clone https://github.com/opendecree/decree-typescript.git
cd decree-typescript
# Install dependencies
npm install
# Run the full check suite
npm run lint && npm run typecheck && npm testedit code -> lint -> typecheck -> test -> commit -> PR
| Script | Description |
|---|---|
npm run generate |
Regenerate proto stubs from .proto files |
npm run build |
Compile TypeScript to dist/ |
npm run lint |
Lint with Biome |
npm run format |
Auto-format with Biome |
npm run typecheck |
Type check with tsc --noEmit |
npm test |
Run tests with Vitest |
npm run test:coverage |
Run tests with coverage report |
Generated proto stubs live in src/generated/ and are committed to git. If the upstream .proto files change, regenerate with:
npm run generatesrc/
├── index.ts # Public exports
├── client.ts # ConfigClient (promise-based)
├── watcher.ts # ConfigWatcher + WatchedField
├── errors.ts # Error hierarchy
├── types.ts # Public interfaces
├── channel.ts # gRPC channel factory
├── convert.ts # TypedValue conversion
├── retry.ts # Exponential backoff retry
├── compat.ts # Server version compatibility
└── generated/ # Proto stubs (committed)
test/
├── client.test.ts # ConfigClient tests
├── watcher.test.ts # ConfigWatcher + WatchedField tests
├── errors.test.ts # Error mapping tests
├── convert.test.ts # Value conversion tests
├── retry.test.ts # Retry logic tests
└── compat.test.ts # Version compatibility tests
docs/ # Usage documentation
npm testTests use Vitest. Coverage is measured with @vitest/coverage-v8. Tests mock gRPC stubs -- no running server needed.
# Run with coverage
npm run test:coverage
# Watch mode during development
npm run test:watch- Linting and formatting: Biome
- Type checking: TypeScript in strict mode
- Run
npm run lint && npm run typecheckbefore submitting
- Fork the repository
- Create a feature branch from
main - Make your changes
- Ensure
npm run lint && npm run typecheck && npm testpasses - Open a pull request against
main
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.