Skip to content

chore: merge develop into main for 0.37.0 #128

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Actix Web | [websocket-actorless](./actix-web/websocket-actorless/) | Websocket
Actix Web | [cookie-authentication](./actix-web/cookie-authentication/) | Use JWT to authenticate API endpoints | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder actix-web/cookie-authentication`
Axum | [hello-world](./axum/hello-world/) | Hello World | `cargo shuttle init --template axum`
Axum | [metadata](./axum/metadata/) | Simple app that prints the service information such as Shuttle service name | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/metadata`
Axum | [qdrant](./axum/qdrant/) | Barebones example of the shuttle-qdrant plugin | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/qdrant`
Axum | [static-files](./axum/static-files/) | Hello World page that serves static HTML and JS files | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/static-files`
Axum | [static-next-server](./axum/static-next-server/) | SPA server for serving a apps from frameworks such as Next.js | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/static-next-server`
Axum | [websocket](./axum/websocket/) | Websocket app that checks the status of Shuttle's API | `cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/websocket`
Expand Down
4 changes: 2 additions & 2 deletions actix-web/cookie-authentication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
actix-identity = "0.6.0"
actix-session = { version = "0.8.0", features = ["cookie-session"] }
actix-web = "4.3.1"
shuttle-actix-web = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-actix-web = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-actix-web = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
8 changes: 4 additions & 4 deletions actix-web/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-actix-web = "0.37.0"
shuttle-runtime = "0.37.0"
serde = "1.0.148"
shuttle-shared-db = { version = "0.36.0", features = ["postgres"] }
sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls", "postgres"] }
shuttle-shared-db = { version = "0.37.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
actix-files = "0.6.2"
actix-web = "4.3.1"
shuttle-actix-web = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-actix-web = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
4 changes: 2 additions & 2 deletions actix-web/websocket-actorless/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures = "0.3"
reqwest = "0.11"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
shuttle-actix-web = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-actix-web = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = { version = "1", features = ["rt-multi-thread", "sync"] }
tracing = "0.1"
4 changes: 2 additions & 2 deletions axum/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.2"
tracing = "0.1.40"
4 changes: 2 additions & 2 deletions axum/jwt-authentication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jsonwebtoken = "8.3.0"
once_cell = "1.18.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.2"
tracing-subscriber = "0.3.17"
6 changes: 3 additions & 3 deletions axum/metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-metadata = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-metadata = "0.37.0"
tokio = "1.28.2"
8 changes: 4 additions & 4 deletions axum/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
[dependencies]
axum = "0.7.3"
serde = { version = "1.0.188", features = ["derive"] }
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-shared-db = { version = "0.36.0", features = ["postgres"] }
sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls", "postgres"] }
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-shared-db = { version = "0.37.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
tokio = "1.28.2"
12 changes: 12 additions & 0 deletions axum/qdrant/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "shuttle-axum-qdrant"
version = "0.1.0"
edition = "2021"

[dependencies]
axum = "0.7.3"
qdrant-client = "1.7.0"
shuttle-axum = "0.37.0"
shuttle-qdrant = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
3 changes: 3 additions & 0 deletions axum/qdrant/Secrets.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Note that we use gRPC (port 6334) to talk to Qdrant.
CLOUD_URL = 'https://xyz-example.eu-central.aws.cloud.qdrant.io:6334'
API_KEY = 'your_api_key'
25 changes: 25 additions & 0 deletions axum/qdrant/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use axum::{extract::State, routing::get, Router};
use qdrant_client::prelude::*;
use std::sync::Arc;

struct AppState {
qdrant: QdrantClient,
}

async fn list_collections(State(state): State<Arc<AppState>>) -> String {
format!("{:?}\n", state.qdrant.list_collections().await)
}

#[shuttle_runtime::main]
async fn axum(
#[shuttle_qdrant::Qdrant(cloud_url = "{secrets.CLOUD_URL}", api_key = "{secrets.API_KEY}")]
qdrant: QdrantClient,
) -> shuttle_axum::ShuttleAxum {
let state = Arc::new(AppState { qdrant });

let router = Router::new()
.route("/", get(list_collections))
.with_state(state);

Ok(router.into())
}
4 changes: 2 additions & 2 deletions axum/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
4 changes: 2 additions & 2 deletions axum/static-next-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
tower-http = { version = "0.5.0", features = ["fs"] }
6 changes: 3 additions & 3 deletions axum/turso/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-turso = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-turso = "0.37.0"
libsql-client = "0.31.0"
tokio = "1.26.0"
serde = { version = "1.0.164", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions axum/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ futures = "0.3.28"
reqwest = "0.11.23"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
4 changes: 2 additions & 2 deletions axum/with-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
6 changes: 3 additions & 3 deletions custom-resource/pdo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
async-trait = "0.1.56"
axum = "0.7.3"
serde = { version = "1.0.148", default-features = false, features = ["derive"] }
shuttle-service = "0.36.0"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-service = "0.37.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.2"
32 changes: 10 additions & 22 deletions custom-resource/pdo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
use async_trait::async_trait;
use serde::Serialize;
use shuttle_service::Factory;
use shuttle_service::ResourceBuilder;
use shuttle_service::Type;
use shuttle_service::{resource::Type, Error, Factory, IntoResource, ResourceBuilder};

#[derive(Serialize)]
#[derive(Default, Serialize)]
pub struct Builder {
name: String,
}

#[derive(Clone)]
pub struct Pdo {
pub name: String,
}
Expand All @@ -23,33 +20,24 @@ impl Builder {
}

#[async_trait]
impl ResourceBuilder<Pdo> for Builder {
impl ResourceBuilder for Builder {
const TYPE: Type = Type::Custom;

type Config = Self;

type Output = String;

fn new() -> Self {
Self {
name: String::new(),
}
}

fn config(&self) -> &Self::Config {
self
}

async fn output(
self,
_factory: &mut dyn Factory,
) -> Result<Self::Output, shuttle_service::Error> {
async fn output(self, _factory: &mut dyn Factory) -> Result<Self::Output, Error> {
// factory can be used to get resources from Shuttle
Ok(self.name)
}
}

async fn build(build_data: &Self::Output) -> Result<Pdo, shuttle_service::Error> {
Ok(Pdo {
name: build_data.clone(),
})
#[async_trait]
impl IntoResource<Pdo> for String {
async fn into_resource(self) -> Result<Pdo, Error> {
Ok(Pdo { name: self })
}
}
2 changes: 1 addition & 1 deletion custom-service/none/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"
publish = false

[dependencies]
shuttle-runtime = "0.36.0"
shuttle-runtime = "0.37.0"
tokio = "1"
4 changes: 2 additions & 2 deletions custom-service/request-scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chrono = "0.4.24"
cron = "0.12.0"
reqwest = "0.11.17"
serde = "1.0.163"
shuttle-persist = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-persist = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.28.0"
tracing = "0.1.37"
1 change: 1 addition & 0 deletions fullstack-templates/saas/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[workspace]
resolver = "2"
members = ["backend"]
10 changes: 5 additions & 5 deletions fullstack-templates/saas/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ lettre = "0.10.4"
rand = "0.8.5"
reqwest = "0.11.16"
serde = { version = "1.0.160", features = ["derive"] }
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-secrets = "0.36.0"
shuttle-shared-db = { version = "0.36.0", features = ["postgres"] }
sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls", "postgres", "time"] }
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-secrets = "0.37.0"
shuttle-shared-db = { version = "0.37.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
time = { version = "0.3.20", features = ["serde"] }
tokio = "1.27.0"
tower = "0.4.13"
Expand Down
2 changes: 1 addition & 1 deletion next/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
crate-type = [ "cdylib" ]

[dependencies]
shuttle-next = "0.36.0"
shuttle-next = "0.37.0"
tracing = "0.1.37"
futures = "0.3.25"
6 changes: 3 additions & 3 deletions other/standalone-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ path = "src/bin/standalone.rs"
[dependencies]
axum = "0.7.3"
dotenvy = "0.15.7"
shuttle-axum = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-secrets = "0.36.0"
shuttle-axum = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-secrets = "0.37.0"
tokio = "1.28.2"
6 changes: 3 additions & 3 deletions poem/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
poem = "1.3.55"
shuttle-poem = "0.36.0"
shuttle-runtime = "0.36.0"
poem = "2.0.0"
shuttle-poem = "0.37.0"
shuttle-runtime = "0.37.0"
tokio = "1.26.0"
8 changes: 4 additions & 4 deletions poem/mongodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ edition = "2021"

[dependencies]
mongodb = "2.4.0"
poem = "1.3.55"
shuttle-poem = "0.36.0"
shuttle-shared-db = { version = "0.36.0", features = ["mongodb"] }
shuttle-runtime = "0.36.0"
poem = "2.0.0"
shuttle-poem = "0.37.0"
shuttle-shared-db = { version = "0.37.0", features = ["mongodb"] }
shuttle-runtime = "0.37.0"
serde = { version = "1.0.148", features = ["derive"] }
serde_json = "1.0.89"
tokio = "1.26.0"
10 changes: 5 additions & 5 deletions poem/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ version = "0.1.0"
edition = "2021"

[dependencies]
poem = "1.3.55"
poem = "2.0.0"
serde = "1.0.148"
shuttle-poem = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-shared-db = { version = "0.36.0", features = ["postgres"] }
sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls", "postgres"] }
shuttle-poem = "0.37.0"
shuttle-runtime = "0.37.0"
shuttle-shared-db = { version = "0.37.0", features = ["postgres", "sqlx"] }
sqlx = "0.7.1"
tokio = "1.26.0"
11 changes: 6 additions & 5 deletions poise/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "hello-world"
name = "hello-world-poise-bot"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
anyhow = "1.0.68"
poise = "0.5.2"
shuttle-poise = "0.36.0"
shuttle-runtime = "0.36.0"
shuttle-secrets = "0.36.0"
poise = "0.6.1"
shuttle-runtime = "0.37.0"
shuttle-secrets = "0.37.0"
# Since poise is a serenity command framework, it can run on Shuttle with shuttle-serenity
shuttle-serenity = "0.37.0"
tracing = "0.1.37"
tokio = "1.26.0"
1 change: 0 additions & 1 deletion poise/hello-world/Shuttle.toml

This file was deleted.

Loading