Start a Server

Install dependencies

npm install

Setup and/or reinstall Pattern Lab

npm run setup

Start the local Webpack dev server for Pattern Lab, hot-reload all frontend assets, and automatically recompile all assets and Pattern Lab on file change

npm start

Start file watchers and compile assets to disk for Drupal on changes

npm run dev:drupal

Start file watchers and compile assets to disk for Grav on changes

npm run dev:grav

Compile Assets

Compile production assets for Drupal

npm run build:drupal

Compile production assets for Grav

npm run build:grav

Compile production assets for Pattern Lab (e.g. for a static file host)

npm run build:pl

Code Formatting

Lint and Prettier both JavaScript and Sass

npm run fmt

Lint and Prettier only JavaScript

npm run fmt:js

Lint and Prettier only Sass

npm run fmt:scss

Code Linting

Run all linters:

npm run lint

Run only Javascript linters

npm run lint:js

Run only Sass linters

npm run lint:scss

Run only Twig linters

npm run lint:twig

Run only Twig linters for Drupal

npm run lint:twig:drupal

Run only Twig linters for Grav

npm run lint:twig:grav

Run only Twig linters for Pattern Lab

npm run lint:twig:source

Automated Testing

Run all tests:

npm test

You'll need to install Pa11y yourself before you can run it

Run only Pa11y accessibility tests

npm run test:pa11y

Run only unit tests

npm run test:unit

Additional Commands

Run any Gulp task:

# See gulpfile.js for gulp tasks
npx gulp gulpTaskName
# For instance, running a full Pattern Lab compile
npx gulp compile:pl

Run Yeoman generator to make new component

npm run new