grunt-jasper
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "grunt-jasper", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Grunt task to build and package jasper application", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/jasperjs/grunt-jasper", |
@@ -19,3 +19,2 @@ /* | ||
delete def.__path; | ||
delete def.templateFile; | ||
@@ -168,2 +167,4 @@ switch (type.toUpperCase()) { | ||
grunt.registerTask('jasperCollectDefs', 'Find all application components definitions (_definition.json) files', function () { | ||
areas.forEach(function (area) { | ||
@@ -173,4 +174,3 @@ var areaDefinitions = []; | ||
configurations.forEach(function (config) { | ||
var def = grunt.file.readJSON(config); | ||
var registerDefinition = function(config, def){ | ||
if (!def.name) { | ||
@@ -197,2 +197,3 @@ var tagName = utils.getParentFolderName(config); | ||
def.templateUrl = def.__path + '/' + def.templateFile; | ||
delete def.templateFile; | ||
} | ||
@@ -214,3 +215,15 @@ // if we package our application, we need to collect all html templates | ||
areaDefinitions.push(def); | ||
}; | ||
configurations.forEach(function (config) { | ||
var def = grunt.file.readJSON(config); | ||
if(Array.isArray(def)){ | ||
def.forEach(function(d){ | ||
registerDefinition(config, d); | ||
}); | ||
}else { | ||
registerDefinition(config, def); | ||
} | ||
}); | ||
area.__defs = areaDefinitions; | ||
@@ -217,0 +230,0 @@ }); |
@@ -102,2 +102,3 @@ 'use strict'; | ||
appPath + '/app/core/components/site-footer/SiteFooter.js', | ||
appPath + '/app/core/components/site-footer/SiteFooter2.js', | ||
appPath + '/app/core/components/site-header/SiteHeader.js', | ||
@@ -104,0 +105,0 @@ appPath + '/app/core/decorators/focus-on-default/FocusOnDefault.js', |
@@ -106,3 +106,3 @@ 'use strict'; | ||
test.ok(configObject.core.scripts[1] === '//path/to/external/script.js', 'Core area must contains external script'); | ||
test.ok(configObject.core.scripts[2] === 'scripts/core.min.js?v=8264c972e5bad2fdf6fc50fcd990151d','Core area must contains area script'); | ||
test.ok(configObject.core.scripts[2] === 'scripts/core.min.js?v=65791b00570e7daadf335ed00636d0d5','Core area must contains area script'); | ||
@@ -112,3 +112,3 @@ test.strictEqual(configObject.boot.scripts, undefined, 'Scripts of bootstrapped area must be undefined') | ||
ensurePartsExistence(test, configObject.feature.dependencies, ['core']); | ||
ensurePartsExistence(test, configObject.core.scripts, ['scripts/core.min.js?v=8264c972e5bad2fdf6fc50fcd990151d']); | ||
ensurePartsExistence(test, configObject.core.scripts, ['scripts/core.min.js?v=65791b00570e7daadf335ed00636d0d5']); | ||
ensurePartsExistence(test, configObject.feature.scripts, ['scripts/feature.min.js?v=539fe595c896279cdb6caeeb7bff75a7']); | ||
@@ -115,0 +115,0 @@ |
@@ -1,1 +0,13 @@ | ||
{ "templateFile": "site-footer.html", "type": "component","ctrl": "spa.core.components.SiteFooter" } | ||
[ | ||
{ | ||
"templateFile": "site-footer.html", | ||
"type": "component", | ||
"ctrl": "spa.core.components.SiteFooter" | ||
}, | ||
{ | ||
"templateFile": "site-footer2.html", | ||
"name": "siteFooter2", | ||
"type": "component", | ||
"ctrl": "spa.core.components.SiteFooter2" | ||
} | ||
] |
53756
48
1203