aplus-babel.js
function plugin(params) {

	logger = params.logger;
	params.dirname = params.dirname ? _.template(params.dirname)(params) : params.event.dir.resourcesPlatform;

	logger.trace("running babel in directory: " + params.dirname);

	_.defaults(params, {
		options: {},
		includes: ["**/*.js", "!backbone.js"]
	});

	if (params.code) {
		params.code = transformCode(params.code, params.options);
	} else {
		var files = findFiles(params.dirname, params.includes);
		_.forEach(files, function(file) {
			transformFile(path.join(params.dirname, file), params.options);
		});
	}
}
function plugin(params) {

	logger = params.logger;
	params.dirname = params.dirname ? _.template(params.dirname)(params) : params.event.dir.resourcesPlatform;

	logger.trace("running babel in directory: " + params.dirname);

	_.defaults(params, {
		options: {},
		includes: ["**/*.js", "!backbone.js"]
	});

	if (params.code) {
		params.code = transformCode(params.code, params.options);
	} else {
		var files = findFiles(params.dirname, params.includes);
		_.forEach(files, function(file) {
			transformFile(path.join(params.dirname, file), params.options);
		});
	}
}
function plugin ( params ) { logger = params . logger ; params . dirname = params . dirname ? _ . template ( params . dirname ) ( params ) : params . event . dir . resourcesPlatform ; logger . trace ( "running babel in directory: " + params . dirname ) ; _ . defaults ( params , { options : { } , includes : [ "**/*.js" , "!backbone.js" ] } ) ; if ( params . code ) { params . code = transformCode ( params . code , params . options ) ; } else { var files = findFiles ( params . dirname , params . includes ) ; _ . forEach ( files , function ( file ) { transformFile ( path . join ( params . dirname , file ) , params . options ) ; } ) ; } }
Run babel tranformations on Alloy source code

@param {Object} params - parameters available for executing of Alloy+ plugin.
@param {Object} params.event - Provides a set of objects and values which may be useful for building tasks:
@param {Object} params.event.alloyConfig - Contains Alloy compiler configuration information.
@param {string} params.event.alloyConfig.platform - either android, ios, mobileweb or windows.
@param {string} [params.event.alloyConfig.file] - file to target for selective compilation.
@param {string} params.event.alloyConfig.deploytype - compilation environment type: either development, test or production.
@param {string} params.event.alloyConfig.beautify - if set to true, the output from UglifyJS will be beautified.
@param {string} params.event.autoStyle - If set to true, autostyle is enabled for the entire project.
@param {Object} params.event.dependencies - If set to true, autostyle is enabled for the entire project.
@param {Object} params.event.dir - Contains directory paths to various resources.
@param {string} params.event.dir.home - absolute path to the Alloy project's app directory.
@param {string} params.event.dir.project - absolute path to the Alloy project's root directory.
@param {string} params.event.dir.resources - absolute path to the Alloy project's Resource directory.
@param {string} params.event.dir.resourcesAlloy - absolute path to the Alloy project's Resource/alloy directory.
@param {string} params.event.dir.resourcesPlatform - absolute path to the Alloy project's Resource/{platform} directory. (i.e. /Resources/iphone)
@param {string} params.event.dir.assets - absolute path to the Alloy project's assets.
@param {string} params.event.dir.config - absolute path to the Alloy project's config.
@param {string} params.event.dir.controllers - absolute path to the Alloy project's controllers.
@param {string} params.event.dir.migrations - absolute path to the Alloy project's migrations.
@param {string} params.event.dir.models - absolute path to the Alloy project's models.
@param {string} params.event.dir.styles - absolute path to the Alloy project's styles.
@param {string} params.event.dir.themes - absolute path to the Alloy project's themes.
@param {string} params.event.dir.views - absolute path to the Alloy project's views.
@param {string} params.event.dir.widgets - absolute path to the Alloy project's widgets.
@param {string} params.event.dir.builtins - absolute path to the Alloy project's builtins.
@param {string} params.event.dir.template - absolute path to the Alloy project's template.
@param {string} params.event.sourcemap - If true, generates the source mapping files for use with the Studio debugger and other functions.
These files maps the generated Titanium files in the Resources directory to the ones in the app directory.
@param {string} params.event.theme - Name of the theme being used.
@param {string} [params.event.code] - Only present for the appjs build hook. Contains the contents of the app.js file.
@param {string} [params.event.appJSFile] - Only present for the appjs build hook. Contains the the absolute path to the app.js file.
@param {Object} params.logger - Alloy logger object
@param {string[]} [params.includes] - Array of glob patterns to match files to be included in transformation
@param {string} [params.code]
@param {Object} params.options - babel configuration object (see http://babeljs.io/docs/usage/options/)
@param {string[]} [params.options.presets=[]] - List of presets (a set of plugins) to load and use..
@param {string[]} [options.plugins=[]] - List of plugins to load and use.
@param {boolean} [params.options.babelrc=true] - Specify whether or not to use .babelrc and .babelignore files.
@param {boolean} [params.options.ast=true] - Include the AST in the returned object
@param {boolean} [params.options.minified=true] - Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping () from new when safe)
@param {boolean} [params.options.comments=true] - Output comments in generated output.
@param {Object} [params.options.env={}] - This is an object of keys that represent different environments. For example, you may have: { env: { production: { someOption: true } } } which will use those options when the enviroment variable BABEL_ENV is set to "production". If BABEL_ENV isn’t set then NODE_ENV will be used, if it’s not set then it defaults to "development"
@param {string} [params.options.extends=null] - A path to an .babelrc file to extend
Run babel tranformations on Alloy source code