OneJSToolkit/gulp-onejs-compiler — pull request #4 by BobNisco (2014-11-21 23:01:10+00:00)
Title: Importable gulp tasks!

It's what we've all been waiting for, importable gulp tasks! We no longer need to have splintered gulp tasks that all do the same thing in our various OneJS repos (and eventually 3rd party repos that want to build OneJS easily).

## Overview of changes
**Slight breaking change** in order to make this work, we needed to modify the way gulp-common-js exposes its modules. Previously, if someone wanted to include OneJsCompiler they would do
```javascript
var oneJsCompiler = require('gulp-onejs-compiler');
```

Now since we're exposing both the compiler and gulp tasks, it needs to be further qualified
```javascript
var oneJsCompiler = require('gulp-onejs-compiler').compiler;
```

**Exposed gulp tasks**
Now you can easily use our gulp tasks with just a few lines
```javascript
var gulp = require('gulp');
var oneJs= require('gulp-onejs-compiler');
var karma = require('karma').server;

oneJs.gulpTasks.all({
gulp: gulp,
rootDir: __dirname,
karma: karma
});
```

All we're doing is passing our gulp, local root path, and karma instance, and now we have all of the tasks defined in `./tasks/*.js` of this repo available on the gulp instance on any project.

This means by default, the user has capabilities to build amd/commonjs modules, test with karma, automate a release of their package and STILL have the ability to write their own gulp tasks in the gulp file or even overwrite our tasks.

Now, we can update these tasks, push out an update to compiler and let all users benefit from it!

**Directory structure**
After many email threads, we came up with a directory structure. You can see it in index.js (module.exports.gulpTasks.paths). All gulp tasks use these paths/glob helpers to make everything super normalized from OneJS project to the next.

## Future work
* Minify could be better. Right now it just minifies it all into 1 file. Look into integrating https://github.com/SteveSanderson/gulp-requirejs-bundler but this is not high pri right now and will NOT be a part of this pull request