Skip to content

Commit 75bdbfc

Browse files
author
Chris Gross
committed
v2.0: ng 1.2, bs 3, fa 4, new ngUI, underscore instead of lodash, jquery 2
1 parent 752893d commit 75bdbfc

File tree

18 files changed

+106
-92
lines changed

18 files changed

+106
-92
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
Features
66

7-
* Provides a directory structure geared towards large Angular projects.
8-
* Each controller, service, filter, and directive are placed in their own file.
7+
* Provides a directory structure geared towards large Angular projects.
8+
* Each controller, service, filter, and directive are placed in their own file.
99
* All files related to a conceptual unit are placed together. For example, the controller and HTML file for a partial are placed together in the same directory.
1010
* Provides a ready-made Grunt build that produces an extremely optimized distribution.
1111
* Build uses [grunt-ngmin](https://github.com/btford/grunt-ngmin) so you don't have to use the Angular injection syntax for safe minification (i.e. you dont need `$inject` or `(['$scope','$http',...`.
@@ -101,7 +101,7 @@ The project will include a ready-made Grunt build that will:
101101

102102
* Build all the LESS files into one minified CSS file.
103103
* Uses [grunt-angular-templates](https://github.com/ericclemmons/grunt-angular-templates) to turn all your partials into Javascript.
104-
* Uses [grunt-ngmin](https://github.com/btford/grunt-ngmin) to preprocess all Angular injectable methods and add the necessary Angular annotations to ensure minification will not break your app (and you don't have to use the array syntax to
104+
* Uses [grunt-ngmin](https://github.com/btford/grunt-ngmin) to preprocess all Angular injectable methods and add the necessary Angular annotations to ensure minification will not break your app (and you don't have to use the array syntax to
105105
manually add the annotations nor $inject). Read more about [ngmin](https://github.com/btford/ngmin).
106106
* Concatenates and minifies all Javascript into one file.
107107
* Replaces all appropriate script references in `index.html` with the minified CSS and JS files.
@@ -115,6 +115,7 @@ The build process uses [grunt-dom-munger](https://github.com/cgross/grunt-dom-mu
115115

116116
Release History
117117
-------------
118+
* 12/30/2013 - v2.0.0 - Big Update. Angular 1.2 and Bootstrap 3. Newer versions of Angular UI, Font Awesome, and JQuery. Lodash was replaced with Underscore. Lots of other small changes.
118119
* 9/06/2013 - V1.0.4 - Fixed templating issue with generated specs for `yo cg-angular:service` subgenerator.
119120
* 8/29/2013 - V1.0.3 - Renamed `/lib` back to `/bower_components` as clarity trumps brevity. Renamed `/bin` to `/dist`. Fixed spelling error in generated directive's js template location. Moved up to later version of `yeoman-generator` dependency to solve "Cannot read bold of undefined" error coming from Yeoman. JSHint options now read from `.jshintrc`. And more small stuff.
120121
* 7/08/2013 - V1.0.2 - Added utf8 charset to index.html. Fix for "EMFile, too many open files" on `grunt watch` by no longer watching the `lib` folder.

app/templates/skeleton/Gruntfile.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ var folderMount = function folderMount(connect, point) {
66
};
77

88
module.exports = function (grunt) {
9-
// show elapsed time at the end
10-
require('time-grunt')(grunt);
9+
1110
// load all grunt tasks
1211
require('load-grunt-tasks')(grunt);
1312

@@ -58,7 +57,17 @@ module.exports = function (grunt) {
5857
ngtemplates: {
5958
main: {
6059
options: {
61-
module:'<%= _.slugify(appname) %>'
60+
module:'<%= _.slugify(appname) %>',
61+
htmlmin: {
62+
collapseBooleanAttributes: true,
63+
collapseWhitespace: true,
64+
removeAttributeQuotes: true,
65+
removeComments: true,
66+
removeEmptyAttributes: true,
67+
removeRedundantAttributes: true,
68+
removeScriptTypeAttributes: true,
69+
removeStyleLinkTypeAttributes: true
70+
}
6271
},
6372
src: [ 'partial/**/*.html','directive/**/*.html' ],
6473
dest: 'temp/templates.js'
@@ -69,10 +78,10 @@ module.exports = function (grunt) {
6978
files: [
7079
{src: ['index.html'], dest: 'dist/'},
7180
{src: ['img/**'], dest: 'dist/'},
72-
{src: ['bower_components/angular-ui/build/angular-ui-ieshiv.js'], dest: 'dist/'},
73-
{src: ['bower_components/font-awesome/build/assets/font-awesome/font/**'], dest: 'dist/',filter:'isFile',expand:true},
81+
{src: ['bower_components/angular-ui-utils/ui-utils-ieshiv.min.js'], dest: 'dist/'},
82+
{src: ['bower_components/font-awesome/fonts/**'], dest: 'dist/',filter:'isFile',expand:true}
7483
// {src: ['bower_components/select2/*.png','bower_components/select2/*.gif'], dest:'dist/css/',flatten:true,expand:true},
75-
{src: ['bower_components/angular-mocks/angular-mocks.js'], dest: 'dist/'}
84+
// {src: ['bower_components/angular-mocks/angular-mocks.js'], dest: 'dist/'}
7685
]
7786
}
7887
},
@@ -143,8 +152,14 @@ module.exports = function (grunt) {
143152
htmlmin: {
144153
main: {
145154
options: {
155+
collapseBooleanAttributes: true,
156+
collapseWhitespace: true,
157+
removeAttributeQuotes: true,
146158
removeComments: true,
147-
collapseWhitespace: true
159+
removeEmptyAttributes: true,
160+
removeRedundantAttributes: true,
161+
removeScriptTypeAttributes: true,
162+
removeStyleLinkTypeAttributes: true
148163
},
149164
files: {
150165
'dist/index.html': 'dist/index.html'

app/templates/skeleton/bower.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88
"bower_components"
99
],
1010
"dependencies": {
11-
"jquery": "1.x",
12-
"lodash": "~1.2.1",
13-
"bootstrap": "~2.3.2",
14-
"angular": "~1.0.7",
15-
"angular-resource": "~1.0.7",
16-
"angular-cookies": "~1.0.7",
17-
"angular-mocks": "~1.0.7",
18-
"angular-ui": "~0.4.0",
19-
"angular-ui-utils": "~0.0.2",
20-
"angular-bootstrap": "~0.3.0",
21-
"moment": "~2.0.0",
22-
"less.js": "~1.4.0",
23-
"font-awesome": "~3.1.1"
11+
"jquery": "~2.0",
12+
"underscore": "~1.5",
13+
"bootstrap": "~3.0",
14+
"angular": "~1.2",
15+
"angular-route": "~1.2",
16+
"angular-animate": "~1.2",
17+
"angular-resource": "~1.2",
18+
"angular-cookies": "~1.2",
19+
"angular-mocks": "~1.2",
20+
"angular-ui-utils": "~0.1",
21+
"angular-bootstrap": "~0.9",
22+
"moment": "~2.5",
23+
"less.js": "~1.5",
24+
"font-awesome": "~4.0"
2425
}
2526
}
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
@import "../bower_components/bootstrap/less/bootstrap.less";
2-
@import "../bower_components/font-awesome/build/assets/font-awesome/less/font-awesome.less";
3-
@FontAwesomePath: "../bower_components/font-awesome/build/assets/font-awesome/font";
2+
//@import "../bower_components/bootstrap/less/theme.less";
3+
@import "../bower_components/font-awesome/less/font-awesome.less";
4+
@fa-font-path: "../bower_components/font-awesome/fonts";
45

56
/* Directive LESS */
67
/* Add Directive LESS Above */
78

89
/* Partial LESS */
9-
/* Add Partial LESS Above */
10+
/* Add Partial LESS Above */
11+
12+
/* Required for Angular UI Bootstrap */
13+
.nav, .pagination, .carousel a { cursor: pointer; }
14+
15+
/* Personal preference for BS modal. The LESS below makes the backdrop white and
16+
causes the modal to fade in rather than slide in. */
17+
//@modal-backdrop-bg: white;
18+
//.modal {
19+
// &.fade {
20+
// .transition(opacity .3s);
21+
// }
22+
// &.fade .modal-dialog {
23+
// .translate(0,0);
24+
// }
25+
//}

app/templates/skeleton/index.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
<html ng-app="<%= _.slugify(appname) %>">
33
<head>
44
<title></title>
5-
65
<meta name="viewport" content="width=device-width, initial-scale=1.0">
76
<meta charset="utf-8">
87

9-
<!-- CSS from Bower components -->
10-
<link href="bower_components/angular-ui/build/angular-ui.css" rel="stylesheet">
11-
128
<!-- App LESS -->
139
<link href="css/app.less" type="text/css" rel="stylesheet/less">
1410

@@ -19,35 +15,24 @@
1915
<script src="http://localhost:35729/livereload.js" data-build="exclude"></script>
2016

2117
<!-- JS from Bower components -->
22-
<script src="bower_components/less.js/dist/less-1.4.0.js" data-build="exclude"></script>
18+
<script src="bower_components/less.js/dist/less-1.5.0.js" data-build="exclude"></script>
2319
<script src="bower_components/jquery/jquery.js"></script>
24-
<script src="bower_components/lodash/dist/lodash.compat.js"></script>
25-
<script src="bower_components/bootstrap/js/bootstrap-affix.js"></script>
26-
<script src="bower_components/bootstrap/js/bootstrap-alert.js"></script>
27-
<script src="bower_components/bootstrap/js/bootstrap-button.js"></script>
28-
<script src="bower_components/bootstrap/js/bootstrap-carousel.js"></script>
29-
<script src="bower_components/bootstrap/js/bootstrap-collapse.js"></script>
30-
<script src="bower_components/bootstrap/js/bootstrap-dropdown.js"></script>
31-
<script src="bower_components/bootstrap/js/bootstrap-modal.js"></script>
32-
<script src="bower_components/bootstrap/js/bootstrap-tooltip.js"></script>
33-
<script src="bower_components/bootstrap/js/bootstrap-popover.js"></script>
34-
<script src="bower_components/bootstrap/js/bootstrap-scrollspy.js"></script>
35-
<script src="bower_components/bootstrap/js/bootstrap-tab.js"></script>
36-
<script src="bower_components/bootstrap/js/bootstrap-transition.js"></script>
37-
<script src="bower_components/bootstrap/js/bootstrap-typeahead.js"></script>
38-
<script src="bower_components/angular/angular.min.js"></script>
20+
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
21+
<script src="bower_components/underscore/underscore.js"></script>
22+
<script src="bower_components/moment/moment.js"></script>
23+
<script src="bower_components/angular/angular.js"></script>
24+
<script src="bower_components/angular-route/angular-route.js"></script>
25+
<script src="bower_components/angular-animate/angular-animate.js"></script>
3926
<script src="bower_components/angular-resource/angular-resource.js"></script>
40-
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
41-
<script src="bower_components/angular-ui/build/angular-ui.js"></script>
42-
<script src="bower_components/angular-bootstrap/ui-bootstrap.js"></script>
4327
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
44-
<script src="bower_components/moment/min/moment.min.js"></script>
28+
<script src="bower_components/angular-ui-utils/ui-utils.js"></script>
29+
4530

4631
<!-- Main App JS -->
4732
<script src="js/setup.js"></script>
4833

4934
<!-- Service JS -->
50-
<!-- Add New Service JS Above -->
35+
<!-- Add New Service JS Above -->
5136

5237
<!-- Directive JS -->
5338
<!-- Add New Directive JS Above -->

app/templates/skeleton/js/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('<%= _.slugify(appname) %>', ['ui.bootstrap','ui']);
1+
angular.module('<%= _.slugify(appname) %>', ['ui.bootstrap','ui.utils','ngRoute','ngAnimate']);
22

33
angular.module('<%= _.slugify(appname) %>').config(function($routeProvider) {
44

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
{
22
"name": "<%= _.slugify(appname) %>",
3-
"version": "0.1.0",
3+
"version": "0.0.0",
44
"devDependencies": {
5-
"grunt": "~0.4.1",
6-
"grunt-contrib-livereload": "~0.1.2",
7-
"grunt-contrib-connect": "~0.2.0",
8-
"grunt-contrib-copy": "~0.4.1",
9-
"grunt-contrib-clean": "~0.4.0",
10-
"grunt-contrib-concat": "~0.1.3",
11-
"grunt-contrib-cssmin": "~0.5.0",
12-
"grunt-contrib-uglify": "~0.2.0",
13-
"grunt-jasmine-task": "0.2.x",
14-
"grunt-angular-templates": "~0.3.1",
15-
"grunt-contrib-jshint": "~0.3.0",
16-
"grunt-dom-munger": "~2.0.0",
17-
"grunt-contrib-htmlmin": "~0.1.1",
18-
"grunt-contrib-imagemin": "~0.1.2",
19-
"grunt-ngmin": "0.0.2",
20-
"grunt-contrib-less": "~0.6.0",
21-
"grunt-contrib-watch": "~0.4.4",
22-
"grunt-contrib-jasmine": "~0.5.1",
23-
"time-grunt": "~0.1.1",
24-
"load-grunt-tasks": "~0.2.0"
5+
"grunt": "~0.4",
6+
"grunt-dom-munger": "~3.1",
7+
"grunt-angular-templates": "~0.5",
8+
"grunt-ngmin": "0.0.3",
9+
"grunt-contrib-connect": "~0.6",
10+
"grunt-contrib-copy": "~0.5",
11+
"grunt-contrib-clean": "~0.5",
12+
"grunt-contrib-concat": "~0.3",
13+
"grunt-contrib-cssmin": "~0.7",
14+
"grunt-contrib-uglify": "~0.2",
15+
"grunt-contrib-jshint": "~0.7.1",
16+
"grunt-contrib-htmlmin": "~0.1",
17+
"grunt-contrib-imagemin": "~0.4",
18+
"grunt-contrib-less": "~0.8",
19+
"grunt-contrib-watch": "~0.5",
20+
"grunt-contrib-jasmine": "~0.5",
21+
"load-grunt-tasks": "~0.2"
2522
}
2623
}

directive/templates/directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('<%= appname %>').directive('<%= _.classify(name) %>', function() {
1+
angular.module('<%= appname %>').directive('<%= _.camelize(name) %>', function() {
22
return {
33
restrict: 'E',
44
replace: true,

directive/templates/directive_simple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('<%= appname %>').directive('<%= _.classify(name) %>', function() {
1+
angular.module('<%= appname %>').directive('<%= _.camelize(name) %>', function() {
22
return {
33
restrict: 'A',
44
link: function(scope, element, attrs, fn) {

directive/templates/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('<%= _.classify(name) %>', function() {
1+
describe('<%= _.camelize(name) %>', function() {
22

33
beforeEach(module('<%= appname %>'));
44

0 commit comments

Comments
 (0)