Skip to content

Commit

Permalink
fix(gen): updated all conflicts, and fixed some bugs, from merging wi…
Browse files Browse the repository at this point in the history
…th upstream
  • Loading branch information
DaftMonk committed Dec 22, 2013
1 parent 3270414 commit d07c829
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 65 deletions.
40 changes: 17 additions & 23 deletions app/index.js
Expand Up @@ -280,21 +280,6 @@ Generator.prototype.bootstrapFiles = function bootstrapFiles() {
}

this.copy('styles/' + mainFile, 'app/styles/' + mainFile);
var appendOptions = {
html: this.indexFile,
fileType: 'css',
optimizedPath: 'styles/main.css',
sourceFileList: files.map(function (file) {
return 'styles/' + file.replace('.scss', '.css');
}),
searchPath: ['.tmp', 'app']
};

if (this.jade) {
this.indexFile = appendFilesToJade(appendOptions);
} else {
this.indexFile = this.appendFiles(appendOptions);
}
};

function generateJadeBlock(blockType, optimizedPath, filesBlock, searchPath, prefix) {
Expand Down Expand Up @@ -428,16 +413,25 @@ Generator.prototype._injectDependencies = function _injectDependencies() {
if (this.options['skip-install']) {
console.log(howToInstall);
} else {
wiredep({
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/index.html',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
});
if (this.jade) {
wiredep({
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/views/index.jade',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
});
} else {
wiredep({
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/views/index.html',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
});
}
}
};
};

