Switch branches/tags
v3.0.0-alpha.8 v3.0.0-alpha.7 v3.0.0-alpha.6 v3.0.0-alpha.5 v3.0.0-alpha.4 v3.0.0-alpha.3 v3.0.0-alpha.2 v3.0.0-alpha.1 v2.12.0 v2.11.1 v2.11.0 v2.10.0 v2.9.3 v2.9.2 v2.9.1 v2.9.0 v2.8.0 v2.7.2 v2.7.1 v2.7.1-alpha v2.7.0-alpha v2.6.2 v2.6.1 v2.6.0-alpha v2.5.1 v2.5.0 v2.4.4 v2.4.3 v2.4.2 v2.4.1 v2.4.0 v2.3.0 v2.2.1 v2.2.0 v2.1.1 v2.1.0 v2.0.1 v2.0.0 v2.0.0-alpha.3 v2.0.0-alpha.2 v2.0.0-alpha v1.3.0 v1.2.2 v1.2.1 v1.2.0 v1.1.3 v1.1.2 v1.1.1 v1.1.0 v1.0.0 v0.15.1 v0.15.0 v0.14.0 v0.13.1 v0.13.0 v0.12.0 v0.11.0 v0.10.1 v0.10.0 v0.9.1 v0.9.0 v0.8.1 v0.8.0 v0.1.7 v0.1.6 v0.1.5 v0.1.4 v0.1.3 v0.1.2 v0.1.1 v0.1.0 v0.0.5 v.0.0.3 v0.0.3 v.0.0.2 v0.0.1 @pattern-lab/uikit-workshop@1.0.0-beta.0 @pattern-lab/uikit-workshop@1.0.0-alpha.7 @pattern-lab/uikit-workshop@1.0.0-alpha.6 @pattern-lab/uikit-workshop@1.0.0-alpha.4 @pattern-lab/uikit-workshop@1.0.0-alpha.3 @pattern-lab/uikit-workshop@1.0.0-alpha.2 @pattern-lab/plugin-tab@2.0.3-beta.0 @pattern-lab/plugin-tab@2.0.3-alpha.5 @pattern-lab/plugin-tab@2.0.3-alpha.4 @pattern-lab/plugin-tab@2.0.3-alpha.2 @pattern-lab/plugin-tab@2.0.3-alpha.1 @pattern-lab/plugin-tab@2.0.3-alpha.0 @pattern-lab/live-server@1.3.3-beta.0 @pattern-lab/live-server@1.3.3-alpha.6 @pattern-lab/live-server@1.3.3-alpha.5 @pattern-lab/live-server@1.3.3-alpha.4 @pattern-lab/live-server@1.3.3-alpha.2 @pattern-lab/live-server@1.3.3-alpha.1 @pattern-lab/live-server@1.3.3-alpha.0 @pattern-lab/engine-underscore@2.0.0-beta.0 @pattern-lab/engine-underscore@2.0.0-alpha.7 @pattern-lab/engine-underscore@2.0.0-alpha.4 @pattern-lab/engine-underscore@2.0.0-alpha.3 @pattern-lab/engine-underscore@2.0.0-alpha.2
Nothing to show
Find file History
Pull request Compare This branch is 1 commit ahead, 104 commits behind dev.

README.md

Pattern Lab Logo

Build Status current release license Coverage Status code style: prettier node (scoped) Join the chat at Gitter

Pattern Lab Node Core

This is the core API and orchestrator of the Pattern Lab ecosystem.

Installation

Pattern Lab Node can be used different ways. Editions are example pairings of Pattern Lab code and do not always have an upgrade path or simple means to run as a dependency within a larger project. Users wishing to be most current and have the greatest flexibility are encouraged to consume patternlab-node directly. Users wanting to learn more about Pattern Lab and have a tailored default experience are encouraged to start with an Edition. Both methods still expect to interact with other elements of the Pattern Lab Ecosystem.

Direct Consumption

As of Pattern Lab Node 3.X, patternlab-node can run standalone, without the need for task runners like gulp or grunt.

npm install @pattern-lab/core

See Usage for more information.

Editions

For users wanting a more pre-packaged experience several editions are available.

Ecosystem

Pattern Lab Ecosystem

Core, and Editions, are part of the Pattern Lab Ecosystem. With this architecture, we encourage people to write and maintain their own Editions, Starterkits, and even PatternEngines.

Usage

@pattern-lab/core can be required within any Node environment, taking in a configuration file at instantiation.

const config = require('./patternlab-config.json');
const patternlab = require('@pattern-lab/core')(config);

// build, optionally watching or choosing incremental builds
patternlab.build({
  cleanPublic: true,
  watch: true,
});

// or build, watch, and then self-host
patternlab.serve({
  cleanPublic: true,
});

Events

Many events are emitted during Pattern Lab operations, originally built to support plugins. Below is a sample, allowing users to be informed of asset or pattern changes.

patternlab.serve(...);

patternlab.events.on('patternlab-asset-change', (data) => {
  console.log(data); // {file: 'path/to/file.css', dest: 'path/to/destination'}
});

patternlab.events.on('patternlab-pattern-change', (data) => {
  console.log(data); // {file: 'path/to/file.ext'}
});

patternlab.events.on('patternlab-global-change', (data) => {
  console.log(data); // {file: 'path/to/file.ext'}
});

Development Installation / Workflow

If you are interested in contributing to Pattern Lab, please do take some time to learn how we develop locally within the contribution guidelines.

Upgrading

If you find yourself here and are looking to upgrade, check out how to upgrade from version to version of Pattern Lab Node here: https://github.com/pattern-lab/patternlab-node/wiki/Upgrading

View the latest releases for comprehensive changelogs.

Contributing

If you'd like to contribute to Pattern Lab Node, please do so! There is always a lot of ground to cover and something for your wheelhouse.

Please read the contribution guidelines.

Core Team

Community

The Pattern Lab Node team uses our gitter.im channel, pattern-lab/node to keep in sync, share updates, and talk shop. Please stop by to say hello or as a first place to turn if stuck. Other channels in the Pattern Lab organization can be found on gitter too.

There is also a dedicated Pattern Lab channel on the design system slack run by @jina.

Ask or answer Pattern Lab questions on Stack Overflow: http://stackoverflow.com/questions/tagged/patternlab.io

License

MIT