From 3a947b414cb795e7dc2bbd8608c3f99154e20a2e Mon Sep 17 00:00:00 2001 From: OrigamingWasTaken <74014262+OrigamingWasTaken@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:14:28 +0200 Subject: [PATCH] Added Comments --- frontend/src/windows/main/ts/debugging.ts | 5 ++++- frontend/src/windows/main/ts/env.ts | 1 + frontend/src/windows/main/ts/notifications.ts | 1 + tsconfig.json | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/windows/main/ts/debugging.ts b/frontend/src/windows/main/ts/debugging.ts index b788e39..180b9d1 100644 --- a/frontend/src/windows/main/ts/debugging.ts +++ b/frontend/src/windows/main/ts/debugging.ts @@ -1,8 +1,10 @@ -import { filesystem, os } from "@neutralinojs/lib"; +// File with debugging functions +import { filesystem } from "@neutralinojs/lib"; import path from "path-browserify"; import { dataPath, loadSettings } from "./settings"; import { pathExists } from "./utils"; +/** Tries to format every variable to a string */ function formatConsoleLog(...args: any[]): string { return `[${new Date().toLocaleTimeString()}] ` + args .map((arg) => { @@ -42,6 +44,7 @@ function getCircularReplacer() { }; } +/** Appends a message to the log file */ async function appendLog(message: string) { try { const appleBloxDir = path.dirname(await dataPath()); diff --git a/frontend/src/windows/main/ts/env.ts b/frontend/src/windows/main/ts/env.ts index b7049a2..31b6d21 100644 --- a/frontend/src/windows/main/ts/env.ts +++ b/frontend/src/windows/main/ts/env.ts @@ -1,3 +1,4 @@ +/** Detects if the app is ran in dev mode or production */ export function getMode(): "dev" | "prod" { return import.meta.env.MODE === 'development' ? 'dev' : 'prod' } \ No newline at end of file diff --git a/frontend/src/windows/main/ts/notifications.ts b/frontend/src/windows/main/ts/notifications.ts index 137f1f9..7544d13 100644 --- a/frontend/src/windows/main/ts/notifications.ts +++ b/frontend/src/windows/main/ts/notifications.ts @@ -1,3 +1,4 @@ +// Handles notifications in the app using the alerter binary import { debug, events, os, window as w } from "@neutralinojs/lib" import { libraryPath } from "./lib.paths"; import { focusWindow } from "./window"; diff --git a/tsconfig.json b/tsconfig.json index 028fb0c..876f38a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { - "target": "ES2020", + "target": "ES2022", "useDefineForClassFields": true, - // "verbatimModuleSyntax": false, - "module": "ES2020", + "verbatimModuleSyntax": false, + "module": "CommonJS", "resolveJsonModule": true, "moduleResolution": "node", /**