···11-# Development
22-33-Thanks for contributing! We want to ensure that `urql` evolves and fulfills
44-its idea of extensibility and flexibility by seeing continuous improvements
55-and enhancements, no matter how small or big they might be.
66-77-If you're about to add a new exchange, please consider publishing it as
88-a separate package.
99-1010-## How to contribute?
1111-1212-We follow fairly standard but lenient rules around pull requests and issues.
1313-Please pick a title that describes your change briefly, optionally in the imperative
1414-mood if possible.
1515-1616-If you have an idea for a feature or want to fix a bug, consider opening an issue
1717-first. We're also happy to discuss and help you open a PR and get your changes
1818-in!
1919-2020-## How do I set up the project?
2121-2222-Luckily it's not hard to get started. You can install dependencies using yarn.
2323-Please don't use `npm` to respect the lockfile.
2424-2525-```sh
2626-yarn
2727-```
2828-2929-You can then run the build using:
3030-3131-```sh
3232-yarn build
3333-```
3434-3535-Or run just the TypeScript build for type checks:
3636-3737-```sh
3838-yarn run check
3939-```
4040-4141-## How do I test my changes?
4242-4343-It's always good practice to run the tests when making changes.
4444-It might also make sense to add more tests when you're adding features
4545-or fixing a bug, but we'll help you in the pull request, if necessary.
4646-4747-```sh
4848-yarn test # Single pass
4949-yarn test --watch # Watched
5050-yarn test --coverage # Single pass coverage report
5151-```
5252-5353-Additionally you can head to any example in the `examples/` folder
5454-and run them. There you'll also need to run `yarn` to install their
5555-dependencies. All examples are started using `yarn start`.
5656-5757-Make sure you rebuild `urql` using `yarn build` when you run an
5858-example. However, most examples will do so automatically.
5959-6060-## How do I lint my code?
6161-6262-We ensure consistency in `urql`'s codebase using [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) and `prettier`.
6363-They are run on a `precommit` hook, so if something's off they'll try
6464-to automatically fix up your code, or display an error.
6565-6666-If you have them set up in your editor, even better!
6767-6868-## How do I publish a new version?
6969-7070-If you're a core contributor or maintainer this will certainly come
7171-up once in a while.
7272-7373-Make sure you first create a new version. The following commands
7474-bump the version in the `package.json`, create a commit,
7575-and tag the commit on git:
7676-7777-```sh
7878-yarn version --new-version X
7979-# or
8080-npm version patch # accepts patch|minor|major
8181-```
8282-8383-Then run `npm publish` (npm is recommended here, not yarn)
8484-And maybe run `npm publish --dry-run` first to check the output.
8585-8686-```sh
8787-npm publish
8888-```
8989-9090-There's a `prepublishOnly` hook in place that'll clean and build
9191-`urql` automatically.
9292-9393-Don't forget to push afterwards:
9494-9595-```sh
9696-git push && git push --tags
9797-```
9898-9999-[This process can be simplified and streamlined by using `np`.](https://github.com/sindresorhus/np)