Skip to content

Commit

Permalink
feat(docs): add SassDoc option
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
meriadec committed Apr 14, 2015
1 parent cf125c9 commit 0aa716b
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 4 deletions.
17 changes: 17 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ var BangularGenerator = yeoman.generators.Base.extend({
value: 'browsersync',
name: 'BrowserSync'
}]
}, {
type: 'checkbox',
name: 'docs',
message: 'Do you want to add some documentation generators?',
choices: [{
value: 'sassdoc',
name: 'SassDoc',
checked: false
}]
}, {
type: 'checkbox',
name: 'tests',
Expand Down Expand Up @@ -127,6 +136,14 @@ var BangularGenerator = yeoman.generators.Base.extend({
});
}

if (props.docs && props.docs.length) {
props.docs.forEach(function (doc) {
self.filters[doc] = true;
});
}

self.filters.hasDocs = !!self.filters.sassdoc;

if (props.tests && props.tests.length) {
props.tests.forEach(function (test) {
self.filters[test] = true;
Expand Down
3 changes: 2 additions & 1 deletion app/templates/_.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ client/styles/css
.idea/
dist/
.sass-cache/
.bangular-refresh
.bangular-refresh<% if (filters.hasDocs) { %>
docs/<% } %>
3 changes: 2 additions & 1 deletion app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ gulp.task('version', require('./tasks/chore').version);<% if (f
gulp.task('control', require('./tasks/control'));<% } if (filters.e2e) { %>
gulp.task('e2e:update', require('./tasks/test').e2eUpdate);
gulp.task('e2e', ['serve'], require('./tasks/test').e2eTests);<% } if (filters.karma || filters.mocha) { %>
gulp.task('test', require('./tasks/test').test);<% } %>
gulp.task('test', require('./tasks/test').test);<% } if (filters.sassdoc) { %>
gulp.task('sassdoc', require('./tasks/doc').sassdoc);<% } %>
3 changes: 2 additions & 1 deletion app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"karma-ng-html2js-preprocessor": "^0.1.2",
"karma-phantomjs-launcher": "^0.1.4",<% } %>
"main-bower-files": "^2.5.0",
"run-sequence": "^1.0.2",<% if (filters.mocha) { %>
"run-sequence": "^1.0.2",<% if (filters.sassdoc) { %>
"sassdoc": "^2.1.8",<% } if (filters.mocha) { %>
"should": "^5.1.0",<% } %>
"streamqueue": "^0.1.2"<% if (filters.karma) { %>,
"supertest": "^0.15.0"<% } %>
Expand Down
15 changes: 15 additions & 0 deletions app/templates/tasks/doc.js(hasDocs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

/**
* Documentation tasks
*/

var gulp = require('gulp');<% if (filters.sassdoc) { %>
var sassdoc = require('sassdoc');<% } %><% if (filters.sassdoc) { %>

exports.sassdoc = function () {
gulp.src('client/styles/**/*.scss')
.pipe(sassdoc({
dest: 'docs/sass'
}));
};<% } %>
31 changes: 30 additions & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,35 @@ describe('Launching app generator tests', function () {

describe('', function () {

before(function (done) {

utils.scaffold({
name: 'Test',
backend: 'json',
reload: 'livereload',
modules: [],
docs: ['sassdoc']
}, done);

});

it('should create all the files', basicFileCheck);

it('should check sassdoc dependency', function () {
assert.fileContent('package.json', 'sassdoc');
});

it('should check sassdoc task is present', function () {
assert.file('tasks/doc.js');
assert.fileContent('tasks/doc.js', 'exports.sassdoc = function () {');
assert.fileContent('gulpfile.js', 'gulp.task(\'sassdoc\', ');
assert.fileContent('.gitignore', 'docs/');
});

});

This comment has been minimized.

Copy link
@balthazar

balthazar Apr 14, 2015

Member

?

This comment has been minimized.

Copy link
@meriadec

meriadec Apr 14, 2015

Author Member

image


/*describe('', function () {
before(function (done) {
this.timeout(240000);
Expand Down Expand Up @@ -443,6 +472,6 @@ describe('Launching app generator tests', function () {
});
});
});
});*/

});

2 comments on commit 0aa716b

@androidfred
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for asking here but is there any preferred means of communication for bangular?

@balthazar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@androidfred No problem, there was a Gitter but not very active so we decided to remove it from the Readme, it's still accessible though. You can make an issue for almost anything, but for very specific cases or something you don't want public you can email us at contact@bangular.io :)

Please sign in to comment.