-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Done all kinds of things.. Debugging for a couple hours mostly
- Loading branch information
1 parent
3251779
commit f2e0a7d
Showing
22 changed files
with
253 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
["next/babel", { | ||
"preset-env": { | ||
"targets": { | ||
"node": "current" // Ensures Babel is targeting the correct Node.js version for Electron | ||
} | ||
} | ||
}] | ||
] | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import path from 'path' | ||
import { app, ipcMain } from 'electron' | ||
import serve from 'electron-serve' | ||
import { createWindow } from './helpers' | ||
import Platform from '@greenlight/platform' | ||
import Logger from '@greenlight/logger' | ||
// const Platform = require('@greenlight/platform') | ||
const Logger2 = require('@greenlight/logger') | ||
import pkg from '../package.json' | ||
|
||
console.log('Fucking logger kanker shit:', Logger, Logger2.default) | ||
|
||
// export default class Application { | ||
|
||
// public isProduction: boolean = process.env.NODE_ENV === 'production' | ||
|
||
// private _platform:Platform | ||
// public logger:Logger = new Logger('GreenlightApp') | ||
|
||
// constructor() { | ||
// this.logger.log('constructor() Application booting... Greenlight App version', pkg.version) | ||
|
||
// if(this.isProduction === true){ | ||
// serve({ directory: 'app' }) | ||
// } else { | ||
// app.setPath('userData', `${app.getPath('userData')} (development)`) | ||
// } | ||
// } | ||
|
||
// async isReady() { | ||
// await app.whenReady() | ||
// } | ||
|
||
// loadPlatform(){ | ||
// return new Promise((resolve, reject) => { | ||
// // const Platform = require('@greenlight/platform'); | ||
// this._platform = new Platform() | ||
|
||
// this._platform.loadWorker('./app/worker.js').then((authenticated:boolean) => { | ||
// this.logger.log('loadPlatform() Platform loaded and authenticated') | ||
// resolve(authenticated) | ||
// }).catch((error:any) => { | ||
// this.logger.error('loadPlatform() Platform failed to load. Critical error: '+error) | ||
// reject(error) | ||
// }) | ||
// }) | ||
// } | ||
|
||
// async spawnMainWindow() { | ||
// const mainWindow = createWindow('main', { | ||
// width: 1280, | ||
// height: (this.isProduction) ? 800 : 1200, | ||
// title: 'Greenlight', | ||
// backgroundColor: 'rgb(26, 27, 30)', | ||
// webPreferences: { | ||
// preload: path.join(__dirname, 'preload.js'), | ||
// }, | ||
// }) | ||
|
||
// if (this.isProduction) { | ||
// await mainWindow.loadURL('app://./boot') | ||
// } else { | ||
// const port = process.argv[2] | ||
// await mainWindow.loadURL(`http://localhost:${port}/boot`) | ||
// mainWindow.webContents.openDevTools({ | ||
// mode: 'bottom' | ||
// }) | ||
// } | ||
// this.logger.log('spawnMainWindow() Main application windows drawn') | ||
|
||
|
||
// return mainWindow | ||
// } | ||
// } | ||
|
||
// const main = new Application() | ||
// ;(async () => { | ||
// await main.isReady() | ||
|
||
// await main.spawnMainWindow() | ||
// await main.loadPlatform() | ||
// })() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import worker from 'node:worker_threads' | ||
import GreenlightWorker from '@greenlight/platform/src/worker' | ||
import Logger from '@greenlight/logger' | ||
|
||
export default class Worker { | ||
private _platformWorker:GreenlightWorker | ||
public logger = new Logger('GreenlightWorker:main') | ||
|
||
constructor() { | ||
worker.parentPort?.once('message', (handler) => { | ||
try { | ||
this._platformWorker = new GreenlightWorker(this.logger, handler.port) | ||
this._platformWorker.once('ready', (result) => { | ||
if(result === true) | ||
worker.parentPort?.postMessage('ok'); | ||
else | ||
worker.parentPort?.postMessage('unauthenticated'); | ||
}) | ||
} catch (error) { | ||
worker.parentPort?.postMessage('error'); | ||
} | ||
}) | ||
} | ||
} | ||
|
||
new Worker() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
webpack: (config, env) => { | ||
config.entry.background = './main/main.ts' | ||
config.entry.worker = './main/worker.ts' | ||
config.entry.preload = './main/preload.ts' | ||
config.module.rules.push({ | ||
test: /\.node$/, | ||
loader: "node-loader", | ||
}) | ||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
import Head from 'next/head' | ||
import Link from 'next/link' | ||
import Image from 'next/image' | ||
|
||
export default function BootPage() { | ||
return ( | ||
<React.Fragment> | ||
<Head> | ||
<title>Greenlight - Loading...</title> | ||
</Head> | ||
<div className="grid grid-col-1 text-2xl w-full text-center"> | ||
Loading... | ||
</div> | ||
</React.Fragment> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ module.exports = { | |
}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], | ||
"exclude": ["node_modules"] | ||
"include": [ | ||
"next-env.d.ts", | ||
"**/*.ts", | ||
"**/*.tsx" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"incremental": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.