✨ Thanks for contributing to @percy/agent! ✨
As a contributor, here are the guidelines we would like you to follow:
We also recommend that you read How to Contribute to Open Source.
Good pull requests, whether patches, improvements, or new features, are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
Please ask first before embarking on any significant pull requests (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
If you have never created a pull request before, welcome 🎉 😄. Here is a great tutorial on how to send one :)
Here is a summary of the steps to follow:
- Set up the workspace
- If you cloned a while ago, get the latest changes from upstream and update dependencies:
$ git checkout master
$ git pull upstream master
$ rm -rf node_modules
$ yarn install
- Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
$ git checkout -b <topic-branch-name>
- Make your code changes, following the Coding rules
- Push your topic branch up to your fork:
$ git push origin <topic-branch-name>
- Open a Pull Request with a clear title and description.
Tips:
- For ambitious tasks, open a draft Pull Request, in order to get feedback and help from the community.
- Allow @percy/agent maintainers to make changes to your Pull Request branch. This way, we can rebase it and make some minor changes if necessary. All changes we make will be done in new commit and we'll ask for your approval before merging them.
To ensure consistency and quality throughout the source code, all code modifications must have:
- No linting errors
- A test for every possible case introduced by your code change
- 100% test coverage
- Valid commit message(s)
If possible, make atomic commits, which means:
- a commit should contain exactly one self-contained functional change
- a functional change should be contained in exactly one commit
- a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...)
A complex feature can be broken down into multiple commits as long as each one maintains a consistent state and consists of a self-contained change.
The type must be one of the following:
Type | Description |
---|---|
build | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
docs | Documentation only changes |
feat | A new feature |
fix | A bug fix |
perf | A code change that improves performance |
refactor | A code change that neither fixes a bug nor adds a feature |
style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
test | Adding missing tests or correcting existing tests |
fix: stop graphite breaking when too much pressure applied
feat: add 'graphiteWidth' option
Fix #42
perf: remove graphiteWidth option
BREAKING CHANGE: The graphiteWidth option has been removed.
The default graphite width of 10mm is always used for performance reasons.
Fork the project, clone your fork, configure the remotes and install the dependencies:
# Clone your fork of the repo into the current directory
$ git clone https://github.com/percy/percy-agent
# Navigate to the newly cloned directory
$ cd percy-agent
# Assign the original repo to a remote called "upstream"
$ git remote add upstream https://github.com/percy/percy-agent
# Install the dependencies
$ npm install
@percy/agent use tslint for linting.
Before pushing your code changes make sure there are no linting errors with yarn lint
.
You can run the tests with:
$ yarn test
You can test Percy Agent Client with
$ yarn test-client
And the integration tests can be run with:
$ PERCY_TOKEN=xxx yarn test-integration
You can find PERCY_TOKEN
on your Percy project settings.