Thank you for your interest in contributing to visnap! This document provides guidelines for contributing to this project.
Development Setup
-
Clone the repository
git clone https://github.com/behnamazimi/visnap cd visnap -
Install dependencies
npm install -
Build packages
npm run build -
Run tests
npm run test
Package Structure
This is a monorepo with the following packages:
@visnap/protocol- Shared types and interfaces@visnap/playwright-adapter- Playwright browser integration@visnap/storybook-adapter- Storybook integration@visnap/core- Core functionalityvisnap- Command-line interface
All packages share the same version number (fixed versioning).
Making Changes
Code Style
- Follow the existing code style and patterns
- Run
npm run lintto check for linting issues - Run
npm run check-typesto verify there are no TypeScript type errors - Ensure all tests pass with
npm run test
Creating Changesets
When making changes that should be released, you need to create a changeset:
-
Create a changeset describing your changes:
npx changeset -
Follow the prompts to:
- Select which packages are affected (usually all packages)
- Choose the type of change (patch, minor, major)
- Write a clear description of the changes
-
Include the changeset file in your PR
When to create a changeset:
- ✅ Bug fixes, new features, breaking changes
- ❌ Internal refactoring, documentation updates, tests
Write clear descriptions:
- ✅ "Fix CLI command failing on Windows"
- ❌ "Fix bugs"
Pull Request Process
- Create a feature branch from
main - Make your changes
- Add tests if applicable
- Create a changeset if the change should be released
- Submit a pull request with a clear description
Release Process
This project uses automated releases with Changesets:
- Once your PR with changesets is merged to
main, a "Version Packages" PR will be automatically created - Maintainers review and merge the version PR
- Packages are automatically published to npm
Guidelines
- Ensure all tests pass before submitting
- Follow the existing code style and patterns
- Include tests for new functionality
- Update documentation if needed
- Create a changeset for any changes that should be released