Updated yeoman generator to support external ng-xos-lib
Updateding Custom Views:
- ceilometerDashboard
- contentProvider
- dashboardManager
- developer
- diagnostic
- hpc
- mCordTopology
- openVPN
- serviceGrid
- subscribers
- syncNotifier
- tenant
- truckroll
Change-Id: I8bdebf70d3b72ceca8ec04565213efa60bc0b8d3
diff --git a/views/ngXosLib/generator-xos/test/build.spec.js b/views/ngXosLib/generator-xos/test/build.spec.js
index c6cab4c3..e2f6b49 100644
--- a/views/ngXosLib/generator-xos/test/build.spec.js
+++ b/views/ngXosLib/generator-xos/test/build.spec.js
@@ -28,7 +28,7 @@
const basePath = '../../../../xos/core/xoslib';
const destHtml = path.join(__dirname, basePath + '/dashboards/xosTestDashboard.html');
const destJs = path.join(__dirname, basePath + '/static/js/xosTestDashboard.js');
-const destVendor = path.join(__dirname, basePath + '/static/js/vendor/xosTestDashboardVendor.js');
+const destVendor = path.join(__dirname, basePath + '/static/vendor/xosTestDashboardVendor.js');
const destCss = path.join(__dirname, basePath + '/static/css/xosTestDashboard.css');
describe('The XOS Build script', function(){
@@ -140,7 +140,7 @@
it('should include only minified files and minified deps in the index', () => {
assert.fileContent(destHtml, `<script src="/static/js/xos${fileName}.js"></script>`);
- assert.fileContent(destHtml, `<script src="/static/js/vendor/xos${fileName}Vendor.js"></script>`);
+ assert.fileContent(destHtml, `<script src="/static/vendor/xos${fileName}Vendor.js"></script>`);
assert.noFileContent(destHtml, `<!-- bower:css -->`);
assert.noFileContent(destHtml, `<!-- bower:js -->`);
});
diff --git a/views/ngXosLib/generator-xos/test/generator.spec.js b/views/ngXosLib/generator-xos/test/generator.spec.js
index 81ac985..50ec25e 100644
--- a/views/ngXosLib/generator-xos/test/generator.spec.js
+++ b/views/ngXosLib/generator-xos/test/generator.spec.js
@@ -9,17 +9,18 @@
const firstCharTouppercase = string => string.replace(/^./, string[0].toUpperCase())
-// get bower deps installed in ngXosLib
-let bowerDeps = wiredep({
- cwd: path.join(__dirname, '../../'), // pretending to be in the ngXosLib root
- exclude: ['Chart.js']
-});
-bowerDeps = bowerDeps.js.map(d => {
- let path = d.match(/bower_components\/([1-9a-zA-Z\-`.]+)\//);
- if(path){
- return path[1];
- }
-});
+const bowerDeps = [
+ 'angular',
+ 'angular-ui-router',
+ 'angular-resource',
+ 'angular-cookies',
+ 'angular-animate',
+ 'lodash',
+ 'angular-chart.js',
+ 'd3',
+ 'angular-recursion',
+ 'ng-xos-lib'
+];
// test values
const viewName = 'testDashboard';
@@ -100,7 +101,7 @@
assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}.css'))`)
assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}.js'))`)
assert.fileContent(`${testPath}gulp/build.js`, `module: 'xos.${viewName}'`)
- assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'js/vendor/xos${fileName}Vendor.js'`)
+ assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'vendor/xos${fileName}Vendor.js'`)
assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'js/xos${fileName}.js'`)
assert.fileContent(`${testPath}gulp/build.js`, `options.static + 'css/xos${fileName}.css'`)
assert.fileContent(`${testPath}gulp/build.js`, `.pipe(concat('xos${fileName}Vendor.js'))`)