Skip to content

Commit 59b922b

Browse files
committedNov 7, 2014
scaffolding
1 parent 7a3af01 commit 59b922b

27 files changed

+799
-0
lines changed
 

‎Gruntfile.js

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
module.exports = function(grunt) {
2+
"use strict";
3+
4+
grunt.loadNpmTasks('grunt-contrib-jshint');
5+
grunt.loadNpmTasks('grunt-contrib-watch');
6+
grunt.loadNpmTasks('grunt-contrib-concat');
7+
grunt.loadNpmTasks('grunt-contrib-clean');
8+
grunt.loadNpmTasks('grunt-file-append');
9+
grunt.loadNpmTasks('grunt-contrib-uglify');
10+
grunt.loadNpmTasks('grunt-contrib-compass');
11+
grunt.loadNpmTasks('grunt-contrib-copy');
12+
grunt.loadNpmTasks('grunt-contrib-cssmin');
13+
grunt.loadNpmTasks('grunt-concat-css');
14+
require('time-grunt')(grunt);
15+
16+
grunt.initConfig({
17+
18+
pkg: grunt.file.readJSON('package.json'),
19+
20+
concat: {
21+
options: {
22+
separator: ';'
23+
},
24+
controllers: {
25+
src: ['app/src/js/init.js', 'app/src/js/components/**/ctrl.js'],
26+
dest: 'app/dist/js/controllers.js'
27+
},
28+
directives: {
29+
src: ['app/src/js/shared/directives/*.js'],
30+
dest: 'app/dist/js/directives.js'
31+
},
32+
services: {
33+
src: ['app/src/js/components/**/service.js'],
34+
dest: 'app/dist/js/services.js'
35+
},
36+
filters: {
37+
src: ['app/src/js/shared/filters.js'],
38+
dest: 'app/dist/js/filters.js'
39+
}
40+
},
41+
42+
clean: {
43+
dist_js: {
44+
src: [
45+
'app/dist/*'
46+
]
47+
}
48+
},
49+
50+
jshint: {
51+
options: {
52+
strict: true,
53+
expr: true,
54+
onecase: true,
55+
maxcomplexity: 8,
56+
curly: false, //change
57+
eqeqeq: false, //change
58+
forin: true,
59+
// immed: true,
60+
// indent : 4,
61+
latedef: true,
62+
newcap: true,
63+
noarg: true,
64+
noempty: false, //change
65+
nonew: false,
66+
// quotmark : true, //'single', //change
67+
regexp: true,
68+
undef: true,
69+
// options here to override JSHint defaults
70+
globals: {
71+
jQuery: true,
72+
console: true,
73+
module: true,
74+
document: true,
75+
window: true,
76+
define: true
77+
}
78+
},
79+
uses_defaults: ['Gruntfile.js', 'app/src/js/**/*.js']
80+
},
81+
82+
compass: {
83+
src: {
84+
options: {
85+
sassDir: 'app/src/css/sass/',
86+
cssDir: 'app/src/css/'
87+
}
88+
}
89+
},
90+
91+
copy: {
92+
src: {
93+
files: [
94+
{expand: true, cwd: 'app/src/', src: ['**', '!css/sass/**', '!js/components/**', '!js/shared/**'], dest: 'app/dist/'}
95+
]
96+
}
97+
},
98+
99+
uglify: {
100+
options: {
101+
mangle: false
102+
},
103+
104+
dist: {
105+
files: [{
106+
expand: true,
107+
cwd: 'app/dist/js',
108+
src: '**/*.js',
109+
dest: 'app/dist/js'
110+
}]
111+
}
112+
},
113+
114+
watch: {
115+
dev: {
116+
files: ['<%= jshint.uses_defaults %>', 'app/src/css/sass/*.scss'],
117+
tasks: ['compass', 'clean:dist_js', 'copy', 'concat', 'concat_css']
118+
},
119+
prod: {
120+
files: ['<%= jshint.uses_defaults %>', 'app/src/css/sass/*.scss'],
121+
tasks: ['compass', 'clean:dist_js', 'copy', 'concat', 'cssmin', 'uglify']
122+
}
123+
},
124+
125+
concat_css: {
126+
all: {
127+
src: ["app/dist/css/app.css"],
128+
dest: "app/dist/css/app.min.css"
129+
}
130+
},
131+
132+
cssmin: {
133+
combine: {
134+
files: {
135+
'app/dist/css/app.min.css': ['app/dist/css/bootstrap-3.min.css', 'app/dist/css/app.css', 'app/dist/css/animations.css', 'app/dist/css/jquery-ui.custom.min.css', 'app/dist/css/font-awesome.css']
136+
}
137+
},
138+
minify: {
139+
src: ['app/dist/css/app.min.css'],
140+
dest: 'app/dist/css/app.min.css'
141+
}
142+
}
143+
144+
});
145+
146+
grunt.registerTask('shared', ['clean:dist_js', 'compass', 'copy', 'concat']);
147+
grunt.registerTask('jenkins-dev', ['shared', 'concat_css']);
148+
grunt.registerTask('jenkins-prod', ['shared', 'uglify', 'cssmin']);
149+
grunt.registerTask('dev', ['shared', 'concat_css', 'watch:dev']);
150+
grunt.registerTask('default', ['shared', 'uglify', 'cssmin', 'watch:prod']);
151+
152+
};

‎app/dist/css/app.css

