GithubHelp home page GithubHelp logo

thinkscientist / patternlab-edition-node-webpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from comcast/patternlab-edition-node-webpack

0.0 1.0 0.0 127 KB

The webpack wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.

Home Page: http://patternlab.io/

License: Apache License 2.0

JavaScript 79.61% HTML 6.54% CSS 13.86%

patternlab-edition-node-webpack's Introduction

Apache V2 License

Pattern Lab Node - Webpack Edition

The webpack wrapper around Pattern Lab Node Core providing tasks to interact with the core library and move supporting frontend assets.

Installation and Starting

  1. yarn install or npm install
  2. yarn start or npm run start

Packaged Components

The webpack edition comes with the following components:

  • patternlab-node: GitHub, npm
  • patternengine-node-mustache: GitHub, npm
  • pattern-lab/styleguidekit-assets-default: GitHub
  • pattern-lab/styleguidekit-mustache-default: GitHub

Prerequisites

The Pattern Lab Node - webpack edition uses Node for core processing, npm to manage project dependencies, and webpack.io to run tasks and interface with the core library. Node version 4 or higher suffices. You can follow the directions for installing Node on the Node website if you haven't done so already. Installation of Node will include npm. Also includes yarn package manager which makes things a bit easier to manage.

Installing

There's two options for installing this version:

  1. yarn install (Preferred)
  2. npm install

What's Included

The pre-built project comes with the Base Starterkit for Mustache installed by default.

Please note: Pattern Lab Node uses npm to manage project dependencies. To upgrade the webpack edition or to install plug-ins you'll need to be familiar with npm.

Use npm (yarn)

npm is a dependency management and package system which can pull in all of the webpack editions's dependencies for you. To accomplish this:

  • download or git clone this repository to an install location.

  • run the following

    cd install/location
    yarn install
    

Running yarn install or npm install from a directory containing a package.json file will download all dependencies defined within. The yarn.lock file is automatically managaged everytime you add/remove/upgrade a dependency. Currently yarn is faster than npm so it's the preferred method of running scripts.

Getting Started

The Pattern Lab Node - Webpack Edition ships with a base experience which serves as clean place to start from scratch with Pattern Lab. But if you want to get rolling with a starterkit of your own, or use the demo starterkit like the one on demo.patternlab.io, you can do so automatically at time of yarn install by adding your starterkit to the package.json file.

You can also work with starterkits using the command line.

Updating Pattern Lab

To update Pattern Lab please refer to each component's GitHub repository, and the master instructions for core. The components are listed at the top of the README.

List all of the available commands

To list all available commands type:

yarn patternlab:help

Generate Pattern Lab

To generate the front-end for Pattern Lab type:

yarn patternlab:build

Watch for changes and re-generate Pattern Lab

To watch for changes, re-generate the front-end, and server it via a BrowserSync server, type:

yarn patternlab:serve

Webpack dev server should open http://localhost:3000 in your browser, both host and port are configurable in the patternlab-config.json file.

Install a StarterKit

To install a specific StarterKit from GitHub type:

yarn add [starterkit-vendor/starterkit-name]

yarn patternlab:loadstarterkit --kit=[starterkit-name]

Pattern Lab - Configuration

Unlike the other editions, there were a few options added just for this edition that allow for easier upgrading, and better flexibility.

Setting Dev Server Settings

You can set the url and port number in the configuration for

"server": {
    "url": "http://localhost",
    "port": 3000
},

Setting the Webpack Merge Options

In this edition, it's important to make the configuration for webpack something very easy to update, and very easy to modify. The current setting for webpack merge are described here.

You can change how it merges by changing this object in patternlab-config.json:

"webpackMerge": {
    "entry":"replace"
},

By default merge does a append if that option works for you only set which webpack configuration you want to change. The merge setting is: smartStrategy which is documented over on this page.

Licenses

Special Thanks and Contributions

Contributor Special Thanks
@rgualberto@rgualberto "A huge thank you to a incredible developer Rodrigo Gualberto for all of his hard work, dedication, and support from the start of project."

patternlab-edition-node-webpack's People

Contributors

johnriv avatar mbulfair avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.