- getting started
- how to
This is a step-by-step guide to setting up a local development environment that will let you contribute back to the project.
- Install Node.js and yarn
- Fork and checkout your own sonarwhal repository
- Add the upstream source
- Run the tests
nodejs.org to download and install the latest stable
Node.js for your operating system.
Once you’ve cloned the repository:
git clone https://github.com/sonarwhal/sonarwhal.git
go into the project’s directory:
yarn to get all the necessary dependencies:
You must be connected to the Internet for this step to work. You’ll see a lot of utilities being downloaded.
The upstream source is the main
sonarwhal repository that active
development happens on. While you won’t have push access to upstream,
you will have pull access, allowing you to pull in the latest code
whenever you want.
To add the upstream source for
sonarwhal, run the following in your
git remote add upstream email@example.com:sonarwhal/sonarwhal.git
Now, the remote
upstream points to the upstream source.
Running the tests is the best way to ensure you have correctly set up
your development environment. Make sure you’re in the
directory, and then run:
The testing takes a a bit to complete. If any tests fail, that likely means one or more parts of the environment setup didn’t complete correctly. The upstream tests always pass.
There are different scripts in all the
package.json (root and package ones).
The following is the list of all the available ones:
|Shortcut to the ||everywhere|
|This will build the current package or all the packages from scratch||everywhere|
|This builds the ||root|
|This builds the main ||root|
|Copies the static files to the ||package|
|Compiles the TypeScript files and outputs to the ||package|
|Cleans the output of all the packages or the current one||everywhere|
|Lints all the markdown and TypeScript files||everywhere|
|Lints TypeScript files using ||everywhere|
|Lints markdown files using ||everywhere|
|Starts the wizard to create a new rule under ||root|
|Publishes the package in ||package|
|Runs ||package (sonarwhal)|
|Builds the package or all packages and runs the tests with code coverage||everywhere|
|This modifies some of the configurations to make sure we don’t run into issues when testing on Travis||everywhere|
|Launches all the other ||package|
|Copies all the static assets to ||package|
|Runs the tests as soon as there is a test in the tests or in the code to test||package|
|Compiles the TypeScript files as soon as there is a change||package|