Generator.prototype.serverFiles = function () {
this.template('../../templates/express/server.js', 'server.js');
Expand Down
2 changes: 0 additions & 2 deletions app/templates/styles/main.scss
@@ -1,7 +1,5 @@
<% if (compassBootstrap) { %>$icon-font-path: "/bower_components/sass-bootstrap/fonts/";

@import 'sass-bootstrap/lib/bootstrap';

<% } %>.browsehappy {
margin: 0.2em 0;
background: #ccc;
Expand Down
43 changes: 16 additions & 27 deletions templates/common/Gruntfile.js
Expand Up @@ -71,7 +71,6 @@ module.exports = function (grunt) {
files: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
},<% } else { %>
},<% } %>
styles: {
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['newer:copy:styles', 'autoprefixer']
Expand All @@ -80,7 +79,6 @@ module.exports = function (grunt) {
files: ['Gruntfile.js']
},
livereload: {
files: [
files: [
'<%%= yeoman.app %>/<%%= yeoman.views %>/{,*//*}*.{html,jade}',
'{.tmp,<%%= yeoman.app %>}/styles/{,*//*}*.css',
Expand All @@ -102,13 +100,6 @@ module.exports = function (grunt) {
livereload: true,
nospawn: true //Without this option specified express won't be reloaded
}
},
styles: {
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['newer:copy:styles', 'autoprefixer']
},
gruntfile: {
files: ['Gruntfile.js']
}
},

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

// Automatically inject Bower components into the app
'bower-install': {
app: {
html: '<%%= yeoman.app %>/index.html',
app: {<% if (jade) { %>
html: '<%%= yeoman.app %>/views/index.jade',<% } else { %>
html: '<%%= yeoman.app %>/views/index.html',<% } %>
ignorePath: '<%%= yeoman.app %>/'
}
},

<% if (coffee) { %>
<% if (coffee) { %>
// Compiles CoffeeScript to JavaScript
coffee: {
options: {
Expand All @@ -204,8 +195,7 @@ module.exports = function (grunt) {
}]
}
},<% } %>

<% if (compass) { %>
<% if (compass) { %>
// Compiles Sass to CSS and generates necessary files if requested
compass: {
options: {
Expand All @@ -220,7 +210,8 @@ module.exports = function (grunt) {
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false
assetCacheBuster: false,
raw: 'Sass::Script::Number.precision = 10\n'
},
dist: {
options: {
Expand Down Expand Up @@ -293,10 +284,10 @@ module.exports = function (grunt) {
htmlmin: {
dist: {
options: {
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeCommentsFromCDATA: true,
removeOptionalTags: true
//collapseWhitespace: true,
//collapseBooleanAttributes: true,
//removeCommentsFromCDATA: true,
//removeOptionalTags: true
},
files: [{
expand: true,
Expand Down Expand Up @@ -338,8 +329,6 @@ module.exports = function (grunt) {
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'views/{,*/}*.html',
'bower_components/**/*',
'images/{,*/}*.{webp}',
'fonts/**/*'
Expand Down Expand Up @@ -375,7 +364,7 @@ module.exports = function (grunt) {
'lib/**/*'
]
}]
},
},
styles: {
expand: true,
cwd: '<%%= yeoman.app %>/styles',
Expand All @@ -401,7 +390,8 @@ module.exports = function (grunt) {
'compass:dist',<% } else { %>
'copy:styles',<% } %>
'imagemin',
'svgmin'
'svgmin',
'htmlmin'
]
},

Expand Down Expand Up @@ -485,14 +475,13 @@ module.exports = function (grunt) {
'cssmin',
'uglify',
'rev',
'usemin',
'htmlmin'
'usemin'
]);

grunt.registerTask('heroku', [
'build',
'clean:heroku',
'copy:heroku'
'copy:heroku'
]);

grunt.registerTask('default', [
Expand Down
14 changes: 7 additions & 7 deletions templates/common/_bower.json
Expand Up @@ -2,19 +2,19 @@
"name": "<%= _.slugify(_.humanize(appname)) %>",
"version": "0.0.0",
"dependencies": {
"angular": "~1.2.5",
"angular": "1.2.5",
"json3": "~3.2.6",
"es5-shim": "~2.1.0"<% if (bootstrap) { %>,
"jquery": "~1.10.2"<% if (compassBootstrap) { %>,
"sass-bootstrap": "~3.0.2"<% } else { %>,
"bootstrap": "~3.0.3"<% } } %><% if (resourceModule) { %>,
"angular-resource": "~1.2.5"<% } %><% if (cookiesModule) { %>,
"angular-cookies": "~1.2.5"<% } %><% if (sanitizeModule) { %>,
"angular-sanitize": "~1.2.5"<% } %><% if (routeModule) { %>,
"angular-route": "~1.2.5"<% } %>
"angular-resource": "1.2.5"<% } %><% if (cookiesModule) { %>,
"angular-cookies": "1.2.5"<% } %><% if (sanitizeModule) { %>,
"angular-sanitize": "1.2.5"<% } %><% if (routeModule) { %>,
"angular-route": "1.2.5"<% } %>
},
"devDependencies": {
"angular-mocks": "~1.2.5",
"angular-scenario": "~1.2.5"
"angular-mocks": "1.2.5",
"angular-scenario": "1.2.5"
}
}
2 changes: 1 addition & 1 deletion templates/views/html/index.html
Expand Up @@ -47,7 +47,7 @@
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->

<!-- build:js scripts/vendor.js -->
<!-- build:js(app) scripts/vendor.js -->
<!-- bower:js -->
<!-- endbower -->
<!-- endbuild -->
Expand Down
16 changes: 11 additions & 5 deletions templates/views/jade/index.jade
Expand Up @@ -13,7 +13,13 @@ html.no-js
meta(name="description", content="")
meta(name="viewport", content="width=device-width")
// Place favicon.ico and apple-touch-icon.png in the root directory
//- build:head
<!-- build:css(app) styles/vendor.css -->
<!-- bower:css -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
body(ng-app="<%= scriptAppName %>")
//[if lt IE 7]>
<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>
Expand All @@ -33,7 +39,7 @@ html.no-js
g.src='//www.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));

<% if (bootstrap) { %>script(src="bower_components/jquery/jquery.js")<% } %>
script(src="bower_components/angular/angular.js")

//- build:body
<!-- build:js(app) scripts/vendor.js -->
<!-- bower:js -->
<!-- endbower -->
<!-- endbuild -->

0 comments on commit d07c829

Please sign in to comment.