Skip to content

Commit

Permalink
SUKU prettier run
Browse files Browse the repository at this point in the history
  • Loading branch information
SukuWc committed Apr 21, 2023
1 parent 0410f36 commit 5f934a9
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"printWidth": 80
"printWidth": 80
}
34 changes: 17 additions & 17 deletions electron.vite.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import preprocess from 'svelte-preprocess';
import path, { resolve } from 'path';
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import preprocess from "svelte-preprocess";
import path, { resolve } from "path";
import monacoEditorPlugin from "vite-plugin-monaco-editor";

export default defineConfig({
main: {
Expand All @@ -16,11 +16,11 @@ export default defineConfig({
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'src/electron/main.ts'),
}
index: resolve(__dirname, "src/electron/main.ts"),
},
},
outDir: 'dist/main',
}
outDir: "dist/main",
},
},
preload: {
plugins: [externalizeDepsPlugin()],
Expand All @@ -42,25 +42,25 @@ export default defineConfig({
preprocess: [
preprocess({
postcss: true,
})
]
}),
],
}),
monacoEditorPlugin([])
monacoEditorPlugin([]),
],
publicDir: 'assets', // needed, to copy assets to dist during build
publicDir: "assets", // needed, to copy assets to dist during build
build: {
rollupOptions: {
input: {
index: resolve(__dirname, "src/renderer/index.html"),
},
},
outDir: '../../dist/renderer'
outDir: "../../dist/renderer",
},
resolve: {
alias: {
'$lib': path.resolve('src/renderer/lib'),
$lib: path.resolve("src/renderer/lib"),
},
},
target: 'chrome104'
}
target: "chrome104",
},
});
26 changes: 12 additions & 14 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,23 +510,21 @@ ipcMain.on("get-env", (event) => {
event.returnValue = variables;
});

ipcMain.on('get-app-path', (event) => {
event.returnValue = app.getAppPath()
})

ipcMain.on('analytics_uuid', (event) => {
event.returnValue = store.get('userId')
})

ipcMain.on('app_version', (event) => {
event.returnValue = app.getVersion()
})
ipcMain.on("get-app-path", (event) => {
event.returnValue = app.getAppPath();
});

