-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (42 loc) · 1.42 KB
/
index.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
/* jshint node: true */
'use strict';
const path = require('path');
// const fs = require('fs');
// const chalk = require('chalk');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
module.exports = {
name: 'ui-input',
description: 'Input controls for ambitious Ember applications',
included: function(app, parentAddon) {
const target = (parentAddon || app);
this._super.included(app);
var options = typeof app.options === 'object' ? app.options : {};
var addonConfig = options['ui-input'] || {};
// component CSS
target.import('vendor/ui-input/ui-input.css');
target.import('vendor/ui-input/ui-input-flat.css');
target.import('vendor/ui-input/ui-input-minimal.css');
// if(!addonConfig.quiet) {
// const info = JSON.parse(fs.readFileSync('node_modules/ui-input/package.json'));
// this.ui.writeLine(`ui-input: using ${chalk.bold(info.version)}`);
// }
},
treeForStyles: function(tree) {
const bootstrapPath = path.join('node_modules', 'bootstrap/scss');
const trees = [];
if(tree) {
trees.push(tree);
}
const existingStyle = this._super.treeForStyles.apply(this, arguments);
const bootstrap = new Funnel(bootstrapPath, {
srcDir: '/',
destDir: '/bootstrap-source'
});
trees.push(bootstrap);
if (existingStyle) {
trees.push(existingStyle);
}
return mergeTrees(trees);
},
};