FormidableLabs / builder-init

A project generator for builder archetypes.
MIT License
12 stars 2 forks source link

Extract abstract template engine out. #37

Open ryan-roemer opened 8 years ago

ryan-roemer commented 8 years ago

We have a generic templating tool here that's not builder specific, so let's move that to it's own project

New list of proposed default fields:

/**
 * Default prompts values added to all prompt calls.
 */
var DEFAULTS = {
  destination: {
    message: "Destination directory to write",
    validate: function (val) { /* existing stuff */ }
  },
  derived: {
    // Existing renamed file name helpers.
    _npmignore: function (data, cb) { cb(null, ".npmignore"); },
    _gitignore: function (data, cb) { cb(null, ".gitignore"); },
    _eslintrc: function (data, cb) { cb(null, ".eslintrc"); },
    _npmrc: function (data, cb) { cb(null, ".npmrc"); }

    // New stuff
    //
    // Location of templates directory to use.
    // Default to `init` for `builder-init`. Could be anything for new project.
    // https://github.com/FormidableLabs/builder-init/issues/36
    _templatesDir: /* snipped */
  }
};

/cc @kenwheeler