ipcMain.on('resetAppSettings', (event, arg) => {
log.info('Clear app settings...')
store.clear()
ipcMain.on("analytics_uuid", (event) => {
event.returnValue = store.get("userId");
});

ipcMain.on("app_version", (event) => {
event.returnValue = app.getVersion();
});

ipcMain.on("resetAppSettings", (event, arg) => {
log.info("Clear app settings...");
store.clear();

if (process.env.APPIMAGE) {
let options;
Expand Down
4 changes: 2 additions & 2 deletions src/electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ contextBridge.exposeInMainWorld("ctxProcess", {
// we can also expose variables, not just functions
});

contextBridge.exposeInMainWorld('electron', {
appPath: () => ipcRenderer.sendSync('get-app-path'),
contextBridge.exposeInMainWorld("electron", {
appPath: () => ipcRenderer.sendSync("get-app-path"),
auth: {
onExternalResponse: (callback) =>
ipcRenderer.on("onExternalAuthResponse", callback),
Expand Down
104 changes: 48 additions & 56 deletions src/renderer/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@

@font-face {
font-family: "GT Pressura Pro M Trial";
src: url("/fonts/GT-Pressura-Pro-Mono-Trial-Light.otf") format("opentype"), ;
src: url("/fonts/GT-Pressura-Pro-Mono-Trial-Light.otf") format("opentype");
}

@font-face {
font-family: "Aldo-SemiBold";
src: url("/fonts/AldoPC.eot");
/* IE9 Compat Modes */
src: url("/fonts/AldoPC.eot?#iefix") format("embedded-opentype"),
/* IE6-IE8 */
url("/fonts/AldoPC.otf") format("opentype"),
/* Open Type Font */
url("/fonts/AldoPC.svg") format("svg"),
/* Legacy iOS */
url("/fonts/AldoPC.ttf") format("truetype"),
/* Safari, Android, iOS */
url("/fonts/AldoPC.woff") format("woff"),
/* Modern Browsers */
url("/fonts/AldoPC.woff2") format("woff2");
/* IE6-IE8 */ url("/fonts/AldoPC.otf") format("opentype"),
/* Open Type Font */ url("/fonts/AldoPC.svg") format("svg"),
/* Legacy iOS */ url("/fonts/AldoPC.ttf") format("truetype"),
/* Safari, Android, iOS */ url("/fonts/AldoPC.woff") format("woff"),
/* Modern Browsers */ url("/fonts/AldoPC.woff2") format("woff2");
/* Modern Browsers */
font-weight: normal;
font-style: normal;
Expand All @@ -31,18 +26,17 @@
font-family: "Roboto";
font-style: normal;
font-weight: 300;
src: url('/fonts/roboto-v20-latin-300.eot');
src: url("/fonts/roboto-v20-latin-300.eot");
/* IE9 Compat Modes */
src: local('Roboto Light'), local('Roboto-Light'),
url('/fonts/roboto-v20-latin-300.eot?#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('/fonts/roboto-v20-latin-300.woff2') format('woff2'),
/* Super Modern Browsers */
url('/fonts/roboto-v20-latin-300.woff') format('woff'),
/* Modern Browsers */
url('/fonts/roboto-v20-latin-300.ttf') format('truetype'),
/* Safari, Android, iOS */
url('/fonts/roboto-v20-latin-300.svg#Roboto') format('svg');
src: local("Roboto Light"), local("Roboto-Light"),
url("/fonts/roboto-v20-latin-300.eot?#iefix") format("embedded-opentype"),
/* IE6-IE8 */ url("/fonts/roboto-v20-latin-300.woff2") format("woff2"),
/* Super Modern Browsers */ url("/fonts/roboto-v20-latin-300.woff")
format("woff"),
/* Modern Browsers */ url("/fonts/roboto-v20-latin-300.ttf")
format("truetype"),
/* Safari, Android, iOS */ url("/fonts/roboto-v20-latin-300.svg#Roboto")
format("svg");
/* Legacy iOS */
}

Expand All @@ -51,18 +45,18 @@
font-family: "Roboto";
font-style: normal;
font-weight: 400;
src: url('/fonts/roboto-v20-latin-regular.eot');
src: url("/fonts/roboto-v20-latin-regular.eot");
/* IE9 Compat Modes */
src: local('Roboto'), local('Roboto-Regular'),
url('/fonts/roboto-v20-latin-regular.eot?#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('/fonts/roboto-v20-latin-regular.woff2') format('woff2'),
/* Super Modern Browsers */
url('/fonts/roboto-v20-latin-regular.woff') format('woff'),
/* Modern Browsers */
url('/fonts/roboto-v20-latin-regular.ttf') format('truetype'),
/* Safari, Android, iOS */
url('/fonts/roboto-v20-latin-regular.svg#Roboto') format('svg');
src: local("Roboto"), local("Roboto-Regular"),
url("/fonts/roboto-v20-latin-regular.eot?#iefix")
format("embedded-opentype"),
/* IE6-IE8 */ url("/fonts/roboto-v20-latin-regular.woff2") format("woff2"),
/* Super Modern Browsers */ url("/fonts/roboto-v20-latin-regular.woff")
format("woff"),
/* Modern Browsers */ url("/fonts/roboto-v20-latin-regular.ttf")
format("truetype"),
/* Safari, Android, iOS */ url("/fonts/roboto-v20-latin-regular.svg#Roboto")
format("svg");
/* Legacy iOS */
}

Expand All @@ -71,18 +65,17 @@
font-family: "Roboto";
font-style: normal;
font-weight: 500;
src: url('/fonts/roboto-v20-latin-500.eot');
src: url("/fonts/roboto-v20-latin-500.eot");
/* IE9 Compat Modes */
src: local('Roboto Medium'), local('Roboto-Medium'),
url('/fonts/roboto-v20-latin-500.eot?#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('/fonts/roboto-v20-latin-500.woff2') format('woff2'),
/* Super Modern Browsers */
url('/fonts/roboto-v20-latin-500.woff') format('woff'),
/* Modern Browsers */
url('/fonts/roboto-v20-latin-500.ttf') format('truetype'),
/* Safari, Android, iOS */
url('/fonts/roboto-v20-latin-500.svg#Roboto') format('svg');
src: local("Roboto Medium"), local("Roboto-Medium"),
url("/fonts/roboto-v20-latin-500.eot?#iefix") format("embedded-opentype"),
/* IE6-IE8 */ url("/fonts/roboto-v20-latin-500.woff2") format("woff2"),
/* Super Modern Browsers */ url("/fonts/roboto-v20-latin-500.woff")
format("woff"),
/* Modern Browsers */ url("/fonts/roboto-v20-latin-500.ttf")
format("truetype"),
/* Safari, Android, iOS */ url("/fonts/roboto-v20-latin-500.svg#Roboto")
format("svg");
/* Legacy iOS */
}

Expand All @@ -91,18 +84,17 @@
font-family: "Roboto";
font-style: normal;
font-weight: 700;
src: url('/fonts/roboto-v20-latin-700.eot');
src: url("/fonts/roboto-v20-latin-700.eot");
/* IE9 Compat Modes */
src: local('Roboto Bold'), local('Roboto-Bold'),
url('/fonts/roboto-v20-latin-700.eot?#iefix') format('embedded-opentype'),
/* IE6-IE8 */
url('/fonts/roboto-v20-latin-700.woff2') format('woff2'),
/* Super Modern Browsers */
url('/fonts/roboto-v20-latin-700.woff') format('woff'),
/* Modern Browsers */
url('/fonts/roboto-v20-latin-700.ttf') format('truetype'),
/* Safari, Android, iOS */
url('/fonts/roboto-v20-latin-700.svg#Roboto') format('svg');
src: local("Roboto Bold"), local("Roboto-Bold"),
url("/fonts/roboto-v20-latin-700.eot?#iefix") format("embedded-opentype"),
/* IE6-IE8 */ url("/fonts/roboto-v20-latin-700.woff2") format("woff2"),
/* Super Modern Browsers */ url("/fonts/roboto-v20-latin-700.woff")
format("woff"),
/* Modern Browsers */ url("/fonts/roboto-v20-latin-700.ttf")
format("truetype"),
/* Safari, Android, iOS */ url("/fonts/roboto-v20-latin-700.svg#Roboto")
format("svg");
/* Legacy iOS */
}

Expand All @@ -117,4 +109,4 @@ body {
@apply flex flex-col bg-secondary font-roboto p-0 m-0 h-screen;
}

@tailwind utilities;
@tailwind utilities;
65 changes: 31 additions & 34 deletions src/renderer/serialport/serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,26 @@ let lineBuffer = "";
let latestValue = 0;

// INITIALIZE THE INTERVAL
console.log("Initialize Discovery Interval! ENABLE debugging through navigator.debugSerial = true");
window.electron.serial.restartSerialCheckInterval()

console.log(
"Initialize Discovery Interval! ENABLE debugging through navigator.debugSerial = true"
);
window.electron.serial.restartSerialCheckInterval();

navigator.serial.addEventListener("disconnect", (e) => {
if (navigator.debugSerial) console.log("Any Device Disconnect", e, navigator.intechPort);
if (navigator.debugSerial) console.log("Restart Discovery Interval");

window.electron.serial.restartSerialCheckInterval()
if (navigator.debugSerial)
console.log("Any Device Disconnect", e, navigator.intechPort);
if (navigator.debugSerial) console.log("Restart Discovery Interval");

window.electron.serial.restartSerialCheckInterval();
});
navigator.serial.addEventListener("connect", (e) => {
if (navigator.debugSerial) console.log("Any Device Connect", e, navigator.intechPort);
if (navigator.debugSerial) console.log("Restart Discovery Interval");
window.electron.serial.restartSerialCheckInterval()
if (navigator.debugSerial)
console.log("Any Device Connect", e, navigator.intechPort);
if (navigator.debugSerial) console.log("Restart Discovery Interval");
window.electron.serial.restartSerialCheckInterval();
});

export async function testIt() {


if (navigator.debugSerial) console.log("Serial Try Connect");

const env = window.ctxProcess.env();
Expand Down Expand Up @@ -70,32 +71,28 @@ export async function testIt() {

fetchStream();

navigator.intechPort = port

port.addEventListener("disconnect", (e) => {
if (navigator.debugSerial) console.log("The Real Disconnect", e);
navigator.intechPort = undefined;
});


fetchStream()
navigator.intechPort = port;

// port.readable
// .pipeThrough(new TextDecoderStream())
// .pipeTo(appendStream);
port.addEventListener("disconnect", (e) => {
if (navigator.debugSerial) console.log("The Real Disconnect", e);
navigator.intechPort = undefined;
});

fetchStream();

}).catch(error => {
if (navigator.debugSerial) console.log("Error on Open: ", error);
// port.readable
// .pipeThrough(new TextDecoderStream())
// .pipeTo(appendStream);
})
.catch((error) => {
if (navigator.debugSerial) console.log("Error on Open: ", error);
});
})
.catch((error) => {
//no port selected by the user
//console.log(error)
if (navigator.debugSerial) console.log("Error on Request: ", error);
});


}).catch(error => {
//no port selected by the user
//console.log(error)
if (navigator.debugSerial) console.log("Error on Request: ", error);
});

}

return false;
Expand Down

0 comments on commit 5f934a9

Please sign in to comment.