Skip to content

Commit

Permalink
feat #984 noder-js: integration of noder-js
Browse files Browse the repository at this point in the history
  • Loading branch information
divdavem authored and flongo committed Jun 4, 2014
1 parent b3a6193 commit 5aa1447
Show file tree
Hide file tree
Showing 84 changed files with 2,186 additions and 2,320 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.js
Expand Up @@ -26,6 +26,8 @@ module.exports = function (grunt) {

grunt.loadTasks('./build/grunt-tasks');
grunt.loadNpmTasks('atpackager');
require('atpackager').loadNpmPlugin('noder-js');
require('atpackager').loadNpmPlugin('at-noder-converter');
grunt.loadNpmTasks('grunt-verifylowercase');
grunt.loadNpmTasks('grunt-leading-indent');
grunt.loadNpmTasks('grunt-contrib-jshint');
Expand Down
3 changes: 2 additions & 1 deletion build/config/files-bootstrap.json
Expand Up @@ -46,5 +46,6 @@
"aria/core/environment/EnvironmentBaseCfgBeans.js",
"aria/core/environment/EnvironmentBase.js",
"aria/core/environment/Environment.js",
"aria/core/ResMgr.js"
"aria/core/ResMgr.js",
"aria/core/loaders/OldATLoader.js"
]
17 changes: 17 additions & 0 deletions build/config/files-prod.json
Expand Up @@ -21,6 +21,10 @@
{
"name": "aria/pack-templates1.js",
"files": [
"aria/$resources.js",
"aria/core/loaders/ResProviderLoader.js",
"aria/core/loaders/*Preprocessor.js",
"!aria/core/loaders/TxtPreprocessor.js",
"aria/core/environment/Customizations.js",
"aria/core/environment/CustomizationsCfgBeans.js",
"aria/templates/*",
Expand Down Expand Up @@ -61,6 +65,7 @@
{
"name": "aria/pack-templates2.js",
"files": [
"aria/core/loaders/TxtPreprocessor.js",
"aria/templates/TextTemplate.js",
"aria/templates/TxtClassGenerator.js",
"aria/templates/TxtCtxt.js",
Expand Down Expand Up @@ -185,5 +190,17 @@
"files": [
"aria/tester/runner/**/*"
]
},
{
"name": "aria/pack-noder-error.js",
"files": [
"aria/noderError/**"
],
"builder": {
"type": "NoderPackage",
"cfg": {
"header": "<%= packaging.license_min %>"
}
}
}
]
3 changes: 0 additions & 3 deletions build/config/jshint-build.json

This file was deleted.

4 changes: 2 additions & 2 deletions build/config/jshint.json
Expand Up @@ -57,7 +57,7 @@
"dojo" : false,
"jquery" : false,
"mootools" : false,
"node" : false,
"node" : true,
"nonstandard" : false,
"prototypejs" : false,
"rhino" : false,
Expand All @@ -72,7 +72,7 @@

"globals" : {
"aria" : false,
"Aria" : false,
"Aria" : true,
"setTimeout" : false,
"setInterval" : false,
"clearTimeout" : false,
Expand Down
48 changes: 48 additions & 0 deletions build/grunt-config/config-atpackager-bootstrap-skin.js
@@ -0,0 +1,48 @@
/*
* Copyright 2013 Amadeus s.a.s.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = function (grunt) {
grunt.config.set('atpackager.bootstrapSkin', {
options : {
ATDebug : true,
ATBootstrapFile : '<%= packaging.main_file %>',
ATDirectories : ['<%= packaging.bootstrap.outputdir %>'],
sourceDirectories : ['src'],
sourceFiles : ['aria/css/**'],
outputDirectory : '<%= packaging.bootstrap.outputdir %>',
visitors : [{
type : 'ATNormalizeSkin',
cfg : {
files : ['aria/css/*.js'],
strict : true
}
}, {
type : 'CopyUnpackaged',
cfg : {
files : ['aria/css/*.js'],
renameFunction : function (name) {
return name.replace(/.js$/, grunt.config.process("-<%= pkg.version %>.js"));
},
builder : {
type : 'Concat',
cfg : {
header : '<%= packaging.license %>'
}
}
}
}, 'CopyUnpackaged']
}
});
};
108 changes: 68 additions & 40 deletions build/grunt-config/config-atpackager-bootstrap.js
Expand Up @@ -15,9 +15,9 @@

/**
* Aria Templates opensource bootstrap build file.<br>
* This is a very minimalistic build. The main thing it does is to create a file 'aria-templates-x.y.z.js' as a
* concatenation of the framework's most essential files. The x.y.z stands for current release version that is read from
* JSON config file.<br>
* This is a very minimalistic build. The main thing it does is to create a file 'aria-templates-x.y.z.js' containing
* noder-js and able to load the core part of the framework. The x.y.z stands for current release version that is read
* from JSON config file.<br>
* It also:
* <ul>
* <li>updates license headers in all the files accordingly,</li>
Expand All @@ -27,30 +27,78 @@

module.exports = function (grunt) {
var atExtensions = ['**/*.js', '**/*.tpl', '**/*.tpl.css', '**/*.tpl.txt', '**/*.tml', '**/*.cml'];
var mainATFile = 'aria/<%= pkg.name %>-<%= pkg.version %>.js';

grunt.config.set('atpackager.bootstrap', {
options : {
ATDebug : true,
sourceDirectories : ['src'],
sourceFiles : ['aria/**/*', '!aria/node.js', '!aria/bootstrap.js'],
defaultBuilder : {
type : 'ATMultipart',
var getNoderPackage = function (packageFile, mainFile, environment) {
return {
name : packageFile,
builder : {
type : 'NoderBootstrapPackage',
cfg : {
header : '<%= packaging.license_min %>'
header : '<%= packaging.license %>',
noderModules : ['src/noder-modules/*'],
noderEnvironment : environment,
noderConfigOptions : {
main : mainFile,
failFast : false,
resolver : {
"default" : {
ariatemplates : "aria"
}
},
packaging : {
ariatemplates : true
}
}
}
},
files : [mainFile]
};
};

grunt.config.set('atpackager.bootstrap', {
options : {
sourceDirectories : ['src'],
sourceFiles : ['aria/**/*', '!aria/node.js', '!aria/bootstrap.tpl.js', '!aria/css/**'],
outputDirectory : '<%= packaging.bootstrap.outputdir %>',
visitors : [{
type : 'CheckDependencies',
type : 'NoderPlugins',
cfg : {
targetBaseLogicalPath : "aria",
targetFiles : "aria/noderError/**"
}
}, {
type : 'NoderRequiresGenerator',
cfg : {
requireFunction : "syncRequire",
wrapper : "<%= grunt.file.read('src/aria/bootstrap.tpl.js') %>",
targetLogicalPath : 'aria/bootstrap.js',
requires : '<%= packaging.bootstrap.files %>'
}
}, {
type : 'NoderRequiresGenerator',
cfg : {
requireFunction : "syncRequire",
wrapper : "<%= grunt.file.read('src/aria/bootstrap.tpl.js') %>",
targetLogicalPath : 'aria/bootstrap-node.js',
requires : '<%= packaging.bootstrap.files %>'
}
}, {
type : 'ATNoderConverter',
cfg : {
// only check dependencies for the bootstrap
files : [mainATFile]
files : ['aria/**/*.js']
}
}, 'ATDependencies', {
}, {
type : 'CheckGlobals',
cfg : {
files : '<%= packaging.check_globals.files %>',
allowCommonJSGlobals : true,
allowedGlobals : ["aria", "Aria", "setTimeout", "clearTimeout", "setInterval",
"clearInterval", "global"]
}
}, {
type : 'JSStripBanner',
cfg : {
files : atExtensions
files : atExtensions.concat("!aria/noderError/**")
}
}, {
type : "TextReplace",
Expand All @@ -61,12 +109,6 @@ module.exports = function (grunt) {
replace : '<%= pkg.version %>'
}]
}
}, {
type : 'ATNormalizeSkin',
cfg : {
files : ['aria/css/*.js'],
strict : true
}
}, {
type : 'CopyUnpackaged',
cfg : {
Expand All @@ -79,29 +121,15 @@ module.exports = function (grunt) {
}
}
}, 'CopyUnpackaged'],
packages : [{
name : mainATFile,
builder : {
type : 'Concat',
cfg : {
header : '<%= packaging.license %>'
}
},
files : '<%= packaging.bootstrap.files %>'
}, {
name : 'aria/css/atskin-<%= pkg.version %>.js',
files : ['aria/css/atskin.js']
}, {
name : 'aria/css/atflatskin-<%= pkg.version %>.js',
files : ['aria/css/atflatskin.js']
}]
packages : [getNoderPackage('<%= packaging.main_file %>', "aria/bootstrap.js", "browser"),
getNoderPackage("aria/node.js", "aria/bootstrap-node.js", "node")]
}
});

grunt.config.set('removedirs.bootstrap', {
folders : ['<%= packaging.bootstrap.outputdir %>']
});

grunt.registerTask('bootstrap', 'atpackager:bootstrap');
grunt.registerTask('bootstrap', ['atpackager:bootstrap', 'atpackager:bootstrapSkin']);

};

0 comments on commit 5aa1447

Please sign in to comment.