Skip to content

Split up patternlab-node for better inclusion in existing projects and add a cli. #281

@dopry

Description

@dopry

I've been starting to experiment with patternlab, but it seems to assume I am going to work out of a clone of a patternlab repo. In most of my uses cases I'm going to be adding patternlab to an existing project. For me it would be nice to have a couple different packages to work with. I wanted to float my ideas here to see if @bmuenzenmeyer would be on board with these types of changes because it's a big departure from the current packaging.

  • patternlab-node - The pattern lib builder library.

    This is essentially the contents of ./builder as it's own project and package. It shouldn't look for a config by default, instead config should be injected from a caller.

  • patternlab-node-cli - a cli interface to the library

    with commands like init, build, clean that setup a pattern lab project. should look for config file.
    maybe rename the default config file to patternlab.json (it's not well named to play nice
    with other tools). could be quickly built with commander.

    It would be nice to be able to type

    npm install -g patternlab-node
    cd existing/project
    patternlab init ./src/patternlab  ./dist/styleguide

    Then end up with

    • /existing/project/src/pattenlab/patterns
    • /existing/project/src/pattenlab/styleguide
    • /existing/project/patternlab.json
    {
      "paths": { 
         "source": { 
            "root": "./src/patternlab"
         },
         "public": {
            "root": "./dist/styleguide"
         }
    }

    then follow up with

    patternlab build
    patternlab serve
    patternlab clean

    to populate, serve, or clean

    • /existing/project/dist/styleguide

    and a

    patternlab watch

    to watch for changes in

    • ./existing/projects/src/patternlab
      and rebuild
    • ./existing/projects/dist/styleguide
  • gulp-patternlab-node

    A wrapper for easily integrating pattern lab into gulp following the same configuration conventions as patternlab-node-cli

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions