php

Pattern Lab 2 uses Composer to manage project dependencies. To upgrade an edition based on Pattern Lab 2 do the following:

  1. In a terminal window navigate to the root of your project
  2. Type composer update

During the upgrade process Pattern Lab 2 will move or add any files that are required for the new version to work. It will also update your configuration as appropriate. If you don’t have Composer installed please follow the directions for installing Composer that are available on the Composer website. We recommend you install it globally.

Upgrading Pattern Lab 1 to Pattern Lab 2

Pattern Lab 2 was a complete rewrite and reorganization of Pattern Lab 1. Learn about the changes. To upgrade do the following:

  1. Download the PHP edition that matches your needs

If you chose a Mustache-based edition do the following:

  1. Copy ./source from your old project to your new edition
  2. Copy ./source/_patterns/00-atoms/00-meta/_00-head.mustache to ./source/_meta/_00-head.mustache
  3. Copy ./source/_patterns/00-atoms/00-meta/_01-foot.mustache to ./source/_meta/_00-foot.mustache (you can then delete source/_patterns/00-atoms/00-meta/ directory)
  4. In ./source/_meta/_00-head.mustache, replace {% pattern-lab-head %} with {{{ patternLabHead }}}
  5. In ./source/_meta/_00-foot.mustache replace {% pattern-lab-foot %} with {{{ patternLabFoot }}}
  6. Copy ./source/_data/annotations.js to ./source/_annotations/annotations.js
  7. Remove the underscore in front of the JSON files in source/data (i.e. data.json not _data.json).

If you chose another version do the above and convert the templates as appropriate.

Learning About Upgrades

New releases and upgrades are announced in Pattern Lab’s PHP room on Gitter and on Twitter at @patternlabio.

You can also determine if your version of Pattern Lab 2 can be upgraded yourself by doing the following:

  1. In a terminal window navigate to the root of your project
  2. Type composer outdated

Two components of Pattern Lab 2 maintain CHANGELOGs as part of their “Releases” page on GitHub:

node

Pattern Lab uses npm to manage project dependencies. To upgrade an edition based on Pattern Lab 2 do the following:

  1. In a terminal window navigate to the root of your project
  2. Type npm update

During the upgrade process Pattern Lab 2 will move or add any files that are required for the new version to work. It will also update your configuration as appropriate.

It’s recommended to review the ChangeLog prior to any update so you are aware of upcoming changes. Update Instructions are also maintained on Github and may contain addenda should the normal upgrade process not apply.

Upgrading from Pattern Lab 1.X to 2.X

  1. Install a node edition of Pattern Lab 2
  2. Move the following files:
  • 1.X source/* to 2.X source/
  • 1.X source/_patterns/00-atoms/00-meta/* to 2.X source/_meta/ (you can then delete source/_patterns/00-atoms/00-meta/)
  • 1.X source/_data/annotations.js to 2.X source/_annotations/
  1. In source/_meta/_00-head.mustache, replace {% pattern-lab-head %} with {{{ patternLabHead }}}
  2. In source/_meta/_00-foot.mustache replace {% pattern-lab-foot %} with {{{ patternLabFoot }}}
  3. Remap the paths configured in the edition’s patternlab-config.json file with yours, if needed.