Skip to content

Commit

Permalink
Fix windows build issue, add vsconfig, add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pierr3 committed Jun 4, 2024
1 parent b76dc6a commit 5460bfc
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
electron_mirror=https://npmmirror.com/mirrors/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/
shamefully-hoist=true
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
out
dist
pnpm-lock.yaml
LICENSE.md
tsconfig.json
tsconfig.*.json
4 changes: 4 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint"]
}
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
},
"runtimeArgs": ["--sourcemap"],
"env": {
"REMOTE_DEBUGGING_PORT": "9222"
}
},
{
"name": "Debug Renderer Process",
"port": 9222,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}/src/renderer",
"timeout": 60000,
"presentation": {
"hidden": true
}
}
],
"compounds": [
{
"name": "Debug All",
"configurations": ["Debug Main Process", "Debug Renderer Process"],
"presentation": {
"order": 1
}
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
7 changes: 5 additions & 2 deletions backend/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "afv-native/atcClientWrapper.h"
#include "afv-native/event.h"
#include "afv-native/hardwareType.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include <absl/strings/ascii.h>
#include <absl/strings/match.h>
Expand Down Expand Up @@ -639,12 +640,13 @@ void CreateLoggers()
{
auto max_size = 1048576 * 5;
auto max_files = 3;
std::string fileName = std::string(FileSystem::GetStateFolderPath().string() + "trackaudio.log");
auto trackaudio_logger = spdlog::rotating_logger_mt("trackaudio_logger",
FileSystem::GetStateFolderPath() / "trackaudio.log", max_size, max_files);
fileName, max_size, max_files);

spdlog::set_default_logger(trackaudio_logger);
auto afv_logger = spdlog::rotating_logger_mt(
"afv_logger", FileSystem::GetStateFolderPath() / "trackaudio.log", max_size, max_files);
"afv_logger", fileName, max_size, max_files);

// NOLINTNEXTLINE this cannot be solved here but in afv
afv_native::api::setLogger(
Expand Down Expand Up @@ -739,6 +741,7 @@ Napi::Boolean Exit(const Napi::CallbackInfo& info)
MainThreadShared::inputHandler.reset();

mClient.reset();
spdlog::shutdown();

return Napi::Boolean::New(info.Env(), true);
}
Expand Down

0 comments on commit 5460bfc

Please sign in to comment.