-
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.
Reorganized the project into a workspace
- Loading branch information
Showing
65 changed files
with
344 additions
and
151 deletions.
There are no files selected for viewing
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,87 +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" | ||
|
||
[dependencies] | ||
# core | ||
tide = { version = "0.5.0" } | ||
http = { version = "0.1.21" } | ||
|
||
# data types | ||
url = { version = "2.1.1" } | ||
semver = { version = "0.9.0", features = ["serde"] } | ||
chrono = { version = "0.4.10", features = ["serde"] } | ||
|
||
# file formats | ||
serde = { version = "1.0.104", features = ["derive"] } | ||
json = { package = "serde_json", version = "1.0.44" } | ||
toml = { version = "0.5.5" } | ||
|
||
# binary parsing | ||
byteorder = { version = "1.3.2" } | ||
bytes = { version = "0.5.3" } | ||
|
||
# (en|de)coding / hashing | ||
ring = { version = "0.16.9" } | ||
hex = { version = "0.4.0" } | ||
base64 = { version = "0.11.0" } | ||
percent-encoding = { version = "2.1.0" } | ||
|
||
# database | ||
diesel = { version = "1.4.3", features = ["r2d2", "chrono", "numeric"] } | ||
diesel_migrations = { version = "1.4.0" } | ||
|
||
# async primitives | ||
async-std = { version = "1.4.0", features = ["unstable", "attributes"] } | ||
futures = { version = "0.3.1" } | ||
|
||
# error handling | ||
thiserror = { version = "1.0.9" } | ||
|
||
# README rendering | ||
syntect = { version = "3.3.0" } | ||
cmark = { package = "pulldown-cmark", version = "0.6.1" } | ||
flate2 = { version = "1.0.13" } | ||
tar = { version = "0.4.26" } | ||
|
||
# frontend | ||
handlebars = { version = "2.0.4", optional = true } | ||
cookie = { version = "0.12.0", features = ["percent-encode"], optional = true } | ||
time = { version = "0.1.42", optional = true } | ||
num-format = { version = "0.4.0", optional = true } | ||
bigdecimal = { version = "0.1.0", features = ["serde"], optional = true } | ||
|
||
# git2 | ||
git2 = { version = "0.11.0", optional = true } | ||
|
||
# logs | ||
log = { version = "0.4.8" } | ||
slog = { version = "2.5.2" } | ||
slog-stdlog = { version = "4.0.0" } | ||
slog-scope = { version = "4.3.0" } | ||
slog-term = { version = "2.4.2" } | ||
slog-async = { version = "2.3.0" } | ||
slog-json = { version = "2.3.0" } | ||
|
||
# miscellaneous | ||
path-absolutize = { version = "1.1.7" } | ||
mime_guess = { version = "2.0.1" } | ||
|
||
[features] | ||
# default = ["frontend", "sqlite"] | ||
# default = ["frontend", "mysql"] | ||
default = ["frontend", "postgres"] | ||
frontend = ["handlebars", "num-format", "bigdecimal", "cookie", "time"] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[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" | ||
|
||
[dependencies] | ||
# data types | ||
semver = { version = "0.9.0", features = ["serde"] } | ||
|
||
# file formats | ||
serde = { version = "1.0.104", features = ["derive"] } | ||
json = { package = "serde_json", version = "1.0.44" } | ||
|
||
# error handling | ||
thiserror = { version = "1.0.9" } | ||
|
||
# git2 | ||
git2 = { version = "0.11.0", optional = true } |
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
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
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,25 @@ | ||
[package] | ||
name = "alexandrie-rendering" | ||
version = "0.1.0" | ||
edition = "2018" | ||
authors = ["Nicolas Polomack <nicolas@polomack.eu>"] | ||
description = "The markdown rendering 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" | ||
|
||
[dependencies] | ||
# data types | ||
semver = { version = "0.9.0", features = ["serde"] } | ||
|
||
# file formats | ||
serde = { version = "1.0.104", features = ["derive"] } | ||
|
||
# error handling | ||
thiserror = { version = "1.0.9" } | ||
|
||
# README rendering | ||
syntect = { version = "3.3.0" } | ||
cmark = { package = "pulldown-cmark", version = "0.6.1" } |
File renamed without changes.
Oops, something went wrong.