Skip to content

Commit 6c77238

Browse files
committed
Add description, repository, license, keywords, and category information to Cargo.toml, rename the library, and publish it.
1 parent 05c4836 commit 6c77238

File tree

8 files changed

+44
-33
lines changed

8 files changed

+44
-33
lines changed

Cargo.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cache/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
[package]
2-
name = "cache"
2+
name = "reactive_cache"
33
version = "0.1.0"
44
edition = "2024"
5+
description = "A lightweight, dependency-aware memoization library with automatic invalidation and lazy recomputation."
6+
repository = "https://github.com/fxdmhtt/ReactiveCache"
7+
license = "GPL-2.0"
8+
keywords = ["cache", "reactive"]
9+
categories = ["caching"]
510

611
[dependencies]
712
lru = "0.16.0"

macros/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
[package]
2-
name = "macros"
2+
name = "reactive_macros"
33
version = "0.1.0"
44
edition = "2024"
5+
description = "A lightweight, dependency-aware memoization library with automatic invalidation and lazy recomputation."
6+
repository = "https://github.com/fxdmhtt/ReactiveCache"
7+
license = "GPL-2.0"
8+
keywords = ["cache", "reactive"]
9+
categories = ["caching"]
510

611
[lib]
712
proc-macro = true
@@ -12,4 +17,4 @@ proc-macro2 = "1.0.95"
1217
quote = "1.0.40"
1318
syn = { version = "2.0.104", features = ["full"] }
1419

15-
cache = { path = "../cache" }
20+
reactive_cache = { path = "../cache" }

macros/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ pub fn signal(input: TokenStream) -> TokenStream {
3232
let ident_set = format_ident!("{}_set", ident);
3333
let ident_fn = format_ident!("{}", ident);
3434

35-
let lazy_ty = quote! { once_cell::unsync::Lazy<std::rc::Rc<cache::Signal<#ty>>> };
36-
let expr = quote! { once_cell::unsync::Lazy::new(|| cache::Signal::new(Some(#expr))) };
35+
let lazy_ty = quote! { once_cell::unsync::Lazy<std::rc::Rc<reactive_cache::Signal<#ty>>> };
36+
let expr = quote! { once_cell::unsync::Lazy::new(|| reactive_cache::Signal::new(Some(#expr))) };
3737

3838
let expanded = quote! {
3939
#(#attrs)*
@@ -86,8 +86,9 @@ pub fn memo(_attr: TokenStream, item: TokenStream) -> TokenStream {
8686
}
8787

8888
let ident = format_ident!("{}", ident.to_string().to_uppercase());
89-
let ty = quote! { once_cell::unsync::Lazy<cache::Memo<#output_ty, fn() -> #output_ty>> };
90-
let expr = quote! { once_cell::unsync::Lazy::new(|| cache::Memo::new(|| #block)) };
89+
let ty =
90+
quote! { once_cell::unsync::Lazy<reactive_cache::Memo<#output_ty, fn() -> #output_ty>> };
91+
let expr = quote! { once_cell::unsync::Lazy::new(|| reactive_cache::Memo::new(|| #block)) };
9192

9293
let expanded = quote! {
9394
static mut #ident: #ty = #expr;
@@ -110,12 +111,12 @@ pub fn effect(input: TokenStream) -> TokenStream {
110111
Expr::Path(path) if path.path.get_ident().is_some() => {
111112
let ident = path.path.get_ident().unwrap();
112113
quote! {
113-
cache::Effect::new(#ident)
114+
reactive_cache::Effect::new(#ident)
114115
}
115116
}
116117
Expr::Closure(closure) => {
117118
quote! {
118-
cache::Effect::new(#closure)
119+
reactive_cache::Effect::new(#closure)
119120
}
120121
}
121122
_ => {

macros/tests/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use macros::memo;
1+
use reactive_macros::memo;
22

33
#[memo]
44
pub fn get_number() -> i32 {

macros/tests/dep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::cell::Cell;
44

5-
use macros::{memo, signal};
5+
use reactive_macros::{memo, signal};
66

77
thread_local! {
88
static SOURCE_A_CALLED: Cell<bool> = const { Cell::new(false) };

macros/tests/effect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::rc::Rc;
44

5-
use macros::{effect, memo, signal};
5+
use reactive_macros::{effect, memo, signal};
66

77
static mut SOURCE_A_CALLED: i32 = 0;
88
static mut SOURCE_B_CALLED: i32 = 0;

macros/tests/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use macros::evaluate;
1+
use reactive_macros::evaluate;
22

33
static mut PRINT_INVOKED: i32 = 0;
44

0 commit comments

Comments
 (0)