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