Files: 302a1977ff1d540991f9e38ace65341334faef0a / main.js
1318 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 | inbox: require('patch-inbox'), |
23 | history: require('patch-history') |
24 | } |
25 | } |
26 | |
27 | |
28 | // from more specialized to more general |
29 | const sockets = combine( |
30 | //require('ssb-horcrux'), |
31 | //require('patch-hub'), |
32 | |
33 | require('ssb-chess'), |
34 | require('patchbay-gatherings'), |
35 | // require('patch-network), |
36 | require('patch-settings'), // might need to be in patchbay |
37 | patchbay, |
38 | require('patchcore') |
39 | ) |
40 | |
41 | const api = entry(sockets, nest('app.html.app', 'first')) |
42 | const app = api.app.html.app |
43 | |
44 | module.exports = patchbay |
45 | |
46 | // for electro[n] |
47 | if (typeof window !== 'undefined') { |
48 | document.body.appendChild(app()) |
49 | } |
50 | |
51 |
Built with git-ssb-web