This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
@comicrelief/pattern-lab with all
npm packages installed. Try it out:
@comicrelief/pattern-lab lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
A Node-based project to supply Sass components and a styleguide generator.
To have a centralised hub supply common styling across Comic Relief products.
npm install @comicrelief/pattern-lab --save
on local scss file, add
includePaths: ['node_modules'] in grunt-sass
or copy css file straight to your project
git clone https://github.com/comicrelief/pattern-lab ~/cr_root/pattern-lab
npm install npm-link-local --globaland then e.g.
Either of the last 2 steps creates a symlink in the other project's
node_modules, pointing to your local copy of
yarn watchto liveload file changes
yarn buildto generate all themes in the styleguide
yarn build-baseto only generate the base theme in the styleguide
yarn build-cr17to only generate the cr17 theme in the styleguide
yarn build-frostto only generate the frost theme in the styleguide
yarn build-payinto only generate the payin theme in the styleguide
yarn build-rnd17to only generate the rnd17 theme in the styleguide
yarn build-sr18to only generate the sr18 theme in the styleguide
http://localhost:1337to view styleguide
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.
Commit messages are expected to be in this format:
<type>(<scope>): <subject> <BLANK LINE> <body> <BLANK LINE> <footer>
subject is required.
When there are no breaking changes or no new features. When we are fixing bugs or styles.
fix: A bug fix
When there is a new feature / functionality is added to the library
feat: A new feature
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.
feat: A new feature BREAKING CHANGE: A description of the change
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:
git add .to add changed files and get ready to commit
This will start an interactive process to build commit message. Simply answer all questions or
Enter to skip.
We are using Concourse CI and Travis CI to run tasks, and Netlify and Cloud Foundry to deploy pattern-lab. When a pull request is created, it triggers a Netlify preview deployment, which is at
Pull request commits and merge also trigger CI visual regression tests as explained below. Output is available at
/tests/visual/html_report/index.htmlin your browser.
yarn backstop approve