comicrelief / pattern-lab

CR Styleguide
https://pattern-lab.services.comicrelief.com/
GNU General Public License v2.0
17 stars 0 forks source link
npm-package pattern-library scss styleguide

Comic Relief Pattern Lab NPM version Build Status

A Node-based project to supply Sass components and a styleguide generator.

The idea

To have a centralised hub supply common styling across Comic Relief products.

Quicklinks

Styleguide

Workflow

Semantic Release Process

Visual Regression

Styleguide

Import styling to a project

Contribute styling to pattern-lab

Development workflow

Get it up and running in another project

Either of the last 2 steps creates a symlink in the other project's node_modules, pointing to your local copy of pattern-lab.

Make code changes

Dev server

Semantic Release Process

Git commit messages are used to automatically publish a new version of npm package. To achieve this, every commit message should have a type and a message in the format described below.

Travis CI will run a job automatically after PR is merged and analyze all commit messages since last npm release. Then semantic-release plugin will calculate new version according to this result.

To avoid commit loops, version numbers are not committed back to package.json. Versions are listed on GitHub releases and used in the modified package.json published to npm.

Commit messages are expected to be in this format:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Minimally, only type and subject is required.

Bugfix / patch

When there are no breaking changes or no new features. When we are fixing bugs or styles.

fix: A bug fix

Minor / Feature

When there is a new feature / functionality is added to the library

feat: A new feature

Major / breaking change

When there is a breaking change, we need to extend our commit message and add BREAKING CHANGE: A description of the change to its body. This message can be added to any type of commit. Example:

feat: A new feature

BREAKING CHANGE: A description of the change

Automating commit message format

Commitizen library is added as npm dev dependency and it can be used to generate commit messages by answering a few questions and skipping the ones which are not relavent. Example workflow:

This will start an interactive process to build commit message. Simply answer all questions or press Enter to skip.