-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from Hirevo/refactor/workspace
Split codebase into a workspace of multiple library crates
- Loading branch information
Showing
80 changed files
with
390 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,7 @@ | ||
[package] | ||
name = "alexandrie" | ||
version = "0.1.0" | ||
edition = "2018" | ||
authors = ["Nicolas Polomack <nicolas@polomack.eu>"] | ||
description = "An alternative crate registry, implemented in Rust." | ||
repository = "https://github.com/Hirevo/alexandrie" | ||
documentation = "https://crates.polomack.eu/docs/alexandrie" | ||
keywords = ["crates", "cargo", "web", "registry"] | ||
categories = ["development-tools"] | ||
license = "MIT OR Apache-2.0" | ||
|
||
default-run = "alexandrie" | ||
|
||
[badges] | ||
codecov = { repository = "Hirevo/alexandrie"} | ||
|
||
[dependencies] | ||
# core | ||
tide = "0.10.0" | ||
|
||
# data types | ||
url = "2.1.1" | ||
semver = { version = "0.10.0", features = ["serde"] } | ||
chrono = { version = "0.4.11", features = ["serde"] } | ||
|
||
# file formats | ||
serde = { version = "1.0.111", features = ["derive"] } | ||
json = { package = "serde_json", version = "1.0.53" } | ||
toml = "0.5.6" | ||
|
||
# binary parsing | ||
byteorder = "1.3.4" | ||
|
||
# (en|de)coding / hashing | ||
ring = "0.16.14" | ||
hex = "0.4.2" | ||
base64 = "0.12.1" | ||
percent-encoding = "2.1.0" | ||
|
||
# database | ||
diesel = { version = "1.4.4", features = ["r2d2", "chrono"] } | ||
diesel_migrations = "1.4.0" | ||
|
||
# async primitives | ||
async-std = { version = "1.6.0", features = ["unstable", "attributes"] } | ||
futures = "0.3.5" | ||
|
||
# error handling | ||
thiserror = "1.0.19" | ||
|
||
# README rendering | ||
syntect = "4.2.0" | ||
cmark = { package = "pulldown-cmark", version = "0.7.1" } | ||
flate2 = "1.0.14" | ||
tar = "0.4.28" | ||
ammonia = "3.0.0" | ||
|
||
# frontend | ||
handlebars = { version = "3.1.0", features = ["dir_source"], optional = true } | ||
cookie = { version = "0.14.1", features = ["percent-encode"], optional = true } | ||
time = { version = "0.2.16", optional = true } | ||
num-format = { version = "0.4.0", optional = true } | ||
bigdecimal = { version = "0.1.0", features = ["serde"], optional = true } | ||
|
||
# git2 | ||
git2 = { version = "0.13.6", optional = true } | ||
|
||
# logs | ||
log = "0.4.8" | ||
slog = "2.5.2" | ||
slog-stdlog = "4.0.0" | ||
slog-scope = "4.3.0" | ||
slog-term = "2.6.0" | ||
slog-async = "2.5.0" | ||
|
||
[features] | ||
default = ["frontend", "sqlite"] | ||
# default = ["frontend", "mysql"] | ||
# default = ["frontend", "postgres"] | ||
frontend = ["handlebars", "num-format", "bigdecimal", "cookie", "time", "diesel/numeric"] | ||
mysql = ["diesel/mysql", "diesel_migrations/mysql"] | ||
sqlite = ["diesel/sqlite", "diesel_migrations/sqlite"] | ||
postgres = ["diesel/postgres", "diesel_migrations/postgres"] | ||
[workspace] | ||
members = [ | ||
"alexandrie", | ||
"alexandrie-index", | ||
"alexandrie-storage", | ||
"alexandrie-rendering" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "alexandrie-index" | ||
version = "0.1.0" | ||
edition = "2018" | ||
authors = ["Nicolas Polomack <nicolas@polomack.eu>"] | ||
description = "The index management library for Alexandrie, an alternative crate registry." | ||
repository = "https://github.com/Hirevo/alexandrie" | ||
documentation = "https://crates.polomack.eu/docs/alexandrie" | ||
keywords = ["crates", "cargo", "web", "registry"] | ||
categories = ["development-tools"] | ||
license = "MIT OR Apache-2.0" | ||
|
||
# [badges] | ||
# codecov = { repository = "Hirevo/alexandrie"} | ||
|
||
[dependencies] | ||
# data types | ||
semver = { version = "0.10.0", features = ["serde"] } | ||
|
||
# file formats | ||
serde = { version = "1.0.111", features = ["derive"] } | ||
json = { package = "serde_json", version = "1.0.53" } | ||
|
||
# error handling | ||
thiserror = "1.0.19" | ||
|
||
# git2 | ||
git2 = { version = "0.13.6", optional = true } | ||
|
||
[features] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use semver::Version; | ||
use thiserror::Error; | ||
|
||
/// The Error type for the registry. | ||
/// | ||
/// It can represent any kind of error the registry might encounter. | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
/// An IO error (file not found, access forbidden, etc...). | ||
#[error("IO error: {0}")] | ||
IOError(#[from] std::io::Error), | ||
/// JSON (de)serialization error (invalid JSON parsed, etc...). | ||
#[error("JSON error: {0}")] | ||
JSONError(#[from] json::Error), | ||
/// Git2 error. | ||
#[error("libgit2 error: {0}")] | ||
#[cfg(feature = "git2")] | ||
Git2Error(#[from] git2::Error), | ||
/// Other index-specific error (crate not found, etc...). | ||
#[error("index-specific error: {0}")] | ||
IndexError(#[from] IndexError), | ||
} | ||
|
||
/// The Error type for Alexandrie's own errors. | ||
#[derive(Error, Debug)] | ||
pub enum IndexError { | ||
/// The requested crate cannot be found. | ||
#[error("no crate named '{name}' found")] | ||
CrateNotFound { | ||
/// The requested crate's name. | ||
name: String, | ||
}, | ||
/// The published crate version is lower than the current hosted version. | ||
#[error("the published version is too low (hosted version is {hosted}, and thus {published} <= {hosted})")] | ||
VersionTooLow { | ||
/// The krate's name. | ||
krate: String, | ||
/// The available hosted version. | ||
hosted: Version, | ||
/// The proposed version to be published. | ||
published: Version, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Index management through `git` shell command invocations. | ||
pub mod cli; | ||
|
||
/// Index management using [**`libgit2`**][libgit2]. | ||
/// [libgit2]: https://libgit2.org | ||
#[cfg(feature = "git2")] | ||
pub mod git2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.