h5bp/node-build-script — Issue #2: build: have config prompted
Author: mklabs
Created: 2012-02-03 14:28:32+00:00
State: open

Ported from h5bp/html5-boilerplate#867
Originally opened by @mklabs

Here are random thoughts and ideas on the build scripts. I think it could apply to both the ant and cake version.

The idea here is to make the scripts easier to work with, guiding the user along the way and prompting for the more common configuration values.

The more I think about it, the more I see this as some kind of wizards, maybe related to #796. The docs and guiding could be part of the build script itself. Might be a terrible idea though, but I'd like to hear other thoughts on this. Users may configure how the build script behaves without editing configuration files.

What I can think of is

* some of [the directory paths](https://github.com/h5bp/html5-boilerplate/blob/master/build/config/default.properties#L11-24) (like source, publish, js paths, css and images).
* the list of [html pages to process](https://github.com/h5bp/html5-boilerplate/blob/master/build/config/default.properties#L30)
* probably other options like `file.root.script` and `file.root.stylesheet`

Each of these prompted values would have a description and a default value (most likely from default.properties). We may think of using the project.properties file to store these values.

For ant, the [input task](http://ant.apache.org/manual/Tasks/input.html) may be used to do this.

#### runnable build script from outside the build/ dir

It would probably be better to open another issue, but I'm doing it right here since I see it kinda related.

It would be cool to be able to run the build script from anywhere on the system. I'm not sure how it could be applied to the ant script but I'm thinking basically about some kind of executable wrapper around the build scripts (like an `h5bp-build` command).

The idea is to make it easier to run the build script on a variety of folder structure, and not necessarely from within an h5bp clone or download.

The scripts should know from where the command is run, and adjust relative paths accordingly. Doing so, it may provide a greater level of flexibility (combined with prompts, or local configuration).

The command may even include some scaffolding helper, by using the `createproject.sh` script.

I'm also thinking about a way for users to define custom tasks, that would override some part of the build script and let users define their own js task (to run requirejs optimizer for instance), or the css part (like running a less or sass compile step). But this issue description is getting pretty long, so.. I guess I'll stop there :)

Cheers,