Skip to content

Commit

Permalink
refactor: define a crate data-link to handle links-related code
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Feb 28, 2024
1 parent 9055af4 commit 50e1b19
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"data-error",
"data-json",
"data-link",
"data-pdf",
"data-resource",
"fs-atomic-versions",
Expand All @@ -12,6 +13,7 @@ members = [
default-members = [
"data-error",
"data-json",
"data-link",
"data-pdf",
"data-resource",
"fs-atomic-versions",
Expand Down
27 changes: 27 additions & 0 deletions data-link/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "data-link"
version = "0.1.0"
edition = "2021"


[lib]
name = "data_link"
crate-type = ["rlib"]
bench = false

[dependencies]
fs-index = { path = "../fs-index" }
fs-atomic-versions = { path = "../fs-atomic-versions" }
fs-utils = { path = "../fs-utils" }
data-resource = { path = "../data-resource" }

log = { version = "0.4.17", features = ["release_max_level_off"] }
serde_json = "1.0.82"
serde = { version = "1.0.138", features = ["derive"] }
url = { version = "2.2.2", features = ["serde"] }
reqwest = "0.11.11"
scraper = "0.13.0"
tokio = { version = "1", features = ["full"] }

[dev-dependencies]
tempdir = "0.3.7"
11 changes: 6 additions & 5 deletions fs-index/src/link.rs → data-link/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::storage::meta::store_metadata;
use crate::storage::prop::store_properties;
use crate::{
storage::prop::load_raw_properties, AtomicFile, Result, ARK_FOLDER,
use data_resource::ResourceId;
use fs_index::storage::meta::store_metadata;
use fs_index::storage::prop::store_properties;
use fs_index::{
storage::prop::load_raw_properties, AtomicFile, ARK_FOLDER,
PREVIEWS_STORAGE_FOLDER, PROPERTIES_STORAGE_FOLDER,
};
use data_resource::ResourceId;
use fs_utils::errors::Result;
use reqwest::header::HeaderValue;
use scraper::{Html, Selector};
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 0 additions & 4 deletions fs-index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ canonical-path = "2.0.2"
pathdiff = "0.2.1"
serde_json = "1.0.82"
serde = { version = "1.0.138", features = ["derive"] }
url = { version = "2.2.2", features = ["serde"] }
reqwest = "0.11.11"
scraper = "0.13.0"
tokio = { version = "1", features = ["full"] }
itertools = "0.10.5"

[dev-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions fs-index/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ extern crate canonical_path;
use fs_utils::errors::{ArklibError, Result};

pub mod index;
pub mod link;

mod storage;
pub mod storage;

pub use fs_atomic_versions::atomic::{modify, modify_json, AtomicFile};

Expand Down

0 comments on commit 50e1b19

Please sign in to comment.