refactor: 改为单包结构,库和命令行放在 src

This commit is contained in:
2026-11-19 11:47:25 +08:00
parent b948f7a5d3
commit c932e8d318
15 changed files with 19 additions and 45 deletions
Generated
-8
View File
@@ -849,14 +849,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "punchlog-cli"
version = "0.1.0"
dependencies = [
"chrono",
"punchlog",
]
[[package]]
name = "quinn"
version = "0.11.12"
+18 -4
View File
@@ -1,4 +1,18 @@
[workspace]
resolver = "2"
members = ["crates/punchlog", "crates/punchlog-cli"]
default-members = ["crates/punchlog-cli"]
[package]
name = "punchlog"
version = "0.1.0"
edition = "2021"
description = "iCenter 打卡登录、记录拉取与缺卡统计"
publish = false
[dependencies]
aes-gcm = "0.10"
base64 = "0.22"
chrono = "0.4"
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
rsa = { version = "0.9", features = ["sha2", "pem"] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
sha2 = "0.10"
thiserror = "2"
+1 -1
View File
@@ -1,6 +1,6 @@
# PunchLog
个人打卡记录。核心逻辑在 `crates/punchlog`,命令行只负责打印最近一周。
个人打卡记录。核心逻辑在 `src` 库里,`src/main.rs` 只负责打印最近一周。
```powershell
cargo run
-14
View File
@@ -1,14 +0,0 @@
[package]
name = "punchlog-cli"
version = "0.1.0"
edition = "2021"
description = "输出最近一周打卡记录"
publish = false
[[bin]]
name = "punchlog"
path = "src/main.rs"
[dependencies]
chrono = "0.4"
punchlog = { path = "../punchlog" }
-18
View File
@@ -1,18 +0,0 @@
[package]
name = "punchlog"
version = "0.1.0"
edition = "2021"
description = "iCenter 打卡登录、记录拉取与缺卡统计"
publish = false
[dependencies]
aes-gcm = "0.10"
base64 = "0.22"
chrono = "0.4"
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
rsa = { version = "0.9", features = ["sha2", "pem"] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
sha2 = "0.10"
thiserror = "2"