Contributing
Thank you for your interest in contributing to Craft! This guide will help you get started.
Development Setup
Prerequisites
- Node.js v22+ (managed by Volta)
- Yarn v1
Installation
# Clone the repositorygit clone https://github.com/getsentry/craft.gitcd craft
# Install dependenciesyarn install --frozen-lockfileDevelopment Commands
| Command | Description |
|---|---|
yarn build | Build the project (outputs to dist/craft) |
yarn test | Run tests |
yarn lint | Run ESLint |
yarn fix | Auto-fix lint issues |
Manual Testing
To test your changes locally:
yarn build && ./dist/craftProject Structure
src/├── __mocks__/ # Test mocks├── __tests__/ # Test files (*.test.ts)├── artifact_providers/ # Artifact provider implementations├── commands/ # CLI command implementations├── schemas/ # JSON schema and TypeScript types├── status_providers/ # Status provider implementations├── targets/ # Release target implementations├── types/ # Shared TypeScript types├── utils/ # Utility functions├── config.ts # Configuration loading├── index.ts # CLI entry point└── logger.ts # Logging utilitiesCode Style
- TypeScript throughout the codebase
- Prettier for formatting (single quotes, no arrow parens)
- ESLint with
@typescript-eslint/recommended - Unused variables prefixed with
_are allowed
Testing
- Tests use Jest with
ts-jest - Test files are in
src/__tests__/with the*.test.tspattern
# Run all testsyarn test
# Run tests in watch modeyarn test:watchAdding a New Target
- Create a new file in
src/targets/(e.g.,myTarget.ts) - Implement the
BaseTargetinterface - Register the target in
src/targets/index.ts - Add configuration schema in
src/schemas/ - Write tests in
src/__tests__/ - Document the target in the docs
Pull Requests
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
Pre-release Script Conventions
The pre-release script (scripts/bump-version.sh) should:
- Accept old and new version as the last two arguments
- Replace version occurrences in project files
- Not commit changes
- Not change git state
Example:
#!/bin/bashset -euxOLD_VERSION="${1}"NEW_VERSION="${2}"
export npm_config_git_tag_version=falsenpm version "${NEW_VERSION}"Post-release Script Conventions
The post-release script (scripts/post-release.sh) runs after successful publish and should:
- Accept old and new version as arguments
- Handle its own git operations (commit, push)
Questions?
- Open an issue on GitHub
- Check existing issues and pull requests