forked from angular-ui/ui-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.js
45 lines (34 loc) · 941 Bytes
/
publish.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
/* jshint node:true */
'use strict';
var fs = require('fs');
module.exports = function() {
var modulesName = [];
if (fs.existsSync(__dirname + '/dist/sub')){
modulesName = fs.readdirSync(__dirname + '/dist/sub');
}
function makingComponentData(memo, name){
memo[name] = {
name: 'angular-ui-' + name,
main: './' + name + '.js'
};
return memo;
}
return {
// gh-pages stuff
humaName : 'UI.Utils',
repoName : 'ui-utils',
inlineHTML : fs.readFileSync(__dirname + '/demo/demos.html'),
inlineJS : fs.readFileSync(__dirname + '/demo/demo.js'),
// gh-pages css dependencies
// css : []
// gh-pages js dependencies
js : ['dist/ui-utils.js'],
// HACK...
main_dist_dir: 'main',
bowerData : { main: './ui-utils.js'},
// The sub-components
subcomponents : modulesName.reduce(makingComponentData, {}),
// HACK...
sub_dist_dir: 'sub'
};
};