diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d6dd716..8fc4d874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. -## Unreleased (44348c2..230d43e) +## 0.4.0 - 2024-07-05 #### Bug Fixes - **(macros)** default controller methods output to response type - (b736094) - elcharitas - **(routes)** grouped routes resolving with blank screen issue - (c0c890c) - elcharitas diff --git a/Cargo.lock b/Cargo.lock index 9066755e..c0b2a482 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -543,7 +543,7 @@ name = "basic_app" version = "0.1.0" dependencies = [ "async-std", - "ngyn 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ngyn 0.3.1", "nject", ] @@ -1285,13 +1285,13 @@ dependencies = [ [[package]] name = "graphql" -version = "0.1.0" +version = "0.2.0" dependencies = [ "http-body-util", "hyper 1.3.1", "juniper", "juniper_hyper", - "ngyn 0.3.1", + "ngyn 0.4.0", "ngyn-hyper", "serde", "serde_json", @@ -2063,20 +2063,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ngyn" -version = "0.3.1" -dependencies = [ - "async-std", - "async-trait", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "ngyn_macros 0.3.1", - "ngyn_shared 0.3.1", - "tokio", -] - [[package]] name = "ngyn" version = "0.3.1" @@ -2084,36 +2070,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14d60007fdf1ee508c009ac6cfde9578dba68072e4c8fff776650991dbafb9be" dependencies = [ "async-std", - "ngyn_macros 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ngyn_shared 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ngyn_macros 0.3.1", + "ngyn_shared 0.3.1", "nject", "tide", ] [[package]] -name = "ngyn-hyper" -version = "0.3.1" +name = "ngyn" +version = "0.4.0" dependencies = [ + "async-std", + "async-trait", "http-body-util", "hyper 1.3.1", "hyper-util", - "ngyn_shared 0.3.1", + "ngyn_macros 0.4.0", + "ngyn_shared 0.4.0", "tokio", ] [[package]] -name = "ngyn-vercel" -version = "0.3.1" -dependencies = [ - "http-body-util", - "hyper 1.3.1", - "ngyn_shared 0.3.1", - "tokio", - "vercel_runtime", -] - -[[package]] -name = "ngyn_cli" +name = "ngyn-cli" version = "0.0.1" dependencies = [ "anyhow", @@ -2129,23 +2107,53 @@ dependencies = [ "tracing-tree", ] +[[package]] +name = "ngyn-hyper" +version = "0.1.0" +dependencies = [ + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "ngyn_shared 0.4.0", + "tokio", +] + +[[package]] +name = "ngyn-shuttle" +version = "0.1.0" +dependencies = [ + "ngyn-hyper", + "shuttle-runtime", +] + +[[package]] +name = "ngyn-vercel" +version = "0.1.0" +dependencies = [ + "http-body-util", + "hyper 1.3.1", + "ngyn_shared 0.4.0", + "tokio", + "vercel_runtime", +] + [[package]] name = "ngyn_macros" version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146a2f3fed9fd02f1a093c5f194c773612d2ebbd3760b61b8e8bff8eb605d554" dependencies = [ "ngyn_shared 0.3.1", + "nject", "quote", "syn 2.0.66", ] [[package]] name = "ngyn_macros" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146a2f3fed9fd02f1a093c5f194c773612d2ebbd3760b61b8e8bff8eb605d554" +version = "0.4.0" dependencies = [ - "ngyn_shared 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nject", + "ngyn_shared 0.4.0", "quote", "syn 2.0.66", ] @@ -2153,12 +2161,11 @@ dependencies = [ [[package]] name = "ngyn_shared" version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b221b14d889b5500dde44958a14fe4f8ec21ab5cb738450b2136065260da061e" dependencies = [ "async-trait", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "regex", + "nject", "serde", "serde_json", "url", @@ -2166,12 +2173,13 @@ dependencies = [ [[package]] name = "ngyn_shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b221b14d889b5500dde44958a14fe4f8ec21ab5cb738450b2136065260da061e" +version = "0.4.0" dependencies = [ "async-trait", - "nject", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "regex", "serde", "serde_json", "url", @@ -3011,14 +3019,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "shuttle_ngyn" -version = "0.3.1" -dependencies = [ - "ngyn-hyper", - "shuttle-runtime", -] - [[package]] name = "signal-hook" version = "0.3.17" @@ -3939,7 +3939,7 @@ dependencies = [ name = "vercel_app" version = "0.2.8" dependencies = [ - "ngyn 0.3.1", + "ngyn 0.4.0", "ngyn-vercel", "tokio", "vercel_runtime", @@ -4096,14 +4096,14 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "weather_api" -version = "0.1.2" +version = "0.2.0" dependencies = [ "dotenv", - "ngyn 0.3.1", + "ngyn 0.4.0", + "ngyn-shuttle", "serde", "serde_json", "shuttle-runtime", - "shuttle_ngyn", "ureq", "validator", ] diff --git a/cog.toml b/cog.toml index 24ca463d..2bbf48a8 100644 --- a/cog.toml +++ b/cog.toml @@ -8,6 +8,8 @@ authors = [ [packages] ngyn = { path = "crates/core" } -ngyn_cli = { path = "crates/cli" } +ngyn-cli = { path = "crates/cli" } ngyn_macros = { path = "crates/macros" } ngyn_shared = { path = "crates/shared" } +ngyn-hyper = { path = "crates/hyper" } +ngyn-vercel = { path = "crates/vercel" } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index c81389a8..2f9586f9 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ngyn_cli" +name = "ngyn-cli" version = "0.0.1" edition = "2021" description = "Modular backend framework for web applications" @@ -46,7 +46,7 @@ console = "^0.15.0" exitcode = "^1.1.2" tracing = "^0.1.34" tracing-tree = { version = "0.2.1" } -tracing-subscriber = { version = "^0.3.11", features = ["env-filter"] } +tracing-subscriber = { version = "0.3.1", features = ["env-filter"] } [features] diff --git a/crates/core/CHANGELOG.md b/crates/core/CHANGELOG.md deleted file mode 100644 index df3ea58c..00000000 --- a/crates/core/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. - -- - - -## ngyn-0.3.0 - 2023-12-27 -#### Bug Fixes -- re-export common modules into prelude (#75) - (e653403) - elcharitas -- improve response body peeking and conversion (#74) - (0322480) - elcharitas -- make requests partially mutable (#72) - (311bf5a) - elcharitas -- await response update in vercel platform (#52) - (905bbdc) - elcharitas -- proper import paths (#50) - (6496470) - elcharitas -- proper error route handling (#46) - (82a1241) - elcharitas -- use less ambiguous name (#44) - (b6ef3f1) - elcharitas -- status/set_status fixes (#40) - (242fc15) - elcharitas -- update response values in vercel engine (#38) - (274e0e0) - elcharitas -- readme symlinking final fix - (5559c5b) - elcharitas -- sub crates readme symlinks (#37) - (0922eb3) - elcharitas -- handle uncaught clippy and test issues (#34) - (6d5ae62) - elcharitas -- use ureq in weather api sample (#30) - (00489b2) - elcharitas -- further macro improvements (#28) - (8ef8bbc) - elcharitas -- address all clippy errors (#9) - (68f7c6e) - elcharitas -- broken server doc tests (#8) - (3304537) - elcharitas -#### Features -- **(structure)** use crates to contain all crates - (647e4b7) - elcharitas -- extend response body (#69) - (476ec43) - elcharitas -- improve request processing and handling (#68) - (b497899) - elcharitas -- add platform macro (#67) - (f54e955) - elcharitas -- support body returns to match specs (#65) - (7fc7233) - elcharitas -- add feature flag for tide platform engine (#43) - (2061c37) - elcharitas -- proper response handling (#33) - (cd46101) - elcharitas -- add support for gates and middlewares (#19) - (966087e) - elcharitas -- add support for vercel service (#24) - (175a06b) - elcharitas -- add more http methods support to engine (#12) - (067ce21) - elcharitas -- add support for async routes (#11) - (e5cdc19) - elcharitas -- support multiple http methods (#2) - (3f6c8bb) - elcharitas -#### Miscellaneous Chores -- **(bump)** ngyn@0.2.0 -> ngyn@0.2.1 (#36) - (ab3e43e) - *elcharitas* -- **(bump)** ngyn_macros@v0.2.1 -> ngyn_macros@v0.2.2 (#35) - (f0ecded) - *elcharitas* -- **(version)** ngyn-0.2.8 - (2aa9005) - elcharitas -- clean out NgynResponse::new - (48a88f6) - elcharitas -- add pre-bump script (#64) - (f1473d9) - elcharitas -- sync cargo.toml - (bf38fc9) - elcharitas -- bump version to 0.2.7 - (19dfb6b) - elcharitas -- rename body to match specs (#53) - (9cfd24a) - elcharitas -- bump version to 0.2.6 - (e016500) - elcharitas -- bump version to 0.2.5 (#48) - (cf04092) - elcharitas -- rename ngyn::server to ngyn::platforms (#47) - (c4eeb65) - elcharitas -- move engine traits to shared (#45) - (5484665) - elcharitas -- bump version to 0.2.4 (#41) - (0b36fc1) - elcharitas -- bump version to 0.2.3 - (b3c0c20) - elcharitas -- bump versions to 0.2.2 (#39) - (452d3f6) - elcharitas -- bump crates version - (ada1c92) - elcharitas -- bump crates version number (#22) - (d55b86a) - elcharitas -- revamp weather api using reqwest + tokio (#18) - (db501df) - elcharitas -- Rename to ngyn (#4) - (c81adc9) - elcharitas -- add http specific methods to server (#1) - (a8ee7ec) - elcharitas - -- - - - -## ngyn-0.2.8 - 2023-11-26 - -- - - - -Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). \ No newline at end of file diff --git a/crates/core/CHANGELOG.md b/crates/core/CHANGELOG.md new file mode 120000 index 00000000..699cc9e7 --- /dev/null +++ b/crates/core/CHANGELOG.md @@ -0,0 +1 @@ +../../CHANGELOG.md \ No newline at end of file diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index cbc78c85..ad6e837d 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ngyn" -version = "0.3.1" +version = "0.4.0" edition = "2021" description = "Modular backend framework for web applications" license = "MIT" @@ -14,6 +14,6 @@ async-trait = "0.1" http-body-util = "0.1" hyper = { version = "1", features = ["full"] } hyper-util = { version = "0.1", features = ["full"] } -ngyn_macros = { version = "0.3.1", path = "../macros" } -ngyn_shared = { version = "0.3.1", path = "../shared" } +ngyn_macros = { version = "^0.4.0", path = "../macros" } +ngyn_shared = { version = "^0.4.0", path = "../shared" } tokio = { version = "1", features = ["full"] } diff --git a/crates/hyper/Cargo.toml b/crates/hyper/Cargo.toml index f62ac4ea..53fab346 100644 --- a/crates/hyper/Cargo.toml +++ b/crates/hyper/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "ngyn-hyper" -version = "0.3.1" +version = "0.1.0" edition = "2021" +description = "Hyper Platform for ngyn web framework" +license = "MIT" [dependencies] http-body-util = "0.1" hyper = { version = "1", features = ["full"] } hyper-util = { version = "0.1", features = ["full"] } -ngyn_shared = { version = "0.3.1", path = "../shared" } +ngyn_shared = { version = "^0.4.0", path = "../shared" } tokio = { version = "1", features = ["full"] } diff --git a/crates/macros/Cargo.toml b/crates/macros/Cargo.toml index 8a64c694..87d66941 100644 --- a/crates/macros/Cargo.toml +++ b/crates/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ngyn_macros" -version = "0.3.1" +version = "0.4.0" edition = "2021" description = "Modular backend framework for web applications" license = "MIT" @@ -8,7 +8,7 @@ license = "MIT" [dependencies] syn = "2.0" quote = "1.0" -ngyn_shared = { version = "0.3.1", path = "../shared" } +ngyn_shared = { version = "^0.4.0", path = "../shared" } [lib] path = "src/lib.rs" diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index 2771c905..db7daaec 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ngyn_shared" -version = "0.3.1" +version = "0.4.0" edition = "2021" description = "Modular backend framework for web applications" license = "MIT" diff --git a/crates/shuttle/Cargo.toml b/crates/shuttle/Cargo.toml index 11b56ffa..650207ad 100644 --- a/crates/shuttle/Cargo.toml +++ b/crates/shuttle/Cargo.toml @@ -1,10 +1,12 @@ [package] -name = "shuttle_ngyn" -version = "0.3.1" +name = "ngyn-shuttle" +version = "0.1.0" edition = "2021" +description = "Shuttle Runtime Platform for ngyn web framework" +license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ngyn-hyper = { version = "0.3.1", path = "../../crates/hyper" } +ngyn-hyper = { version = "^0.1.0", path = "../../crates/hyper" } shuttle-runtime = "0" diff --git a/crates/vercel/Cargo.toml b/crates/vercel/Cargo.toml index 64261f8e..5d5adea6 100644 --- a/crates/vercel/Cargo.toml +++ b/crates/vercel/Cargo.toml @@ -1,13 +1,15 @@ [package] name = "ngyn-vercel" -version = "0.3.1" +version = "0.1.0" edition = "2021" +description = "Vercel Runtime Platform for ngyn web framework" +license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] http-body-util = "0.1" hyper = { version = "1", features = ["full"] } -ngyn_shared = { version = "0.3.1", path = "../shared" } +ngyn_shared = { version = "^0.4.0", path = "../shared" } tokio = { version = "1", features = ["full"] } vercel_runtime = { version = "1.1.0" } diff --git a/examples/graphql_app/Cargo.toml b/examples/graphql_app/Cargo.toml index c1a2d799..5aaaa0de 100644 --- a/examples/graphql_app/Cargo.toml +++ b/examples/graphql_app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "graphql" -version = "0.1.0" +version = "0.2.0" edition = "2021" [dependencies] @@ -8,8 +8,8 @@ http-body-util = "0.1" hyper = { version = "1.0", features = ["full"] } juniper = { version = "0.16", features = ["expose-test-schema"] } juniper_hyper = "0.9" -ngyn = { version = "0.3.1", path = "../../crates/core" } -ngyn-hyper = { version = "0.3.1", path = "../../crates/hyper" } +ngyn = { version = "^0.4.0", path = "../../crates/core" } +ngyn-hyper = { version = "^0.1.0", path = "../../crates/hyper" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tokio = { version = "1.0", features = ["full"] } \ No newline at end of file +tokio = { version = "1.0", features = ["full"] } diff --git a/examples/vercel_app/Cargo.toml b/examples/vercel_app/Cargo.toml index 1ec23760..9106a973 100644 --- a/examples/vercel_app/Cargo.toml +++ b/examples/vercel_app/Cargo.toml @@ -11,7 +11,7 @@ path = "api/[[...all]].rs" path = "src/lib.rs" [dependencies] -ngyn = { version = "0.3.1", path = "../../crates/core" } -ngyn-vercel = { version = "0.3.1", path = "../../crates/vercel" } +ngyn = { version = "^0.4.0", path = "../../crates/core" } +ngyn-vercel = { version = "^0.1.0", path = "../../crates/vercel" } tokio = { version = "1.32.0", features = ["full"] } vercel_runtime = { version = "1.1.0" } diff --git a/examples/weather_app/Cargo.toml b/examples/weather_app/Cargo.toml index 901c288e..ac1e2bcc 100644 --- a/examples/weather_app/Cargo.toml +++ b/examples/weather_app/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "weather_api" -version = "0.1.2" +version = "0.2.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] dotenv = "0.15.0" -ngyn = { version = "0.3.1", path = "../../crates/core" } +ngyn = { version = "^0.4.0", path = "../../crates/core" } +ngyn-shuttle = { version = "^0.1.0", path = "../../crates/shuttle" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" shuttle-runtime = "0" -shuttle_ngyn = { version = "0.3.1", path = "../../crates/shuttle" } ureq = { version = "2.8.0" } validator = { version = "0.18.1", features = ["derive"] } diff --git a/examples/weather_app/src/main.rs b/examples/weather_app/src/main.rs index e451f0bd..be9feecd 100644 --- a/examples/weather_app/src/main.rs +++ b/examples/weather_app/src/main.rs @@ -4,7 +4,7 @@ mod modules; use dotenv::dotenv; use modules::AppModule; use ngyn::prelude::*; -use shuttle_ngyn::{ShuttleApplication, ShuttleNgyn}; +use ngyn_shuttle::{ShuttleApplication, ShuttleNgyn}; use crate::middlewares::notfound_middleware::NotFoundMiddleware; diff --git a/release.sh b/release.sh new file mode 100755 index 00000000..5122b3f1 --- /dev/null +++ b/release.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +new_version=$1 + +# Install smart-release if it's not already installed +cargo install smart-release + +root_dir=$(git rev-parse --show-toplevel) + +# Find all subfolders in the crates directory +crate_names=("shared" "macros" "hyper" "vercel" "shuttle") +examples_dirs=() + +while IFS= read -r -d $'\0' example_dir; do + if [[ $example_dir != "examples" ]]; then + echo "Found example: $example_dir" + examples_dirs+=("$example_dir") + fi +done < <(find examples -maxdepth 1 -type d -print0) + +# bump core version used in the examples +for example_dir in "${examples_dirs[@]}"; do + echo "Bumping version in $example_dir" + sed -i '' -e "s/^ngyn = .*/ngyn = \"$new_version\"/" $example_dir/Cargo.toml +done + +# publish the version of all crates +for crate_name in "${crate_names[@]}"; do + echo "Publishing version $new_version of $crate_name" + cargo smart-release --execute --no-changelog -b keep -d keep $crate_name + # sleep for two minutes to avoid rate limiting + sleep 120 # 2 minutes +done + +cd $root_dir/crates/core +# publish the version of the core crate +echo "Publishing version $new_version of ngyn" +cargo publish diff --git a/scripts/version-bump.sh b/scripts/version-bump.sh deleted file mode 100755 index 34b95de1..00000000 --- a/scripts/version-bump.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -new_version=$1 - -# Install cargo-bump if it's not already installed -if ! command -v cargo-bump &> /dev/null; then - cargo install cargo-bump -fi - -# Install cocogitto if it's not already installed -if ! command -v cog &> /dev/null; then - cargo install cocogitto -fi - -root_dir=$(git rev-parse --show-toplevel) - -# Find all subfolders in the crates directory -crate_names=() -crate_dirs=() -examples_dirs=() - -while IFS= read -r -d $'\0' example_dir; do - examples_dirs+=("$example_dir") -done < <(find examples -maxdepth 1 -type d -print0) - -while IFS= read -r -d $'\0' crate_dir; do - if [[ "$crate_dir" != "crates" ]]; then - cargo_toml="./Cargo.toml" - cd $crate_dir - # Bump the version of each crate - cargo bump $new_version - # read the name of the crate from the Cargo.toml file (the very first). - crate_name=$(grep -m 1 "name =" "$cargo_toml" | sed -e 's/.*= "//' -e 's/"//' | tr -d '[:space:]') - echo "Found crate: $crate_name" - - crate_names+=("$crate_name") - crate_dirs+=("$crate_dir") - cd $root_dir - fi -done < <(find crates -maxdepth 1 -type d -print0) - -echo "" - -# Update the version of each crate used in the entire workspace -for ((i=0; i<${#crate_names[@]}; ++i)); do - crate_name="${crate_names[$i]}" - - echo "Updating version of $crate_name to $new_version" - # check both `crates` and examples folders for Cargo.toml files and update the version for $crate_name in each - for dir in "${crate_dirs[@]}" "${examples_dirs[@]}"; do - cargo_toml="$dir/Cargo.toml" - if [[ -f "$cargo_toml" ]]; then - # using perl, update the version which should be in format $crate_name = { version = "0.1.0", ... } - perl -i -pe "s/($crate_name = \{ version = )\".*?(\",.*)/\1\"$new_version\2/" "$cargo_toml" - fi - done - echo "" - - # bump, tag, create changelog, and push to github - echo "Bumping tag of $crate_name" - cog bump --version $new_version --package $crate_name --skip-untracked -done