sheltertech.org

Command-line Quick Reference

This document lists commands that commonly used during development.

Note that if you are running in the Docker environment, you should prefix any npm commands with docker-compose run --rm app.

Gatsby Commands

Start Gatsby development web server

$ npm run start

In the Docker environment, launch the Docker service instead:

$ docker-compose up app

Build production site bundle

$ npm run build

Storybook Commands

Start Storybook development web server

$ npm run storybook

In the Docker environment, launch the Docker service instead:

$ docker-compose up storybook

General Commands

Install dependencies

$ npm install

You may need to rerun this command if the dependencies have been changed since the last time you installed them.

Run code lint checks

# Run this to automatically fix lint issues
$ npm run lint:fix

There are six variants of the command in case if you want to run something more specific. The commands are:

Run tests

$ npm run test

This command will currently run the Storybook StoryShots tests in render-only mode. We do this just to get basic testing for things like prop-types checking for all Storybook stories than using the actual snapshot testing functionality.