From 5587ded60dd1211c47204b42fe3a4d2e3d765267 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 5 May 2020 23:18:05 +0200 Subject: [PATCH] merge workspace and main crate --- .gitlab-ci.yml | 4 +- Cargo.toml | 61 ++++++++++++++++--- {gotham_restful_derive => derive}/Cargo.toml | 4 +- {gotham_restful => derive}/LICENSE-Apache | 0 {gotham_restful => derive}/LICENSE-EPL | 0 {gotham_restful => derive}/LICENSE.md | 0 .../src/from_body.rs | 0 {gotham_restful_derive => derive}/src/lib.rs | 0 .../src/method.rs | 0 .../src/openapi_type.rs | 0 .../src/request_body.rs | 0 .../src/resource.rs | 0 .../src/resource_error.rs | 0 {gotham_restful_derive => derive}/src/util.rs | 0 gotham_restful/Cargo.toml | 52 ---------------- gotham_restful/README.md | 1 - gotham_restful_derive/LICENSE-Apache | 1 - gotham_restful_derive/LICENSE-EPL | 1 - gotham_restful_derive/LICENSE.md | 1 - {gotham_restful/src => src}/auth.rs | 0 {gotham_restful/src => src}/lib.rs | 0 {gotham_restful/src => src}/matcher/accept.rs | 0 .../src => src}/matcher/content_type.rs | 0 {gotham_restful/src => src}/matcher/mod.rs | 0 .../src => src}/openapi/builder.rs | 0 .../src => src}/openapi/handler.rs | 0 {gotham_restful/src => src}/openapi/mod.rs | 0 .../src => src}/openapi/operation.rs | 0 {gotham_restful/src => src}/openapi/router.rs | 0 {gotham_restful/src => src}/openapi/types.rs | 0 {gotham_restful/src => src}/resource.rs | 0 {gotham_restful/src => src}/response.rs | 0 .../src => src}/result/auth_result.rs | 0 {gotham_restful/src => src}/result/mod.rs | 0 .../src => src}/result/no_content.rs | 0 {gotham_restful/src => src}/result/raw.rs | 0 {gotham_restful/src => src}/result/result.rs | 0 {gotham_restful/src => src}/result/success.rs | 0 {gotham_restful/src => src}/routing.rs | 0 {gotham_restful/src => src}/types.rs | 0 .../tests => tests}/custom_request_body.rs | 0 .../tests => tests}/openapi_supports_scope.rs | 0 .../tests => tests}/trybuild_ui.rs | 0 .../tests => tests}/ui/from_body_enum.rs | 0 .../tests => tests}/ui/from_body_enum.stderr | 0 45 files changed, 58 insertions(+), 67 deletions(-) rename {gotham_restful_derive => derive}/Cargo.toml (79%) rename {gotham_restful => derive}/LICENSE-Apache (100%) rename {gotham_restful => derive}/LICENSE-EPL (100%) rename {gotham_restful => derive}/LICENSE.md (100%) rename {gotham_restful_derive => derive}/src/from_body.rs (100%) rename {gotham_restful_derive => derive}/src/lib.rs (100%) rename {gotham_restful_derive => derive}/src/method.rs (100%) rename {gotham_restful_derive => derive}/src/openapi_type.rs (100%) rename {gotham_restful_derive => derive}/src/request_body.rs (100%) rename {gotham_restful_derive => derive}/src/resource.rs (100%) rename {gotham_restful_derive => derive}/src/resource_error.rs (100%) rename {gotham_restful_derive => derive}/src/util.rs (100%) delete mode 100644 gotham_restful/Cargo.toml delete mode 120000 gotham_restful/README.md delete mode 120000 gotham_restful_derive/LICENSE-Apache delete mode 120000 gotham_restful_derive/LICENSE-EPL delete mode 120000 gotham_restful_derive/LICENSE.md rename {gotham_restful/src => src}/auth.rs (100%) rename {gotham_restful/src => src}/lib.rs (100%) rename {gotham_restful/src => src}/matcher/accept.rs (100%) rename {gotham_restful/src => src}/matcher/content_type.rs (100%) rename {gotham_restful/src => src}/matcher/mod.rs (100%) rename {gotham_restful/src => src}/openapi/builder.rs (100%) rename {gotham_restful/src => src}/openapi/handler.rs (100%) rename {gotham_restful/src => src}/openapi/mod.rs (100%) rename {gotham_restful/src => src}/openapi/operation.rs (100%) rename {gotham_restful/src => src}/openapi/router.rs (100%) rename {gotham_restful/src => src}/openapi/types.rs (100%) rename {gotham_restful/src => src}/resource.rs (100%) rename {gotham_restful/src => src}/response.rs (100%) rename {gotham_restful/src => src}/result/auth_result.rs (100%) rename {gotham_restful/src => src}/result/mod.rs (100%) rename {gotham_restful/src => src}/result/no_content.rs (100%) rename {gotham_restful/src => src}/result/raw.rs (100%) rename {gotham_restful/src => src}/result/result.rs (100%) rename {gotham_restful/src => src}/result/success.rs (100%) rename {gotham_restful/src => src}/routing.rs (100%) rename {gotham_restful/src => src}/types.rs (100%) rename {gotham_restful/tests => tests}/custom_request_body.rs (100%) rename {gotham_restful/tests => tests}/openapi_supports_scope.rs (100%) rename {gotham_restful/tests => tests}/trybuild_ui.rs (100%) rename {gotham_restful/tests => tests}/ui/from_body_enum.rs (100%) rename {gotham_restful/tests => tests}/ui/from_body_enum.stderr (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f9f002..c50b7f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ test-all: script: - cargo test --workspace --all-features --doc - cargo test trybuild_ui -- --ignored - - cargo tarpaulin --target-dir target/tarpaulin --all --all-features --exclude-files 'cargo/*' --exclude-files 'gotham_restful_derive/*' --exclude-files 'example/*' --ignore-panics --ignore-tests --out Html -v + - cargo tarpaulin --target-dir target/tarpaulin --all --all-features --exclude-files 'cargo/*' --exclude-files 'derive/*' --exclude-files 'example/*' --ignore-panics --ignore-tests --out Html -v artifacts: paths: - tarpaulin-report.html @@ -40,7 +40,7 @@ readme: stage: test image: msrd0/cargo-readme script: - - cargo readme -r gotham_restful -t ../README.tpl >README.md.new + - cargo readme -t README.tpl >README.md.new - diff README.md README.md.new publish: diff --git a/Cargo.toml b/Cargo.toml index 8efb671..59519a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,60 @@ # -*- eval: (cargo-minor-mode 1) -*- [workspace] -members = [ - "gotham_restful", - "gotham_restful_derive", - "example" -] +members = ["derive", "example"] + +[package] +name = "gotham_restful" +version = "0.1.0-dev" +authors = ["Dominic Meiser "] +edition = "2018" +description = "RESTful additions for the gotham web framework" +keywords = ["gotham", "rest", "restful", "web", "http"] +license = "EPL-2.0 OR Apache-2.0" +readme = "README.md" +repository = "https://gitlab.com/msrd0/gotham-restful" + +[badges] +gitlab = { repository = "msrd0/gotham-restful", branch = "master" } + +[dependencies] +base64 = { version = "0.12.0", optional = true } +chrono = { version = "0.4.11", optional = true } +cookie = { version = "0.13.3", optional = true } +futures-core = "0.3.4" +futures-util = "0.3.4" +gotham = { git = "https://github.com/gotham-rs/gotham", version = "0.5.0-dev", default-features = false } +gotham_derive = { git = "https://github.com/gotham-rs/gotham", version = "0.5.0-dev" } +gotham_middleware_diesel = { git = "https://github.com/gotham-rs/gotham", version = "0.1.0", optional = true } +gotham_restful_derive = { version = "0.1.0-dev" } +indexmap = { version = "1.3.2", optional = true } +itertools = "0.9.0" +jsonwebtoken = { version = "7.1.0", optional = true } +log = "0.4.8" +mime = "0.3.16" +openapiv3 = { version = "0.3", optional = true } +serde = { version = "1.0.106", features = ["derive"] } +serde_json = "1.0.52" +thiserror = "1.0.16" +uuid = { version = "0.8.1", optional = true } + +[dev-dependencies] +diesel = { version = "1.4.4", features = ["postgres"] } +futures-executor = "0.3.4" +paste = "0.1.12" +trybuild = "1.0.26" + +[features] +default = ["errorlog"] +auth = ["gotham_restful_derive/auth", "base64", "cookie", "jsonwebtoken"] +errorlog = [] +database = ["gotham_restful_derive/database", "gotham_middleware_diesel"] +openapi = ["gotham_restful_derive/openapi", "indexmap", "openapiv3"] + +[package.metadata.docs.rs] +all-features = true [patch.crates-io] -gotham_restful = { path = "./gotham_restful" } -gotham_restful_derive = { path = "./gotham_restful_derive" } +gotham_restful = { path = "." } +gotham_restful_derive = { path = "./derive" } openapiv3 = { git = "https://github.com/glademiller/openapiv3", rev = "4c3bd95c966a3f9d59bb494c3d8e30c5c3068bdb" } diff --git a/gotham_restful_derive/Cargo.toml b/derive/Cargo.toml similarity index 79% rename from gotham_restful_derive/Cargo.toml rename to derive/Cargo.toml index 275b490..62678f0 100644 --- a/gotham_restful_derive/Cargo.toml +++ b/derive/Cargo.toml @@ -5,8 +5,8 @@ name = "gotham_restful_derive" version = "0.1.0-dev" authors = ["Dominic Meiser "] edition = "2018" -description = "RESTful additions for Gotham - Derive" -keywords = ["gotham", "rest", "restful", "derive"] +description = "RESTful additions for the gotham web framework - Derive" +keywords = ["gotham", "rest", "restful", "web", "http", "derive"] license = "EPL-2.0 OR Apache-2.0" repository = "https://gitlab.com/msrd0/gotham-restful" diff --git a/gotham_restful/LICENSE-Apache b/derive/LICENSE-Apache similarity index 100% rename from gotham_restful/LICENSE-Apache rename to derive/LICENSE-Apache diff --git a/gotham_restful/LICENSE-EPL b/derive/LICENSE-EPL similarity index 100% rename from gotham_restful/LICENSE-EPL rename to derive/LICENSE-EPL diff --git a/gotham_restful/LICENSE.md b/derive/LICENSE.md similarity index 100% rename from gotham_restful/LICENSE.md rename to derive/LICENSE.md diff --git a/gotham_restful_derive/src/from_body.rs b/derive/src/from_body.rs similarity index 100% rename from gotham_restful_derive/src/from_body.rs rename to derive/src/from_body.rs diff --git a/gotham_restful_derive/src/lib.rs b/derive/src/lib.rs similarity index 100% rename from gotham_restful_derive/src/lib.rs rename to derive/src/lib.rs diff --git a/gotham_restful_derive/src/method.rs b/derive/src/method.rs similarity index 100% rename from gotham_restful_derive/src/method.rs rename to derive/src/method.rs diff --git a/gotham_restful_derive/src/openapi_type.rs b/derive/src/openapi_type.rs similarity index 100% rename from gotham_restful_derive/src/openapi_type.rs rename to derive/src/openapi_type.rs diff --git a/gotham_restful_derive/src/request_body.rs b/derive/src/request_body.rs similarity index 100% rename from gotham_restful_derive/src/request_body.rs rename to derive/src/request_body.rs diff --git a/gotham_restful_derive/src/resource.rs b/derive/src/resource.rs similarity index 100% rename from gotham_restful_derive/src/resource.rs rename to derive/src/resource.rs diff --git a/gotham_restful_derive/src/resource_error.rs b/derive/src/resource_error.rs similarity index 100% rename from gotham_restful_derive/src/resource_error.rs rename to derive/src/resource_error.rs diff --git a/gotham_restful_derive/src/util.rs b/derive/src/util.rs similarity index 100% rename from gotham_restful_derive/src/util.rs rename to derive/src/util.rs diff --git a/gotham_restful/Cargo.toml b/gotham_restful/Cargo.toml deleted file mode 100644 index a571a2d..0000000 --- a/gotham_restful/Cargo.toml +++ /dev/null @@ -1,52 +0,0 @@ -# -*- eval: (cargo-minor-mode 1) -*- - -[package] -name = "gotham_restful" -version = "0.1.0-dev" -authors = ["Dominic Meiser "] -edition = "2018" -description = "RESTful additions for Gotham" -keywords = ["gotham", "rest", "restful"] -license = "EPL-2.0 OR Apache-2.0" -readme = "README.md" -repository = "https://gitlab.com/msrd0/gotham-restful" - -[badges] -gitlab = { repository = "msrd0/gotham-restful", branch = "master" } - -[dependencies] -base64 = { version = "0.12.0", optional = true } -chrono = { version = "0.4.11", optional = true } -cookie = { version = "0.13.3", optional = true } -futures-core = "0.3.4" -futures-util = "0.3.4" -gotham = { git = "https://github.com/gotham-rs/gotham", version = "0.5.0-dev", default-features = false } -gotham_derive = { git = "https://github.com/gotham-rs/gotham", version = "0.5.0-dev" } -gotham_middleware_diesel = { git = "https://github.com/gotham-rs/gotham", version = "0.1.0", optional = true } -gotham_restful_derive = { version = "0.1.0-dev" } -indexmap = { version = "1.3.2", optional = true } -itertools = "0.9.0" -jsonwebtoken = { version = "7.1.0", optional = true } -log = "0.4.8" -mime = "0.3.16" -openapiv3 = { version = "0.3", optional = true } -serde = { version = "1.0.106", features = ["derive"] } -serde_json = "1.0.52" -thiserror = "1.0.16" -uuid = { version = "0.8.1", optional = true } - -[dev-dependencies] -diesel = { version = "1.4.4", features = ["postgres"] } -futures-executor = "0.3.4" -paste = "0.1.12" -trybuild = "1.0.26" - -[features] -default = ["errorlog"] -auth = ["gotham_restful_derive/auth", "base64", "cookie", "jsonwebtoken"] -errorlog = [] -database = ["gotham_restful_derive/database", "gotham_middleware_diesel"] -openapi = ["gotham_restful_derive/openapi", "indexmap", "openapiv3"] - -[package.metadata.docs.rs] -all-features = true diff --git a/gotham_restful/README.md b/gotham_restful/README.md deleted file mode 120000 index 32d46ee..0000000 --- a/gotham_restful/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/gotham_restful_derive/LICENSE-Apache b/gotham_restful_derive/LICENSE-Apache deleted file mode 120000 index 0cd69a3..0000000 --- a/gotham_restful_derive/LICENSE-Apache +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-Apache \ No newline at end of file diff --git a/gotham_restful_derive/LICENSE-EPL b/gotham_restful_derive/LICENSE-EPL deleted file mode 120000 index 2004d06..0000000 --- a/gotham_restful_derive/LICENSE-EPL +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-EPL \ No newline at end of file diff --git a/gotham_restful_derive/LICENSE.md b/gotham_restful_derive/LICENSE.md deleted file mode 120000 index 7eabdb1..0000000 --- a/gotham_restful_derive/LICENSE.md +++ /dev/null @@ -1 +0,0 @@ -../LICENSE.md \ No newline at end of file diff --git a/gotham_restful/src/auth.rs b/src/auth.rs similarity index 100% rename from gotham_restful/src/auth.rs rename to src/auth.rs diff --git a/gotham_restful/src/lib.rs b/src/lib.rs similarity index 100% rename from gotham_restful/src/lib.rs rename to src/lib.rs diff --git a/gotham_restful/src/matcher/accept.rs b/src/matcher/accept.rs similarity index 100% rename from gotham_restful/src/matcher/accept.rs rename to src/matcher/accept.rs diff --git a/gotham_restful/src/matcher/content_type.rs b/src/matcher/content_type.rs similarity index 100% rename from gotham_restful/src/matcher/content_type.rs rename to src/matcher/content_type.rs diff --git a/gotham_restful/src/matcher/mod.rs b/src/matcher/mod.rs similarity index 100% rename from gotham_restful/src/matcher/mod.rs rename to src/matcher/mod.rs diff --git a/gotham_restful/src/openapi/builder.rs b/src/openapi/builder.rs similarity index 100% rename from gotham_restful/src/openapi/builder.rs rename to src/openapi/builder.rs diff --git a/gotham_restful/src/openapi/handler.rs b/src/openapi/handler.rs similarity index 100% rename from gotham_restful/src/openapi/handler.rs rename to src/openapi/handler.rs diff --git a/gotham_restful/src/openapi/mod.rs b/src/openapi/mod.rs similarity index 100% rename from gotham_restful/src/openapi/mod.rs rename to src/openapi/mod.rs diff --git a/gotham_restful/src/openapi/operation.rs b/src/openapi/operation.rs similarity index 100% rename from gotham_restful/src/openapi/operation.rs rename to src/openapi/operation.rs diff --git a/gotham_restful/src/openapi/router.rs b/src/openapi/router.rs similarity index 100% rename from gotham_restful/src/openapi/router.rs rename to src/openapi/router.rs diff --git a/gotham_restful/src/openapi/types.rs b/src/openapi/types.rs similarity index 100% rename from gotham_restful/src/openapi/types.rs rename to src/openapi/types.rs diff --git a/gotham_restful/src/resource.rs b/src/resource.rs similarity index 100% rename from gotham_restful/src/resource.rs rename to src/resource.rs diff --git a/gotham_restful/src/response.rs b/src/response.rs similarity index 100% rename from gotham_restful/src/response.rs rename to src/response.rs diff --git a/gotham_restful/src/result/auth_result.rs b/src/result/auth_result.rs similarity index 100% rename from gotham_restful/src/result/auth_result.rs rename to src/result/auth_result.rs diff --git a/gotham_restful/src/result/mod.rs b/src/result/mod.rs similarity index 100% rename from gotham_restful/src/result/mod.rs rename to src/result/mod.rs diff --git a/gotham_restful/src/result/no_content.rs b/src/result/no_content.rs similarity index 100% rename from gotham_restful/src/result/no_content.rs rename to src/result/no_content.rs diff --git a/gotham_restful/src/result/raw.rs b/src/result/raw.rs similarity index 100% rename from gotham_restful/src/result/raw.rs rename to src/result/raw.rs diff --git a/gotham_restful/src/result/result.rs b/src/result/result.rs similarity index 100% rename from gotham_restful/src/result/result.rs rename to src/result/result.rs diff --git a/gotham_restful/src/result/success.rs b/src/result/success.rs similarity index 100% rename from gotham_restful/src/result/success.rs rename to src/result/success.rs diff --git a/gotham_restful/src/routing.rs b/src/routing.rs similarity index 100% rename from gotham_restful/src/routing.rs rename to src/routing.rs diff --git a/gotham_restful/src/types.rs b/src/types.rs similarity index 100% rename from gotham_restful/src/types.rs rename to src/types.rs diff --git a/gotham_restful/tests/custom_request_body.rs b/tests/custom_request_body.rs similarity index 100% rename from gotham_restful/tests/custom_request_body.rs rename to tests/custom_request_body.rs diff --git a/gotham_restful/tests/openapi_supports_scope.rs b/tests/openapi_supports_scope.rs similarity index 100% rename from gotham_restful/tests/openapi_supports_scope.rs rename to tests/openapi_supports_scope.rs diff --git a/gotham_restful/tests/trybuild_ui.rs b/tests/trybuild_ui.rs similarity index 100% rename from gotham_restful/tests/trybuild_ui.rs rename to tests/trybuild_ui.rs diff --git a/gotham_restful/tests/ui/from_body_enum.rs b/tests/ui/from_body_enum.rs similarity index 100% rename from gotham_restful/tests/ui/from_body_enum.rs rename to tests/ui/from_body_enum.rs diff --git a/gotham_restful/tests/ui/from_body_enum.stderr b/tests/ui/from_body_enum.stderr similarity index 100% rename from gotham_restful/tests/ui/from_body_enum.stderr rename to tests/ui/from_body_enum.stderr