git ssb

16+

Dominic / patchbay



Tree: 46869ffe4f40685e2fc3bfc01a8d84496403e4af

Files: 46869ffe4f40685e2fc3bfc01a8d84496403e4af / main.js

1981 bytesRaw
1const combine = require('depject')
2const entry = require('depject/entry')
3const nest = require('depnest')
4const bulk = require('bulk-require')
5const values = require('lodash/values')
6
7// polyfills
8require('setimmediate')
9
10const patchcore = require('patchcore')
11delete patchcore.patchcore.message.html.action.reply
12// prune an action we don't want
13
14const patchbay = {
15 patchbay: {
16 about: bulk(__dirname, [ 'about/**/*.js' ]),
17 app: bulk(__dirname, [ 'app/**/*.js' ]),
18 blob: bulk(__dirname, [ 'blob/**/*.js' ]),
19 channel: bulk(__dirname, [ 'channel/**/*.js' ]),
20 contact: bulk(__dirname, [ 'contact/**/*.js' ]),
21 message: bulk(__dirname, [ 'message/**/*.js' ]),
22 router: bulk(__dirname, [ 'router/**/*.js' ]),
23 styles: bulk(__dirname, [ 'styles/**/*.js' ]),
24 sbot: bulk(__dirname, [ 'sbot/**/*.js' ]),
25
26 config: require('./config'), // shouldn't be in here ?
27 contextMenu: require('patch-context'),
28 suggestions: require('patch-suggest'),
29 settings: require('patch-settings'),
30 drafts: require('patch-drafts'),
31 history: require('patch-history')
32 }
33}
34
35const plugins = {
36 scry: require('patchbay-scry'),
37 darkCrystal: require('patchbay-dark-crystal'),
38 poll: require('patchbay-poll'),
39 // hackyArt: require('patchbay-hacky-art'), // TODO rework this to be in alignment with values
40 inbox: require('patch-inbox'), // TODO needs work
41 chess: require('ssb-chess-mithril'),
42 book: require('patchbay-book'),
43 gatherings: require('patchbay-gatherings')
44}
45
46module.exports = {
47 plugins,
48 patchbay,
49 patchcore
50}
51
52// for electro[n]
53if (typeof window !== 'undefined' && !module.parent.parent) {
54 // TODO spin up settings check which modules are wanted
55 const args = [ ...values(plugins), patchbay, patchcore ]
56 // plugings loaded first will over-ride core modules loaded later
57 const sockets = combine.apply(null, args)
58
59 const api = entry(sockets, nest('app.html.app', 'first'))
60 document.body.appendChild(api.app.html.app())
61}
62

Built with git-ssb-web