git ssb

16+

Dominic / patchbay



Tree: 03ce3474ce130d4761d364412f79db838997ddb9

Files: 03ce3474ce130d4761d364412f79db838997ddb9 / main.js

1938 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 suggestions: require('patch-suggest'),
28 settings: require('patch-settings'),
29 drafts: require('patch-drafts'),
30 history: require('patch-history')
31 }
32}
33
34const plugins = {
35 scry: require('patchbay-scry'),
36 darkCrystal: require('patchbay-dark-crystal'),
37 poll: require('patchbay-poll'),
38 // hackyArt: require('patchbay-hacky-art'), // TODO rework this to be in alignment with values
39 inbox: require('patch-inbox'), // TODO needs work
40 chess: require('ssb-chess-mithril'),
41 book: require('patchbay-book'),
42 gatherings: require('patchbay-gatherings')
43}
44
45module.exports = {
46 plugins,
47 patchbay,
48 patchcore
49}
50
51// for electro[n]
52if (typeof window !== 'undefined' && !module.parent.parent) {
53 // TODO spin up settings check which modules are wanted
54 const args = [ ...values(plugins), patchbay, patchcore ]
55 // plugings loaded first will over-ride core modules loaded later
56 const sockets = combine.apply(null, args)
57
58 const api = entry(sockets, nest('app.html.app', 'first'))
59 document.body.appendChild(api.app.html.app())
60}
61

Built with git-ssb-web