Skip to content

rentpost/big-gulp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIG Gulp (beta)

A micro-framework for BIG Gulp projects that could benefit from some abstraction and organization.

Big gulps, huh?

Getting Started

Getting going with BIG Gulp is really simple. Start off by installing the gulp and rentpost/big-gulp npm modules.

cd /path/to/your/gulp/app
npm install gulp
npm install rentpost/big-gulp

Next, be sure to add something similar to the following to your package.json file inside your app directory.

Note that within the autoload property, you can define directories for autoloading. A value of true for a "namespace" like "tasks" will load all task files within that directory. Optionally, you can selectively load in modules by defining an object collection with a value of true where the "key" is the name of the module/file.

{
    "_BigGulp": {
		"config": {
			"absolutePath": "/path/to/your/gulp/app",
			"logPath": "/path/to/your/gulp/app/logs",
			"minLogLevel": "debug"
		},
		"autoload": {
			"tasks": true,
			"node_modules": {
				"gulp": true,
				"gulp-sourcemaps": true,
				"gulp-sass": true,
				"gulp-uglify": true,
			}
		},
		"watch": {
		  "/path/to/your/gulp/app/src/js": [ "lint", "test", "js" ],
		  "/path/to/your/gulp/app/src/scss": [ "sass" ]
	}
}

After setting up your config, add the following to your gulpfile.js to initialize and load BIG Gulp.

var BigGulp = require("big-gulp")(module),
	app = BigGulp.load();
	
app.watch(); //optionally start watching

Once you've done this, you can now start playing. If you autoloaded a "tasks" namespace, the tasks within this directory get overloaded and pass the app for accessing your various modules.

Below is an example of a task.

Note the use of the app.config. Additional config properties can be added to the config in your package.json. If you choose to do so, please use _underscored property keys to avoid any future conflicts.

/**
 * LINT's the necessary assets
 */
module.exports = {

	/**
	 * Run the task
	 * @param {object} app
	 */
	run: function(app) {
	    return app.modules.gulp.src(app.config.absolutePath + 'src/*.js')
			.pipe(app.modules.gulpJshint())
			.pipe(app.modules.gulpJshint.reporter('default'));
	}
};

Dependencies & Credits

  • gulp for providing some amazing build tools.
  • jwerle for a nice autoloader for node modules.
  • lodash becasue it's awesome!
  • indexzero for a nice tool for locating, reading and parsing package.json.
  • ianstormtaylor for making it easy to camelCase random strings.
  • flatiron for their fantastic work on Winston, a kick-ass logging lib.
  • momentjs because it's amazing.
  • sindresorhus for helping make the CLI purdy.

License

The MIT License (MIT)

Copyright © 2014 - RentPost, Inc.

Releases

No releases published

Packages

No packages published