Skip to content

Commit ce0982e

Browse files
committed
refactor: rename crates
1 parent 157b7e4 commit ce0982e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+72
-69
lines changed

Cargo.lock

+18-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/syndapi/Cargo.toml crates/synd_api/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "syndapi"
2+
name = "synd_api"
33
version = "0.1.0"
44
description = "syndicationd backend api"
55
authors.workspace = true
@@ -27,7 +27,7 @@ reqwest = { workspace = true }
2727
serde = { workspace = true }
2828
serde_json = "1.0.111"
2929
supports-color = { version = "2.1.0" }
30-
synd = { path = "../synd" }
30+
synd_feed = { path = "../synd_feed", version = "0.1.0" }
3131
thiserror = "1.0.56"
3232
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
3333
tracing = { workspace = true }
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndapi/src/dependency.rs crates/synd_api/src/dependency.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{sync::Arc, time::Duration};
22

3-
use synd::feed::{
3+
use synd_feed::feed::{
44
cache::{CacheConfig, CacheLayer},
55
parser::FeedService,
66
};
File renamed without changes.
File renamed without changes.

crates/syndapi/src/gql/object/id.rs crates/synd_api/src/gql/object/id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::convert::Infallible;
22

33
use async_graphql::connection::CursorType;
4-
use synd::types;
4+
use synd_feed::types;
55

66
pub enum Id {
77
V1(IdV1),

crates/syndapi/src/gql/object/mod.rs crates/synd_api/src/gql/object/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use async_graphql::{
55
Enum, Object, SimpleObject, ID,
66
};
77
use feed_rs::model as feedrs;
8-
use synd::types;
8+
use synd_feed::types;
99

1010
use crate::gql::scalar;
1111

@@ -76,7 +76,7 @@ impl<'a> Entry<'a> {
7676
}
7777

7878
#[derive(Enum, Clone, Copy, PartialEq, Eq)]
79-
#[graphql(remote = "synd::types::FeedType")]
79+
#[graphql(remote = "synd_feed::types::FeedType")]
8080
pub enum FeedType {
8181
Atom,
8282
RSS1,
File renamed without changes.

crates/syndapi/src/gql/scalar.rs crates/synd_api/src/gql/scalar.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use async_graphql::{InputValueError, Scalar, ScalarType, Value};
22
use chrono::Utc;
33

44
/// RFC3339 Time
5-
pub struct Rfc3339Time(synd::types::Time);
5+
pub struct Rfc3339Time(synd_feed::types::Time);
66

77
#[Scalar]
88
impl ScalarType for Rfc3339Time {
@@ -22,8 +22,8 @@ impl ScalarType for Rfc3339Time {
2222
}
2323
}
2424

25-
impl From<synd::types::Time> for Rfc3339Time {
26-
fn from(value: synd::types::Time) -> Self {
25+
impl From<synd_feed::types::Time> for Rfc3339Time {
26+
fn from(value: synd_feed::types::Time) -> Self {
2727
Self(value)
2828
}
2929
}
File renamed without changes.

crates/syndapi/src/main.rs crates/synd_api/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use tracing::{error, info};
22

3-
use syndapi::{args, dependency::Dependency, serve::listen_and_serve};
3+
use synd_api::{args, dependency::Dependency, serve::listen_and_serve};
44

55
fn init_tracing() {
6-
use syndapi::serve::layer::audit;
6+
use synd_api::serve::layer::audit;
77
use tracing_subscriber::{
88
filter::EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt as _, Layer as _,
99
Registry,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndapi/src/usecase/fetch_entries.rs crates/synd_api/src/usecase/fetch_entries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{cmp::Ordering, collections::HashMap, sync::Arc};
22

33
use futures_util::{stream::FuturesUnordered, StreamExt};
4-
use synd::{
4+
use synd_feed::{
55
feed::{cache::FetchCachedFeed, parser::ParserError},
66
types::{self, EntryId},
77
};

crates/syndapi/src/usecase/fetch_subscribed_feeds.rs crates/synd_api/src/usecase/fetch_subscribed_feeds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::sync::Arc;
22

3-
use synd::{feed::cache::FetchCachedFeed, types};
3+
use synd_feed::{feed::cache::FetchCachedFeed, types};
44

55
use crate::{
66
persistence::Datastore,

crates/syndapi/src/usecase/mod.rs crates/synd_api/src/usecase/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use tracing::error;
1717
pub mod authorize;
1818
use std::{future::Future, sync::Arc};
1919

20-
use synd::feed::cache::FetchCachedFeed;
20+
use synd_feed::feed::cache::FetchCachedFeed;
2121

2222
use crate::{
2323
audit,

crates/syndapi/src/usecase/subscribe_feed.rs crates/synd_api/src/usecase/subscribe_feed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::sync::Arc;
22

3-
use synd::{feed::cache::FetchCachedFeed, types::Feed};
3+
use synd_feed::{feed::cache::FetchCachedFeed, types::Feed};
44

55
use crate::{
66
persistence::{self, Datastore},

crates/synd/Cargo.toml crates/synd_feed/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "synd"
2+
name = "synd_feed"
33
version = "0.1.0"
44
description = "Library to handle syndication spec"
55
authors.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndterm/Cargo.toml crates/synd_term/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "syndterm"
2+
name = "synd_term"
33
version = "0.1.0"
44
authors.workspace = true
55
edition.workspace = true
@@ -30,7 +30,7 @@ ratatui = { git = "https://github.com/ratatui-org/ratatui.git", branch = "main"
3030
reqwest = { workspace = true }
3131
serde = { workspace = true, features = ["derive"] }
3232
serde_json = "1.0.111"
33-
synd = { path = "../synd" }
33+
synd_feed = { path = "../synd_feed", version = "0.1.0" }
3434
tokio = { workspace = true, features = [
3535
"macros",
3636
"rt-multi-thread",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndterm/src/cli/mod.rs crates/synd_term/src/cli/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod clear;
1010
#[derive(Parser, Debug)]
1111
#[command(version, propagate_version = true, about = "xxx")]
1212
pub struct Args {
13-
/// syndapi endpoint
13+
/// synd_api endpoint
1414
#[arg(long, default_value = config::api::ENDPOINT)]
1515
pub endpoint: Url,
1616
/// Log file path
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndterm/src/main.rs crates/synd_term/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::PathBuf;
22

33
use crossterm::event::EventStream;
4-
use syndterm::{
4+
use synd_term::{
55
application::Application,
66
auth,
77
cli::{self, Args},
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndterm/src/types/time.rs crates/synd_term/src/types/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub type Time = synd::types::Time;
1+
pub type Time = synd_feed::types::Time;
22

33
pub trait TimeExt {
44
fn local_ymd(&self) -> String;
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/syndterm/tests/integration.rs crates/synd_term/tests/integration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod test {
1010
style::{Modifier, Style},
1111
};
1212
use serial_test::file_serial;
13-
use syndterm::{
13+
use synd_term::{
1414
application::{Application, Config},
1515
client::Client,
1616
ui::theme::Theme,

crates/syndterm/tests/test/helper.rs crates/synd_term/tests/test/helper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use ratatui::backend::TestBackend;
2-
use syndterm::terminal::Terminal;
2+
use synd_term::terminal::Terminal;
33

44
pub fn new_test_terminal() -> Terminal {
55
let backend = TestBackend::new(80, 20);

flake.nix

+15-15
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,26 @@
4444

4545
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
4646

47-
syndtermCrate = craneLib.crateNameFromCargoToml {
48-
cargoToml = ./crates/syndterm/Cargo.toml;
47+
syndTermCrate = craneLib.crateNameFromCargoToml {
48+
cargoToml = ./crates/synd_term/Cargo.toml;
4949
};
50-
syndterm = craneLib.buildPackage (commonArgs // {
50+
syndTerm = craneLib.buildPackage (commonArgs // {
5151
inherit cargoArtifacts;
52-
inherit (syndtermCrate) pname version;
53-
cargoExtraArgs = "--package ${syndtermCrate.pname}";
52+
inherit (syndTermCrate) pname version;
53+
cargoExtraArgs = "--package ${syndTermCrate.pname}";
5454
});
5555

56-
syndapiCrate = craneLib.crateNameFromCargoToml {
57-
cargoToml = ./crates/syndapi/Cargo.toml;
56+
syndApiCrate = craneLib.crateNameFromCargoToml {
57+
cargoToml = ./crates/synd_api/Cargo.toml;
5858
};
59-
syndapi = craneLib.buildPackage (commonArgs // {
59+
syndApi = craneLib.buildPackage (commonArgs // {
6060
inherit cargoArtifacts;
61-
inherit (syndapiCrate) pname version;
62-
cargoExtraArgs = "--package ${syndapiCrate.pname}";
61+
inherit (syndApiCrate) pname version;
62+
cargoExtraArgs = "--package ${syndApiCrate.pname}";
6363
});
6464

6565
checks = {
66-
inherit syndterm syndapi;
66+
inherit syndTerm syndApi;
6767

6868
clippy = craneLib.cargoClippy (commonArgs // {
6969
inherit cargoArtifacts;
@@ -93,11 +93,11 @@
9393
in {
9494
inherit checks;
9595

96-
packages.default = self.packages."${system}".syndterm;
97-
packages.syndterm = syndterm;
98-
packages.syndapi = syndapi;
96+
packages.default = self.packages."${system}".synd;
97+
packages.synd = syndTerm;
98+
packages.synd_api = syndApi;
9999

100-
apps.default = flake-utils.lib.mkApp { drv = syndterm; };
100+
apps.default = flake-utils.lib.mkApp { drv = syndTerm; };
101101

102102
devShells.default = craneLib.devShell {
103103
packages = dev_packages;

justfile

+16-13
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,52 @@ check:
1313
# Format files
1414
fmt: fmt-toml
1515

16+
lint:
17+
cargo clippy
18+
1619
# Format toml files
1720
fmt-toml:
1821
taplo fmt **.toml
1922

2023
# Run integration test
2124
integration:
22-
RUST_LOG="syndterm,integration=debug" cargo nextest run --package syndterm --features integration --test integration --no-capture
25+
RUST_LOG="synd_term,integration=debug" cargo nextest run --package syndterm --features integration --test integration --no-capture
2326

2427
update-gql-schema:
2528
@graphql-client introspect-schema http://localhost:5959/graphql \
26-
--header 'authorization: github {{github_pat}}' out> syndterm/gql/schema.json
29+
--header 'authorization: github {{github_pat}}' out> crates/synd_term/gql/schema.json
2730

2831

2932
gen-gql:
3033
graphql-client generate \
31-
--schema-path syndterm/gql/schema.json \
32-
--output-directory syndterm/src/client \
34+
--schema-path crates/syndterm/gql/schema.json \
35+
--output-directory crates/syndterm/src/client \
3336
--response-derives "Debug" \
3437
--custom-scalars-module "crate::client::scalar" \
35-
syndterm/gql/query.gql
38+
crates/syndterm/gql/query.gql
3639

3740
graphql-client generate \
38-
--schema-path syndterm/gql/schema.json \
39-
--output-directory syndterm/src/client \
41+
--schema-path crates/syndterm/gql/schema.json \
42+
--output-directory crates/syndterm/src/client \
4043
--response-derives "Debug" \
4144
--custom-scalars-module "crate::client::scalar" \
42-
syndterm/gql/mutation.gql
45+
crates/syndterm/gql/mutation.gql
4346

4447
graphql-client generate \
45-
--schema-path syndapi/src/client/github/schema.json \
46-
--output-directory syndapi/src/client/github \
48+
--schema-path crates/synd_api/src/client/github/schema.json \
49+
--output-directory crates/synd_api/src/client/github \
4750
--response-derives "Debug" \
48-
syndapi/src/client/github/query.gql
51+
crates/synd_api/src/client/github/query.gql
4952

5053
# Run kvsd
5154
kvsd:
5255
~/.cargo/bin/kvsd server --disable-tls --config dev/kvsd_config.yaml --username {{kvsd_user}}
5356

5457
# Run api
5558
api:
56-
cd syndapi; RUST_LOG="info" cargo run --features "introspection" -- \
59+
cd crates/synd_api; RUST_LOG="info" cargo run --features "introspection" -- \
5760
--kvsd-host 127.0.0.1 --kvsd-port 7379 --kvsd-username {{kvsd_user}} --kvsd-password secret
5861

5962
# Run term
6063
term:
61-
cd syndterm; cargo run -- --log /tmp/syndterm.log
64+
cd crates/synd_term; cargo run -- --log /tmp/syndterm.log

0 commit comments

Comments
 (0)