# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# generate static project and launch server
$ npm run generate
$ npm run start
To deploy on Netlify just hit following button:
You can also test the Netlify build before you deploy.
-
Link Netlify Project.
Run following command to link the project.
netlify link
Select a way to link the project.
-
Run test build.
To test the build run following command:
netlify build
This will run the build on your local dev environment. The logs will show if the build will be successful or has any errors.
We are using EsLint for Javascript linting. Simply run following command to lint your code:
npm run lint
To fix any issues simply run the fix command:
npm run lintfix
We are using Jest for unit tests. You can find more details in the gatsby docs.
To run all unit tests simply use following command:
npm run test
You can also watch unit tests while developing:
npx jest --watch
To watch all unit tests run following:
npx jest --watchAll
All unit tests generate also code coverage. You can find the generated code coverage under <rootDir>/coverage/index.html
.
We are running lighthouse audits via lighthouse CI CLI.
To start mobile Lighthouse audits use following command:
npm run lhci:mobile
To start desktop Lighthouse audits use following command:
npm run lhci:desktop
To test GitHub actions locally before pushing to GitHub we are using nektos/act.
You have to install it first via brew brew install act
. Then you can run actions via following command:
act -j <workflow-name>
Visit the docs for more example commands.