git ssb

16+

Dominic / patchbay



Tree: ad0e7c850b6e58238e7da31bc5e6f8be41cae5c9

Files: ad0e7c850b6e58238e7da31bc5e6f8be41cae5c9 / main.js

1637 bytesRaw
1const combine = require('depject')
2const entry = require('depject/entry')
3const nest = require('depnest')
4const bulk = require('bulk-require')
5
6// polyfills
7require('setimmediate')
8
9const 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
30const post = {
31 patchbay: {
32 message: bulk(__dirname, [ 'post-patchcore/message/**/*.js' ])
33 }
34}
35
36// from more specialized to more general
37const sockets = combine(
38 require('ssb-horcrux'),
39 // require('patch-hub'),
40
41 require('patchbay-dark-crystal'),
42 require('patchbay-poll'),
43 require('ssb-chess'),
44 require('patchbay-gatherings'),
45 require('patchbay-book'),
46 // require('patch-network),
47 patchbay,
48 require('patchcore'),
49 post
50)
51
52const api = entry(sockets, nest('app.html.app', 'first'))
53const app = api.app.html.app
54
55module.exports = patchbay
56
57// for electro[n]
58if (typeof window !== 'undefined') {
59 document.body.appendChild(app())
60}
61

Built with git-ssb-web