Skip to content

Commit

Permalink
Further implemented the wrapped vendor services concept.
Browse files Browse the repository at this point in the history
Also rearranged the build files.

Almost complete but  completely non-functional. externalModule.js needs to be split into two files and included in the build process.
No testing completed.
  • Loading branch information
atruskie committed Oct 27, 2014
1 parent 446eabb commit ec45641
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 195 deletions.
36 changes: 20 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
var modRewrite = require('connect-modrewrite'),
path = require('path'),
_ = require('lodash');


module.exports = function (grunt) {

// bit of bullshit to ensure the build fails for missing files in the concat task
// note this overrides normal logging! not cool.
// These problems (failing on missing files) are expected to be resolved in grunt 0.5
//grunt.log.oldWarn = grunt.log.warn;
//grunt.log.warn = grunt.warn;
var modRewrite = require('connect-modrewrite'),
path = require('path'),
_ = require('lodash');


/**
* Load required Grunt tasks. These are installed based on the versions listed
Expand All @@ -34,7 +28,14 @@ module.exports = function (grunt) {
/**
* Load in our build configuration file.
*/
var userConfig = require('./build.config.js');
var userConfig = require('./buildConfig/build.config.js');

/**
* Load in the special vendor template.
*/
var processVendorJs =
require("./buildConfig/vendorTemplateProcessing.js")
(grunt, "./buildConfig/vendor.wrapper", "window.bawApp.externalsCallback", userConfig.vendor_files.jsDoNotWrap);


/**
Expand Down Expand Up @@ -122,7 +123,7 @@ module.exports = function (grunt) {
//after: "2013-09-05T10:18:39.4492679+10:00",
//before: "now",
dest: 'CHANGELOG.md',
template: 'changelog.tpl'
template: 'buildConfig/changelog.tpl'
}
},

Expand Down Expand Up @@ -224,7 +225,7 @@ module.exports = function (grunt) {
},
build_appjs: {
options: {
processContent: function (content, srcPath) {
process: function (content, srcPath) {
// if srcPath contain .tpl.js
// for now since the angular templates use tpl as well,
// we'll cheat and just use a direct file reference
Expand All @@ -249,6 +250,9 @@ module.exports = function (grunt) {
]
},
build_vendorjs: {
options: {
process: processVendorJs
},
files: [
{
src: [ '<%= vendor_files.js %>' ],
Expand Down Expand Up @@ -302,12 +306,12 @@ module.exports = function (grunt) {
},
nonull: true,
src: [
'<%= vendor_files.js %>',
'module.prefix',
'<%= build_dir %>/vendor/**/*.js',
'buildConfig/module.prefix',
'<%= build_dir %>/src/**/*.js',
'<%= html2js.app.dest %>',
'<%= html2js.common.dest %>',
'module.suffix'
'buildConfig/module.suffix'
],
dest: '<%= compile_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.js'
}
Expand Down
151 changes: 0 additions & 151 deletions build.config.js

This file was deleted.

23 changes: 0 additions & 23 deletions changelog.tpl

This file was deleted.

2 changes: 0 additions & 2 deletions module.prefix

This file was deleted.

1 change: 0 additions & 1 deletion module.suffix

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "0.5.x",
"grunt-contrib-copy": "0.7.x",
"grunt-contrib-jshint": "0.10.x",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-watch": "~0.6.x",
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/externals/bowserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ angular
.module("bawApp.services.core.bowser", [])
.provider("bowser", function () {

// TODO: is there a better way to load lodash without requiring it be attached to window?
// TODO: is there a better way to load bowser without requiring it be attached to window?
var bowser = window.bowser;

this.$get = [function bowserFactory() {
Expand Down

0 comments on commit ec45641

Please sign in to comment.