From a6f8b73324f02bec2e09ec9603b9ac18246a1ba7 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sun, 8 Jan 2023 10:52:53 -0500 Subject: [PATCH] rename compiler crate --- crates/compiler/Cargo.toml | 4 ++-- crates/compiler/src/lib.rs | 6 +++--- crates/include_sass/Cargo.toml | 2 +- crates/include_sass/src/lib.rs | 12 ++++++------ crates/lib/Cargo.toml | 6 +++--- crates/lib/src/lib.rs | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index 893b7b4..c6b8adf 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "compiler" +name = "grass_compiler" version = "0.12.1" edition = "2021" description = "Internal implementation of the grass compiler" @@ -11,7 +11,7 @@ repository = "https://github.com/connorskees/grass" authors = ["Connor Skees <39542938+ConnorSkees@users.noreply.github.com>"] [lib] -name = "compiler" +name = "grass_compiler" path = "src/lib.rs" # crate-type = ["cdylib", "rlib"] bench = false diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index fc247bc..2b44808 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -14,7 +14,7 @@ implementation. ## Use as library ``` -# use compiler as grass; +# use grass_compiler as grass; fn main() -> Result<(), Box> { let css = grass::from_string( "a { b { color: &; } }".to_owned(), @@ -187,7 +187,7 @@ fn from_string_with_file_name>( /// n.b. `grass` does not currently support files or paths that are not valid UTF-8 /// /// ``` -/// # use compiler as grass; +/// # use grass_compiler as grass; /// fn main() -> Result<(), Box> { /// let css = grass::from_path("input.scss", &grass::Options::default())?; /// Ok(()) @@ -201,7 +201,7 @@ pub fn from_path>(p: P, options: &Options) -> Result { /// Compile CSS from a string /// /// ``` -/// # use compiler as grass; +/// # use grass_compiler as grass; /// fn main() -> Result<(), Box> { /// let css = grass::from_string("a { b { color: &; } }".to_string(), &grass::Options::default())?; /// assert_eq!(css, "a b {\n color: a b;\n}\n"); diff --git a/crates/include_sass/Cargo.toml b/crates/include_sass/Cargo.toml index dfb5835..7073c87 100644 --- a/crates/include_sass/Cargo.toml +++ b/crates/include_sass/Cargo.toml @@ -16,7 +16,7 @@ proc-macro = true [dependencies] syn = { version = "1.0.103", default-features = false } -compiler = { path = "../compiler" } +grass_compiler = { path = "../compiler" } quote = { version = "1.0.23", default-features = false } [features] diff --git a/crates/include_sass/src/lib.rs b/crates/include_sass/src/lib.rs index da8d08d..22e0521 100644 --- a/crates/include_sass/src/lib.rs +++ b/crates/include_sass/src/lib.rs @@ -2,7 +2,7 @@ use std::{cell::RefCell, collections::HashSet, path::PathBuf}; -use compiler::StdFs; +use grass_compiler::StdFs; use proc_macro::TokenStream; use quote::format_ident; use syn::{parse_macro_input, LitStr}; @@ -12,10 +12,10 @@ use quote::__private::TokenStream as TokenStream2; #[derive(Debug)] struct FileTracker<'a> { files: RefCell>, - fs: &'a dyn compiler::Fs, + fs: &'a dyn grass_compiler::Fs, } -impl<'a> compiler::Fs for FileTracker<'a> { +impl<'a> grass_compiler::Fs for FileTracker<'a> { fn is_dir(&self, path: &std::path::Path) -> bool { #[cfg(feature = "nightly")] if let Ok(p) = std::fs::canonicalize(path) { @@ -88,7 +88,7 @@ fn finish(css: String, files: &HashSet) -> TokenStream { pub fn include_sass(item: TokenStream) -> TokenStream { let input = parse_macro_input!(item as LitStr); - let options = compiler::Options::default(); + let options = grass_compiler::Options::default(); let fs = FileTracker { files: RefCell::new(HashSet::new()), @@ -97,9 +97,9 @@ pub fn include_sass(item: TokenStream) -> TokenStream { let value = input.value(); - let css = match compiler::from_path( + let css = match grass_compiler::from_path( value, - &options.fs(&fs).style(compiler::OutputStyle::Compressed), + &options.fs(&fs).style(grass_compiler::OutputStyle::Compressed), ) { Ok(css) => css, Err(e) => { diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index baa62ee..eb9c5e0 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -24,7 +24,7 @@ path = "src/lib.rs" bench = false [dependencies] -compiler = { path = "../compiler", version = "0.12.1" } +grass_compiler = { path = "../compiler", version = "0.12.1" } include_sass = { path = "../include_sass", version = "0.12.1", optional = true } clap = { version = "2.34.0", optional = true } @@ -33,8 +33,8 @@ clap = { version = "2.34.0", optional = true } default = ["commandline", "random"] # Option (enabled by default): build a binary using clap commandline = ["clap"] -random = ["compiler/random"] -wasm-exports = ["compiler/wasm-exports"] +random = ["grass_compiler/random"] +wasm-exports = ["grass_compiler/wasm-exports"] # Option: include the proc macro `include_sass!` macro = ["include_sass"] nightly = ["include_sass/nightly"] diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index a935b14..b0df988 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -80,7 +80,7 @@ grass input.scss unknown_lints, )] -pub use compiler::*; +pub use grass_compiler::*; /// Include CSS in your binary at compile time from a Sass source file ///