chore: clean up codebase (#186)

* refactor app state

* clean up

* clean up

* .
This commit is contained in:
reya
2025-10-18 09:46:45 +07:00
committed by GitHub
parent 32a0401907
commit a1e0934fc3
37 changed files with 516 additions and 1716 deletions

194
Cargo.lock generated
View File

@@ -82,21 +82,6 @@ version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "app_state"
version = "0.2.11"
dependencies = [
"anyhow",
"dirs 5.0.1",
"flume",
"log",
"nostr-lmdb",
"nostr-sdk",
"rustls",
"smol",
"whoami",
]
[[package]]
name = "arbitrary"
version = "1.4.2"
@@ -507,7 +492,6 @@ name = "auto_update"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"cargo-packager-updater",
"common",
"gpui",
@@ -515,6 +499,7 @@ dependencies = [
"nostr-sdk",
"smallvec",
"smol",
"states",
]
[[package]]
@@ -1094,11 +1079,11 @@ name = "client_keys"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"gpui",
"log",
"nostr-sdk",
"smallvec",
"states",
]
[[package]]
@@ -1128,14 +1113,14 @@ dependencies = [
[[package]]
name = "cocoa"
version = "0.26.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad36507aeb7e16159dfe68db81ccc27571c3ccd4b76fb2fb72fc59e7a4b1b64c"
checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2"
dependencies = [
"bitflags 2.9.4",
"block",
"cocoa-foundation 0.2.1",
"core-foundation 0.10.1",
"cocoa-foundation 0.2.0",
"core-foundation 0.10.0",
"core-graphics 0.24.0",
"foreign-types 0.5.0",
"libc",
@@ -1158,14 +1143,15 @@ dependencies = [
[[package]]
name = "cocoa-foundation"
version = "0.2.1"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81411967c50ee9a1fc11365f8c585f863a22a9697c89239c452292c40ba79b0d"
checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d"
dependencies = [
"bitflags 2.9.4",
"block",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-graphics-types 0.2.0",
"libc",
"objc",
]
@@ -1183,11 +1169,10 @@ dependencies = [
[[package]]
name = "collections"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"indexmap",
"rustc-hash 2.1.1",
"workspace-hack",
]
[[package]]
@@ -1221,7 +1206,6 @@ name = "common"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"chrono",
"futures",
"gpui",
@@ -1234,6 +1218,7 @@ dependencies = [
"reqwest",
"smallvec",
"smol",
"states",
"webbrowser",
]
@@ -1295,7 +1280,6 @@ name = "coop"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"assets",
"auto_update",
"client_keys",
@@ -1319,9 +1303,9 @@ dependencies = [
"serde",
"serde_json",
"settings",
"signer_proxy",
"smallvec",
"smol",
"states",
"theme",
"title_bar",
"tracing-subscriber",
@@ -1341,9 +1325,9 @@ dependencies = [
[[package]]
name = "core-foundation"
version = "0.10.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63"
dependencies = [
"core-foundation-sys",
"libc",
@@ -1375,7 +1359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
dependencies = [
"bitflags 2.9.4",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-graphics-types 0.2.0",
"foreign-types 0.5.0",
"libc",
@@ -1412,7 +1396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
dependencies = [
"bitflags 2.9.4",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"libc",
]
@@ -1425,7 +1409,7 @@ dependencies = [
"bitflags 2.9.4",
"block",
"cfg-if",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"libc",
]
@@ -1435,7 +1419,7 @@ version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a593227b66cbd4007b2a050dfdd9e1d1318311409c8d600dc82ba1b15ca9c130"
dependencies = [
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-graphics 0.24.0",
"foreign-types 0.5.0",
"libc",
@@ -1448,7 +1432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d45e71d5be22206bed53c3c3cb99315fc4c3d31b8963808c6bc4538168c4f8ef"
dependencies = [
"block",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-graphics2",
"io-surface",
"libc",
@@ -1625,12 +1609,11 @@ dependencies = [
[[package]]
name = "derive_refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.106",
"workspace-hack",
]
[[package]]
@@ -2003,9 +1986,9 @@ dependencies = [
[[package]]
name = "file-locker"
version = "1.1.3"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6c3e69656680c6c3d76750b46dfa64bf07626bd2130c540d6cf2d306ba595a8"
checksum = "75ae8b5984a4863d8a32109a848d038bd6d914f20f010cc141375f7a183c41cf"
dependencies = [
"nix 0.29.0",
]
@@ -2523,7 +2506,7 @@ dependencies = [
[[package]]
name = "gpui"
version = "0.2.1"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"as-raw-xcb-connection",
@@ -2538,9 +2521,10 @@ dependencies = [
"calloop",
"calloop-wayland-source",
"cbindgen",
"cocoa 0.26.1",
"cocoa 0.26.0",
"cocoa-foundation 0.2.0",
"collections",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-foundation-sys",
"core-graphics 0.24.0",
"core-text",
@@ -2572,6 +2556,7 @@ dependencies = [
"parking",
"parking_lot",
"pathfinder_geometry",
"pin-project",
"postage",
"profiling",
"rand 0.9.2",
@@ -2605,7 +2590,6 @@ dependencies = [
"windows-core 0.61.2",
"windows-numerics",
"windows-registry 0.5.3",
"workspace-hack",
"x11-clipboard",
"x11rb",
"xkbcommon",
@@ -2617,25 +2601,23 @@ dependencies = [
[[package]]
name = "gpui_macros"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.106",
"workspace-hack",
]
[[package]]
name = "gpui_tokio"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"gpui",
"tokio",
"util",
"workspace-hack",
]
[[package]]
@@ -2859,7 +2841,7 @@ dependencies = [
[[package]]
name = "http_client"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"async-compression",
@@ -2878,18 +2860,16 @@ dependencies = [
"tempfile",
"url",
"util",
"workspace-hack",
"zed-reqwest",
]
[[package]]
name = "http_client_tls"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"rustls",
"rustls-platform-verifier",
"workspace-hack",
]
[[package]]
@@ -2898,12 +2878,6 @@ version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "httpdate"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
version = "1.7.0"
@@ -2918,7 +2892,6 @@ dependencies = [
"http",
"http-body",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
"pin-utils",
@@ -3188,9 +3161,9 @@ checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8"
[[package]]
name = "indexmap"
version = "2.11.4"
version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
dependencies = [
"equivalent",
"hashbrown 0.16.0",
@@ -3256,7 +3229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "554b8c5d64ec09a3a520fe58e4d48a73e00ff32899cdcbe32a4877afd4968b8e"
dependencies = [
"cgl",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-foundation-sys",
"leaky-cow",
]
@@ -3687,17 +3660,16 @@ dependencies = [
[[package]]
name = "media"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"bindgen 0.71.1",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-video",
"ctor 0.4.3",
"foreign-types 0.5.0",
"metal",
"objc",
"workspace-hack",
]
[[package]]
@@ -3794,13 +3766,13 @@ checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff"
[[package]]
name = "mio"
version = "1.0.4"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873"
dependencies = [
"libc",
"wasi",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -4521,12 +4493,11 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "perf"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"collections",
"serde",
"serde_json",
"workspace-hack",
]
[[package]]
@@ -5138,10 +5109,9 @@ dependencies = [
[[package]]
name = "refineable"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"derive_refineable",
"workspace-hack",
]
[[package]]
@@ -5178,17 +5148,20 @@ name = "registry"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"common",
"flume",
"fuzzy-matcher",
"gpui",
"itertools 0.13.0",
"log",
"nostr",
"nostr-lmdb",
"nostr-sdk",
"rustls",
"settings",
"smallvec",
"smol",
"states",
]
[[package]]
@@ -5243,7 +5216,7 @@ dependencies = [
[[package]]
name = "reqwest_client"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"bytes",
@@ -5254,7 +5227,6 @@ dependencies = [
"regex",
"serde",
"tokio",
"workspace-hack",
"zed-reqwest",
]
@@ -5298,7 +5270,7 @@ dependencies = [
[[package]]
name = "rope"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"arrayvec",
"log",
@@ -5307,7 +5279,6 @@ dependencies = [
"sum_tree",
"unicode-segmentation",
"util",
"workspace-hack",
]
[[package]]
@@ -5464,9 +5435,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.32"
version = "0.23.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40"
checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c"
dependencies = [
"aws-lc-rs",
"log",
@@ -5515,7 +5486,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1"
dependencies = [
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-foundation-sys",
"jni",
"log",
@@ -5741,7 +5712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef"
dependencies = [
"bitflags 2.9.4",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-foundation-sys",
"libc",
"security-framework-sys",
@@ -5766,11 +5737,10 @@ checksum = "0f7d95a54511e0c7be3f51e8867aa8cf35148d7b9445d44de2f943e2b206e749"
[[package]]
name = "semantic_version"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"serde",
"workspace-hack",
]
[[package]]
@@ -5915,7 +5885,6 @@ name = "settings"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"gpui",
"log",
"nostr-sdk",
@@ -5923,6 +5892,7 @@ dependencies = [
"serde",
"serde_json",
"smallvec",
"states",
]
[[package]]
@@ -5977,28 +5947,6 @@ dependencies = [
"libc",
]
[[package]]
name = "signer_proxy"
version = "0.2.11"
dependencies = [
"anyhow",
"app_state",
"atomic-destructor",
"bytes",
"futures",
"http-body-util",
"hyper",
"hyper-util",
"log",
"nostr",
"oneshot",
"serde",
"serde_json",
"smallvec",
"smol",
"uuid",
]
[[package]]
name = "simd-adler32"
version = "0.3.7"
@@ -6151,6 +6099,21 @@ dependencies = [
"syn 2.0.106",
]
[[package]]
name = "states"
version = "0.2.11"
dependencies = [
"anyhow",
"dirs 5.0.1",
"flume",
"log",
"nostr-lmdb",
"nostr-sdk",
"rustls",
"smol",
"whoami",
]
[[package]]
name = "static_assertions"
version = "1.1.0"
@@ -6218,12 +6181,11 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "sum_tree"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"arrayvec",
"log",
"rayon",
"workspace-hack",
]
[[package]]
@@ -7255,7 +7217,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "util"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"anyhow",
"async-fs",
@@ -7285,18 +7247,16 @@ dependencies = [
"unicase",
"walkdir",
"which",
"workspace-hack",
]
[[package]]
name = "util_macros"
version = "0.1.0"
source = "git+https://github.com/zed-industries/zed#908ae95cf86930893140bee37cf37c8918ac90e8"
source = "git+https://github.com/zed-industries/zed#3d6722be9abf94af5680a3323b69a452154c55b2"
dependencies = [
"perf",
"quote",
"syn 2.0.106",
"workspace-hack",
]
[[package]]
@@ -7657,7 +7617,7 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00f1243ef785213e3a32fa0396093424a3a6ea566f9948497e5a2309261a4c97"
dependencies = [
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"jni",
"log",
"ndk-context",
@@ -8345,12 +8305,6 @@ version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
[[package]]
name = "workspace-hack"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "beffa227304dbaea3ad6a06ac674f9bc83a3dec3b7f63eeb442de37e7cb6bb01"
[[package]]
name = "writeable"
version = "0.6.1"
@@ -8583,7 +8537,7 @@ source = "git+https://github.com/zed-industries/font-kit?rev=110523127440aefb11c
dependencies = [
"bitflags 2.9.4",
"byteorder",
"core-foundation 0.10.1",
"core-foundation 0.10.0",
"core-graphics 0.24.0",
"core-text",
"dirs 5.0.1",