Skip to content

Commit d07c829

Browse files
committed
fix(gen): updated all conflicts, and fixed some bugs, from merging with upstream
1 parent 3270414 commit d07c829

File tree

6 files changed

+52
-65
lines changed

6 files changed

+52
-65
lines changed

Diff for: app/index.js

+17-23
Original file line numberDiff line numberDiff line change
@@ -280,21 +280,6 @@ Generator.prototype.bootstrapFiles = function bootstrapFiles() {
280280
}
281281

282282
this.copy('styles/' + mainFile, 'app/styles/' + mainFile);
283-
var appendOptions = {
284-
html: this.indexFile,
285-
fileType: 'css',
286-
optimizedPath: 'styles/main.css',
287-
sourceFileList: files.map(function (file) {
288-
return 'styles/' + file.replace('.scss', '.css');
289-
}),
290-
searchPath: ['.tmp', 'app']
291-
};
292-
293-
if (this.jade) {
294-
this.indexFile = appendFilesToJade(appendOptions);
295-
} else {
296-
this.indexFile = this.appendFiles(appendOptions);
297-
}
298283
};
299284

300285
function generateJadeBlock(blockType, optimizedPath, filesBlock, searchPath, prefix) {
@@ -428,16 +413,25 @@ Generator.prototype._injectDependencies = function _injectDependencies() {
428413
if (this.options['skip-install']) {
429414
console.log(howToInstall);
430415
} else {
431-
wiredep({
432-
directory: 'app/bower_components',
433-
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
434-
ignorePath: 'app/',
435-
htmlFile: 'app/index.html',
436-
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
437-
});
416+
if (this.jade) {
417+
wiredep({
418+
directory: 'app/bower_components',
419+
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
420+
ignorePath: 'app/',
421+
htmlFile: 'app/views/index.jade',
422+
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
423+
});
424+
} else {
425+
wiredep({
426+
directory: 'app/bower_components',
427+
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
428+
ignorePath: 'app/',
429+
htmlFile: 'app/views/index.html',
430+
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
431+
});
432+
}
438433
}
439434
};
440-
};
441435

