refactor: 重命名库并统一术语使用

- 将库名称从 `tauri_demo_lib` 更改为 `tauri_shell_lib` 以确保名称唯一性并避免潜在冲突。
- 更新注释以统一使用“Sidecar”术语,明确标识进程启动与清理操作
- 将主函数中的库调用从 tauri_demo_lib 更改为 tauri_shell_lib。
This commit is contained in:
2026-01-16 23:09:52 +08:00
parent d2a70b5a26
commit f257650c44
3 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ edition = "2021"
# 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 = "tauri_demo_lib"
name = "tauri_shell_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]

View File

@@ -15,7 +15,7 @@ pub fn run() {
// 注册全局状态
app.manage(SidecarProcess(std::sync::Mutex::new(None)));
// 启动 Sidecar Server 进程
// 启动 Sidecar 进程
let app_handle = app.handle().clone();
sidecar::spawn_sidecar(app_handle);
@@ -25,7 +25,7 @@ pub fn run() {
.build(tauri::generate_context!())
.expect("error while building tauri application")
.run(|app_handle, event| {
// 监听应用退出事件,清理 Sidecar Server 进程
// 监听应用退出事件,清理 Sidecar 进程
match event {
tauri::RunEvent::ExitRequested { .. } | tauri::RunEvent::Exit => {
sidecar::cleanup_sidecar_process(app_handle);

View File

@@ -2,5 +2,5 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri_demo_lib::run()
tauri_shell_lib::run()
}