git ssb

16+

Dominic / patchbay



Tree: 2d2b9653cdfc8066b4bd16d2b35193875df3427d

Files: 2d2b9653cdfc8066b4bd16d2b35193875df3427d / main.js

1740 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 patchcore = require('patchcore')
10delete patchcore.patchcore.message.html.action.reply
11// prune an action we don't want
12
13const patchbay = {
14 patchbay: {
15 about: bulk(__dirname, [ 'about/**/*.js' ]),
16 app: bulk(__dirname, [ 'app/**/*.js' ]),
17 blob: bulk(__dirname, [ 'blob/**/*.js' ]),
18 channel: bulk(__dirname, [ 'channel/**/*.js' ]),
19 contact: bulk(__dirname, [ 'contact/**/*.js' ]),
20 message: bulk(__dirname, [ 'message/**/*.js' ]),
21 router: bulk(__dirname, [ 'router/**/*.js' ]),
22 styles: bulk(__dirname, [ 'styles/**/*.js' ]),
23 sbot: bulk(__dirname, [ 'sbot/**/*.js' ]),
24
25 config: require('./config'), // shouldn't be in here ?
26 contextMenu: require('patch-context'),
27 suggestions: require('patch-suggest'),
28 settings: require('patch-settings'),
29 drafts: require('patch-drafts'),
30 history: require('patch-history')
31 }
32}
33module.exports = patchbay
34
35// for electro[n]
36if (typeof window !== 'undefined') {
37 // TODO spin up settings check which modules are wanted
38 const plugins = [
39 require('patchbay-scry'),
40 require('patchbay-dark-crystal'),
41 require('patchbay-poll'),
42 require('patch-inbox'), // TODO needs work
43 require('ssb-chess-mithril'),
44 require('patchbay-book'),
45 require('patchbay-gatherings')
46 ]
47 const args = [ ...plugins, patchbay, patchcore ]
48 // plugings loaded first will over-ride core modules loaded later
49 const sockets = combine.apply(null, args)
50
51 const api = entry(sockets, nest('app.html.app', 'first'))
52 document.body.appendChild(api.app.html.app())
53}
54

Built with git-ssb-web