Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
vslio committed Nov 4, 2015
2 parents b57e248 + eb925a8 commit f80bea2
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 205 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

[Yeoman](http://yeoman.io) generator that scaffolds out a front-end web app.

![](http://i.imgur.com/5YLfo6S.png)


## Features

* Grunt
- Automagically compile your SCSS
- Image optimization
* libsass
* Bourbon for Sass - A simple and lightweight mixin library for SASS
* Neat for Bourbon - A lightweight semantic grid framework for SASS and Bourbon
* jQuery
* Basic .editorconfig file for consistency across editors/IDEs
* jscsrc and scss-lint rules

For more information on what `generator-neverbuild` can do for you, take a look at the [Grunt tasks](https://github.com/vslio/generator-neverbuild/blob/master/app/templates/_package.json) used in the `package.json`.

Expand All @@ -26,13 +25,6 @@ For more information on what `generator-neverbuild` can do for you, take a look
- Run `grunt` for building & watch + compile your SCSS files


## Options

* `--skip-install`

Skips the automatic execution of `bower` and `npm` after scaffolding has finished.


## License

[MIT license](http://opensource.org/licenses/MIT)
65 changes: 19 additions & 46 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,35 @@
var path = require('path');
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var mkdirp = require('mkdirp');
var _s = require('underscore.string');

var NEVERGenerator = yeoman.generators.Base.extend({
init: function() {
this.pkg = require('../package.json');
},

askFor: function() {
var done = this.async();
var yosay = require('yosay');

this.log(yosay('Ey, Lad. I\'m here to help you kickstart your new NB project. Grunt, Bourbon and Neat are included.'));

var prompts = [{
type: 'confirm',
name: 'sassOption',
message: 'Would you like to install the SASS gem?',
default: false
}];

this.prompt(prompts, function(props) {
this.sassOption = props.sassOption;

done();
}.bind(this));
},

app: function() {
this.slugName = _s.slugify(this.appname);

this.imagesFolder = 'images';
this.scssFolder = 'scss';
this.cssFolder = 'css';
this.jsFolder = 'javascripts';
this.jsFolder = 'javascript';

this.log(chalk.magenta(
'[ Creating the structure. ]' +
' '
));

// Creating all the project folders
this.mkdir(this.imagesFolder);
this.mkdir(this.scssFolder);
this.mkdir(this.cssFolder);
this.mkdir(this.jsFolder);
mkdirp(this.imagesFolder);
mkdirp(this.scssFolder);
mkdirp(this.cssFolder);
mkdirp(this.jsFolder);

// Moving the right files/folders to the right folders
this.template('_package.json', 'package.json');
this.template('_bower.json', 'bower.json');
this.copy('_Gruntfile.js', 'Gruntfile.js');
this.copy('_gitignore', '.gitignore');
this.copy('_editorconfig', '.editorconfig');
Expand All @@ -57,27 +45,12 @@ var NEVERGenerator = yeoman.generators.Base.extend({
},

install: function() {
if (!this.options['skip-install']) {
if (this.sassOption) {
var gemSpawn;

this.log(chalk.magenta('[ Installing the SASS gem ]'));

gemSpawn = this.spawnCommand('sudo', ['gem', 'install', 'sass', '-v', '3.4.13']);
this.log(chalk.green(
'[ Cool. ]'
));

gemSpawn.on('close', function(code) {
if (code) {
this.log(chalk.red('Gem couldn\'t be installed! WAT! Error: ' + code));
} else {
this.log(chalk.green('Gem installed successfully. Wow.'));
this.installDependencies();
}
}.bind(this));
} else {
this.installDependencies();
}
}
this.installDependencies();
}
});

module.exports = NEVERGenerator;
module.exports = NEVERGenerator;
48 changes: 28 additions & 20 deletions app/templates/_Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
module.exports = function(grunt) {
grunt.project = {
name: '<%= slugName %>',
assetsFolder: ''
};

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
app: '<%= _.slugify(appname) %>',
assets: '',
scss: ['<%= project.assets %>scss/app.scss']
},
connect: {
dist: {
options: {
port: 8888,

// Change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
}
Expand All @@ -18,40 +19,47 @@ module.exports = function(grunt) {
sass: {
dev: {
options: {
style: 'nested',
precision: 5,
sourcemap: 'none'
outputStyle: 'nested',
sourcemap: true
},
files: {
'<%= project.assets %>css/app.css': '<%= project.scss %>'
}
files: [{
expand: true,
cwd: grunt.project.assetsFolder + 'scss',
src: ['app.scss'],
dest: grunt.project.assetsFolder + 'css',
ext: '.css'
}]
},
dist: {
options: {
style: 'nested',
precision: 5
outputStyle: 'compressed',
sourcemap: false
},
files: {
'<%= project.assets %>css/app.css': '<%= project.scss %>'
}
files: [{
expand: true,
cwd: grunt.project.assetsFolder + 'scss',
src: ['app.scss'],
dest: grunt.project.assetsFolder + 'css',
ext: '.css'
}]
}
},
watch: {
options: {
livereload: true
},
sass: {
files: '<%= project.assets %>scss/{,**/}*.scss',
files: grunt.project.assetsFolder + 'scss/{,**/}*.scss',
tasks: ['sass:dev']
}
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= project.assets %>images',
cwd: grunt.project.assetsFolder + 'images',
src: '{,*/}*.{gif,jpeg,jpg,png}',
dest: '<%= project.assets %>images'
dest: grunt.project.assetsFolder + 'images'
}]
}
}
Expand All @@ -72,4 +80,4 @@ module.exports = function(grunt) {
'connect:dist',
'watch'
]);
};
};
10 changes: 0 additions & 10 deletions app/templates/_bower.json

This file was deleted.

2 changes: 1 addition & 1 deletion app/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<link rel="apple-touch-icon" href="apple-touch-icon.png">

<title><%= _.slugify(appname) %></title>
<title><%= slugName %></title>

<!-- Included Font Files -->

Expand Down
8 changes: 5 additions & 3 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= _.slugify(appname) %>",
"name": "<%= slugName %>",
"version": "0.0.1",
"license": "MIT",
"engines": {
Expand All @@ -8,12 +8,14 @@
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-sass": "~0.9.2",
"grunt-sass": "^1.1.0",
"grunt-contrib-watch": "~0.6.1",
"load-grunt-tasks": "~3.1.0",
"grunt-concurrent": "^1.0.0",
"grunt-contrib-connect": "~0.9.0",
"grunt-contrib-imagemin": "^0.9.3",
"time-grunt": "^1.0.0"
"time-grunt": "^1.0.0",
"bourbon": "~4.2",
"node-neat": "~1.7"
}
}
36 changes: 0 additions & 36 deletions app/templates/_scss/_addons/_rem.scss

This file was deleted.

17 changes: 9 additions & 8 deletions app/templates/_scss/_base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
*/
html {
font-family: $base-font;
font-size: 62.5%;
font-size: 100%;
$em-base: 16px;
}

body {
position: relative;
background-color: $background-color;
color: $color;
background-color: $background-colour;
color: $colour;
}

/*
Expand All @@ -20,18 +21,18 @@ body {
* Customize the background color to match your design.
*/
@include selection {
background: #b3d4fc;
background: $selection-colour;
text-shadow: none;
}

.no-bullet,
%no-bullet {
.no-list-style,
%no-list-style {
list-style: none;
}

ul {
&.no-bullet {
@extend %no-bullet;
&.no-list-style {
@extend %no-list-style;
}
}

Expand Down
25 changes: 13 additions & 12 deletions app/templates/_scss/_base/_colours.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
/**
* Base styles ~ Colours
*/
$color: #333333;
$background-color: #f7f5f2;
$heading-colour: #333333;
$link-color: #939393;
$link-color-hovered: #000000;
$code-color: #444444;
$blockquote-color: #6f6f6f;
$hr-color: #dddddd;
$colour: #333333 !default;
$background-colour: #f7f5f2 !default;
$selection-colour: #b3d4fc !default;
$heading-colour: #333333 !default;
$link-colour: #939393 !default;
$link-colour-hovered: #000000 !default;
$code-colour: #444444 !default;
$blockquote-colour: #6f6f6f !default;
$hr-colour: #dddddd !default;

/**
* Add custom colours and their respective classes, ie:
*
* $red: #E23C3C;
* $colour-red: #E23C3C;
*
* .red,
* %red {
* color: $red;
* %red,
* .red {
* color: $colour-red;
* }
*
*/
2 changes: 1 addition & 1 deletion app/templates/_scss/_base/_grid-settings.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../bower_components/neat/app/assets/stylesheets/_neat-helpers";
@import "../../node_modules/node-neat/node_modules/bourbon-neat/app/assets/stylesheets/_neat-helpers";

/**
* Base styles ~ Grid options
Expand Down
Loading

0 comments on commit f80bea2

Please sign in to comment.