forked from mainmatter/ember-simple-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ember-cli-build.js
54 lines (46 loc) · 1.43 KB
/
ember-cli-build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* global require, module */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const yuidoc = require('broccoli-yuidoc');
const version = require('git-repo-version')();
const Handlebars = require('handlebars');
const mergeTrees = require('broccoli-merge-trees');
const merge = require('lodash/merge');
var sourceTrees = [];
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
jscsOptions: {
enabled: true,
testGenerator: function(relativePath, errors) {
if (errors) {
errors = "\\n" + this.escapeErrorString(errors);
} else {
errors = "";
}
return "describe('JSCS - " + relativePath + "', function() {\n" +
"it('should pass jscs', function() { \n" +
" expect(" + !errors + ", '" + relativePath + " should pass jscs." + errors + "').to.be.ok; \n" +
"})});\n";
}
}
});
app.import('bower_components/bootstrap/dist/css/bootstrap.css');
sourceTrees.push(app.toTree());
const yuidocTree = new yuidoc(['addon', 'app'], {
destDir: 'docs',
yuidoc: {
project: {
name: 'The Ember Simple Auth API',
version: version,
},
linkNatives: false,
quiet: true,
parseOnly: false,
lint: false,
themedir: 'docs/theme'
}
});
if (app.env === 'production') {
sourceTrees.push(yuidocTree);
}
return mergeTrees(sourceTrees);
};