Search code examples
patternlab.io

What from Pattern Lab should be committed to the master branch?


I'm starting our first project using Pattern Lab and I can't tell what I should commit for my team. The Twig build came with a .gitignore file that had the following:

.DS_Store
composer.lock
config/*
export/*
packages/*
public/*
source/*
vendor/*

It seems that at the very least, source/* should be committed if this is to be shared and multiple devs are to contribute. It also seems that config, packages, and vendor are needed for building correctly. I'm not sure what export is.

In public, I'm pretty sure I can ignore everything since it does seem to all build just fine from scratch. We can build on individual local machines as well as on the server.

So is this more like what should be ignored? For a team working on it together?

.DS_Store
composer.lock
public/annotations/
public/css/
public/images/
public/js/
public/patternlab-components/
public/patterns/
public/
public/favicon.ico

Is there another workflow that I'm missing? If there's a resource about this somewhere I haven't been able to find it but I'd be happy to simply be pointed there.

Also posed in the repo, but don't see recent activity. Will update here if there's a response.


Solution

  • The maintainer of the GitHub project, dmolsen, responded to me there. https://github.com/pattern-lab/patternengine-php-twig/issues/15#issuecomment-202633762

    His response is in direct relation to that repo:

    The .gitignore is primarily focused on folks who use Composer to build or update their projects. If you downloaded the zip and expect that to be your own true copy then you're correct, a fair bit of the .gitignore can be removed.

    packages/ and vendor/ can definitely be removed in that scenario. They get created by the Composer build process. Just note that you'll only want one member of your team running Composer update and pushing changes to the repo. Anything else could get really messy.

    Adding config/ and source/ was probably overkill on my part. It's more to make sure I don't accidentally commit something but that's not going to happen in my dev environment anymore. Feel free to take them out. I'll remove them in the future too.

    I'd leave export/ in as it's similar to public/. It's just a place to export clean patterns to and wouldn't need to be tracked. That's a new and undocumented feature.

    Thanks to dmolsen for the response!