feat: basic electron

This commit is contained in:
cha0s 2022-04-02 13:09:03 -05:00
parent a995985bb8
commit ab9d9aa96e
5 changed files with 26 additions and 2 deletions

View File

@ -44,6 +44,13 @@
'@flecks/db/server':
port: 32362
'@flecks/docker': {}
'@flecks/electron/server':
browserWindowOptions:
backgroundColor: '#212121'
show: false
window:
- '@persea/core'
- '...'
'@flecks/governor': {}
'@flecks/web': {}
'@flecks/web/client':
@ -115,6 +122,7 @@
- '...'
- '@persea/bootstrap'
- '@flecks/web'
- '@flecks/electron'
- '@flecks/repl'
'@flecks/socket': {}
'@flecks/socket/server':

View File

@ -4,7 +4,7 @@
<base href="/" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title><%= htmlWebpackPlugin.options.title %></title>
<title>Persea</title>
<style>
html {
background-color: #212121;

View File

@ -4,6 +4,7 @@
"type": "git",
"url": "https://git.hq.cha0s.io/cha0s/persea.git"
},
"main": "index.js",
"version": "4.0.0",
"private": true,
"scripts": {
@ -37,6 +38,7 @@
"@flecks/core": "^1.4.1",
"@flecks/create-app": "^1.4.1",
"@flecks/db": "^1.4.1",
"@flecks/electron": "^1.4.1",
"@flecks/governor": "^1.4.1",
"@flecks/react": "^1.4.1",
"@flecks/redis": "^1.4.1",

View File

@ -14,12 +14,26 @@ export default {
flecks.set('$persea/core.replacements', []);
startFlush(flecks);
},
'@flecks/core.webpack': (target, config) => {
if ('web' === target) {
// eslint-disable-next-line no-param-reassign
config.devServer.writeToDisk = true;
}
},
'@flecks/db/server.models': Flecks.provide(require.context('./models', false, /\.js$/)),
'@flecks/db/server.models.decorate': (
Flecks.decorate(require.context('./models/decorators', false, /\.js$/))
),
'@flecks/electron/server.window': async (win) => {
win.removeMenu();
win.maximize();
win.once('ready-to-show', () => {
win.show();
});
},
'@flecks/web/server.request.socket': () => (req, res, next) => {
if (req.url.startsWith('/projects')) {
req.url = req.url.slice(9);
resources(req, res, next);
return;
}

View File

@ -100,7 +100,7 @@ const Organization = ({
label={label}
nodes={nodesFromResourcePaths(label, uuid, resourcePaths)}
renderLabel={({label, nodes, value}) => {
const {displayName} = flecks
const {displayName = 'Binary'} = flecks
.get('$avocado/resource/persea.controllers')
.find(({matcher}) => value.match(matcher))
.Component;