Files: 08cc898e45256d9570b4c0fd8a7aaa72b6276841 / main.js
1229 bytesRaw
1 | const combine = require('depject') |
2 | const entry = require('depject/entry') |
3 | const nest = require('depnest') |
4 | const bulk = require('bulk-require') |
5 | |
6 | // polyfills |
7 | require('setimmediate') |
8 | |
9 | const patchbay = { |
10 | patchbay: { |
11 | about: bulk(__dirname, [ 'about/**/*.js' ]), |
12 | app: bulk(__dirname, [ 'app/**/*.js' ]), |
13 | blob: bulk(__dirname, [ 'blob/**/*.js' ]), |
14 | channel: bulk(__dirname, [ 'channel/**/*.js' ]), |
15 | contact: bulk(__dirname, [ 'contact/**/*.js' ]), |
16 | message: bulk(__dirname, [ 'message/**/*.js' ]), |
17 | router: bulk(__dirname, [ 'router/**/*.js' ]), |
18 | styles: bulk(__dirname, [ 'styles/**/*.js' ]), |
19 | |
20 | config: require('./config'), // shouldn't be in here ? |
21 | contextMenu: require('patch-context'), |
22 | } |
23 | } |
24 | |
25 | |
26 | // from more specialized to more general |
27 | const sockets = combine( |
28 | // require('ssb-horcrux'), |
29 | require('ssb-chess'), |
30 | // require('patch-hub'), |
31 | // require('patch-gatherings'), |
32 | // require('patchbay-gatherings'), // TODO collect gatherings into this |
33 | patchbay, |
34 | require('patchcore') |
35 | ) |
36 | |
37 | const api = entry(sockets, nest('app.html.app', 'first')) |
38 | const app = api.app.html.app |
39 | |
40 | module.exports = patchbay |
41 | |
42 | // for electro[n] |
43 | if (typeof window !== 'undefined') { |
44 | document.body.appendChild(app()) |
45 | } |
46 | |
47 |
Built with git-ssb-web