442436
Generator.prototype.serverFiles = function () {
443437
this.template('../../templates/express/server.js', 'server.js');

Diff for: app/templates/styles/main.scss

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<% if (compassBootstrap) { %>$icon-font-path: "/bower_components/sass-bootstrap/fonts/";
22

3-
@import 'sass-bootstrap/lib/bootstrap';
4-
53
<% } %>.browsehappy {
64
margin: 0.2em 0;
75
background: #ccc;

Diff for: templates/common/Gruntfile.js

+16-27
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ module.exports = function (grunt) {
7171
files: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
7272
tasks: ['compass:server', 'autoprefixer']
7373
},<% } else { %>
74-
},<% } %>
7574
styles: {
7675
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
7776
tasks: ['newer:copy:styles', 'autoprefixer']
@@ -80,7 +79,6 @@ module.exports = function (grunt) {
8079
files: ['Gruntfile.js']
8180
},
8281
livereload: {
83-
files: [
8482
files: [
8583
'<%%= yeoman.app %>/<%%= yeoman.views %>/{,*//*}*.{html,jade}',
8684
'{.tmp,<%%= yeoman.app %>}/styles/{,*//*}*.css',
@@ -102,13 +100,6 @@ module.exports = function (grunt) {
102100
livereload: true,
103101
nospawn: true //Without this option specified express won't be reloaded
104102
}
105-
},
106-
styles: {
107-
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
108-
tasks: ['newer:copy:styles', 'autoprefixer']
109-
},
110-
gruntfile: {
111-
files: ['Gruntfile.js']
112103
}
113104
},
114105

@@ -172,13 +163,13 @@ module.exports = function (grunt) {
172163

173164
// Automatically inject Bower components into the app
174165
'bower-install': {
175-
app: {
176-
html: '<%%= yeoman.app %>/index.html',
166+
app: {<% if (jade) { %>
167+
html: '<%%= yeoman.app %>/views/index.jade',<% } else { %>
168+
html: '<%%= yeoman.app %>/views/index.html',<% } %>
177169
ignorePath: '<%%= yeoman.app %>/'
178170
}
179171
},
180-
181-
<% if (coffee) { %>
172+
<% if (coffee) { %>
182173
// Compiles CoffeeScript to JavaScript
183174
coffee: {
184175
options: {
@@ -204,8 +195,7 @@ module.exports = function (grunt) {
204195
}]
205196
}
206197
},<% } %>
207-
208-
<% if (compass) { %>
198+
<% if (compass) { %>
209199
// Compiles Sass to CSS and generates necessary files if requested
210200
compass: {
211201
options: {
@@ -220,7 +210,8 @@ module.exports = function (grunt) {
220210
httpGeneratedImagesPath: '/images/generated',
221211
httpFontsPath: '/styles/fonts',
222212
relativeAssets: false,
223-
assetCacheBuster: false
213+
assetCacheBuster: false,
214+
raw: 'Sass::Script::Number.precision = 10\n'
224215
},
225216
dist: {
226217
options: {
@@ -293,10 +284,10 @@ module.exports = function (grunt) {
293284
htmlmin: {
294285
dist: {
295286
options: {
296-
collapseWhitespace: true,
297-
collapseBooleanAttributes: true,
298-
removeCommentsFromCDATA: true,
299-
removeOptionalTags: true
287+
//collapseWhitespace: true,
288+
//collapseBooleanAttributes: true,
289+
//removeCommentsFromCDATA: true,
290+
//removeOptionalTags: true
300291
},
301292
files: [{
302293
expand: true,
@@ -338,8 +329,6 @@ module.exports = function (grunt) {
338329
src: [
339330
'*.{ico,png,txt}',
340331
'.htaccess',
341-
'*.html',
342-
'views/{,*/}*.html',
343332
'bower_components/**/*',
344333
'images/{,*/}*.{webp}',
345334
'fonts/**/*'
@@ -375,7 +364,7 @@ module.exports = function (grunt) {
375364
'lib/**/*'
376365
]
377366
}]
378-
},
367+
},
379368
styles: {
380369
expand: true,
381370
cwd: '<%%= yeoman.app %>/styles',
@@ -401,7 +390,8 @@ module.exports = function (grunt) {
401390
'compass:dist',<% } else { %>
402391
'copy:styles',<% } %>
403392
'imagemin',
404-
'svgmin'
393+
'svgmin',
394+
'htmlmin'
405395
]
406396
},
407397

@@ -485,14 +475,13 @@ module.exports = function (grunt) {
485475
'cssmin',
486476
'uglify',
487477
'rev',
488-
'usemin',
489-
'htmlmin'
478+
'usemin'
490479
]);
491480

492481
grunt.registerTask('heroku', [
493482
'build',
494483
'clean:heroku',
495-
'copy:heroku'
484+
'copy:heroku'
496485
]);
497486

498487
grunt.registerTask('default', [

Diff for: templates/common/_bower.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
"name": "<%= _.slugify(_.humanize(appname)) %>",
33
"version": "0.0.0",
44
"dependencies": {
5-
"angular": "~1.2.5",
5+
"angular": "1.2.5",
66
"json3": "~3.2.6",
77
"es5-shim": "~2.1.0"<% if (bootstrap) { %>,
88
"jquery": "~1.10.2"<% if (compassBootstrap) { %>,
99
"sass-bootstrap": "~3.0.2"<% } else { %>,
1010
"bootstrap": "~3.0.3"<% } } %><% if (resourceModule) { %>,
11-
"angular-resource": "~1.2.5"<% } %><% if (cookiesModule) { %>,
12-
"angular-cookies": "~1.2.5"<% } %><% if (sanitizeModule) { %>,
13-
"angular-sanitize": "~1.2.5"<% } %><% if (routeModule) { %>,
14-
"angular-route": "~1.2.5"<% } %>
11+
"angular-resource": "1.2.5"<% } %><% if (cookiesModule) { %>,
12+
"angular-cookies": "1.2.5"<% } %><% if (sanitizeModule) { %>,
13+
"angular-sanitize": "1.2.5"<% } %><% if (routeModule) { %>,
14+
"angular-route": "1.2.5"<% } %>
1515
},
1616
"devDependencies": {
17-
"angular-mocks": "~1.2.5",
18-
"angular-scenario": "~1.2.5"
17+
"angular-mocks": "1.2.5",
18+
"angular-scenario": "1.2.5"
1919
}
2020
}

Diff for: templates/views/html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<script src="bower_components/json3/lib/json3.min.js"></script>
4848
<![endif]-->
4949

50-
<!-- build:js scripts/vendor.js -->
50+
<!-- build:js(app) scripts/vendor.js -->
5151
<!-- bower:js -->
5252
<!-- endbower -->
5353
<!-- endbuild -->

Diff for: templates/views/jade/index.jade

+11-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ html.no-js
1313
meta(name="description", content="")
1414
meta(name="viewport", content="width=device-width")
1515
// Place favicon.ico and apple-touch-icon.png in the root directory
16-
//- build:head
16+
<!-- build:css(app) styles/vendor.css -->
17+
<!-- bower:css -->
18+
<!-- endbower -->
19+
<!-- endbuild -->
20+
<!-- build:css({.tmp,app}) styles/main.css -->
21+
<link rel="stylesheet" href="styles/main.css">
22+
<!-- endbuild -->
1723
body(ng-app="<%= scriptAppName %>")
1824
//[if lt IE 7]>
1925
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
@@ -33,7 +39,7 @@ html.no-js
3339
g.src='//www.google-analytics.com/ga.js';
3440
s.parentNode.insertBefore(g,s)}(document,'script'));
3541

36-
<% if (bootstrap) { %>script(src="bower_components/jquery/jquery.js")<% } %>
37-
script(src="bower_components/angular/angular.js")
38-
39-
//- build:body
42+
<!-- build:js(app) scripts/vendor.js -->
43+
<!-- bower:js -->
44+
<!-- endbower -->
45+
<!-- endbuild -->

0 commit comments

Comments
 (0)