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.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yago committed May 14, 2016
2 parents 2de0e13 + 4ec2113 commit aa8eb5b
Show file tree
Hide file tree
Showing 68 changed files with 805 additions and 658 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
dist
build
styleguide
.sass-cache
.publish
*.DS_Store
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ $ cd /path-to/your/project
$ yo toolbox
```

Then initialize your project with `$ npm start`.

## Options available

You can use the flag `--skip-install` if you wish to installl all npm and bower dependencies later.
Expand Down
91 changes: 22 additions & 69 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var toolboxSay = function() {

};

module.exports = yeoman.generators.Base.extend({
module.exports = yeoman.Base.extend({
initializing: function () {
this.pkg = require('../package.json');
},
Expand All @@ -47,11 +47,7 @@ module.exports = yeoman.generators.Base.extend({
name: 'tools',
message: 'What would you like to use in your project ? (unselect the ones you don\'t want) ',
choices: [{
name: 'Task runner (GulpJS)',
value: 'gulp',
checked: true
}, {
name: 'Styleguide (Fabricator)',
name: 'Styleguide',
value: 'fabricator',
checked: true
}, {
Expand All @@ -73,24 +69,6 @@ module.exports = yeoman.generators.Base.extend({
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 @@ -110,20 +88,11 @@ module.exports = yeoman.generators.Base.extend({
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 @@ -144,55 +113,38 @@ module.exports = yeoman.generators.Base.extend({
app: function () {
this.template('_package.json', 'package.json');

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

this.template('tasks/_clean.js', 'tasks/clean.js');
this.template('tasks/_server.js', 'tasks/server.js');
this.copy('tasks/gh-pages.js', 'tasks/gh-pages.js');
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');
}
this.copy('tasks/styles.js', 'tasks/styles.js');
this.copy('tasks/vendors.js', 'tasks/vendors.js');
this.template('_gulp_config.json', 'gulp_config.json');
this.template('_gulpfile.js', 'gulpfile.js');

this.template('tasks/_clean.js', 'tasks/clean.js');
this.template('tasks/_server.js', 'tasks/server.js');
this.copy('tasks/gh-pages.js', 'tasks/gh-pages.js');
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/metalsmith.js', 'tasks/metalsmith.js');
this.copy('tasks/filters.js', 'tasks/filters.js');
}
this.copy('tasks/styles.js', 'tasks/styles.js');
this.copy('tasks/vendors.js', 'tasks/vendors.js');

if (this.fabricator) {
this.mkdir(this.assets + 'components');
this.mkdir(this.assets + 'components/atoms');
this.mkdir(this.assets + 'components/molecules');
this.mkdir(this.assets + 'components/organisms');
this.mkdir(this.assets + 'components/pages');
this.directory('assets/templates', this.assets + 'templates');
this.directory('assets/data', this.assets + 'data');
this.directory('assets/docs', this.assets + 'docs');
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.mkdir(this.assets + 'sass/pages');
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 Down Expand Up @@ -226,8 +178,9 @@ module.exports = yeoman.generators.Base.extend({
this.copy('editorconfig', '.editorconfig');
this.copy('gitattributes', '.gitattributes');
this.copy('gitignore', '.gitignore');
this.copy('jshintrc', '.jshintrc');
this.copy('sass-lint.yml', '.sass-lint.yml');
this.copy('eslintrc.yml', '.eslintrc.yml');
this.copy('env', '.env');
this.copy('stylelintrc', '.stylelintrc');
}
},

Expand Down
54 changes: 42 additions & 12 deletions app/templates/_gulp_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,48 @@
"iconsFontName": "icons",
"build": "<%= build %>",
"browsers": ["last 2 versions", "safari 5", "ie 8", "ie 9", "ff 27", "opera 12.1"]<% if (fabricator) { %>,
"styleguide": {
"metalsmith": {
"assets": "node_modules/fabricator/src/assets/fabricator/",
"layout": "default",
"layouts": "<%= assets %>templates/views/layouts/*",
"layoutIncludes": "<%= assets %>templates/views/layouts/includes/*",
"views": [
"<%= assets %>templates/**/*",
"!<%= assets %>templates/views/+(layouts)/**"
],
"materials": "<%= assets %>components/**/*",
"data": "<%= assets %>data/**/*.{json,yml}",
"docs": "<%= assets %>docs/**/*.md",
"dest": "styleguide"
"dist": "styleguide/",
"plugins": {
"permalinks": {
"pattern": ":title",
"linksets": [{
"match": { "collection": "pages" },
"pattern": ":title"
}]
},
"collections": {
"atoms": {
"sortBy": "title",
"reverse": false
},
"molecules": {
"sortBy": "title",
"reverse": false
},
"organisms": {
"sortBy": "title",
"reverse": false
},
"pages": {
"sortBy": "title",
"reverse": false
},
"docs": {
"sortBy": "title",
"reverse": false
}
},
"layouts": {
"engine": "swig",
"default": "default.html.swig",
"directory": "assets/templates",
"rename": true
},
"metalsmithinplace": {
"engine": "swig"
}
}
}<% } %>
}
7 changes: 3 additions & 4 deletions app/templates/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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 + 'metalsmith')(); // $ gulp metalsmith<% } %>
require(config.tasks + 'server')(); // $ gulp serve
require(config.tasks + 'gh-pages')(); // $ gulp deploy<% if (tests) { %>
require(config.tasks + 'tests-regression')(); // $ gulp regression
Expand Down Expand Up @@ -46,13 +46,12 @@ gulp.task('init', function() {
* Task to build assets on production server
*/
gulp.task('build',['clean'], function() {
return gulp.start('vendors', 'styles', 'img', 'scripts', 'icons');
return gulp.start('vendors', 'styles', 'img', 'scripts', 'icons', 'metalsmith');
});


/**
* 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'<% } %>], 'favicons'<% if (fabricator) { %>, 'styleguide'<% } %>, done);
runSequence(['css-vendors', 'js-vendors', 'fonts-vendors', 'polyfills-vendors', 'img', 'icons', 'styles', 'scripts', 'metalsmith-styles', 'metalsmith-scripts'], 'favicons', 'metalsmith', done);
});
42 changes: 28 additions & 14 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,69 @@
"devDependencies": {
"async": "^2.0.0-rc.2",
"autoprefixer": "^6.2.3",
"babel-core": "6.7.4",
"babel-core": "6.8.0",
"babel-loader": "6.2.4",
"babel-preset-es2015": "^6.6.0",
"backstopjs": "^1.0.0",
"browser-sync": "^2.7.1",
"casperjs": "^1.1.0-beta3",
"chai": "^3.4.1",
"contentful-metalsmith": "^0.1.0",
"del": "~2.2.0",
"dotenv": "^2.0.0",
"eslint": "^2.5.3",
"fabricator-assemble": "fbrctr/fabricator-assemble.git",<% if (gulp) { %>
"gulp": "^3.9.0",
"gulp-babel": "^6.1.2",
"gulp-browserify": "^0.5.1",
"gulp-casperjs": "0.0.5",
"gulp-changed": "^1.3.0",
"gulp-clean-css": "^2.0.7",
"gulp-concat": "^2.5.2",
"gulp-consolidate": "^0.3.2",
"gulp-consolidate": "^0.2.0",
"gulp-eslint": "^2.0.0",
"gulp-front-matter": "^1.3.0",
"gulp-gh-pages": "^0.5.1",
"gulp-iconfont": "^6.0.0",
"gulp-iconfont": "^8.0.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.2.1",
"gulp-jshint": "^2.0.0",
"gulp-imagemin": "^3.0.1",
"gulp-inline-fonts": "^1.0.1",
"gulp-load-plugins": "^1.2.0",
"gulp-minify-css": "^1.1.1",
"gulp-metalsmith": "^1.0.0",
"gulp-mocha": "^2.1.1",
"gulp-notify": "^2.2.0",
"gulp-phantomcss": "0.1.1",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.0",
"gulp-sass-lint": "^1.1.1",
"gulp-size": "^2.0.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-stylelint": "^2.0.2",
"gulp-uglify": "~1.5.1",
"gulp-util": "^3.0.4",<% } %>
"helper-markdown": "^0.2.1",
"imagemin-pngquant": "^4.1.0",
"gulp-util": "^3.0.4",
"imagemin-pngquant": "^5.0.0",
"imgur": "^0.1.5",
"jsdom": "^8.2.0",
"jshint-stylish": "^2.1.0",
"jsdom": "^9.0.0",
"lodash": "^4.1.6",
"marked": "^0.3.5",
"metalsmith": "^2.1.0",
"metalsmith-collections": "^0.7.0",
"metalsmith-define": "^2.0.1",
"metalsmith-if": "^0.1.1",
"metalsmith-layouts": "^1.6.5",
"metalsmith-markdown": "^0.2.1",
"metalsmith-pagination": "^1.4.0",
"metalsmith-paths": "^2.1.2",
"metalsmith-permalinks": "^0.5.0",
"metalsmith-rootpath": "^0.1.7",
"metalsmith-slug": "^0.2.0",
"mocha": "^2.2.5",
"phantomcss": "^1.0.0",
"run-sequence": "~1.1.0",
"sinon": "^1.14.1",
"sinon-chai": "^2.7.0",
"slug": "^0.9.1",
"stylelint": "^6.2.2",
"swig": "^1.4.2",
"toolbox-utils": "0.0.1",
"yargs": "^4.3.2"
}
Expand Down
10 changes: 0 additions & 10 deletions app/templates/assets/components/atoms/button.hbs

This file was deleted.

7 changes: 0 additions & 7 deletions app/templates/assets/components/atoms/separator.hbs

This file was deleted.

7 changes: 0 additions & 7 deletions app/templates/assets/components/atoms/spacer.hbs

This file was deleted.

9 changes: 0 additions & 9 deletions app/templates/assets/components/atoms/video.hbs

This file was deleted.

9 changes: 9 additions & 0 deletions app/templates/assets/data/colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"primary": {
"black": "#000",
"mine": "#222",
"silver": "#7F7F7F",
"dust": "#E6E6E6",
"white": "#fff"
}
}
6 changes: 0 additions & 6 deletions app/templates/assets/data/colors.yml

This file was deleted.

Loading

0 comments on commit aa8eb5b

Please sign in to comment.