callumlocke / origami-product-boilerplate

1 stars 1 forks source link

Consider a generator #12

Open callumlocke opened 9 years ago

callumlocke commented 9 years ago

The initial idea of this repo was to hammer out a good structure for an Origami-consuming product. It's easier to hack on a plain boilerplate than a Yeoman generator (much easier to test changes, less code to go wrong), so that's why we started it as a boilerplate. (Also our ftnewsapp generator has led to over-automation, to the point that people never learn about the basics.)

But there are still reasons to make a generator based on this boilerplate:

  1. You can get user input and customise the scaffold, per-project.
    • yes, too many questions becomes problematic; it's good for most customisation to be done by the user after generating (and recipes can be provided for common tasks)... but on the other hand, it's tedious to do absolutely everything manually. There's a happy medium. gulp-webapp has found a good balance – just one question to toggle on/off three features, then it scaffolds and installs deps.
  2. Having every project start by cloning the boilerplate is messy; it copies all the boilerplate-specific extras into the new project.
    • the tests and travis.yml are for testing that the boilerplate is up to scratch, and should not just be copied into a project.
    • the docs should not be copied into every project we generate from it.

Options...

  1. Keep this repo as it is, and create a new Yeoman generator repo that is published to npm. (Most iterative changes would still take place in this repo, and the generator would rarely change.) The generator would git clone a local copy of the boilerplate (inside its global module dir) as a postinstall. Then, whenever you run it, it would git pull to refresh it, then do the scaffolding (copying over client and other appropriate files) and maybe doing things like adding a new README template for you to fill in, injecting a gulpfile comment saying what date it was generated on, and then finally installing deps.

callumlocke commented 9 years ago

Better idea from Luke: don't do a whole Yeoman generator. Do something more minimal. Just make a curl-able gist that downloads a tar snapshot of the boilerplate and sets everything up.

callumlocke commented 9 years ago

actually, there is still a potential big benefit to having a Yeoman generator: we can massively cut down scaffolding time by caching npm and bower deps in the project.