Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 2.04 KB

command-line-quick-reference.md

File metadata and controls

84 lines (57 loc) · 2.04 KB

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:

  • lint:fix - Automatically fix CSS, TypeScript, and JavaScript lint issues. Note that if an error is encountered in CSS, it will not run the TypeScript/JavaScript lint checks.
  • lint - Check, but do not fix, both CSS, TypeScript, and JavaScript lint issues
  • stylelint:fix - Automatically fix CSS lint issues
  • stylelint - Check, but do not fix, CSS lint issues
  • tsc - Run the TypeScript compiler (tsc) to check for type errors
  • eslint:fix - Automatically fix JavaScript lint issues
  • eslint - Check, but do not fix, JavaScript lint issues

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.