forked from ssbc/patchbay
/
main.js
51 lines (41 loc) · 1.33 KB
/
main.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
const combine = require('depject')
const entry = require('depject/entry')
const nest = require('depnest')
const bulk = require('bulk-require')
// polyfills
require('setimmediate')
const patchbay = {
patchbay: {
about: bulk(__dirname, [ 'about/**/*.js' ]),
app: bulk(__dirname, [ 'app/**/*.js' ]),
blob: bulk(__dirname, [ 'blob/**/*.js' ]),
channel: bulk(__dirname, [ 'channel/**/*.js' ]),
contact: bulk(__dirname, [ 'contact/**/*.js' ]),
message: bulk(__dirname, [ 'message/**/*.js' ]),
router: bulk(__dirname, [ 'router/**/*.js' ]),
styles: bulk(__dirname, [ 'styles/**/*.js' ]),
config: require('./config'), // shouldn't be in here ?
contextMenu: require('patch-context'),
suggestions: require('patch-suggest'),
inbox: require('patch-inbox'),
history: require('patch-history'),
}
}
// from more specialized to more general
const sockets = combine(
//require('ssb-horcrux'),
//require('patch-hub'),
require('ssb-chess'),
require('patchbay-gatherings'),
// require('patch-network),
require('patch-settings'), // might need to be in patchbay
patchbay,
require('patchcore')
)
const api = entry(sockets, nest('app.html.app', 'first'))
const app = api.app.html.app
module.exports = patchbay
// for electro[n]
if (typeof window !== 'undefined') {
document.body.appendChild(app())
}