- 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 webhint repository
- Add the upstream source
- Run the tests
nodejs.org to download and install the latest stable
Node.js for your operating system.
Clone your forked repository:
git clone https://github.com/<your_GitHub_username>/hint.git
Then 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
webhint 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
webhint, run the following in your
git remote add upstream firstname.lastname@example.org:webhintio/hint.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 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
||This will build the current package or all the packages from scratch||everywhere|
||This builds the main
||Copies the static files to the
||Compiles the TypeScript files and outputs to the
||Cleans the output of all the packages or the current one||everywhere|
||Lints all the markdown and TypeScript files||everywhere|
||Lints TypeScript files using
||Lints markdown files using
||Starts the wizard to create a new hint under
||Publishes the package in
||Builds the package or the most recent modified packages and runs the tests with code coverage||everywhere|
||Builds the whole project and run the tests of all the packages||root|
||Launches all the other
||Copies all the static assets to
||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|