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

18
.vscode/launch.json vendored
View file

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

114
.vscode/tasks.json vendored
View file

@ -1,61 +1,57 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "dotnet build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/AmtrakStatus.csproj"
],
"problemMatcher": "$msCompile"
},
{
"type": "cargo",
"command": "tauri",
"isBackground": true,
"args": [
"dev"
],
"group": "build",
"label": "tauri dev"
},
{
"type": "cargo",
"command": "tauri",
"isBackground": true,
"args": [
"build"
],
"group": "build",
"label": "tauri build"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "dotnet build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/AmtrakStatus.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "dotnet watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/AmtrakStatus.csproj"
],
"problemMatcher": "$msCompile"
},
{
"type": "cargo",
"command": "tauri",
"isBackground": true,
"args": ["dev"],
"group": "build",
"label": "tauri dev"
},
{
"type": "cargo",
"command": "tauri",
"isBackground": true,
"args": ["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/).
@ -6,11 +6,11 @@ Amtrak Status Boards, or AMTK Status, is a desktop front-end for accessing Dixie
## 🗓️ Update Cycle
| Type | Frequency |
| ------------ | -------------------- |
| Minor Update | Every 36 months |
| Patch Update | Monthly or as needed |
| Major Update | As needed |
| Type | Frequency |
| ----- | -------------------- |
| Minor | Every 36 months |
| Patch | Monthly or as needed |
| Major | As needed |
## 🖥️ Platform Support

View file

@ -1,6 +1,13 @@
{
"dependencies": {
"@tauri-apps/cli": "^2.1.0",
"@tauri-apps/plugin-shell": "~2"
}
"name": "amtkstat",
"private": true,
"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
[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]
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
serde = { version = "1", features = ["derive"] }
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!!
#![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() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![open_browser])
.run(tauri::generate_context!())
.expect("error while running tauri application");
entries_lib::run()
}

View file

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

View file

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

View file

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