From 1a39f93fd607ea2c7b2af233a88b5abcf722dbc2 Mon Sep 17 00:00:00 2001 From: Bilal Mahmoud Date: Thu, 7 Nov 2024 16:20:56 +0100 Subject: [PATCH] feat: `harpc-service` -> `harpc-system` --- Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- apps/hash-graph/libs/api/Cargo.toml | 2 +- apps/hash-graph/libs/api/package.json | 2 +- apps/hash-graph/libs/api/src/rpc/account.rs | 4 ++-- apps/hash-graph/libs/api/src/rpc/auth.rs | 4 ++-- apps/hash-graph/libs/api/src/rpc/echo.rs | 4 ++-- apps/hash-graph/libs/api/src/rpc/mod.rs | 8 ++++---- libs/@local/harpc/client/Cargo.toml | 2 +- libs/@local/harpc/client/package.json | 2 +- libs/@local/harpc/client/src/utils.rs | 2 +- libs/@local/harpc/server/Cargo.toml | 2 +- libs/@local/harpc/server/examples/account.rs | 2 +- libs/@local/harpc/server/package.json | 2 +- libs/@local/harpc/server/src/delegate.rs | 8 ++++---- libs/@local/harpc/server/src/route.rs | 4 ++-- libs/@local/harpc/server/src/router.rs | 2 +- libs/@local/harpc/server/src/utils.rs | 2 +- libs/@local/harpc/{service => system}/Cargo.toml | 2 +- libs/@local/harpc/{service => system}/LICENSE.md | 0 libs/@local/harpc/{service => system}/package.json | 2 +- libs/@local/harpc/{service => system}/src/delegate.rs | 0 libs/@local/harpc/{service => system}/src/lib.rs | 0 libs/@local/harpc/{service => system}/src/metadata.rs | 0 libs/@local/harpc/{service => system}/src/procedure.rs | 0 libs/@local/harpc/{service => system}/src/role.rs | 0 26 files changed, 34 insertions(+), 34 deletions(-) rename libs/@local/harpc/{service => system}/Cargo.toml (95%) rename libs/@local/harpc/{service => system}/LICENSE.md (100%) rename libs/@local/harpc/{service => system}/package.json (84%) rename libs/@local/harpc/{service => system}/src/delegate.rs (100%) rename libs/@local/harpc/{service => system}/src/lib.rs (100%) rename libs/@local/harpc/{service => system}/src/metadata.rs (100%) rename libs/@local/harpc/{service => system}/src/procedure.rs (100%) rename libs/@local/harpc/{service => system}/src/role.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index b2ebd996f47..19d7e820d3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2486,7 +2486,7 @@ dependencies = [ "harpc-client", "harpc-codec", "harpc-server", - "harpc-service", + "harpc-system", "harpc-tower", "harpc-types", "hash-graph-store", @@ -2655,7 +2655,7 @@ dependencies = [ "futures", "harpc-codec", "harpc-net", - "harpc-service", + "harpc-system", "harpc-tower", "harpc-types", "multiaddr", @@ -2739,7 +2739,7 @@ dependencies = [ "harpc-client", "harpc-codec", "harpc-net", - "harpc-service", + "harpc-system", "harpc-tower", "harpc-types", "multiaddr", @@ -2754,7 +2754,7 @@ dependencies = [ ] [[package]] -name = "harpc-service" +name = "harpc-system" version = "0.0.0" dependencies = [ "frunk", diff --git a/Cargo.toml b/Cargo.toml index 835239a4b5d..a65c1d962e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ "libs/@local/harpc/codec", "libs/@local/harpc/net", "libs/@local/harpc/server", - "libs/@local/harpc/service", + "libs/@local/harpc/system", "libs/@local/harpc/tower", "libs/@local/harpc/types", "libs/@local/harpc/wire-protocol", @@ -61,7 +61,7 @@ harpc-net.path = "libs/@local/harpc/net" harpc-types.path = "libs/@local/harpc/types" harpc-wire-protocol.path = "libs/@local/harpc/wire-protocol" harpc-tower.path = "libs/@local/harpc/tower" -harpc-service.path = "libs/@local/harpc/service" +harpc-system.path = "libs/@local/harpc/system" harpc-codec.path = "libs/@local/harpc/codec" harpc-server.path = "libs/@local/harpc/server" harpc-client.path = "libs/@local/harpc/client" diff --git a/apps/hash-graph/libs/api/Cargo.toml b/apps/hash-graph/libs/api/Cargo.toml index 66601805f7b..1b88cbf408d 100644 --- a/apps/hash-graph/libs/api/Cargo.toml +++ b/apps/hash-graph/libs/api/Cargo.toml @@ -34,7 +34,7 @@ error-stack = { workspace = true, features = ["futures", "spantrace", "unstable" # Private workspace dependencies graph-type-defs = { workspace = true } harpc-codec = { workspace = true } -harpc-service = { workspace = true } +harpc-system = { workspace = true } harpc-tower = { workspace = true } harpc-types = { workspace = true } hash-status = { workspace = true } diff --git a/apps/hash-graph/libs/api/package.json b/apps/hash-graph/libs/api/package.json index a189821de15..5d6b353d368 100644 --- a/apps/hash-graph/libs/api/package.json +++ b/apps/hash-graph/libs/api/package.json @@ -17,7 +17,7 @@ "@rust/harpc-client": "0.0.0-private", "@rust/harpc-codec": "0.0.0-private", "@rust/harpc-server": "0.0.0-private", - "@rust/harpc-service": "0.0.0-private", + "@rust/harpc-system": "0.0.0-private", "@rust/harpc-tower": "0.0.0-private", "@rust/harpc-types": "0.0.0-private", "@rust/hash-graph-store": "0.0.0-private", diff --git a/apps/hash-graph/libs/api/src/rpc/account.rs b/apps/hash-graph/libs/api/src/rpc/account.rs index bc3b038848f..9d6ab406995 100644 --- a/apps/hash-graph/libs/api/src/rpc/account.rs +++ b/apps/hash-graph/libs/api/src/rpc/account.rs @@ -23,7 +23,7 @@ use harpc_server::{ session::Session, utils::{delegate_call_discrete, parse_procedure_id}, }; -use harpc_service::{delegate::SubsystemDelegate, role::Role}; +use harpc_system::{delegate::SubsystemDelegate, role::Role}; use harpc_tower::{body::Body, either::Either, request::Request, response::Response}; use harpc_types::{error_code::ErrorCode, response_kind::ResponseKind}; use hash_graph_store::account::{ @@ -98,7 +98,7 @@ pub mod meta { //! In the future this will be automatically generated by the `harpc` crate. use frunk::HList; - use harpc_service::{ + use harpc_system::{ Subsystem, procedure::{Procedure, ProcedureIdentifier}, }; diff --git a/apps/hash-graph/libs/api/src/rpc/auth.rs b/apps/hash-graph/libs/api/src/rpc/auth.rs index fff45e3e1d1..e84dba7fdca 100644 --- a/apps/hash-graph/libs/api/src/rpc/auth.rs +++ b/apps/hash-graph/libs/api/src/rpc/auth.rs @@ -9,7 +9,7 @@ use harpc_server::{ session::Session, utils::{delegate_call_discrete, parse_procedure_id}, }; -use harpc_service::delegate::SubsystemDelegate; +use harpc_system::delegate::SubsystemDelegate; use harpc_tower::{body::Body, request::Request, response::Response}; use harpc_types::response_kind::ResponseKind; @@ -36,7 +36,7 @@ pub mod meta { //! In the future this will be automatically generated by the `harpc` crate. use frunk::HList; - use harpc_service::{ + use harpc_system::{ Subsystem, procedure::{Procedure, ProcedureIdentifier}, }; diff --git a/apps/hash-graph/libs/api/src/rpc/echo.rs b/apps/hash-graph/libs/api/src/rpc/echo.rs index 4ccf4bc8356..fa9b93da2d6 100644 --- a/apps/hash-graph/libs/api/src/rpc/echo.rs +++ b/apps/hash-graph/libs/api/src/rpc/echo.rs @@ -6,7 +6,7 @@ use harpc_server::{ session::Session, utils::{delegate_call_discrete, parse_procedure_id}, }; -use harpc_service::{delegate::SubsystemDelegate, role::Role}; +use harpc_system::{delegate::SubsystemDelegate, role::Role}; use harpc_tower::{body::Body, request::Request, response::Response}; use harpc_types::response_kind::ResponseKind; @@ -33,7 +33,7 @@ pub mod meta { //! In the future this will be automatically generated by the `harpc` crate. use frunk::HList; - use harpc_service::{ + use harpc_system::{ Subsystem, procedure::{Procedure, ProcedureIdentifier}, }; diff --git a/apps/hash-graph/libs/api/src/rpc/mod.rs b/apps/hash-graph/libs/api/src/rpc/mod.rs index 1fbb90e88d9..2a8a6e623b3 100644 --- a/apps/hash-graph/libs/api/src/rpc/mod.rs +++ b/apps/hash-graph/libs/api/src/rpc/mod.rs @@ -3,18 +3,18 @@ pub mod auth; pub mod echo; mod session; -use harpc_service::SubsystemIdentifier; +use harpc_system::SubsystemIdentifier; use harpc_types::subsystem::SubsystemId; mod role { use harpc_client::connection::Connection; use harpc_server::session::Session; - pub(crate) use harpc_service::role::Role; + pub(crate) use harpc_system::role::Role; use super::session::Account; - pub(crate) type Server = harpc_service::role::Server>; - pub(crate) type Client = harpc_service::role::Client>; + pub(crate) type Server = harpc_system::role::Server>; + pub(crate) type Client = harpc_system::role::Client>; } #[derive(Debug, Copy, Clone)] diff --git a/libs/@local/harpc/client/Cargo.toml b/libs/@local/harpc/client/Cargo.toml index bea6892f584..e2dd1bf29fa 100644 --- a/libs/@local/harpc/client/Cargo.toml +++ b/libs/@local/harpc/client/Cargo.toml @@ -11,7 +11,7 @@ publish.workspace = true [dependencies] # Public workspace dependencies harpc-tower = { workspace = true, public = true } -harpc-service = { workspace = true, public = true } +harpc-system = { workspace = true, public = true } # Public third-party dependencies tower = { workspace = true, public = true } diff --git a/libs/@local/harpc/client/package.json b/libs/@local/harpc/client/package.json index 24aa0895cc3..f1419ee77f3 100644 --- a/libs/@local/harpc/client/package.json +++ b/libs/@local/harpc/client/package.json @@ -7,7 +7,7 @@ "@rust/error-stack": "0.5.0", "@rust/harpc-codec": "0.0.0-private", "@rust/harpc-net": "0.0.0-private", - "@rust/harpc-service": "0.0.0-private", + "@rust/harpc-system": "0.0.0-private", "@rust/harpc-tower": "0.0.0-private", "@rust/harpc-types": "0.0.0-private" } diff --git a/libs/@local/harpc/client/src/utils.rs b/libs/@local/harpc/client/src/utils.rs index a08f8e36cab..da545b60467 100644 --- a/libs/@local/harpc/client/src/utils.rs +++ b/libs/@local/harpc/client/src/utils.rs @@ -6,7 +6,7 @@ use error_stack::{Report, ResultExt as _, TryReportStreamExt as _}; use futures::{StreamExt as _, stream}; use harpc_codec::encode::Encoder; use harpc_net::session::server::SessionId; -use harpc_service::{Subsystem, procedure::ProcedureIdentifier}; +use harpc_system::{Subsystem, procedure::ProcedureIdentifier}; use harpc_tower::{ Extensions, request::{self, Request}, diff --git a/libs/@local/harpc/server/Cargo.toml b/libs/@local/harpc/server/Cargo.toml index 3d417af2aeb..53361fc9070 100644 --- a/libs/@local/harpc/server/Cargo.toml +++ b/libs/@local/harpc/server/Cargo.toml @@ -10,7 +10,7 @@ publish.workspace = true [dependencies] # Public workspace dependencies -harpc-service = { workspace = true, public = true } +harpc-system = { workspace = true, public = true } harpc-net = { workspace = true, public = true } # Public third-party dependencies diff --git a/libs/@local/harpc/server/examples/account.rs b/libs/@local/harpc/server/examples/account.rs index a1ca1b9e280..7aac8349265 100644 --- a/libs/@local/harpc/server/examples/account.rs +++ b/libs/@local/harpc/server/examples/account.rs @@ -21,7 +21,7 @@ use graph_types::account::AccountId; use harpc_client::{Client, ClientConfig, connection::Connection}; use harpc_codec::{decode::Decoder, encode::Encoder, json::JsonCodec}; use harpc_server::{Server, ServerConfig, router::RouterBuilder, serve::serve, session::SessionId}; -use harpc_service::{ +use harpc_system::{ Subsystem, SubsystemIdentifier, delegate::SubsystemDelegate, procedure::{Procedure, ProcedureIdentifier}, diff --git a/libs/@local/harpc/server/package.json b/libs/@local/harpc/server/package.json index 387adff398d..599666c9ebf 100644 --- a/libs/@local/harpc/server/package.json +++ b/libs/@local/harpc/server/package.json @@ -7,7 +7,7 @@ "@rust/error-stack": "0.5.0", "@rust/harpc-codec": "0.0.0-private", "@rust/harpc-net": "0.0.0-private", - "@rust/harpc-service": "0.0.0-private", + "@rust/harpc-system": "0.0.0-private", "@rust/harpc-tower": "0.0.0-private", "@rust/harpc-types": "0.0.0-private" }, diff --git a/libs/@local/harpc/server/src/delegate.rs b/libs/@local/harpc/server/src/delegate.rs index 1d3b85958d4..46b6dee335c 100644 --- a/libs/@local/harpc/server/src/delegate.rs +++ b/libs/@local/harpc/server/src/delegate.rs @@ -4,17 +4,17 @@ use core::{ task::{Context, Poll}, }; -use harpc_service::delegate::SubsystemDelegate; +use harpc_system::delegate::SubsystemDelegate; use harpc_tower::{body::Body, request::Request, response::Response}; use tower::Service; use crate::session::{RequestInfo, Session, SessionStorage}; -/// Bridge between `harpc-service` and `tower`. +/// Bridge between `harpc-system` and `tower`. /// -/// This is a very thin layer between the `harpc-service` and `tower` services. It is responsible +/// This is a very thin layer between the `harpc-system` and `tower` systems. It is responsible /// for taking the incoming request, selecting the appropriate session and codec, and then -/// delegating the request to the inner service (which is cloned). +/// delegating the request to the inner system (which is cloned). /// /// A conscious decision was made not to have `ServiceDelegate` be a `Service`, as it allows for /// greater ergonomics, and allows server implementation that are not based on tower in the future. diff --git a/libs/@local/harpc/server/src/route.rs b/libs/@local/harpc/server/src/route.rs index 9fa73dd358a..f694cb37f07 100644 --- a/libs/@local/harpc/server/src/route.rs +++ b/libs/@local/harpc/server/src/route.rs @@ -4,7 +4,7 @@ use bytes::Bytes; use frunk::{HCons, HNil}; use futures::FutureExt as _; use harpc_codec::error::NetworkError; -use harpc_service::{RefinedSubsystemIdentifier, SubsystemIdentifier}; +use harpc_system::{RefinedSubsystemIdentifier, SubsystemIdentifier}; use harpc_tower::{ body::{Body, controlled::Controlled, full::Full}, request::Request, @@ -26,7 +26,7 @@ pub struct Handler { impl Handler { pub(crate) const fn new(inner: Svc) -> Handler where - Sys: harpc_service::Subsystem, + Sys: harpc_system::Subsystem, { Handler { subsystem: Sys::ID, diff --git a/libs/@local/harpc/server/src/router.rs b/libs/@local/harpc/server/src/router.rs index b206a170360..b26a745b7b5 100644 --- a/libs/@local/harpc/server/src/router.rs +++ b/libs/@local/harpc/server/src/router.rs @@ -7,7 +7,7 @@ use core::{ use frunk::{HCons, HNil}; use futures::{FutureExt as _, Stream}; use harpc_net::session::server::SessionEvent; -use harpc_service::{Subsystem, delegate::SubsystemDelegate}; +use harpc_system::{Subsystem, delegate::SubsystemDelegate}; use harpc_tower::{ body::Body, net::pack::{PackLayer, PackService}, diff --git a/libs/@local/harpc/server/src/utils.rs b/libs/@local/harpc/server/src/utils.rs index cfc7ef0a282..4e70a3dc360 100644 --- a/libs/@local/harpc/server/src/utils.rs +++ b/libs/@local/harpc/server/src/utils.rs @@ -5,7 +5,7 @@ use core::{array, pin::pin}; use error_stack::{Report, ResultExt as _}; use futures::{StreamExt as _, stream}; use harpc_codec::{decode::ReportDecoder, encode::Encoder}; -use harpc_service::{Subsystem, procedure::ProcedureIdentifier}; +use harpc_system::{Subsystem, procedure::ProcedureIdentifier}; use harpc_tower::{ body::{Body, BodyExt as _, Frame, controlled::Controlled, stream::StreamBody}, request::Request, diff --git a/libs/@local/harpc/service/Cargo.toml b/libs/@local/harpc/system/Cargo.toml similarity index 95% rename from libs/@local/harpc/service/Cargo.toml rename to libs/@local/harpc/system/Cargo.toml index b26748eacc9..1ed5d36852b 100644 --- a/libs/@local/harpc/service/Cargo.toml +++ b/libs/@local/harpc/system/Cargo.toml @@ -1,7 +1,7 @@ cargo-features = ["edition2024"] [package] -name = "harpc-service" +name = "harpc-system" authors.workspace = true version.workspace = true edition.workspace = true diff --git a/libs/@local/harpc/service/LICENSE.md b/libs/@local/harpc/system/LICENSE.md similarity index 100% rename from libs/@local/harpc/service/LICENSE.md rename to libs/@local/harpc/system/LICENSE.md diff --git a/libs/@local/harpc/service/package.json b/libs/@local/harpc/system/package.json similarity index 84% rename from libs/@local/harpc/service/package.json rename to libs/@local/harpc/system/package.json index 16e48adcff7..21646163db1 100644 --- a/libs/@local/harpc/service/package.json +++ b/libs/@local/harpc/system/package.json @@ -1,5 +1,5 @@ { - "name": "@rust/harpc-service", + "name": "@rust/harpc-system", "version": "0.0.0-private", "private": true, "license": "AGPL-3", diff --git a/libs/@local/harpc/service/src/delegate.rs b/libs/@local/harpc/system/src/delegate.rs similarity index 100% rename from libs/@local/harpc/service/src/delegate.rs rename to libs/@local/harpc/system/src/delegate.rs diff --git a/libs/@local/harpc/service/src/lib.rs b/libs/@local/harpc/system/src/lib.rs similarity index 100% rename from libs/@local/harpc/service/src/lib.rs rename to libs/@local/harpc/system/src/lib.rs diff --git a/libs/@local/harpc/service/src/metadata.rs b/libs/@local/harpc/system/src/metadata.rs similarity index 100% rename from libs/@local/harpc/service/src/metadata.rs rename to libs/@local/harpc/system/src/metadata.rs diff --git a/libs/@local/harpc/service/src/procedure.rs b/libs/@local/harpc/system/src/procedure.rs similarity index 100% rename from libs/@local/harpc/service/src/procedure.rs rename to libs/@local/harpc/system/src/procedure.rs diff --git a/libs/@local/harpc/service/src/role.rs b/libs/@local/harpc/system/src/role.rs similarity index 100% rename from libs/@local/harpc/service/src/role.rs rename to libs/@local/harpc/system/src/role.rs