Rename all crates to start with letterbox-
This commit is contained in:
parent
d1beaded09
commit
2076596f50
97
Cargo.lock
generated
97
Cargo.lock
generated
@ -2884,30 +2884,24 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "letterbox"
|
||||
name = "letterbox-notmuch"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"build-info-build",
|
||||
"chrono",
|
||||
"console_error_panic_hook",
|
||||
"console_log",
|
||||
"gloo-net",
|
||||
"graphql_client",
|
||||
"human_format",
|
||||
"itertools 0.14.0",
|
||||
"log",
|
||||
"notmuch",
|
||||
"seed",
|
||||
"seed_hooks",
|
||||
"pretty_assertions",
|
||||
"rayon",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shared",
|
||||
"thiserror 2.0.11",
|
||||
"uuid",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-test",
|
||||
"web-sys",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-procmail2notmuch"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2927,13 +2921,14 @@ dependencies = [
|
||||
"css-inline",
|
||||
"futures 0.3.31",
|
||||
"html-escape",
|
||||
"letterbox-notmuch",
|
||||
"letterbox-shared",
|
||||
"linkify",
|
||||
"log",
|
||||
"lol_html",
|
||||
"mailparse",
|
||||
"maplit",
|
||||
"memmap",
|
||||
"notmuch",
|
||||
"opentelemetry",
|
||||
"regex",
|
||||
"reqwest",
|
||||
@ -2942,7 +2937,6 @@ dependencies = [
|
||||
"scraper",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shared",
|
||||
"sqlx",
|
||||
"tantivy",
|
||||
"thiserror 2.0.11",
|
||||
@ -2953,6 +2947,41 @@ dependencies = [
|
||||
"xtracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-shared"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"letterbox-notmuch",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "letterbox-web"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"build-info-build",
|
||||
"chrono",
|
||||
"console_error_panic_hook",
|
||||
"console_log",
|
||||
"gloo-net",
|
||||
"graphql_client",
|
||||
"human_format",
|
||||
"itertools 0.14.0",
|
||||
"letterbox-shared",
|
||||
"log",
|
||||
"seed",
|
||||
"seed_hooks",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.11",
|
||||
"uuid",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-test",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "levenshtein_automata"
|
||||
version = "0.2.1"
|
||||
@ -3449,20 +3478,6 @@ dependencies = [
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "notmuch"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"itertools 0.14.0",
|
||||
"log",
|
||||
"pretty_assertions",
|
||||
"rayon",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.11",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nu-ansi-term"
|
||||
version = "0.46.0"
|
||||
@ -4256,13 +4271,6 @@ dependencies = [
|
||||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "procmail2notmuch"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
version = "0.13.4"
|
||||
@ -5354,15 +5362,6 @@ dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shared"
|
||||
version = "0.0.144"
|
||||
dependencies = [
|
||||
"build-info",
|
||||
"notmuch",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "0.1.1"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "notmuch"
|
||||
name = "letterbox-notmuch"
|
||||
version = "0.0.144"
|
||||
edition = "2021"
|
||||
exclude = ["/testdata"]
|
||||
|
||||
@ -4,7 +4,7 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use notmuch::Notmuch;
|
||||
use letterbox_notmuch::Notmuch;
|
||||
use rayon::iter::{ParallelBridge, ParallelIterator};
|
||||
|
||||
#[test]
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
[package]
|
||||
name = "procmail2notmuch"
|
||||
name = "letterbox-procmail2notmuch"
|
||||
version = "0.0.144"
|
||||
edition = "2021"
|
||||
description = "Tool for generating notmuch rules from procmail"
|
||||
license = "UNLICENSED"
|
||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||
publish = ["xinu"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
@ -23,13 +23,13 @@ clap = { version = "4.5.23", features = ["derive"] }
|
||||
css-inline = "0.14.0"
|
||||
futures = "0.3.31"
|
||||
html-escape = "0.2.13"
|
||||
letterbox-notmuch = { path = "../notmuch" }
|
||||
linkify = "0.10.0"
|
||||
log = "0.4.17"
|
||||
lol_html = "2.0.0"
|
||||
mailparse = "0.16.0"
|
||||
maplit = "1.0.2"
|
||||
memmap = "0.7.0"
|
||||
notmuch = { path = "../notmuch" }
|
||||
opentelemetry = "0.28.0"
|
||||
regex = "1.11.1"
|
||||
reqwest = { version = "0.12.7", features = ["blocking"] }
|
||||
@ -38,7 +38,7 @@ rocket_cors = "0.6.0"
|
||||
scraper = "0.22.0"
|
||||
serde = { version = "1.0.147", features = ["derive"] }
|
||||
serde_json = "1.0.87"
|
||||
shared = { path = "../shared" }
|
||||
letterbox-shared = { path = "../shared" }
|
||||
sqlx = { version = "0.8.2", features = ["postgres", "runtime-tokio", "time"] }
|
||||
tantivy = { version = "0.22.0", optional = true }
|
||||
thiserror = "2.0.0"
|
||||
|
||||
@ -8,6 +8,7 @@ use std::{error::Error, io::Cursor, str::FromStr};
|
||||
use async_graphql::{extensions, http::GraphiQLSource, EmptySubscription, Schema};
|
||||
use async_graphql_rocket::{GraphQLQuery, GraphQLRequest, GraphQLResponse};
|
||||
use cacher::FilesystemCacher;
|
||||
use letterbox_notmuch::{Notmuch, NotmuchError, ThreadSet};
|
||||
#[cfg(feature = "tantivy")]
|
||||
use letterbox_server::tantivy::TantivyConnection;
|
||||
use letterbox_server::{
|
||||
@ -16,7 +17,6 @@ use letterbox_server::{
|
||||
graphql::{Attachment, GraphqlSchema, Mutation, QueryRoot},
|
||||
nm::{attachment_bytes, cid_attachment_bytes},
|
||||
};
|
||||
use notmuch::{Notmuch, NotmuchError, ThreadSet};
|
||||
use rocket::{
|
||||
fairing::AdHoc,
|
||||
http::{ContentType, Header},
|
||||
@ -179,7 +179,7 @@ async fn graphql_request(
|
||||
async fn main() -> Result<(), Box<dyn Error>> {
|
||||
let _guard = xtracing::init(env!("CARGO_BIN_NAME"))?;
|
||||
build_info::build_info!(fn bi);
|
||||
info!("Build Info: {}", shared::build_version(bi));
|
||||
info!("Build Info: {}", letterbox_shared::build_version(bi));
|
||||
let allowed_origins = AllowedOrigins::all();
|
||||
let cors = rocket_cors::CorsOptions {
|
||||
allowed_origins,
|
||||
@ -195,7 +195,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
let rkt = rocket::build()
|
||||
.mount(
|
||||
shared::urls::MOUNT_POINT,
|
||||
letterbox_shared::urls::MOUNT_POINT,
|
||||
routes![
|
||||
original,
|
||||
show_pretty,
|
||||
|
||||
@ -10,7 +10,7 @@ use crate::TransformError;
|
||||
#[derive(Error, Debug)]
|
||||
pub enum ServerError {
|
||||
#[error("notmuch: {0}")]
|
||||
NotmuchError(#[from] notmuch::NotmuchError),
|
||||
NotmuchError(#[from] letterbox_notmuch::NotmuchError),
|
||||
#[error("flatten")]
|
||||
FlattenError,
|
||||
#[error("mail parse error: {0}")]
|
||||
|
||||
@ -6,8 +6,8 @@ use async_graphql::{
|
||||
SimpleObject, Union,
|
||||
};
|
||||
use cacher::FilesystemCacher;
|
||||
use letterbox_notmuch::Notmuch;
|
||||
use log::info;
|
||||
use notmuch::Notmuch;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::postgres::PgPool;
|
||||
use tokio::join;
|
||||
@ -283,7 +283,7 @@ pub struct QueryRoot;
|
||||
impl QueryRoot {
|
||||
async fn version<'ctx>(&self, _ctx: &Context<'ctx>) -> Result<String, Error> {
|
||||
build_info::build_info!(fn bi);
|
||||
Ok(shared::build_version(bi))
|
||||
Ok(letterbox_shared::build_version(bi))
|
||||
}
|
||||
#[instrument(skip_all, fields(query=query))]
|
||||
#[instrument(skip_all, fields(query=query, request_id=request_id()))]
|
||||
|
||||
@ -2,10 +2,10 @@ use std::collections::HashMap;
|
||||
|
||||
use cacher::FilesystemCacher;
|
||||
use futures::{stream::FuturesUnordered, StreamExt};
|
||||
use letterbox_shared::compute_color;
|
||||
use log::{error, info};
|
||||
use maplit::hashmap;
|
||||
use scraper::Selector;
|
||||
use shared::compute_color;
|
||||
use sqlx::postgres::PgPool;
|
||||
use tracing::instrument;
|
||||
use url::Url;
|
||||
|
||||
@ -5,10 +5,10 @@ use std::{
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use letterbox_notmuch::Notmuch;
|
||||
use log::{error, info, warn};
|
||||
use mailparse::{parse_content_type, parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||
use memmap::MmapOptions;
|
||||
use notmuch::Notmuch;
|
||||
use sqlx::PgPool;
|
||||
use tracing::instrument;
|
||||
|
||||
@ -43,7 +43,9 @@ pub fn is_notmuch_thread_or_id(id: &str) -> bool {
|
||||
}
|
||||
|
||||
// TODO(wathiede): decide good error type
|
||||
pub fn threadset_to_messages(thread_set: notmuch::ThreadSet) -> Result<Vec<Message>, ServerError> {
|
||||
pub fn threadset_to_messages(
|
||||
thread_set: letterbox_notmuch::ThreadSet,
|
||||
) -> Result<Vec<Message>, ServerError> {
|
||||
for t in thread_set.0 {
|
||||
for _tn in t.0 {}
|
||||
}
|
||||
@ -190,7 +192,7 @@ pub async fn thread(
|
||||
.headers
|
||||
.get_first_value("date")
|
||||
.and_then(|d| mailparse::dateparse(&d).ok());
|
||||
let cid_prefix = shared::urls::cid_prefix(None, &id);
|
||||
let cid_prefix = letterbox_shared::urls::cid_prefix(None, &id);
|
||||
let base_url = None;
|
||||
let mut part_addr = Vec::new();
|
||||
part_addr.push(id.to_string());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "shared"
|
||||
name = "letterbox-shared"
|
||||
version = "0.0.144"
|
||||
edition = "2021"
|
||||
description = "Shared module for letterbox"
|
||||
@ -11,5 +11,5 @@ publish = ["xinu"]
|
||||
|
||||
[dependencies]
|
||||
build-info = "0.0.39"
|
||||
notmuch = { path = "../notmuch" }
|
||||
letterbox-notmuch = { path = "../notmuch" }
|
||||
serde = { version = "1.0.147", features = ["derive"] }
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||
|
||||
use build_info::{BuildInfo, VersionControl};
|
||||
use notmuch::SearchSummary;
|
||||
use letterbox_notmuch::SearchSummary;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
version = "0.0.144"
|
||||
name = "letterbox"
|
||||
name = "letterbox-web"
|
||||
authors = ["Bill Thiede <git@xinu.tv>"]
|
||||
edition = "2021"
|
||||
description = "Web frontend for letterbox"
|
||||
@ -21,8 +21,7 @@ seed = { version = "0.10.0", features = ["routing"] }
|
||||
#seed = "0.9.2"
|
||||
console_log = { version = "0.1.0", registry = "xinu" }
|
||||
serde = { version = "1.0.147", features = ["derive"] }
|
||||
notmuch = { path = "../notmuch" }
|
||||
shared = { path = "../shared" }
|
||||
letterbox-shared = { path = "../shared" }
|
||||
itertools = "0.14.0"
|
||||
serde_json = { version = "1.0.93", features = ["unbounded_depth"] }
|
||||
chrono = "0.4.31"
|
||||
|
||||
@ -27,7 +27,7 @@ pub fn unread_query() -> &'static str {
|
||||
|
||||
// `init` describes what should happen when your app started.
|
||||
pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||
let version = shared::build_version(bi);
|
||||
let version = letterbox_shared::build_version(bi);
|
||||
info!("Build Info: {}", version);
|
||||
if url.hash().is_none() {
|
||||
orders.request_url(urls::search(unread_query(), 0));
|
||||
|
||||
@ -3,10 +3,10 @@ use std::collections::HashSet;
|
||||
use chrono::{DateTime, Datelike, Duration, Local, Utc};
|
||||
use human_format::{Formatter, Scales};
|
||||
use itertools::Itertools;
|
||||
use letterbox_shared::compute_color;
|
||||
use log::{debug, error, info};
|
||||
use seed::{prelude::*, *};
|
||||
use seed_hooks::{state_access::CloneState, topo, use_state};
|
||||
use shared::compute_color;
|
||||
use web_sys::HtmlElement;
|
||||
|
||||
use crate::{
|
||||
@ -697,7 +697,12 @@ fn render_attachements(
|
||||
let default = "UNKNOWN_FILE".to_string();
|
||||
let filename = a.filename.as_ref().unwrap_or(&default);
|
||||
let host = seed::window().location().host().expect("couldn't get host");
|
||||
let url = shared::urls::download_attachment(Some(&host), &a.id, &a.idx, filename);
|
||||
let url = letterbox_shared::urls::download_attachment(
|
||||
Some(&host),
|
||||
&a.id,
|
||||
&a.idx,
|
||||
filename,
|
||||
);
|
||||
let mut fmtr = Formatter::new();
|
||||
fmtr.with_separator(" ");
|
||||
fmtr.with_scales(Scales::Binary());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user