Pattern Lab Node v3.0.0-alpha.3
Pre-releasePattern Lab Node v3.0.0-alpha.3
It's Hacktoberfest!. Find issues you can help with here and get a free T-Shirt.
⚡ ⚡ ⚡ It's finally here - Pattern Lab Node Core 3.0.0! ⚡ ⚡ ⚡
I've been tracking work against #603 and our milestone for quite a while, and now I finally feel like we've reached a point that we can release a preview of what's to come. There is still work to do and I am certain some bugs to work out - but gathering feedback from y'all is a vital next step! There will be a general shakeup (for the better I think( of things in the Edition space - for example. We now also have a coming together of all our development paths - making future work far simpler to orchestrate and get out faster.
Let's address opportunities brought up within #603 and discuss the state of affairs.
It's too hard to use Pattern Lab as a dependency
As of Pattern Lab Node 3.X, patternlab-node
can run standalone, without the need for task runners like gulp or grunt.
const config = require('./patternlab-config.json');
const patternlab = require('patternlab-node')(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
});
While much of this API always existed, now core is responsible for copying (and optionally watching) assets, meta files, data, and patterns defined within patternlab-config.json
paths. This means that you no longer need gulp, grunt, or any task manager if you dont want to.
Have sass you need to compile? Images you want to optimize? Do it within your existing build chain. Pattern Lab has never endeavored to do that work for you. Pattern Lab now seamlessly integrates into your workflow without having to merge complicated internal tasks.
Want to know what Pattern Lab is doing with assets? Done.
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'}
});
More events are documented on the wiki. I imagine only more will be added now that we have exposed this to consumers.
Pattern Lab build times are increasingly slow with increasing numbers and complexity of patterns
Incremental builds and complete async building should help realize results. Now that the core work has merged a bit too, I know we can devote more energy to performance.
Staying "up to date" with edition-node-gulp/editon-node-grunt is too difficult
Editions are example pairings of Pattern Lab code as part of the Pattern Lab Ecosystem. They were never intended to be installed as dependencies. They are perfect for pre-packaged experiences, and that is what they will remain. I'm excited to say that we now have robust Editions and a robust core - both capable of meeting users where they need to.
Customizing the Pattern Lab UI is not intuitive or for the casual user
Brad is hard at work making this a reality. Pattern Lab Node Core 3.X will support this work as it evolves.
Pattern Lab Node plugin installation is a bit wonky
Plugin installation now adds additional settings to patternlab-config.json
, making it far simpler to configure, disable, or delete a plugin after installation.
CHANGELOG 🎯
BREAKING CHANGES
- ADD: Move watches and source to public asset copying into core | @bmuenzenmeyer
- CHG: Specify template files via configuration | @bmuenzenmeyer
- DEL: Remove patternengine-node-mustache as shipped with core | @bmuenzenmeyer
INTERNAL
- ADD: Config access for pattern engines | @geoffp
- ADD: Alter each engine to spawn its meta patterns if not found | @bmuenzenmeyer
- ADD: Add support for pattern parameter links | @dagjaneiro, Hacktoberfest!\
- ADD: Document the public API | @bmuenzenmeyer
- ADD: More helpful json/yaml error messages | @phawxby
- feat(package): Add default theme config to patternlab-config.json #731 | @bmuenzenmeyer
- CHG: Change var to const or let | @benhalverson
- CHG: Improvement to plugin installation, supporting options right on
patternlab-config.json
| @bmuenzenmeyer - CHG: Defer pattern engine load to the caller | @bmuenzenmeyer
- CHG: Replace common utils | @raphaelokon
- CHG: Remove excessive logs when bootstrapping core | @bmuenzenmeyer
- CHG: Allow engines to support multple extensions | @bmuenzenmeyer
- FIX: Fix broken lineage unit test(s) | @kingofzeal
- DEL: Finally remove deprecated pattern states logic from
patternlab-config.json
in favor of markdown | @benhalverson
TOOLING / META
- ADD: Add code coverage output to
npm test
| @benhalverson @raphaelokon - ADD: Added coveralls support | @kingofzeal
- ADD: [Add coveralls badge to README)[https://github.com//pull/729] | @bmuenzenmeyer
- ADD: Add an
.nvmrc
file | @bmuenzenmeyer - ADD: Add package-lock.json support | @bmuenzenmeyer, Hacktoberfest!
- CHG: Pin all dependencies | @ms10398, Hacktoberfest!
- ADD: Add branching scheme to contribution guidelines | @tburny
- CHG: Improved README and again | @bmuenzenmeyer
KNOWN ISSUES
UPGRADE INSTRUCTIONS ⌨️
Follow the standard upgrade instructions.
INSTALLATION 📦
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/patternlab-node
See Usage for more information.
Editions
For users wanting a more pre-packaged experience several editions are available.
- Pattern Lab/Node: Gulp Edition contains info how to get started within a Gulp task running environment.
- Pattern Lab/Node: Grunt Edition contains info how to get started within a Grunt task running environment.
- Pattern Lab/Node: Vanilla Edition contains info how to get started within a pure node environment.
- Pattern Lab/Node: Webpack Edition contains info how to get started within a webpack environment.
Thanks to the team at Comcast for open-sourcing this stellar work!
UNIT TESTS / ASSERTIONS / CODE COVERAGE 🏗
13
unit tests / assertions were removed, for a total of483
| travis ciDecreased (-1.8%) to 70.17%
| coveralls
ROADMAP 🗺
Keep an eye on the milestones for a clearer understanding of where the project is going in the next few releases.
SUPPORT PATTERN LAB NODE ❤️
I've set up a Patreon account to directly support continued work on the Pattern Lab Node project.
I need help and support to make Pattern Lab Node a sustained success. I devote a lot of free time and would-be sleep to make the project what it is, but nothing compares to hearing back from users. It means the world to me when people find value in Pattern Lab Node. I am ridiculously humbled to hear and see what you all build with it.
If you find yourself here and balk and the idea of supporting open source software monetarily - I understand. Carry on, but please do share what you build - we all learn more together.
The Pattern Lab Node Team 🚀
- @bmuenzenmeyer Brian Muenzenmeyer, Lead Maintainer | Follow Brian on Twitter
- @geoffp Geoff Pursell, Core Contributor | Follow Geoff on Twitter
- @raphaelokon Raphael Okon, CLI Contributor | Follow Raphael on Twitter
- @tburny, Core Contributor