Commit b72cc325 by Vishal Kadam

Added task to combine js files

parent ffed01af
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
node_modules/ node_modules/
lib/ lib/
public/lib public/lib
public/dist
*.log *.log
public/css/common.css public/css/common.css
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "dgc-metadata", "name": "dgc-metadata",
"description": "DGC Metadata", "description": "DGC Metadata",
"version": "1.0.0-SNAPSHOT", "version": "1.0.0-SNAPSHOT",
"dependencies": { "devDependencies": {
"angular": "~1.2.15", "angular": "~1.2.15",
"angular-resource": "~1.2.15", "angular-resource": "~1.2.15",
"angular-cookies": "~1.2.15", "angular-cookies": "~1.2.15",
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
"angular-ui-router": "~0.2.13", "angular-ui-router": "~0.2.13",
"lodash": "~3.0.0", "lodash": "~3.0.0",
"angular-ui-utils": "~0.1.1", "angular-ui-utils": "~0.1.1",
"font-awesome": "~4.2.0" "font-awesome": "~4.2.0",
"closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip",
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip"
} }
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module.exports = function(grunt) { module.exports = function(grunt) {
// Project Configuration // Project Configuration
var classPathSep = (process.platform === "win32") ? ';' : ':';
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
watch: { watch: {
...@@ -9,8 +10,8 @@ module.exports = function(grunt) { ...@@ -9,8 +10,8 @@ module.exports = function(grunt) {
livereload: 35730 livereload: 35730
}, },
js: { js: {
files: ['public/**/*.js', '!public/lib/**'], files: ['public/**/*.js', '!public/lib/**', '!public/dist/**'],
tasks: ['jshint'] tasks: ['jshint', 'shell']
}, },
html: { html: {
files: ['public/**/*.html'] files: ['public/**/*.html']
...@@ -21,7 +22,7 @@ module.exports = function(grunt) { ...@@ -21,7 +22,7 @@ module.exports = function(grunt) {
}, },
jshint: { jshint: {
all: { all: {
src: ['gruntfile.js', 'package.json', 'server.js', 'server/**/*.js', 'public/**/*.js', '!public/lib/**'], src: ['gruntfile.js', 'package.json', 'server.js', 'server/**/*.js', 'public/**/*.js', '!public/lib/**', '!public/dist/**'],
options: { options: {
jshintrc: true jshintrc: true
} }
...@@ -76,6 +77,37 @@ module.exports = function(grunt) { ...@@ -76,6 +77,37 @@ module.exports = function(grunt) {
verbose: true verbose: true
} }
} }
},
// app
dist: 'public/dist/app.min.js',
modules: grunt.file.expand(
'public/js/app.js',
'public/js/routes.js',
'public/modules/**/*Module.js',
'public/modules/**/*.js',
'public/js/init.js'
).join(' '),
shell: {
min: {
command: 'java ' +
'-cp public/lib/closure-compiler/compiler.jar' + classPathSep +
'public/lib/ng-closure-runner/ngcompiler.jar ' +
'org.angularjs.closurerunner.NgClosureRunner ' +
'--compilation_level SIMPLE_OPTIMIZATIONS ' +
//'--formatting PRETTY_PRINT ' +
'--language_in ECMASCRIPT5_STRICT ' +
'--angular_pass ' +
'--manage_closure_dependencies ' +
'--js <%= modules %> ' +
'--js_output_file <%= dist %>'
}
},
devUpdate: {
main: {
options: {
updateType: 'force'
}
}
} }
}); });
...@@ -83,7 +115,7 @@ module.exports = function(grunt) { ...@@ -83,7 +115,7 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt); require('load-grunt-tasks')(grunt);
//Default task(s). //Default task(s).
grunt.registerTask('default', ['bower', 'jshint', 'jsbeautifier:default']); grunt.registerTask('default', ['devUpdate', 'bower', 'jshint', 'jsbeautifier:default', 'shell:min']);
// Server task // Server task
grunt.registerTask('server', ['bower', 'jshint', 'concurrent']); grunt.registerTask('server', ['bower', 'jshint', 'concurrent']);
......
...@@ -49,8 +49,10 @@ ...@@ -49,8 +49,10 @@
"grunt-concurrent": "0.4.3", "grunt-concurrent": "0.4.3",
"grunt-contrib-jshint": "0.9.2", "grunt-contrib-jshint": "0.9.2",
"grunt-contrib-watch": "0.6.0", "grunt-contrib-watch": "0.6.0",
"grunt-dev-update": "^1.0.2",
"grunt-jsbeautifier": "~0.2.6", "grunt-jsbeautifier": "~0.2.6",
"grunt-nodemon": "0.2.0", "grunt-nodemon": "0.2.0",
"load-grunt-tasks": "^2.0.0" "grunt-shell": "^1.1.1",
"load-grunt-tasks": "^3.1.0"
} }
} }
...@@ -23,7 +23,7 @@ angular.module('dgc').factory('lodash', ['$window', ...@@ -23,7 +23,7 @@ angular.module('dgc').factory('lodash', ['$window',
renderErrors: $window.renderErrors renderErrors: $window.renderErrors
}; };
} }
]).run(function(Global, NotificationService, lodash) { ]).run(['Global', 'NotificationService', 'lodash', function(Global, NotificationService, lodash) {
var errors = Global.renderErrors; var errors = Global.renderErrors;
if (angular.isArray(errors) || angular.isObject(errors)) { if (angular.isArray(errors) || angular.isObject(errors)) {
lodash.forEach(errors, function(err) { lodash.forEach(errors, function(err) {
...@@ -37,4 +37,4 @@ angular.module('dgc').factory('lodash', ['$window', ...@@ -37,4 +37,4 @@ angular.module('dgc').factory('lodash', ['$window',
errors.timeout = false; errors.timeout = false;
NotificationService.error(errors); NotificationService.error(errors);
} }
}); }]);
...@@ -5,5 +5,7 @@ angular.element(document).ready(function() { ...@@ -5,5 +5,7 @@ angular.element(document).ready(function() {
if (window.location.hash === '#_=_') window.location.hash = '#!'; if (window.location.hash === '#_=_') window.location.hash = '#!';
//Then init the app //Then init the app
angular.bootstrap(document, ['dgc']); angular.bootstrap(document, ['dgc'], {
strictDi: true
});
}); });
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
angular.module('dgc.system.notification', ['ui.router']).constant('ColorCoding', { angular.module('dgc.system.notification', ['ui.router']).constant('ColorCoding', {
info: 'success', info: 'success',
error: 'danger' error: 'danger'
}).run(function($rootScope, NotificationService) { }).run(['$rootScope', 'NotificationService', function($rootScope, NotificationService) {
$rootScope.$on('$locationChangeSuccess', function(evt, from, to) { $rootScope.$on('$locationChangeSuccess', function(evt, from, to) {
if (from !== to) { if (from !== to) {
NotificationService.reset(); NotificationService.reset();
} }
}); });
}); }]);
...@@ -8,7 +8,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -8,7 +8,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope.search = function(query) { $scope.search = function(query) {
$scope.results = []; $scope.results = [];
NotificationService.reset(); NotificationService.reset();
SearchResource.search($location.search(query).$$search, function(response) { SearchResource.search($location.search(query).search(), function(response) {
$scope.results = response; $scope.results = response;
if ($scope.results.length < 1) { if ($scope.results.length < 1) {
NotificationService.error("No Result found", false); NotificationService.error("No Result found", false);
...@@ -19,7 +19,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio ...@@ -19,7 +19,7 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
}); });
}; };
var urlParts = $location.$$url.split('?'); var urlParts = $location.url().split('?');
$scope.query = urlParts.length > 1 ? urlParts[1] : null; $scope.query = urlParts.length > 1 ? urlParts[1] : null;
if ($scope.query) { if ($scope.query) {
$scope.search($scope.query); $scope.search($scope.query);
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-offset-1 col-lg-6"> <div class="col-sm-offset-1 col-lg-6">
<small class="small-txt">Search : hive_table, hive_database</small> <small class="small-txt">Examples : property=HiveLineage.executionEngine&text=tez</small><br/>
<small class="small-txt">property=type&text=HiveLineage</small><br/>
<small class="small-txt">property=type&text=hive_table</small>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
......
...@@ -9,36 +9,7 @@ ...@@ -9,36 +9,7 @@
<script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap.js"></script> <script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap.js"></script>
<script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap-tpls.js"></script> <script type="text/javascript" src="/lib/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script type="text/javascript" src="dist/app.min.js"></script>
<!-- Application Depedencies -->
<!-- Application Init -->
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/routes.js"></script>
<!-- Notification module -->
<script type="text/javascript" src="/modules/notification/notificationModule.js"></script>
<script type="text/javascript" src="/modules/notification/notificationService.js"></script>
<script type="text/javascript" src="/modules/notification/notificationController.js"></script>
<!-- Home Module -->
<script type="text/javascript" src="/modules/home/homeModule.js"></script>
<script type="text/javascript" src="/modules/home/homeRoutes.js"></script>
<script type="text/javascript" src="/modules/home/headerController.js"></script>
<!-- Search Module -->
<script type="text/javascript" src="/modules/search/searchModule.js"></script>
<script type="text/javascript" src="/modules/search/searchRoutes.js"></script>
<script type="text/javascript" src="/modules/search/searchResource.js"></script>
<script type="text/javascript" src="/modules/search/searchController.js"></script>
<!-- Details Module -->
<script type="text/javascript" src="/modules/details/detailsModule.js"></script>
<script type="text/javascript" src="/modules/details/detailsRoutes.js"></script>
<script type="text/javascript" src="/modules/details/detailsResource.js"></script>
<script type="text/javascript" src="/modules/details/detailsController.js"></script>
<!-- Initialize the application -->
<script type="text/javascript" src="js/init.js"></script>
{% if (process.env.NODE_ENV == 'local') %} {% if (process.env.NODE_ENV == 'local') %}
<!-- Livereload script rendered --> <!-- Livereload script rendered -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment