Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

8 update metadata #9

Merged
merged 3 commits into from
Oct 11, 2023
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
19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[workspace]
workspace.resolver = "2"
members = ["tw-macro", "tailwind"]
members = ["twust-macro", "tailwind"]

# name = "tailwind-rust"
# version = "0.1.0"
# edition = "2021"

[workspace.package]
version = "1.0.0"
name = "twust"
version = "1.0.4"
edition = "2021"
authors = ["Oyelowo Oyedayo"]
description = "One codebase to rule them all"
documentation = "https://codebreather.com/oyelowo"
license = "MIT/Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -20,16 +19,16 @@ documentation = "https://codebreather.com/oyelowo"


[workspace.dependencies]
twust = { path = "tw-macro" }
twust = { path = "twust-macro" }
# tailwind = { path = "tailwind" }

proc-macro2 = "1.0.66"
proc-macro2 = "1.0.69"
quote = "1.0.33"
syn = "2.0.29"
syn = "2.0.38"
nom = "7.1.3"
static_assertions = "1.1.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.105"
regex = "1.9.5"
serde_json = "1.0.107"
regex = "1.10.0"
# tailwindcss-core = { git = "https://github.com/Oyelowo/tailwindcss.git", rev = "696810fd5a3d30ee8225913af268be1d2c9dbced" }
# tailwindcss-core = { git = "https://github.com/Oyelowo/tailwindcss/oxide/crates/core.git", rev = "696810fd5a3d30ee8225913af268be1d2c9dbced" }
7 changes: 4 additions & 3 deletions examples/leptos-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ edition = "2021"
leptos = { version = "0.5.0-beta2", features = ["csr", "nightly"] }
leptos_meta = { version = "0.5.0-beta2", features = ["csr", "nightly"] }
leptos_router = { version = "0.5.0-beta2", features = ["csr", "nightly"] }
log = "0.4"
gloo-net = { version = "0.2", features = ["http"] }
twust = { git = "https://github.com/oyelowo/twust", features = ["daisyui"] }
log = "0.4.2"
gloo-net = { version = "0.4.0", features = ["http"] }
twust = { version = "*", features = ["daisyui"] }
# twust = { git = "https://github.com/oyelowo/twust", features = ["daisyui"] }


# dependecies for client (enable when csr or hydrate set)
Expand Down
7 changes: 4 additions & 3 deletions examples/leptos-demo/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ pub fn App() -> impl IntoView {
fn Home() -> impl IntoView {
// Try to break mistype any of the class name and see what happens.
// Daisyui classes are also ssupported via a feature flag
let x = tw!("my-5 mx-auto max-w-3xl text-center");
view! {
<div class=tw!("my-5 mx-auto max-w-3xl text-center")>
<h2 class=tw!("p-6 text-4xl")>"Tw-macro"</h2>
<i class=tw!("p-2 text-2xl")>"Check your tailwind classes instantly with tw-macro."</i>
<h2 class=tw!("p-6 text-4xl")>"Twust"</h2>
<i class=tw!("p-2 text-2xl")>"Check your tailwind classes instantly with twust."</i>
<p class=tw!("p-2 text-2xl")>"We also support daisyui plugin."</p>

<div class=tw!("mockup-code w-[50px] [margin:auto]")>
<pre data-prefix="$"><code>cargo add tw-macro</code></pre>
<pre data-prefix="$"><code>cargo add twust</code></pre>
<pre data-prefix=">" class=tw!("text-warning")><code>installing...</code></pre>
<pre data-prefix=">" class=tw!("text-success")><code>Done!</code></pre>
</div>
Expand Down
3 changes: 1 addition & 2 deletions tailwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ fn _happy_paths() {
let _classnames = tw!("px-[45px]");
let _classnames = tw!("px-[45cm]");
let _classnames = tw!("px-[45rem]");
tw!("bg-taxvhiti");

// let _classnames = tw!("px-[45em]");
let _classnames = tw!("px-[45em]");
let _classnames = tw!("px-[45%]");
let _classnames = tw!("px-[45in]");
let _classnames = tw!("px-[45vh]");
Expand Down
4 changes: 2 additions & 2 deletions tailwind/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ aria-[sort=ascending]:bg-[url('/img/down-arrow.svg')] aria-[sort=descending]:bg-
// tw!("peer[.is-dirty]:peer-required:block hidden hidden peer-[:nth-of-type(3)_&]:block");
println!("TEXT - {}", test);
let _ = tw!("btn collapse-arrow");
tw!("bg-gray-600 bg-sky-700 bg-midnight underline");
tw!("bg-gray-600 aria-checked:bg-sky-700 aria-asc:bg-midnight data-checked:underline");
let _ = tw!("bg-gray-600 bg-sky-700 bg-midnight underline");
let _ = tw!("bg-gray-600 aria-checked:bg-sky-700 aria-asc:bg-midnight data-checked:underline");
let _classnames = tw!("bg-taxvhiti bg-tahiti-500 bg-tahiti bg-midnight bg-red-50");
let _classnames = tw!("bg-taxvhiti bg-tahiti-500 bg-tahiti bg-midnight bg-purple bg-red-50 bg-tahiti-800 border-s-tahiti-800");
let _classnames = tw!("md:text-red-50 text-slate-50 text-purple text-tahiti-500");
Expand Down
7 changes: 6 additions & 1 deletion tw-macro/Cargo.toml → twust-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ name = "twust"
version = { workspace = true }
edition = { workspace = true }
authors = { workspace = true }
description = { workspace = true }
# description = { workspace = true }
documentation = { workspace = true }
license = { workspace = true }
repository = "https://github.com/Oyelowo/twust"
description = "Static checker for tailwindcss class names in rust for rust"
readme = "../README.md"
keywords = ["tailwindcss", "tailwind", "css", "leptos", "yew"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions tw-macro/src/lib.rs → twust-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,28 +726,28 @@ fn parse_top(input: &str) -> IResult<&str, Vec<&str>> {
#[proc_macro]
pub fn tw(raw_input: TokenStream) -> TokenStream {
let r_input = raw_input.clone();
let input = parse_macro_input!(r_input as LitStr);
let (_modifiers, _valid_class_names) = match setup(&input) {
let input_original = parse_macro_input!(r_input as LitStr);
let (_modifiers, _valid_class_names) = match setup(&input_original) {
Ok(value) => value,
Err(value) => {
return syn::Error::new_spanned(input, value)
return syn::Error::new_spanned(input_original, value)
.to_compile_error()
.into()
}
};
let full_classnames = input.value();
let full_classnames = input_original.value();

let (input, _class_names) = match parse_top(&full_classnames) {
let (_input, _class_names) = match parse_top(&full_classnames) {
Ok(value) => value,
Err(value) => {
return syn::Error::new_spanned(input, value)
return syn::Error::new_spanned(input_original, value)
.to_compile_error()
.into()
}
};

quote::quote! {
#input
#input_original
}
.into()
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.