Initial migration to Tauri 2.0

- Updated package.json with project metadata and moves dependencies to devDependencies.
- Adds .editorconfig for consistent code style
- Updated VSCode and .NET project settings for improved development workflow.
This commit is contained in:
Tony Bark 2026-01-07 05:18:57 -05:00
parent 81799106f8
commit 2cd45c4a6c
13 changed files with 1243 additions and 664 deletions

12
.editorconfig Normal file
View file

@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = tab
# indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

20
.vscode/launch.json vendored
View file

@ -1,11 +1,11 @@
{ {
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch and Debug Standalone Blazor WebAssembly App", "name": "Launch and Debug Standalone Blazor WebAssembly App",
"type": "blazorwasm", "type": "blazorwasm",
"request": "launch", "request": "launch",
"cwd": "${workspaceFolder}/src" "cwd": "${workspaceFolder}/src"
} }
] ]
} }

116
.vscode/tasks.json vendored
View file

@ -1,61 +1,57 @@
{ {
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "dotnet build", "label": "dotnet build",
"command": "dotnet", "command": "dotnet",
"type": "process", "type": "process",
"args": [ "args": [
"build", "build",
"${workspaceFolder}/src/AmtrakStatus.csproj", "${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true", "/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign" "/consoleloggerparameters:NoSummary;ForceNoAlign"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
}, },
{ {
"label": "dotnet publish", "label": "dotnet publish",
"command": "dotnet", "command": "dotnet",
"type": "process", "type": "process",
"args": [ "args": [
"publish", "publish",
"${workspaceFolder}/src/AmtrakStatus.csproj", "${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true", "/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign" "/consoleloggerparameters:NoSummary;ForceNoAlign"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
}, },
{ {
"label": "dotnet watch", "label": "dotnet watch",
"command": "dotnet", "command": "dotnet",
"type": "process", "type": "process",
"args": [ "args": [
"watch", "watch",
"run", "run",
"--project", "--project",
"${workspaceFolder}/src/AmtrakStatus.csproj" "${workspaceFolder}/src/AmtrakStatus.csproj"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
}, },
{ {
"type": "cargo", "type": "cargo",
"command": "tauri", "command": "tauri",
"isBackground": true, "isBackground": true,
"args": [ "args": ["dev"],
"dev" "group": "build",
], "label": "tauri dev"
"group": "build", },
"label": "tauri dev" {
}, "type": "cargo",
{ "command": "tauri",
"type": "cargo", "isBackground": true,
"command": "tauri", "args": ["build"],
"isBackground": true, "group": "build",
"args": [ "label": "tauri build"
"build" }
], ]
"group": "build", }
"label": "tauri build"
}
]
}

View file

@ -1,4 +1,4 @@
<img title="" src="./assets/banner.svg" alt="" data-align="center" width="718"> <img title="" src="assets/banner.svg" alt="" data-align="center" width="718">
Amtrak Status Boards, or AMTK Status, is a desktop front-end for accessing Dixieland Software's [station status boards](https://dixielandsoftware.net/Amtrak/solari/). Amtrak Status Boards, or AMTK Status, is a desktop front-end for accessing Dixieland Software's [station status boards](https://dixielandsoftware.net/Amtrak/solari/).
@ -6,11 +6,11 @@ Amtrak Status Boards, or AMTK Status, is a desktop front-end for accessing Dixie
## 🗓️ Update Cycle ## 🗓️ Update Cycle
| Type | Frequency | | Type | Frequency |
| ------------ | -------------------- | | ----- | -------------------- |
| Minor Update | Every 36 months | | Minor | Every 36 months |
| Patch Update | Monthly or as needed | | Patch | Monthly or as needed |
| Major Update | As needed | | Major | As needed |
## 🖥️ Platform Support ## 🖥️ Platform Support

View file

@ -1,6 +1,13 @@
{ {
"dependencies": { "name": "amtkstat",
"@tauri-apps/cli": "^2.1.0", "private": true,
"@tauri-apps/plugin-shell": "~2" "version": "0.1.0",
} "type": "module",
} "scripts": {
"tauri": "tauri"
},
"devDependencies": {
"@tauri-apps/cli": "^2.1.0",
"@tauri-apps/plugin-shell": "~2"
}
}

1560
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,16 +7,19 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "entries_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies] [build-dependencies]
tauri-build = { version = "2", features = [] } tauri-build = { version = "2", features = [] }
[dependencies] [dependencies]
tauri = { version = "2", features = [] } tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
webbrowser = "1.0.2"
tauri-plugin-shell = "2"
[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]

33
src-tauri/src/lib.rs Normal file
View file

@ -0,0 +1,33 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
use webbrowser;
// use tauri::menu::MenuBuilder;
#[tauri::command]
fn open_browser(address: &str) {
webbrowser::open(address).expect("Failed to open defualt browser.");
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![open_browser])
.setup(|app| {
// TODO: Redo menu bar to return to home screen
/**
let menu = MenuBuilder::new(app)
.text("open", "Open")
.text("close", "Close")
.check("check_item", "Check Item")
.separator()
.text("disabled_item", "Disabled Item")
.text("status", "Status: Processing...")
.build()?;
app.set_menu(menu.clone())?;
**/
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View file

@ -1,16 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!! // Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use webbrowser;
#[tauri::command]
fn open_browser(address: &str) {
webbrowser::open(address).expect("Failed to open defualt browser.");
}
fn main() { fn main() {
tauri::Builder::default() entries_lib::run()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![open_browser])
.run(tauri::generate_context!())
.expect("error while running tauri application");
} }

View file

@ -1,42 +1,42 @@
{ {
"build": { "build": {
"beforeDevCommand": "dotnet watch run --project src/AmtrakStatus.csproj", "beforeDevCommand": "dotnet watch run --project src/AmtrakStatus.csproj",
"beforeBuildCommand": "dotnet publish -c release src/AmtrakStatus.csproj -o dist", "beforeBuildCommand": "dotnet publish -c release src/AmtrakStatus.csproj -o dist",
"frontendDist": "../dist/wwwroot", "frontendDist": "../dist/wwwroot",
"devUrl": "http://localhost:1420" "devUrl": "http://localhost:1420"
}, },
"bundle": { "bundle": {
"active": true, "active": true,
"targets": "all", "targets": "all",
"icon": [ "icon": [
"icons/32x32.png", "icons/32x32.png",
"icons/128x128.png", "icons/128x128.png",
"icons/128x128@2x.png", "icons/128x128@2x.png",
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ]
}, },
"productName": "AMTK Status", "productName": "AMTK Status",
"mainBinaryName": "AMTK Status", "mainBinaryName": "AMTK Status",
"version": "0.1.106", "version": "0.1.106",
"identifier": "com.tonybark.amtkstat", "identifier": "com.tonybark.amtkstat",
"plugins": {}, "plugins": {},
"app": { "app": {
"withGlobalTauri": true, "withGlobalTauri": true,
"windows": [ "windows": [
{ {
"title": "Amtrak Status", "title": "Amtrak Status",
"resizable": true, "resizable": true,
"width": 1100, "width": 1100,
"height": 768, "height": 768,
"minWidth": 1100, "minWidth": 1100,
"minHeight": 768, "minHeight": 768,
"maxWidth": 1450, "maxWidth": 1450,
"maxHeight": 950 "maxHeight": 950
} }
], ],
"security": { "security": {
"csp": null "csp": null
} }
} }
} }

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>

View file

@ -10,4 +10,4 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddFluentUIComponents(); builder.Services.AddFluentUIComponents();
await builder.Build().RunAsync(); await builder.Build().RunAsync();

View file

@ -1,15 +1,15 @@
{ {
"$schema": "https://json.schemastore.org/launchsettings.json", "$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": { "profiles": {
"http": { "http": {
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:1420", "applicationUrl": "http://localhost:1420",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
} }
} }
} }