diff --git a/Cargo.toml b/Cargo.toml index 30cb50402..4158f4c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,15 +5,16 @@ members = [ "packages/hooks", "packages/recoil", "packages/redux", - "packages/web", + # TODO @Jon, share the validation code + # "packages/web", "packages/cli", + "examples", + "packages/html-macro", # # # # Pulled from percy - "packages/html-macro", # "packages/html-macro-test", # "packages/virtual-dom-rs", # "packages/virtual-node", - "examples", ] diff --git a/packages/html-macro/Cargo.toml b/packages/html-macro/Cargo.toml index ae0365f58..b11f48e20 100644 --- a/packages/html-macro/Cargo.toml +++ b/packages/html-macro/Cargo.toml @@ -18,4 +18,5 @@ proc-macro = true proc-macro2 = { version = "0.4", features = ["span-locations"] } quote = "0.6.11" syn = { version = "0.15", features = ["full", "extra-traits"] } -html-validation = { path = "../html-validation", version = "0.1.2" } +lazy_static = "1.4.0" +# html-validation = { path = "../html-validation", version = "0.1.2" } diff --git a/packages/html-macro/src/lib.rs b/packages/html-macro/src/lib.rs index d24374add..ab047c0e2 100644 --- a/packages/html-macro/src/lib.rs +++ b/packages/html-macro/src/lib.rs @@ -7,6 +7,7 @@ use syn::parse_macro_input; mod parser; mod tag; +pub(crate) mod validation; /// Used to generate VirtualNode's from a TokenStream. /// diff --git a/packages/html-macro/src/parser/mod.rs b/packages/html-macro/src/parser/mod.rs index 5edd73f58..e0fdfa4e9 100644 --- a/packages/html-macro/src/parser/mod.rs +++ b/packages/html-macro/src/parser/mod.rs @@ -262,9 +262,9 @@ struct RecentSpanLocations { } fn is_self_closing(tag: &str) -> bool { - html_validation::is_self_closing(tag) + crate::validation::self_closing::is_self_closing(tag) } fn is_valid_tag(tag: &str) -> bool { - html_validation::is_valid_tag(tag) + crate::validation::valid_tags::is_valid_tag(tag) } diff --git a/packages/html-validation/src/lib.rs b/packages/html-macro/src/validation/mod.rs similarity index 90% rename from packages/html-validation/src/lib.rs rename to packages/html-macro/src/validation/mod.rs index 1f0f170ab..f83ed9e27 100644 --- a/packages/html-validation/src/lib.rs +++ b/packages/html-macro/src/validation/mod.rs @@ -31,12 +31,6 @@ //! //! Over time as our validation permitted more cases people could use html! more and more instead of html_loose! -#![deny(missing_docs)] - -pub use self_closing::is_self_closing; -pub use svg_namespace::is_svg_namespace; -pub use valid_tags::is_valid_tag; - -mod self_closing; -mod svg_namespace; -mod valid_tags; +pub mod self_closing; +pub mod svg_namespace; +pub mod valid_tags; diff --git a/packages/html-validation/src/self_closing.rs b/packages/html-macro/src/validation/self_closing.rs similarity index 100% rename from packages/html-validation/src/self_closing.rs rename to packages/html-macro/src/validation/self_closing.rs diff --git a/packages/html-validation/src/svg_namespace.rs b/packages/html-macro/src/validation/svg_namespace.rs similarity index 100% rename from packages/html-validation/src/svg_namespace.rs rename to packages/html-macro/src/validation/svg_namespace.rs diff --git a/packages/html-validation/src/valid_tags.rs b/packages/html-macro/src/validation/valid_tags.rs similarity index 100% rename from packages/html-validation/src/valid_tags.rs rename to packages/html-macro/src/validation/valid_tags.rs diff --git a/packages/html-validation/Cargo.toml b/packages/html-validation/Cargo.toml deleted file mode 100644 index b9dd35b94..000000000 --- a/packages/html-validation/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "html-validation" -version = "0.1.2" -authors = ["Chinedu Francis Nwafili "] -description = "Validation for HTML elements and attributes" -keywords = ["html", "validation", "valid", "dom", "virtual"] -license = "MIT/Apache-2.0" -repository = "https://github.com/chinedufn/percy" -edition = "2018" - -[dependencies] -lazy_static = "1.4.0"