Whitespace-only changes.

‎app/dist/css/app.min.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

‎app/dist/js/app.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
// Declare app level module which depends on views, and components
4+
angular.module('myApp', [
5+
'ngRoute',
6+
'myAppControllers',
7+
'myAppDirectives',
8+
'myAppServices',
9+
'myAppFilters'
10+
]).
11+
config(['$routeProvider', function($routeProvider) {
12+
$routeProvider.otherwise({redirectTo: '/view1'});
13+
}]);

‎app/dist/js/controllers.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
angular.module('myAppControllers').controller('module1Ctrl', [function(){
2+
3+
// Controller logic
4+
}]);;angular.module('myAppControllers').controller('module2Ctrl', [function(){
5+
6+
// Controller logic
7+
}]);;angular.module('myAppControllers').controller('module3Ctrl', [function(){
8+
9+
// Controller logic
10+
}]);

‎app/dist/js/directives.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('myAppDirectives', []).directive( 'customDirective', [
2+
function(){
3+
}
4+
])

‎app/dist/js/filters.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
angular.module('myAppFilters', []).filter('customFilter', function () {
2+
return function (customFilter) {
3+
4+
};
5+
});

‎app/dist/js/lib/angular/angular.min.js

+247
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/dist/js/services.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
angular.module('myAppServices', ['ngResource']).factory('module1Svc', [function(){
2+
3+
// Factory for REST calls, business logic etc
4+
5+
6+
}]);;angular.module('myAppServices', ['ngResource']).factory('module2Svc', [function(){
7+
8+
// Factory for REST calls, business logic etc
9+
10+
11+
}]);;angular.module('myAppServices', ['ngResource']).factory('module3Svc', [function(){
12+
13+
// Factory for REST calls, business logic etc
14+
15+
}]);

‎app/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html ng-app="myApp">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Angular Demo</title>
6+
<script src="dist/js/lib/angular.min.js"></script>
7+
</head>
8+
<body>
9+
<p>Landing Page</p>
10+
<script src="js/app.js"></script>
11+
<script src="dist/js/controllers.js"></script>
12+
<script src="dist/js/directives.js"></script>
13+
<script src="dist/js/services.js"></script>
14+
<script src="dist/js/filters.js"></script>
15+
</body>
16+
</html>

‎app/src/css/app.css

Whitespace-only changes.

‎app/src/css/sass/app.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
3+
}

‎app/src/js/app.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
// Declare app level module which depends on views, and components
4+
angular.module('myApp', [
5+
'ngRoute',
6+
'myAppControllers',
7+
'myAppDirectives',
8+
'myAppServices',
9+
'myAppFilters'
10+
]).
11+
config(['$routeProvider', function($routeProvider) {
12+
$routeProvider.otherwise({redirectTo: '/view1'});
13+
}]);

‎app/src/js/components/module1/ctrl.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('myAppControllers').controller('module1Ctrl', [function(){
2+
3+
// Controller logic
4+
}]);
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
angular.module('myAppServices', ['ngResource']).factory('module1Svc', [function(){
2+
3+
// Factory for REST calls, business logic etc
4+
5+
6+
}]);

‎app/src/js/components/module1/view.html

Whitespace-only changes.

‎app/src/js/components/module2/ctrl.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('myAppControllers').controller('module2Ctrl', [function(){
2+
3+
// Controller logic
4+
}]);
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
angular.module('myAppServices', ['ngResource']).factory('module2Svc', [function(){
2+
3+
// Factory for REST calls, business logic etc
4+
5+
6+
}]);

‎app/src/js/components/module2/view.html

Whitespace-only changes.

‎app/src/js/components/module3/ctrl.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('myAppControllers').controller('module3Ctrl', [function(){
2+
3+
// Controller logic
4+
}]);
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
angular.module('myAppServices', ['ngResource']).factory('module3Svc', [function(){
2+
3+
// Factory for REST calls, business logic etc
4+
5+
}]);

‎app/src/js/components/module3/view.html

Whitespace-only changes.

‎app/src/js/lib/angular/angular.min.js

+247
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('myAppDirectives', []).directive( 'customDirective', [
2+
function(){
3+
}
4+
])

‎app/src/js/shared/filters.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
angular.module('myAppFilters', []).filter('customFilter', function () {
2+
return function (customFilter) {
3+
4+
};
5+
});

‎node_modules/grunt-concat-css/.jshintrc

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "grunt-angular",
3+
"description": "Angular scaffolding with grunt",
4+
"repository": "https://github.com/ankuronweb/grunt-angular",
5+
"devDependencies": {
6+
"grunt": "0.4.4",
7+
"grunt-contrib-watch": "0.6.0",
8+
"grunt-contrib-compass": "^0.9.0",
9+
"grunt-contrib-clean": "^0.6.0",
10+
"grunt-contrib-jshint": "^0.10.0",
11+
"grunt-contrib-concat": "^0.5.0",
12+
"grunt-contrib-copy": "^0.5.0",
13+
"grunt-file-append": "0.0.4",
14+
"grunt-contrib-uglify": "^0.5.1",
15+
"grunt-contrib-cssmin": "^0.10.0",
16+
"grunt-concat-css": "^0.3.1",
17+
"jit-grunt": "^0.8.0",
18+
"time-grunt": "^0.4.0"
19+
}
20+
}

0 commit comments

Comments
 (0)
Please sign in to comment.