Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat #1273 Removing the need for a build step after changing files
Before the migration to noder-js, it was possible to run Aria Templates directly from its src folder. With the migration to noder-js, this was not possible any more for two reasons: 1) files in the src folder were using the old syntax (with $dependencies) and were converted at build time to the new syntax (with require) -> now, starting with commit b0ae188, files in the repository are using the new syntax and it is no longer needed to convert them at build time. 2) the entry point file of Aria Templates needs to be generated (as it is built on top of noder-js, overriding one of its modules) and was generated in the build/target/bootstrap folder. -> this commit is changing the location where the entry point file is generated. It is now generated in the src foilder so that it is possible to fully execute Aria Templates directly from its src folder. The generation of files in the src folder is now part of the full build and can also be run independently with: grunt src The following files are generated in the src folder: src/aria/bootstrap.js src/aria/bootstrap-node.js src/aria/noderError/*.js After running "grunt src", it is possible to use the src folder directly to serve the Aria Templates files, and then changing most of the framework files can be done without requiring a build step. Running again "grunt src" is needed after changing noder-js itself or files in the src/noder-modules folder. Close #1273
- Loading branch information
Showing
8 changed files
with
149 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright 2012 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. | ||
*/ | ||
|
||
/** | ||
* Aria Templates bootstrap build file for files generated in the source folder directly. | ||
*/ | ||
module.exports = function (grunt) { | ||
var packagingSettings = require('./config-packaging')(grunt); | ||
|
||
var getNoderPackage = function (packageFile, mainFile, environment) { | ||
return { | ||
name : packageFile, | ||
builder : { | ||
type : 'NoderBootstrapPackage', | ||
cfg : { | ||
header : packagingSettings.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.bootstrapSrc', { | ||
options : { | ||
sourceDirectories : ['src'], | ||
sourceFiles : [], | ||
outputDirectory : 'src', | ||
visitors : [{ | ||
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 : packagingSettings.bootstrap.files | ||
} | ||
}, { | ||
type : 'NoderRequiresGenerator', | ||
cfg : { | ||
requireFunction : "syncRequire", | ||
wrapper : "<%= grunt.file.read('src/aria/bootstrap.tpl.js') %>", | ||
targetLogicalPath : 'aria/bootstrap-node.js', | ||
requires : packagingSettings.bootstrap.files | ||
} | ||
}], | ||
packages : [getNoderPackage("aria/bootstrap.js", "aria/bootstrap.js", "browser"), | ||
getNoderPackage("aria/bootstrap-node.js", "aria/bootstrap-node.js", "node")] | ||
} | ||
}); | ||
|
||
grunt.config.set('removedirs.bootstrapSrc', { | ||
folders : ['src/aria/noderError'] | ||
}); | ||
|
||
grunt.registerTask('src', ['removedirs:bootstrapSrc', 'atpackager:bootstrapSrc']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters