Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yago committed Jan 6, 2016
2 parents 69b07f2 + 2f232c8 commit df9dec2
Show file tree
Hide file tree
Showing 130 changed files with 406 additions and 946 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
bower_components
dist
build
styleguide
Expand Down
80 changes: 71 additions & 9 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,33 @@ module.exports = yeoman.generators.Base.extend({
checked: true
}
]
},{
when: function (response) {
// this.log(response);
return response.tools.indexOf('bootstrapSass') !== -1;
},
name: 'bootstrap4',
type: 'confirm',
message: 'Do you want to use Bootstrap 4 Alpha?',
default: false
},{
type: 'checkbox',
name: 'components',
message: 'What would you like to have to base components ? (select the ones you want) ',
choices: [{
name: 'Button',
value: 'button'
}, {
name: 'Video embed',
value: 'video'
}, {
name: 'Spacer',
value: 'spacer'
}, {
name: 'Separator',
value: 'separator'
}
]
},{
type: 'input',
name: 'assets',
Expand All @@ -79,13 +106,24 @@ module.exports = yeoman.generators.Base.extend({
this.prompt(prompts, function (props) {
this.name = props.name;

// Tools
var tools = props.tools;
function hasTool(tool) { return tools.indexOf(tool) !== -1; }

this.gulp = hasTool('gulp');
this.fabricator = hasTool('fabricator');
this.bootstrapSass = hasTool('bootstrapSass');
this.bootstrap4 = props.bootstrap4;
this.tests = hasTool('tests');

// Components
var components = props.components;
function hasComponent(component) { return components.indexOf(component) !== -1; }
this.componentButton = hasComponent('button');
this.componentVideo = hasComponent('video');
this.componentSpacer = hasComponent('spacer');
this.componentSeparator = hasComponent('separator');

if (props.assets.slice(-1) === '/') {
this.assets = props.assets;
} else {
Expand All @@ -104,10 +142,9 @@ module.exports = yeoman.generators.Base.extend({

writing: {
app: function () {
this.template('_bower.json', 'bower.json');
this.template('_package.json', 'package.json');

if (this.gulp) {
this.template('_package.json', 'package.json');
if (this.gulp) {
this.template('_gulp_config.json', 'gulp_config.json');
this.template('_gulpfile.js', 'gulpfile.js');

Expand All @@ -117,6 +154,7 @@ module.exports = yeoman.generators.Base.extend({
this.copy('tasks/images.js', 'tasks/images.js');
this.copy('tasks/scripts.js', 'tasks/scripts.js');
this.copy('tasks/icons.js', 'tasks/icons.js');
this.copy('tasks/favicons.js', 'tasks/favicons.js');
if (this.fabricator) {
this.copy('tasks/styleguide.js', 'tasks/styleguide.js');
}
Expand All @@ -125,15 +163,36 @@ module.exports = yeoman.generators.Base.extend({
}

if (this.fabricator) {
this.directory('assets/components', this.assets + 'components');
this.mkdir(this.assets + 'components');
this.mkdir(this.assets + 'components/atoms');
this.mkdir(this.assets + 'components/molecules');
this.mkdir(this.assets + 'components/organisms');
this.directory('assets/templates', this.assets + 'templates');
this.directory('assets/data', this.assets + 'data');
this.directory('assets/docs', this.assets + 'docs');
this.directory('assets/sass/atoms', this.assets + 'sass/atoms');
this.directory('assets/sass/molecules', this.assets + 'sass/molecules');
this.directory('assets/sass/organisms', this.assets + 'sass/organisms');
this.directory('assets/sass/templates', this.assets + 'sass/templates');
this.mkdir(this.assets + 'sass');
this.mkdir(this.assets + 'sass/atoms');
this.mkdir(this.assets + 'sass/molecules');
this.mkdir(this.assets + 'sass/organisms');
this.mkdir(this.assets + 'sass/templates');
this.copy('assets/sass/styleguide.scss', this.assets + 'sass/styleguide.scss');

if (this.componentButton) {
this.copy('assets/components/atoms/button.hbs', this.assets + 'components/atoms/button.hbs');
this.copy('assets/sass/atoms/_buttons.scss', this.assets + 'sass/atoms/_buttons.scss');
}
if (this.componentVideo) {
this.copy('assets/components/atoms/video.hbs', this.assets + 'components/atoms/video.hbs');
this.copy('assets/sass/atoms/_videos.scss', this.assets + 'sass/atoms/_videos.scss');
}
if (this.componentSpacer) {
this.copy('assets/components/atoms/spacer.hbs', this.assets + 'components/atoms/spacer.hbs');
this.copy('assets/sass/atoms/_spacers.scss', this.assets + 'sass/atoms/_spacers.scss');
}
if (this.componentSeparator) {
this.copy('assets/components/atoms/separator.hbs', this.assets + 'components/atoms/separator.hbs');
this.copy('assets/sass/atoms/_separators.scss', this.assets + 'sass/atoms/_separators.scss');
}
}

this.directory('assets/js', this.assets + 'js');
Expand All @@ -142,8 +201,11 @@ module.exports = yeoman.generators.Base.extend({
this.mkdir(this.assets + 'svg');
this.mkdir(this.assets + 'fonts');
this.mkdir(this.assets + 'icons');
this.mkdir(this.assets + 'favicons');

if (this.bootstrapSass) {
if (this.bootstrap4) {
this.copy('assets/sass/bootstrap4.scss', this.assets + 'sass/bootstrap4.scss');
} else if (this.bootstrapSass) {
this.copy('assets/sass/bootstrap.scss', this.assets + 'sass/bootstrap.scss');
}

Expand Down
10 changes: 0 additions & 10 deletions app/templates/_bower.json

This file was deleted.

34 changes: 17 additions & 17 deletions app/templates/_gulp_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
""
],
"js": [
"bower_components/jquery/dist/jquery.js"<% if (bootstrapSass) { %>,
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/affix.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/alert.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/button.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/carousel.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/tab.js",
"bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js"<% } %>
"node_modules/jquery/dist/jquery.js"<% if (bootstrapSass) { %>,
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/affix.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/alert.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/button.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/carousel.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/collapse.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/modal.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/popover.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/scrollspy.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/tab.js",
"node_modules/bootstrap-sass/assets/javascripts/bootstrap/transition.js"<% } %>
],
"fonts": [<% if (bootstrapSass) { %>
"bower_components/bootstrap-sass/assets/fonts/bootstrap/*",<% } %>
"node_modules/bootstrap-sass/assets/fonts/bootstrap/*",<% } %>
"<%= assets %>fonts/*"
],
"polyfills": [
"bower_components/html5shiv/dist/html5shiv.js",
"bower_components/respond/dest/respond.src.js"
"node_modules/html5shiv/dist/html5shiv.js",
"node_modules/respond.js/dest/respond.src.js"
]
},
"images": [
Expand All @@ -44,7 +44,7 @@
"build": "<%= build %>",
"browsers": ["last 2 versions", "safari 5", "ie 8", "ie 9", "ff 27", "opera 12.1"]<% if (fabricator) { %>,
"styleguide": {
"assets": "bower_components/fabricator/src/assets/fabricator/",
"assets": "node_modules/fabricator/src/assets/fabricator/",
"layout": "default",
"layouts": "<%= assets %>templates/views/layouts/*",
"layoutIncludes": "<%= assets %>templates/views/layouts/includes/*",
Expand Down
19 changes: 14 additions & 5 deletions app/templates/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,30 @@ require(config.tasks + 'images')(); // $ gulp img
require(config.tasks + 'styles')(); // $ gulp styles
require(config.tasks + 'scripts')(); // $ gulp scripts
require(config.tasks + 'icons')(); // $ gulp icons
require(config.tasks + 'favicons')(); // $ gulp favicons
require(config.tasks + 'clean')(); // $ gulp clean<% if (fabricator) { %>
require(config.tasks + 'styleguide')(); // $ gulp styleguide<% } %>
require(config.tasks + 'server')(); // $ gulp serve
require(config.tasks + 'gh-pages')(); // $ gulp deploy<% if (tests) { %>
require(config.tasks + 'tests-regression'); // $ gulp regression
require(config.tasks + 'tests-regression')(); // $ gulp regression
require(config.tasks + 'tests-unit')(); // $ gulp test:unit
require(config.tasks + 'tests-navigation')(); // $ gulp test:navigation<% } %>


<% if (bootstrapSass) { %>
<% if (bootstrap4) { %>
/**
* Init project
*/
gulp.task('init', function() {
return gulp.src('node_modules/bootstrap/scss/_variables.scss')
.pipe($.rename('bootstrap-variables.scss'))
.pipe(gulp.dest(config.assets + 'sass/'));
});
<% } else if (bootstrapSass) { %>
/**
* Init project
*/
gulp.task('init', function() {
return gulp.src('bower_components/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss')
return gulp.src('node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss')
.pipe($.rename('bootstrap-variables.scss'))
.pipe(gulp.dest(config.assets + 'sass/'));
});
Expand All @@ -45,5 +54,5 @@ gulp.task('build',['clean'], function() {
* Default task
*/
gulp.task('default', ['clean'], function(done){
runSequence(['css-vendors', 'js-vendors', 'fonts-vendors', 'polyfills-vendors', 'img', 'icons', 'styles', 'scripts'<% if (fabricator) { %>, 'styleguide-styles', 'styleguide-scripts'<% } %>]<% if (fabricator) { %>, 'styleguide'<% } %>, done);
runSequence(['css-vendors', 'js-vendors', 'fonts-vendors', 'polyfills-vendors', 'img', 'icons', 'styles', 'scripts'<% if (fabricator) { %>, 'styleguide-styles', 'styleguide-scripts'<% } %>], 'favicons'<% if (fabricator) { %>, 'styleguide'<% } %>, done);
});
49 changes: 28 additions & 21 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,56 @@
"name": "<%= slug(name).toLowerCase() %>",
"version": "0.0.0",
"main": "index.html",
"dependencies": {<% if (bootstrap4) { %>
"bootstrap": "git@github.com:twbs/bootstrap.git#v4-dev",<% } else if (bootstrapSass) { %>
"bootstrap-sass": "~3.3.5",<% } %>
"fabricator": "fbrctr/fabricator",
"html5shiv": "^3.7.3",
"jquery": "^2.1.4",
"respond.js": "^1.4.2"
},
"devDependencies": {
"autoprefixer-core": "^5.1.11",
"babel-core": "5.2.17",
"babel-loader": "5.0.0",
"backstopjs": "^0.4.3",
"bower": "^1.4.1",
"async": "^1.3.0",
"autoprefixer": "^6.2.3",
"babel-core": "6.3.26",
"babel-loader": "6.2.1",
"backstopjs": "^1.0.0",
"browser-sync": "^2.7.1",
"casperjs": "^1.1.0-beta3",
"chai": "^2.3.0",
"del": "~1.1.1",
"fabricator-assemble": "git@github.com:fbrctr/fabricator-assemble.git#master",
"chai": "^3.4.1",
"del": "~2.2.0",
"fabricator-assemble": "fbrctr/fabricator-assemble.git",<% if (gulp) { %>
"gulp": "^3.9.0",
"gulp-browserify": "^0.5.1",
"gulp-casperjs": "0.0.5",
"gulp-concat": "^2.5.2",
"gulp-consolidate": "^0.1.2",
"gulp-gh-pages": "^0.5.1",
"gulp-hologram": "^1.2.0",
"gulp-iconfont": "^1.0.0",
"gulp-if": "^1.2.5",
"gulp-iconfont": "^5.0.1",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.2.1",
"gulp-jshint": "^1.10.0",
"gulp-load-plugins": "^0.10.0",
"gulp-jshint": "^2.0.0",
"gulp-load-plugins": "^1.2.0",
"gulp-minify-css": "^1.1.1",
"gulp-mocha": "^2.1.1",
"gulp-notify": "^2.2.0",
"gulp-phantomcss": "0.0.4",
"gulp-postcss": "^5.1.6",
"gulp-phantomcss": "0.1.1",
"gulp-postcss": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.0",
"gulp-size": "^1.2.1",
"gulp-size": "^2.0.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "~1.2.0",
"gulp-util": "^3.0.4",
"gulp-uglify": "~1.5.1",
"gulp-util": "^3.0.4",<% } %>
"helper-markdown": "^0.1.1",
"imagemin-pngquant": "^4.1.0",
"imgur": "^0.1.5",
"jquery": "^2.1.4",
"jsdom": "^3.1.2",
"jshint-stylish": "^1.0.2",
"jsdom": "^7.2.2",
"jshint-stylish": "^2.1.0",
"lodash": "^3.8.0",
"mocha": "^2.2.5",
"phantomcss": "^0.10.1",
"phantomcss": "^0.11.1",
"run-sequence": "~1.1.0",
"sinon": "^1.14.1",
"sinon-chai": "^2.7.0",
Expand Down
File renamed without changes.
15 changes: 0 additions & 15 deletions app/templates/assets/components/atoms/alerts.html

This file was deleted.

8 changes: 0 additions & 8 deletions app/templates/assets/components/atoms/badges.html

This file was deleted.

18 changes: 0 additions & 18 deletions app/templates/assets/components/atoms/blockquote.html

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit df9dec2

Please sign in to comment.