Skip to content

Commit

Permalink
Refactored containerConfig to appConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
adambullmer committed Mar 28, 2016
1 parent 423b986 commit 5af80d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
35 changes: 15 additions & 20 deletions lib/angular-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ var Funnel = require('broccoli-funnel'),
module.exports = AngularApp;

function AngularApp (options) {
this.vendorScripts = [];
this.vendorStyles = [];
this.options = AngularApp.initOptions(options);
this.env = AngularApp.env();
this.isTesting = AngularApp.isTesting();
this.isServing = AngularApp.isServing();
this.isProduction = this.env === 'production';
this.containerConfig = configLoader(this.env, true);
this.vendorScripts = [];
this.vendorStyles = [];
this.options = AngularApp.initOptions(options);
this.env = AngularApp.env();
this.isTesting = AngularApp.isTesting();
this.isServing = AngularApp.isServing();
this.isProduction = this.env === 'production';
this.appConfig = configLoader(this.env, true);
}

AngularApp.env = function () {
Expand Down Expand Up @@ -73,15 +73,11 @@ AngularApp.prototype.appScriptTree = function () {
include: ['**/*.js'],
destDir: 'app'
}),
bootstrapper = new Funnel('node_modules/angular-app', {
include: ['bootstrapper.js'],
destDir: 'app'
}),
addons = new Funnel(this.addonsTree(), {
include: ['**/*.module.js']
});

return mergeTrees([app, addons, bootstrapper]);
return mergeTrees([app, addons]);
};

AngularApp.prototype.templateTree = function () {
Expand Down Expand Up @@ -249,8 +245,8 @@ AngularApp.prototype.runTests = function (appScriptsTree, vendorScriptsTree, lin
tests = replace(tests, {
files: [ '**/*.js' ],
pattern: {
match: /@@CONTAINER_CONFIG/g,
replacement: this.containerConfig
match: /@@APP_CONFIG/g,
replacement: this.appConfig
}
});

Expand All @@ -259,7 +255,6 @@ AngularApp.prototype.runTests = function (appScriptsTree, vendorScriptsTree, lin
autoWatch : this.isServing,
configFile : process.cwd() + '/karma.conf.js',
files : [ 'scripts/vendor.js', 'tests/angular-mocks.js', 'tests/helpers/**/*.js', '**/*.js' ],
exclude : [ 'app/bootstrapper.js' ],
});

return [ lintingResults, unitTestingResults ];
Expand All @@ -285,8 +280,8 @@ AngularApp.prototype.toTree = function () {
appScripts = replace(appScripts, {
files: [ 'app/app.js' ],
pattern: {
match: /@@CONTAINER_CONFIG/g,
replacement: this.containerConfig
match: /@@APP_CONFIG/g,
replacement: this.appConfig
}
});
appScripts = new Babel(appScripts, {
Expand All @@ -302,8 +297,8 @@ AngularApp.prototype.toTree = function () {

appScripts = concat(appScripts, {
inputFiles : [ 'addons/**/*.js', 'app/**/*.js' ],
footerFiles : [ 'scripts/templates.js', 'app/bootstrapper.js'],
footer : 'require("app/bootstrapper")["default"];',
footerFiles : [ 'scripts/templates.js' ],
footer : 'require("app/app");',
outputFile : 'scripts/app.js'
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-bro-app",
"version": "0.3.0",
"version": "0.3.1",
"description": "Angular broccoli plugin and compilation routine",
"main": "lib/angular-app.js",
"scripts": {
Expand Down

0 comments on commit 5af80d3

Please sign in to comment.