Getting the new SilverStripe pattern library running

screenshot silverstripe pattern library

When SilverStripe 4.1 came out I read an interesting note in the changelog about the new pattern library. Unfortunately I wasn't able to run it on my windows machine and raised an issue about it. Now, some months later some bugs got fixed and I  was able to install it on a new SS4.2.1 project.

To get the pattern library working it's important to install SiverStripe from source. It won't work with packages.

composer install --prefer-source

After that you have to install some JavaScript dependencies:

cd vendor/silverstripe/admin && yarn install
cd ../asset-admin && yarn install
cd ../cms && yarn install

At the time of writing (SilverStripe 4.2.1) you also have to upgrade SilverStripe's webpack config node module if you're on Windows. Linux or Mac should work out of the box:

cd ../admin && yarn add @silverstripe/webpack-config

Now you're ready to build the pattern library in the admin module:

cd ../admin && yarn pattern-lib

When everything runs fine you're now able to watch the generated patterns in your browser by calling http://localhost:6006 and see the library with all used patterns by SilverStripe's admin interface

Rate this post

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments