Code Conventions
TypeScript
- Use TypeScript whenever possible
- Avoid using
anytype - Ensure all code passes type checking before submitting
Code Style
The project uses ESLint and Prettier for code quality:- ESLint:
@snapshot-labsconfig (Vue variant for UI) - Prettier:
@snapshot-labs/prettier-config
Error Handling
Name errors in catch blocks aserr:
Code Reuse
Before writing new logic:- Check existing helpers in the codebase
- Review composables (for Vue components)
- Look for utility functions that might already solve your problem
Running Tests
Ensure all tests pass before submitting a pull request:CI runs all tests automatically on every pull request. All tests must pass before merging.
Versioning with Changesets
Snapshot X uses changesets for versioning packages, particularly forsx.js.
Creating a Changeset
When you make changes to versioned packages:Choose Version Bump
Specify the version bump following semver:
- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes
Release Process
Once your PR is merged:- Changesets action creates a release PR automatically
- Maintainers merge the release PR to publish packages
Pull Request Guidelines
Before Submitting
Ensure your PR meets these requirements:Code Quality
- All lint checks pass (
yarn lint) - All type checks pass (
yarn typecheck) - All tests pass (
yarn test)
Documentation
- Update relevant documentation
- Add comments for complex logic
- Update README if adding new features
PR Description
Provide a clear description including:- What: Summary of changes
- Why: Reason for the changes
- How: Approach taken (if non-obvious)
- Testing: How you tested the changes
Commit Messages
Write clear, concise commit messages:Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting
- Create changeset if needed
- Commit your changes
- Push to your fork
- Open a pull request
Getting Help
- Join the Snapshot Discord
- Check existing issues on GitHub
- Review the AGENTS.md file for architecture details