Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dopry opened this issue Mar 5, 2016 · 3 comments

Comments

@dopry
Copy link

dopry commented Mar 5, 2016

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

@bmuenzenmeyer
Copy link
Member

Hi @dopry

Thanks for the thoughtful proposal - there is a lot to like about it! I am glad that other people are just as interested as I in making the project more modular, (#272, #245 (comment)).

I am taking a step-wise approach to get the project there, with some prework to better align with the shared assets PL Node could consume in the future. I owe interested parties a better plan to do this, so we can gather feedback and arrive at a place that works for best consumption, upgrades, and integration with shared/generic PL repos.

Stay tuned

@bmuenzenmeyer
Copy link
Member

This will likely become the mothership ticket for this large effort. Future work

@bmuenzenmeyer
Copy link
Member

Most of this work is being done in pattern-lab/edition-node-gulp#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@bmuenzenmeyer @dopry and others