diff --git a/Cargo.lock b/Cargo.lock index fe0f162..6bf1797 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1616,7 +1616,7 @@ dependencies = [ ] [[package]] -name = "hyperprocess_macro" +name = "hyperapp_macro" version = "0.1.0" dependencies = [ "hyperware_process_lib", @@ -1628,7 +1628,7 @@ dependencies = [ [[package]] name = "hyperware_process_lib" version = "2.2.0" -source = "git+https://github.com/hyperware-ai/process_lib?rev=a16d47a#a16d47a2bfae7864e97d70a3914829b4e54a4033" +source = "git+https://github.com/hyperware-ai/process_lib?rev=b9f1ead#b9f1ead63356bfd4b60b337a380fef1be81d81c6" dependencies = [ "alloy", "alloy-primitives", diff --git a/Cargo.toml b/Cargo.toml index f8ea4d7..c6240fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "hyperprocess_macro" +name = "hyperapp_macro" version = "0.1.0" edition = "2021" diff --git a/README.md b/README.md index fee7b64..eaa79bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hyperware Process Framework +# Hyperapp Framework ![How it feels to use Hyperware](hyperware.jpg) How it feels to use hyperware @@ -9,7 +9,7 @@ How it feels to use hyperware - [Overview](#overview) - [Getting Started](#getting-started) - [State Management](#state-management) - - [Hyperprocess Macro Parameters](#hyperprocess-macro-parameters) + - [Hyperapp Macro Parameters](#hyperapp-macro-parameters) - [Handler Types](#handler-types) - [Special Methods](#special-methods) - [Init Method](#init-method) @@ -57,7 +57,7 @@ So this includes: To create a Hyperware process, you need to: 1. Define your process state as a struct -2. Implement the struct with the `hyperprocess` macro +2. Implement the struct with the `hyperapp` macro 3. Define handlers for different types of requests Here's a minimal example: @@ -68,7 +68,7 @@ struct MyProcessState { counter: u64, } -#[hyperprocess( +#[hyperapp( name = "My Process", ui = Some(HttpBindingConfig::default()), endpoints = vec![ @@ -100,7 +100,7 @@ Your state should implement the `Default` and `State` traits, and be serializabl ### Hyperprocess Macro Parameters -The `hyperprocess` macro accepts the following parameters: +The `hyperapp` macro accepts the following parameters: | Parameter | Type | Required | Description | |-----------|------|----------|-------------| @@ -115,7 +115,7 @@ The `hyperprocess` macro accepts the following parameters: Example: ```rust -#[hyperprocess( +#[hyperapp( name = "Async Requester", ui = Some(HttpBindingConfig::default()), endpoints = vec![ @@ -304,7 +304,7 @@ async fn async_handler(&mut self, data: MyData) -> Result { You can bind HTTP handlers to specific paths using the `path` parameter: ```rust -#[hyperprocess( +#[hyperapp( endpoints = vec![ Binding::Http { path: "/api", config: HttpBindingConfig::default() }, Binding::Http { path: "/admin", config: HttpBindingConfig::default() } @@ -489,7 +489,7 @@ struct AsyncRequesterState { request_count: u64, } -#[hyperprocess( +#[hyperapp( name = "Async Requester", ui = Some(HttpBindingConfig::default()), endpoints = vec![ @@ -666,7 +666,7 @@ The macro catches configuration errors at compile time: ```rust // This will fail to compile: -#[hyperprocess( +#[hyperapp( name = "test-app", // Missing required 'endpoints' parameter save_config = SaveOptions::Never, @@ -1010,7 +1010,7 @@ This was achieved by implementing our own async runtime. Given that processes ar ### Macro Implementation -The `hyperprocess` macro transforms a struct implementation into a fully-featured process: +The `hyperapp` macro transforms a struct implementation into a fully-featured process: #### 1. Parsing Phase @@ -1452,14 +1452,14 @@ graph TB %% BUILD PHASE - Where components are generated subgraph BuildPhase["⚙️ BUILD PHASE"] UserSrc[/"User Source Code - #[hyperprocess] macro + #[hyperapp] macro #[http], #[local], #[remote] methods"/] subgraph CodeGen["Code Generation Pipeline"] direction TB HyperBindgen["hyper-bindgen CLI - Scans for #[hyperprocess]"] + Scans for #[hyperapp]"] subgraph BindgenOutputs["hyper-bindgen Outputs"] direction LR @@ -1471,7 +1471,7 @@ graph TB Cross-process types"] end - ProcMacro["hyperprocess Macro + ProcMacro["hyperapp Macro AST Transformation"] subgraph MacroOutputs["Macro Generated Code"] diff --git a/src/lib.rs b/src/lib.rs index 9541edb..0458546 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2067,7 +2067,7 @@ fn generate_component_impl( /// The main procedural macro #[proc_macro_attribute] -pub fn hyperprocess(attr: TokenStream, item: TokenStream) -> TokenStream { +pub fn hyperapp(attr: TokenStream, item: TokenStream) -> TokenStream { // Parse the input let attr_args = parse_macro_input!(attr as MetaList); let impl_block = parse_macro_input!(item as ItemImpl);