From 2247d571c70629691a81957c617f0dcc7651bd80 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Wed, 27 Aug 2025 01:19:42 +0900 Subject: [PATCH 01/12] Impl split css --- .changeset/modern-kids-obey.md | 5 + Cargo.lock | 10 + apps/landing/next.config.ts | 4 +- bindings/devup-ui-wasm/src/lib.rs | 81 +- libs/css/Cargo.toml | 1 + libs/css/src/class_map.rs | 12 +- libs/css/src/constant.rs | 4 +- libs/css/src/file_map.rs | 68 ++ libs/css/src/lib.rs | 301 +++-- libs/css/src/num_to_nm_base.rs | 63 +- .../extract_style/extract_dynamic_style.rs | 3 +- .../src/extract_style/extract_keyframes.rs | 4 +- .../src/extract_style/extract_static_style.rs | 3 +- .../src/extract_style/extract_style_value.rs | 20 +- libs/extractor/src/extract_style/mod.rs | 2 +- libs/extractor/src/gen_class_name.rs | 46 +- libs/extractor/src/gen_style.rs | 88 +- libs/extractor/src/lib.rs | 1026 ++++++++++++----- libs/extractor/src/prop_modify_utils.rs | 32 +- ..._extract_just_tsx_in_multiple_files-2.snap | 27 + ..._extract_just_tsx_in_multiple_files-3.snap | 27 + ..._extract_just_tsx_in_multiple_files-4.snap | 27 + ...s__extract_just_tsx_in_multiple_files.snap | 27 + ...extractor__tests__extract_keyframs-10.snap | 4 +- .../extractor__tests__extract_keyframs-2.snap | 4 +- .../extractor__tests__extract_keyframs-3.snap | 4 +- .../extractor__tests__extract_keyframs-4.snap | 4 +- .../extractor__tests__extract_keyframs-5.snap | 4 +- .../extractor__tests__extract_keyframs-6.snap | 4 +- .../extractor__tests__extract_keyframs-7.snap | 4 +- .../extractor__tests__extract_keyframs-8.snap | 4 +- .../extractor__tests__extract_keyframs-9.snap | 4 +- .../extractor__tests__extract_keyframs.snap | 4 +- ...or__tests__extract_keyframs_literal-2.snap | 4 +- ...ctor__tests__extract_keyframs_literal.snap | 4 +- ...ractor__tests__extract_wrong_keyframs.snap | 4 +- libs/extractor/src/visit.rs | 37 +- libs/sheet/src/lib.rs | 633 ++++++---- .../snapshots/sheet__tests__deserialize.snap | 16 +- packages/next-plugin/src/plugin.ts | 14 +- packages/rsbuild-plugin/src/plugin.ts | 4 +- packages/vite-plugin/src/plugin.ts | 9 +- .../src/__tests__/loader.test.ts | 3 + .../src/__tests__/plugin.test.ts | 4 +- packages/webpack-plugin/src/css-loader.ts | 10 +- packages/webpack-plugin/src/loader.ts | 27 +- packages/webpack-plugin/src/plugin.ts | 34 +- 47 files changed, 1849 insertions(+), 875 deletions(-) create mode 100644 .changeset/modern-kids-obey.md create mode 100644 libs/css/src/file_map.rs create mode 100644 libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-2.snap create mode 100644 libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-3.snap create mode 100644 libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-4.snap create mode 100644 libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files.snap diff --git a/.changeset/modern-kids-obey.md b/.changeset/modern-kids-obey.md new file mode 100644 index 00000000..18c4fff8 --- /dev/null +++ b/.changeset/modern-kids-obey.md @@ -0,0 +1,5 @@ +--- +"@devup-ui/wasm": patch +--- + +Optimize keyframe name diff --git a/Cargo.lock b/Cargo.lock index 10606525..51069850 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,6 +45,15 @@ dependencies = [ "vsimd", ] +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "2.9.1" @@ -252,6 +261,7 @@ checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" name = "css" version = "0.1.0" dependencies = [ + "bimap", "once_cell", "phf 0.13.1", "regex", diff --git a/apps/landing/next.config.ts b/apps/landing/next.config.ts index b676aed5..25083af8 100644 --- a/apps/landing/next.config.ts +++ b/apps/landing/next.config.ts @@ -15,6 +15,8 @@ export default withMDX( pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], output: 'export', }, - { include: ['@devup-ui/components', '@devup-ui/reset-css'] }, + { + include: ['@devup-ui/components', '@devup-ui/reset-css'], + }, ), ) diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 930cd73f..6f4e5b81 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -1,4 +1,5 @@ use css::class_map::{get_class_map, set_class_map}; +use css::file_map::{get_file_map, get_filename_by_file_num}; use extractor::extract_style::ExtractStyleProperty; use extractor::extract_style::extract_style_value::ExtractStyleValue; use extractor::extract_style::style_property::StyleProperty; @@ -18,6 +19,9 @@ pub struct Output { styles: HashSet, map: Option, default_collected: bool, + split_css: bool, + filename: String, + css_file: String, } #[wasm_bindgen] extern "C" { @@ -39,6 +43,11 @@ impl Output { self.code.clone() } + #[wasm_bindgen(getter)] + pub fn css_file(&self) -> String { + self.css_file.clone() + } + #[wasm_bindgen(getter)] pub fn map(&self) -> Option { self.map.clone() @@ -52,7 +61,11 @@ impl Output { for style in self.styles.iter() { match style { ExtractStyleValue::Static(st) => { - let (cls, _) = match style.extract() { + let (cls, _) = match style.extract(if self.split_css { + Some(self.filename.as_str()) + } else { + None + }) { Some(StyleProperty::ClassName(cls)) => (cls, None), Some(StyleProperty::Variable { class_name, @@ -68,12 +81,21 @@ impl Output { st.value(), st.selector(), st.style_order(), + if self.split_css { + Some(self.filename.as_str()) + } else { + None + }, ) { collected = true; } } ExtractStyleValue::Dynamic(dy) => { - let (cls, variable) = match style.extract() { + let (cls, variable) = match style.extract(if self.split_css { + Some(self.filename.as_str()) + } else { + None + }) { Some(StyleProperty::ClassName(cls)) => (cls, None), Some(StyleProperty::Variable { class_name, @@ -89,6 +111,11 @@ impl Output { &format!("var({})", variable.unwrap()), dy.selector(), dy.style_order(), + if self.split_css { + Some(self.filename.as_str()) + } else { + None + }, ) { collected = true; } @@ -96,7 +123,13 @@ impl Output { ExtractStyleValue::Keyframes(keyframes) => { if sheet.add_keyframes( - &keyframes.extract().to_string(), + &keyframes + .extract(if self.split_css { + Some(self.filename.as_str()) + } else { + None + }) + .to_string(), keyframes .keyframes .iter() @@ -115,6 +148,11 @@ impl Output { ) }) .collect(), + if self.split_css { + Some(self.filename.as_str()) + } else { + None + }, ) { collected = true; } @@ -138,7 +176,11 @@ impl Output { return None; } - Some(sheet.create_css()) + Some(sheet.create_css(if self.split_css { + Some(self.filename.as_str()) + } else { + None + })) } } @@ -179,12 +221,27 @@ pub fn export_class_map() -> Result { serde_json::to_string(&get_class_map()).map_err(|e| JsValue::from_str(e.to_string().as_str())) } +#[wasm_bindgen(js_name = "importFileMap")] +pub fn import_file_map(sheet_object: JsValue) -> Result<(), JsValue> { + set_class_map( + serde_wasm_bindgen::from_value(sheet_object) + .map_err(|e| JsValue::from_str(e.to_string().as_str()))?, + ); + Ok(()) +} + +#[wasm_bindgen(js_name = "exportFileMap")] +pub fn export_file_map() -> Result { + serde_json::to_string(&get_file_map()).map_err(|e| JsValue::from_str(e.to_string().as_str())) +} + #[wasm_bindgen(js_name = "codeExtract")] pub fn code_extract( filename: &str, code: &str, package: &str, - css_file: &str, + css_dir: String, + split_css: bool, ) -> Result { let mut sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); @@ -193,7 +250,8 @@ pub fn code_extract( code, ExtractOption { package: package.to_string(), - css_file: Some(css_file.to_string()), + css_dir, + split_css, }, ) { Ok(output) => Ok(Output { @@ -201,6 +259,9 @@ pub fn code_extract( styles: output.styles, map: output.map, default_collected: sheet.rm_global_css(filename), + split_css, + filename: filename.to_string(), + css_file: output.css_file, }), Err(error) => Err(JsValue::from_str(error.to_string().as_str())), } @@ -222,9 +283,9 @@ pub fn get_default_theme() -> Result, JsValue> { } #[wasm_bindgen(js_name = "getCss")] -pub fn get_css() -> Result { +pub fn get_css(file_num: Option) -> Result { let sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); - Ok(sheet.create_css()) + Ok(sheet.create_css(file_num.map(|num| get_filename_by_file_num(num)).as_deref())) } #[wasm_bindgen(js_name = "getThemeInterface")] @@ -259,7 +320,7 @@ mod tests { let mut sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); *sheet = StyleSheet::default(); } - assert_eq!(get_css().unwrap(), ""); + assert_eq!(get_css(None).unwrap(), ""); { let mut sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); @@ -274,7 +335,7 @@ mod tests { sheet.set_theme(theme); } - assert_debug_snapshot!(get_css().unwrap()); + assert_debug_snapshot!(get_css(None).unwrap()); } #[test] diff --git a/libs/css/Cargo.toml b/libs/css/Cargo.toml index 038ce372..0ea9246b 100644 --- a/libs/css/Cargo.toml +++ b/libs/css/Cargo.toml @@ -9,6 +9,7 @@ phf = { version = "0.13", features = ["macros"] } serial_test = "3.2.0" serde = { version = "1.0.219", features = ["derive"] } regex = "1.11.2" +bimap = { version = "0.6.3", features = ["serde"] } [dev-dependencies] rstest = "0.26.1" diff --git a/libs/css/src/class_map.rs b/libs/css/src/class_map.rs index 1d396173..ed30c15b 100644 --- a/libs/css/src/class_map.rs +++ b/libs/css/src/class_map.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, sync::Mutex}; use once_cell::sync::Lazy; -pub(crate) static GLOBAL_CLASS_MAP: Lazy>> = +pub(crate) static GLOBAL_CLASS_MAP: Lazy>>> = Lazy::new(|| Mutex::new(HashMap::new())); /// for test @@ -11,12 +11,12 @@ pub fn reset_class_map() { map.clear(); } -pub fn set_class_map(map: HashMap) { +pub fn set_class_map(map: HashMap>) { let mut global_map = GLOBAL_CLASS_MAP.lock().unwrap(); *global_map = map; } -pub fn get_class_map() -> HashMap { +pub fn get_class_map() -> HashMap> { GLOBAL_CLASS_MAP.lock().unwrap().clone() } @@ -30,17 +30,17 @@ mod tests { #[serial] fn test_set_and_get_class_map() { let mut test_map = HashMap::new(); - test_map.insert("test-key".to_string(), 42); + test_map.insert("".to_string(), HashMap::new()); set_class_map(test_map.clone()); let got = get_class_map(); - assert_eq!(got.get("test-key"), Some(&42)); + assert_eq!(got.get(""), Some(&HashMap::new())); } #[test] #[serial] fn test_reset_class_map() { let mut test_map = HashMap::new(); - test_map.insert("reset-key".to_string(), 1); + test_map.insert("".to_string(), HashMap::new()); set_class_map(test_map); reset_class_map(); let got = get_class_map(); diff --git a/libs/css/src/constant.rs b/libs/css/src/constant.rs index 348ac726..ba095ff8 100644 --- a/libs/css/src/constant.rs +++ b/libs/css/src/constant.rs @@ -168,7 +168,7 @@ pub(super) static N_BASE_ARRAY: [char; 27] = [ 't', 'u', 'v', 'w', 'x', 'y', 'z', '_', ]; -pub(super) static M_BASE_ARRAY: [char; 38] = [ +pub(super) static M_BASE_ARRAY: [char; 37] = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', - 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', + 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', ]; diff --git a/libs/css/src/file_map.rs b/libs/css/src/file_map.rs new file mode 100644 index 00000000..08721c8c --- /dev/null +++ b/libs/css/src/file_map.rs @@ -0,0 +1,68 @@ +use bimap::BiHashMap; +use std::sync::Mutex; + +use once_cell::sync::Lazy; + +pub(crate) static GLOBAL_FILE_MAP: Lazy>> = + Lazy::new(|| Mutex::new(BiHashMap::new())); + +/// for test +pub fn reset_file_map() { + let mut map = GLOBAL_FILE_MAP.lock().unwrap(); + map.clear(); +} + +pub fn set_file_map(map: BiHashMap) { + let mut global_map = GLOBAL_FILE_MAP.lock().unwrap(); + *global_map = map; +} + +pub fn get_file_map() -> BiHashMap { + GLOBAL_FILE_MAP.lock().unwrap().clone() +} + +pub fn get_file_num_by_filename(filename: &str) -> usize { + let mut map = GLOBAL_FILE_MAP.lock().unwrap(); + let len = map.len(); + if !map.contains_left(filename) { + map.insert(filename.to_string(), len as usize); + } + *map.get_by_left(filename).unwrap() +} + +pub fn get_filename_by_file_num(file_num: usize) -> String { + let map = GLOBAL_FILE_MAP.lock().unwrap(); + map.get_by_right(&file_num) + .map(|s| s.as_str()) + .unwrap_or_default() + .to_string() +} + +#[cfg(test)] +mod tests { + use serial_test::serial; + + use super::*; + + #[test] + #[serial] + fn test_set_and_get_file_map() { + let mut test_map = BiHashMap::new(); + test_map.insert("test-key".to_string(), 42); + set_file_map(test_map.clone()); + let got = get_file_map(); + assert_eq!(got.get_by_left("test-key"), Some(&42)); + assert_eq!(got.get_by_right(&42), Some(&"test-key".to_string())); + } + + #[test] + #[serial] + fn test_reset_file_map() { + let mut test_map = BiHashMap::new(); + test_map.insert("reset-key".to_string(), 1); + set_file_map(test_map); + reset_file_map(); + let got = get_file_map(); + assert!(got.is_empty()); + } +} diff --git a/libs/css/src/lib.rs b/libs/css/src/lib.rs index d7895179..a17fec91 100644 --- a/libs/css/src/lib.rs +++ b/libs/css/src/lib.rs @@ -1,6 +1,7 @@ pub mod class_map; mod constant; pub mod debug; +pub mod file_map; pub mod is_special_property; mod num_to_nm_base; pub mod optimize_multi_css_value; @@ -10,11 +11,13 @@ mod selector_separator; pub mod style_selector; pub mod utils; +use std::collections::HashMap; use std::hash::{DefaultHasher, Hash, Hasher}; use crate::class_map::GLOBAL_CLASS_MAP; use crate::constant::{COLOR_HASH, F_SPACE_RE, GLOBAL_STYLE_PROPERTY, ZERO_RE}; use crate::debug::is_debug; +use crate::file_map::get_file_num_by_filename; use crate::num_to_nm_base::num_to_nm_base; use crate::optimize_value::optimize_value; use crate::style_selector::StyleSelector; @@ -63,17 +66,33 @@ pub fn disassemble_property(property: &str) -> Vec { }) } -pub fn keyframes_to_keyframes_name(keyframes: &str) -> String { +pub fn keyframes_to_keyframes_name(keyframes: &str, filename: Option<&str>) -> String { if is_debug() { format!("k-{keyframes}") } else { let key = format!("k-{keyframes}"); let mut map = GLOBAL_CLASS_MAP.lock().unwrap(); - map.get(&key).map(|v| format!("k{v}")).unwrap_or_else(|| { - let len = map.len(); - map.insert(key, len as i32); - format!("k{}", map.len() - 1) - }) + let filename = filename.unwrap_or_default().to_string(); + let class_num = map + .entry(filename.to_string()) + .or_insert_with(HashMap::new) + .get(&key) + .map(|v| format!("{}", num_to_nm_base(*v))) + .unwrap_or_else(|| { + let m = map.entry(filename.to_string()).or_insert_with(HashMap::new); + let len = m.len(); + m.insert(key, len); + format!("{}", num_to_nm_base(len)) + }); + if !filename.is_empty() { + format!( + "{}-{}", + num_to_nm_base(get_file_num_by_filename(&filename)), + class_num + ) + } else { + class_num + } } } @@ -83,11 +102,12 @@ pub fn sheet_to_classname( value: Option<&str>, selector: Option<&str>, style_order: Option, + filename: Option<&str>, ) -> String { if is_debug() { let selector = selector.unwrap_or_default().trim(); format!( - "{}-{}-{}-{}-{}", + "{}-{}-{}-{}-{}-{}", property.trim(), level, optimize_value(value.unwrap_or_default()), @@ -98,25 +118,41 @@ pub fn sheet_to_classname( selector.hash(&mut hasher); hasher.finish().to_string() }, - style_order.unwrap_or(255) + style_order.unwrap_or(255), + filename.unwrap_or_default() ) } else { let key = format!( - "{}-{}-{}-{}-{}", + "{}-{}-{}-{}-{}-{}", property.trim(), level, optimize_value(value.unwrap_or_default()), selector.unwrap_or_default().trim(), - style_order.unwrap_or(255) + style_order.unwrap_or(255), + filename.unwrap_or_default() ); let mut map = GLOBAL_CLASS_MAP.lock().unwrap(); - map.get(&key) - .map(|v| num_to_nm_base(*v as usize)) + let filename = filename.map(|v| v.to_string()).unwrap_or_default(); + let clas_num = map + .entry(filename.to_string()) + .or_insert_with(HashMap::new) + .get(&key) + .map(|v| num_to_nm_base(*v)) .unwrap_or_else(|| { - let len = map.len(); - map.insert(key, len as i32); - num_to_nm_base(map.len() - 1) - }) + let m = map.entry(filename.to_string()).or_insert_with(HashMap::new); + let len = m.len(); + m.insert(key, len); + num_to_nm_base(len) + }); + if !filename.is_empty() { + format!( + "{}-{}", + num_to_nm_base(get_file_num_by_filename(&filename)), + clas_num + ) + } else { + clas_num + } } } @@ -143,12 +179,15 @@ pub fn sheet_to_variable_name(property: &str, level: u8, selector: Option<&str>) selector.unwrap_or_default().trim() ); let mut map = GLOBAL_CLASS_MAP.lock().unwrap(); - map.get(&key) - .map(|v| format!("--{}", num_to_nm_base(*v as usize))) + map.entry("".to_string()) + .or_insert_with(HashMap::new) + .get(&key) + .map(|v| format!("--{}", num_to_nm_base(*v))) .unwrap_or_else(|| { - let len = map.len(); - map.insert(key, len as i32); - format!("--{}", num_to_nm_base(map.len() - 1)) + let m = map.entry("".to_string()).or_insert_with(HashMap::new); + let len = m.len(); + m.insert(key, len); + format!("--{}", num_to_nm_base(len)) }) } } @@ -210,83 +249,116 @@ mod tests { set_debug(false); reset_class_map(); assert_eq!( - sheet_to_classname("background", 0, Some("red"), None, None), + sheet_to_classname("background", 0, Some("red"), None, None, None), "a" ); assert_eq!( - sheet_to_classname("background", 0, Some("red"), Some("hover"), None), + sheet_to_classname("background", 0, Some("red"), Some("hover"), None, None), "b" ); - assert_eq!(sheet_to_classname("background", 1, None, None, None), "c"); assert_eq!( - sheet_to_classname("background", 1, None, Some("hover"), None), + sheet_to_classname("background", 1, None, None, None, None), + "c" + ); + assert_eq!( + sheet_to_classname("background", 1, None, Some("hover"), None, None), "d" ); reset_class_map(); assert_eq!( - sheet_to_classname("background", 0, None, None, None), - sheet_to_classname("background", 0, None, None, None) + sheet_to_classname("background", 0, None, None, None, None), + sheet_to_classname("background", 0, None, None, None, None) ); assert_eq!( - sheet_to_classname("background", 0, Some("red"), None, None), - sheet_to_classname("background", 0, Some("red"), None, None), + sheet_to_classname("background", 0, Some("red"), None, None, None), + sheet_to_classname("background", 0, Some("red"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("red"), None, None), - sheet_to_classname(" background ", 0, Some(" red "), None, None), + sheet_to_classname("background", 0, Some("red"), None, None, None), + sheet_to_classname(" background ", 0, Some(" red "), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("red"), None, None), - sheet_to_classname(" background ", 0, Some("red;"), None, None), + sheet_to_classname("background", 0, Some("red"), None, None, None), + sheet_to_classname(" background ", 0, Some("red;"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("rgba(255, 0, 0, 0.5)"), None, None), - sheet_to_classname("background", 0, Some("rgba(255,0,0,0.5)"), None, None), + sheet_to_classname( + "background", + 0, + Some("rgba(255, 0, 0, 0.5)"), + None, + None, + None + ), + sheet_to_classname("background", 0, Some("rgba(255,0,0,0.5)"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("rgba(255, 0, 0, 0.5)"), None, None), - sheet_to_classname("background", 0, Some("rgba(255,0,0,.5)"), None, None), + sheet_to_classname( + "background", + 0, + Some("rgba(255, 0, 0, 0.5)"), + None, + None, + None + ), + sheet_to_classname("background", 0, Some("rgba(255,0,0,.5)"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("rgba(255, 0, 0, 0.5)"), None, None), - sheet_to_classname("background", 0, Some("#FF000080"), None, None), + sheet_to_classname( + "background", + 0, + Some("rgba(255, 0, 0, 0.5)"), + None, + None, + None + ), + sheet_to_classname("background", 0, Some("#FF000080"), None, None, None), ); { let map = GLOBAL_CLASS_MAP.lock().unwrap(); - assert_eq!(map.get("background-0-#FF000080--255"), Some(&2)); + assert_eq!( + map.get("").unwrap().get("background-0-#FF000080--255-"), + Some(&2) + ); } assert_eq!( - sheet_to_classname("background", 0, Some("#fff"), None, None), - sheet_to_classname(" background ", 0, Some("#FFF"), None, None), + sheet_to_classname("background", 0, Some("#fff"), None, None, None), + sheet_to_classname(" background ", 0, Some("#FFF"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("#ffffff"), None, None), - sheet_to_classname("background", 0, Some("#FFF"), None, None), + sheet_to_classname("background", 0, Some("#ffffff"), None, None, None), + sheet_to_classname("background", 0, Some("#FFF"), None, None, None), ); { let map = GLOBAL_CLASS_MAP.lock().unwrap(); - assert_eq!(map.get("background-0-#FFF--255"), Some(&3)); + assert_eq!( + map.get("").unwrap().get("background-0-#FFF--255-"), + Some(&3) + ); } assert_eq!( - sheet_to_classname("background", 0, Some("#ffffff"), None, None), - sheet_to_classname("background", 0, Some("#FFFFFF"), None, None), + sheet_to_classname("background", 0, Some("#ffffff"), None, None, None), + sheet_to_classname("background", 0, Some("#FFFFFF"), None, None, None), ); assert_eq!( - sheet_to_classname("background", 0, Some("#ffffffAA"), None, None), - sheet_to_classname("background", 0, Some("#FFFFFFaa"), None, None), + sheet_to_classname("background", 0, Some("#ffffffAA"), None, None, None), + sheet_to_classname("background", 0, Some("#FFFFFFaa"), None, None, None), ); { let map = GLOBAL_CLASS_MAP.lock().unwrap(); - assert_eq!(map.get("background-0-#FFFA--255"), Some(&4)); + assert_eq!( + map.get("").unwrap().get("background-0-#FFFA--255-"), + Some(&4) + ); } assert_eq!( sheet_to_classname( @@ -294,6 +366,7 @@ mod tests { 0, Some("color-mix(in srgb,var(--primary) 80%, #000 20%)"), None, + None, None ), sheet_to_classname( @@ -301,110 +374,146 @@ mod tests { 0, Some("color-mix(in srgb, var(--primary) 80%, #000000 20%)"), None, + None, None ), ); reset_class_map(); - assert_eq!(sheet_to_classname("background", 0, None, None, None), "a"); assert_eq!( - sheet_to_classname("background", 0, None, None, Some(1)), + sheet_to_classname("background", 0, None, None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("background", 0, None, None, Some(1), None), "b" ); reset_class_map(); - assert_eq!(sheet_to_classname("width", 0, Some("0px"), None, None), "a"); - assert_eq!(sheet_to_classname("width", 0, Some("0em"), None, None), "a"); assert_eq!( - sheet_to_classname("width", 0, Some("0rem"), None, None), + sheet_to_classname("width", 0, Some("0px"), None, None, None), "a" ); - assert_eq!(sheet_to_classname("width", 0, Some("0vh"), None, None), "a"); - assert_eq!(sheet_to_classname("width", 0, Some("0%"), None, None), "a"); assert_eq!( - sheet_to_classname("width", 0, Some("0dvh"), None, None), + sheet_to_classname("width", 0, Some("0em"), None, None, None), "a" ); assert_eq!( - sheet_to_classname("width", 0, Some("0dvw"), None, None), + sheet_to_classname("width", 0, Some("0rem"), None, None, None), "a" ); - assert_eq!(sheet_to_classname("width", 0, Some("0vw"), None, None), "a"); - assert_eq!(sheet_to_classname("width", 0, Some("0"), None, None), "a"); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0px red"), None, None), + sheet_to_classname("width", 0, Some("0vh"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("width", 0, Some("0%"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("width", 0, Some("0dvh"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("width", 0, Some("0dvw"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("width", 0, Some("0vw"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("width", 0, Some("0"), None, None, None), + "a" + ); + assert_eq!( + sheet_to_classname("border", 0, Some("solid 0px red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0% red"), None, None), + sheet_to_classname("border", 0, Some("solid 0% red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0em red"), None, None), + sheet_to_classname("border", 0, Some("solid 0em red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0rem red"), None, None), + sheet_to_classname("border", 0, Some("solid 0rem red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0vh red"), None, None), + sheet_to_classname("border", 0, Some("solid 0vh red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0vw red"), None, None), + sheet_to_classname("border", 0, Some("solid 0vw red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0dvh red"), None, None), + sheet_to_classname("border", 0, Some("solid 0dvh red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("border", 0, Some("solid 0dvw red"), None, None), + sheet_to_classname("border", 0, Some("solid 0dvw red"), None, None, None), "b" ); assert_eq!( - sheet_to_classname("test", 0, Some("0px 0"), None, None), + sheet_to_classname("test", 0, Some("0px 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0em 0"), None, None), + sheet_to_classname("test", 0, Some("0em 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0rem 0"), None, None), + sheet_to_classname("test", 0, Some("0rem 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0vh 0"), None, None), + sheet_to_classname("test", 0, Some("0vh 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0vw 0"), None, None), + sheet_to_classname("test", 0, Some("0vw 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0dvh 0"), None, None), + sheet_to_classname("test", 0, Some("0dvh 0"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0 0vh"), None, None), + sheet_to_classname("test", 0, Some("0 0vh"), None, None, None), "c" ); assert_eq!( - sheet_to_classname("test", 0, Some("0 0vw"), None, None), + sheet_to_classname("test", 0, Some("0 0vw"), None, None, None), "c" ); reset_class_map(); assert_eq!( - sheet_to_classname("transition", 0, Some("all 0.3s ease-in-out"), None, None), + sheet_to_classname( + "transition", + 0, + Some("all 0.3s ease-in-out"), + None, + None, + None + ), "a" ); assert_eq!( - sheet_to_classname("transition", 0, Some("all .3s ease-in-out"), None, None), + sheet_to_classname( + "transition", + 0, + Some("all .3s ease-in-out"), + None, + None, + None + ), "a" ); } @@ -414,20 +523,20 @@ mod tests { fn test_debug_sheet_to_classname() { set_debug(true); assert_eq!( - sheet_to_classname("background", 0, None, None, None), - "background-0---255" + sheet_to_classname("background", 0, None, None, None, None), + "background-0---255-" ); assert_eq!( - sheet_to_classname("background", 0, Some("red"), Some("hover"), None), - "background-0-red-12448419602614487988-255" + sheet_to_classname("background", 0, Some("red"), Some("hover"), None, None), + "background-0-red-12448419602614487988-255-" ); assert_eq!( - sheet_to_classname("background", 1, None, None, None), - "background-1---255" + sheet_to_classname("background", 1, None, None, None, None), + "background-1---255-" ); assert_eq!( - sheet_to_classname("background", 1, Some("red"), Some("hover"), None), - "background-1-red-12448419602614487988-255" + sheet_to_classname("background", 1, Some("red"), Some("hover"), None, None), + "background-1-red-12448419602614487988-255-" ); } @@ -503,7 +612,10 @@ mod tests { #[serial] fn test_set_class_map() { let mut map = HashMap::new(); - map.insert("background-0-rgba(255,0,0,0.5)-".to_string(), 1); + map.insert("".to_string(), HashMap::new()); + map.get_mut(&"".to_string()) + .unwrap() + .insert("background-0-rgba(255,0,0,0.5)-".to_string(), 1); set_class_map(map); assert_eq!(get_class_map().len(), 1); } @@ -513,12 +625,15 @@ mod tests { fn test_keyframes_to_keyframes_name() { reset_class_map(); set_debug(false); - assert_eq!(keyframes_to_keyframes_name("spin"), "k0"); - assert_eq!(keyframes_to_keyframes_name("spin"), "k0"); - assert_eq!(keyframes_to_keyframes_name("spin2"), "k1"); + assert_eq!(keyframes_to_keyframes_name("spin", None), num_to_nm_base(0)); + assert_eq!(keyframes_to_keyframes_name("spin", None), num_to_nm_base(0)); + assert_eq!( + keyframes_to_keyframes_name("spin2", None), + num_to_nm_base(1) + ); reset_class_map(); set_debug(true); - assert_eq!(keyframes_to_keyframes_name("spin"), "k-spin"); - assert_eq!(keyframes_to_keyframes_name("spin1"), "k-spin1"); + assert_eq!(keyframes_to_keyframes_name("spin", None), "k-spin"); + assert_eq!(keyframes_to_keyframes_name("spin1", None), "k-spin1"); } } diff --git a/libs/css/src/num_to_nm_base.rs b/libs/css/src/num_to_nm_base.rs index 681b2300..d8fdc525 100644 --- a/libs/css/src/num_to_nm_base.rs +++ b/libs/css/src/num_to_nm_base.rs @@ -96,38 +96,37 @@ mod tests { #[case(60, "a7")] #[case(61, "a8")] #[case(62, "a9")] - #[case(63, "a-")] - #[case(64, "a_")] - #[case(65, "ba")] - #[case(66, "bb")] - #[case(67, "bc")] - #[case(68, "bd")] - #[case(69, "be")] - #[case(70, "bf")] - #[case(71, "bg")] - #[case(72, "bh")] - #[case(73, "bi")] - #[case(74, "bj")] - #[case(75, "bk")] - #[case(76, "bl")] - #[case(77, "bm")] - #[case(78, "bn")] - #[case(79, "bo")] - #[case(80, "bp")] - #[case(81, "bq")] - #[case(82, "br")] - #[case(83, "bs")] - #[case(84, "bt")] - #[case(85, "bu")] - #[case(86, "bv")] - #[case(87, "bw")] - #[case(88, "bx")] - #[case(89, "by")] - #[case(90, "bz")] - #[case(91, "b0")] - #[case(92, "b1")] - #[case(1052, "__")] - #[case(1053, "aaa")] + #[case(63, "a_")] + #[case(64, "ba")] + #[case(65, "bb")] + #[case(66, "bc")] + #[case(67, "bd")] + #[case(68, "be")] + #[case(69, "bf")] + #[case(70, "bg")] + #[case(71, "bh")] + #[case(72, "bi")] + #[case(73, "bj")] + #[case(74, "bk")] + #[case(75, "bl")] + #[case(76, "bm")] + #[case(77, "bn")] + #[case(78, "bo")] + #[case(79, "bp")] + #[case(80, "bq")] + #[case(81, "br")] + #[case(82, "bs")] + #[case(83, "bt")] + #[case(84, "bu")] + #[case(85, "bv")] + #[case(86, "bw")] + #[case(87, "bx")] + #[case(88, "by")] + #[case(89, "bz")] + #[case(90, "b0")] + #[case(91, "b1")] + #[case(1025, "__")] + #[case(1026, "aaa")] fn test_num_to_nm_base_rstest(#[case] input: usize, #[case] expected: &str) { assert_eq!(num_to_nm_base(input), expected); } diff --git a/libs/extractor/src/extract_style/extract_dynamic_style.rs b/libs/extractor/src/extract_style/extract_dynamic_style.rs index 2308357e..bb896e4f 100644 --- a/libs/extractor/src/extract_style/extract_dynamic_style.rs +++ b/libs/extractor/src/extract_style/extract_dynamic_style.rs @@ -59,7 +59,7 @@ impl ExtractDynamicStyle { } impl ExtractStyleProperty for ExtractDynamicStyle { - fn extract(&self) -> StyleProperty { + fn extract(&self, filename: Option<&str>) -> StyleProperty { let selector = self.selector.clone().map(|s| s.to_string()); StyleProperty::Variable { class_name: sheet_to_classname( @@ -68,6 +68,7 @@ impl ExtractStyleProperty for ExtractDynamicStyle { None, selector.as_deref(), self.style_order, + filename, ), variable_name: sheet_to_variable_name( self.property.as_str(), diff --git a/libs/extractor/src/extract_style/extract_keyframes.rs b/libs/extractor/src/extract_style/extract_keyframes.rs index 66f8f39a..d3479f84 100644 --- a/libs/extractor/src/extract_style/extract_keyframes.rs +++ b/libs/extractor/src/extract_style/extract_keyframes.rs @@ -15,10 +15,10 @@ pub struct ExtractKeyframes { } impl ExtractStyleProperty for ExtractKeyframes { - fn extract(&self) -> StyleProperty { + fn extract(&self, filename: Option<&str>) -> StyleProperty { let mut hasher = DefaultHasher::new(); self.keyframes.hash(&mut hasher); let hash_key = hasher.finish().to_string(); - StyleProperty::ClassName(keyframes_to_keyframes_name(&hash_key)) + StyleProperty::ClassName(keyframes_to_keyframes_name(&hash_key, filename)) } } diff --git a/libs/extractor/src/extract_style/extract_static_style.rs b/libs/extractor/src/extract_style/extract_static_style.rs index 2f9be507..73d2f119 100644 --- a/libs/extractor/src/extract_style/extract_static_style.rs +++ b/libs/extractor/src/extract_style/extract_static_style.rs @@ -96,7 +96,7 @@ impl ExtractStaticStyle { } impl ExtractStyleProperty for ExtractStaticStyle { - fn extract(&self) -> StyleProperty { + fn extract(&self, filename: Option<&str>) -> StyleProperty { let s = self.selector.clone().map(|s| s.to_string()); let v = optimize_value(&if MAINTAIN_VALUE_PROPERTIES.contains(&self.property) { self.value.to_string() @@ -114,6 +114,7 @@ impl ExtractStyleProperty for ExtractStaticStyle { Some(&v), s.as_deref(), self.style_order, + filename, )) } } diff --git a/libs/extractor/src/extract_style/extract_style_value.rs b/libs/extractor/src/extract_style/extract_style_value.rs index cd377a78..8e8fbad5 100644 --- a/libs/extractor/src/extract_style/extract_style_value.rs +++ b/libs/extractor/src/extract_style/extract_style_value.rs @@ -17,11 +17,11 @@ pub enum ExtractStyleValue { } impl ExtractStyleValue { - pub fn extract(&self) -> Option { + pub fn extract(&self, filename: Option<&str>) -> Option { match self { - ExtractStyleValue::Static(style) => Some(style.extract()), - ExtractStyleValue::Dynamic(style) => Some(style.extract()), - ExtractStyleValue::Keyframes(keyframes) => Some(keyframes.extract()), + ExtractStyleValue::Static(style) => Some(style.extract(filename)), + ExtractStyleValue::Dynamic(style) => Some(style.extract(filename)), + ExtractStyleValue::Keyframes(keyframes) => Some(keyframes.extract(filename)), ExtractStyleValue::Typography(typo) => { Some(StyleProperty::ClassName(format!("typo-{typo}"))) } @@ -68,33 +68,33 @@ mod tests { fn test_extract() { let style = ExtractStaticStyle::new("margin", "10px", 0, None); let value = ExtractStyleValue::Static(style); - let extracted = value.extract(); + let extracted = value.extract(None); assert!(matches!(extracted, Some(StyleProperty::ClassName(_)))); let style = ExtractDynamicStyle::new("margin", 0, "10px", None); let value = ExtractStyleValue::Dynamic(style); - let extracted = value.extract(); + let extracted = value.extract(None); assert!(matches!(extracted, Some(StyleProperty::Variable { .. }))); let keyframes = ExtractKeyframes::default(); let value = ExtractStyleValue::Keyframes(keyframes); - let extracted = value.extract(); + let extracted = value.extract(None); assert!(matches!(extracted, Some(StyleProperty::ClassName(_)))); let value = ExtractStyleValue::Typography("body1".to_string()); - let extracted = value.extract(); + let extracted = value.extract(None); assert!(matches!(extracted, Some(StyleProperty::ClassName(_)))); let value = ExtractStyleValue::Css(ExtractCss { css: "".to_string(), file: "".to_string(), }); - assert!(value.extract().is_none()); + assert!(value.extract(None).is_none()); let value = ExtractStyleValue::Import(ExtractImport { url: "".to_string(), file: "".to_string(), }); - assert!(value.extract().is_none()); + assert!(value.extract(None).is_none()); } } diff --git a/libs/extractor/src/extract_style/mod.rs b/libs/extractor/src/extract_style/mod.rs index 6bbb6872..2d02c05b 100644 --- a/libs/extractor/src/extract_style/mod.rs +++ b/libs/extractor/src/extract_style/mod.rs @@ -12,5 +12,5 @@ use crate::extract_style::style_property::StyleProperty; pub trait ExtractStyleProperty { /// extract style properties - fn extract(&self) -> StyleProperty; + fn extract(&self, filename: Option<&str>) -> StyleProperty; } diff --git a/libs/extractor/src/gen_class_name.rs b/libs/extractor/src/gen_class_name.rs index b49f9d61..42869aa9 100644 --- a/libs/extractor/src/gen_class_name.rs +++ b/libs/extractor/src/gen_class_name.rs @@ -11,12 +11,13 @@ pub fn gen_class_names<'a>( ast_builder: &AstBuilder<'a>, style_props: &mut [ExtractStyleProp<'a>], style_order: Option, + filename: Option<&str>, ) -> Option> { merge_expression_for_class_name( ast_builder, style_props .iter_mut() - .filter_map(|st| gen_class_name(ast_builder, st, style_order)) + .filter_map(|st| gen_class_name(ast_builder, st, style_order, filename)) .rev() .collect(), ) @@ -26,13 +27,14 @@ fn gen_class_name<'a>( ast_builder: &AstBuilder<'a>, style_prop: &mut ExtractStyleProp<'a>, style_order: Option, + filename: Option<&str>, ) -> Option> { match style_prop { ExtractStyleProp::Static(st) => { if let Some(style_order) = style_order { st.set_style_order(style_order); } - let target = st.extract(); + let target = st.extract(filename); Some(ast_builder.expression_string_literal( SPAN, @@ -47,7 +49,7 @@ fn gen_class_name<'a>( ExtractStyleProp::StaticArray(res) => merge_expression_for_class_name( ast_builder, res.iter_mut() - .filter_map(|st| gen_class_name(ast_builder, st, style_order)) + .filter_map(|st| gen_class_name(ast_builder, st, style_order, filename)) .collect(), ), ExtractStyleProp::Conditional { @@ -58,12 +60,14 @@ fn gen_class_name<'a>( } => { let consequent = consequent .as_mut() - .and_then(|ref mut con| gen_class_name(ast_builder, con.as_mut(), style_order)) + .and_then(|ref mut con| { + gen_class_name(ast_builder, con.as_mut(), style_order, filename) + }) .unwrap_or_else(|| ast_builder.expression_string_literal(SPAN, "", None)); let alternate = alternate .as_mut() - .and_then(|ref mut alt| gen_class_name(ast_builder, alt, style_order)) + .and_then(|ref mut alt| gen_class_name(ast_builder, alt, style_order, filename)) .unwrap_or_else(|| ast_builder.expression_string_literal(SPAN, "", None)); if is_same_expression(&consequent, &alternate) { Some(consequent) @@ -87,21 +91,25 @@ fn gen_class_name<'a>( ast_builder.expression_object( SPAN, ast_builder.vec_from_iter(map.iter_mut().filter_map(|(key, value)| { - gen_class_name(ast_builder, value.as_mut(), style_order).map(|expr| { - ast_builder.object_property_kind_object_property( - SPAN, - PropertyKind::Init, - PropertyKey::StringLiteral(ast_builder.alloc_string_literal( + gen_class_name(ast_builder, value.as_mut(), style_order, filename).map( + |expr| { + ast_builder.object_property_kind_object_property( SPAN, - ast_builder.atom(key), - None, - )), - expr, - false, - false, - false, - ) - }) + PropertyKind::Init, + PropertyKey::StringLiteral( + ast_builder.alloc_string_literal( + SPAN, + ast_builder.atom(key), + None, + ), + ), + expr, + false, + false, + false, + ) + }, + ) })), ), expression.clone_in(ast_builder.allocator), diff --git a/libs/extractor/src/gen_style.rs b/libs/extractor/src/gen_style.rs index 3fab89b2..5e2ac607 100644 --- a/libs/extractor/src/gen_style.rs +++ b/libs/extractor/src/gen_style.rs @@ -8,13 +8,14 @@ use std::collections::BTreeMap; pub fn gen_styles<'a>( ast_builder: &AstBuilder<'a>, style_props: &[ExtractStyleProp<'a>], + filename: Option<&str>, ) -> Option> { if style_props.is_empty() { return None; } let properties: Vec<_> = style_props .iter() - .flat_map(|style| gen_style(ast_builder, style)) + .flat_map(|style| gen_style(ast_builder, style, filename)) .rev() .collect(); if properties.is_empty() { @@ -28,6 +29,7 @@ pub fn gen_styles<'a>( fn gen_style<'a>( ast_builder: &AstBuilder<'a>, style: &ExtractStyleProp<'a>, + filename: Option<&str>, ) -> Vec> { let mut properties = vec![]; match style { @@ -36,7 +38,7 @@ fn gen_style<'a>( variable_name, identifier, .. - }) = st.extract() + }) = st.extract(filename) { properties.push(ast_builder.object_property_kind_object_property( SPAN, @@ -57,7 +59,7 @@ fn gen_style<'a>( properties.append( &mut res .iter() - .flat_map(|r| gen_style(ast_builder, r)) + .flat_map(|r| gen_style(ast_builder, r, filename)) .rev() .collect(), ); @@ -71,48 +73,52 @@ fn gen_style<'a>( return vec![]; } (None, Some(c)) => { - gen_style(ast_builder, c).into_iter().for_each(|p| { - if let ObjectPropertyKind::ObjectProperty(p) = p { - properties.push(ast_builder.object_property_kind_object_property( - SPAN, - PropertyKind::Init, - p.key.clone_in(ast_builder.allocator), - ast_builder.expression_conditional( + gen_style(ast_builder, c, filename) + .into_iter() + .for_each(|p| { + if let ObjectPropertyKind::ObjectProperty(p) = p { + properties.push(ast_builder.object_property_kind_object_property( SPAN, - condition.clone_in(ast_builder.allocator), - ast_builder.expression_identifier(SPAN, "undefined"), - p.value.clone_in(ast_builder.allocator), - ), - false, - false, - false, - )) - } - }); + PropertyKind::Init, + p.key.clone_in(ast_builder.allocator), + ast_builder.expression_conditional( + SPAN, + condition.clone_in(ast_builder.allocator), + ast_builder.expression_identifier(SPAN, "undefined"), + p.value.clone_in(ast_builder.allocator), + ), + false, + false, + false, + )) + } + }); } (Some(c), None) => { - gen_style(ast_builder, c).into_iter().for_each(|p| { - if let ObjectPropertyKind::ObjectProperty(p) = p { - properties.push(ast_builder.object_property_kind_object_property( - SPAN, - PropertyKind::Init, - p.key.clone_in(ast_builder.allocator), - ast_builder.expression_conditional( + gen_style(ast_builder, c, filename) + .into_iter() + .for_each(|p| { + if let ObjectPropertyKind::ObjectProperty(p) = p { + properties.push(ast_builder.object_property_kind_object_property( SPAN, - condition.clone_in(ast_builder.allocator), - p.value.clone_in(ast_builder.allocator), - ast_builder.expression_identifier(SPAN, "undefined"), - ), - false, - false, - false, - )) - } - }); + PropertyKind::Init, + p.key.clone_in(ast_builder.allocator), + ast_builder.expression_conditional( + SPAN, + condition.clone_in(ast_builder.allocator), + p.value.clone_in(ast_builder.allocator), + ast_builder.expression_identifier(SPAN, "undefined"), + ), + false, + false, + false, + )) + } + }); } (Some(c), Some(a)) => { - let collect_c = gen_style(ast_builder, c); - let collect_a = gen_style(ast_builder, a); + let collect_c = gen_style(ast_builder, c, filename); + let collect_a = gen_style(ast_builder, a, filename); if collect_c.is_empty() && collect_a.is_empty() { return vec![]; } @@ -189,7 +195,7 @@ fn gen_style<'a>( variable_name, identifier, .. - }) = style.extract() + }) = style.extract(filename) { properties.push(ast_builder.object_property_kind_object_property( SPAN, @@ -215,7 +221,7 @@ fn gen_style<'a>( variable_name, identifier, .. - }) = style.extract() + }) = style.extract(filename) { tmp_map .entry(variable_name) diff --git a/libs/extractor/src/lib.rs b/libs/extractor/src/lib.rs index 543ebd7d..85578ab3 100644 --- a/libs/extractor/src/lib.rs +++ b/libs/extractor/src/lib.rs @@ -10,6 +10,7 @@ mod utils; mod visit; use crate::extract_style::extract_style_value::ExtractStyleValue; use crate::visit::DevupVisitor; +use css::file_map::get_file_num_by_filename; use oxc_allocator::Allocator; use oxc_ast::ast::Expression; use oxc_ast_visit::VisitMut; @@ -76,11 +77,13 @@ pub struct ExtractOutput { pub code: String, pub map: Option, + pub css_file: String, } pub struct ExtractOption { pub package: String, - pub css_file: Option, + pub css_dir: String, + pub split_css: bool, } pub fn extract( @@ -89,12 +92,22 @@ pub fn extract( option: ExtractOption, ) -> Result> { let source_type = SourceType::from_path(filename)?; + let css_file = if option.split_css { + format!( + "{}/devup-ui-{}.css", + option.css_dir, + get_file_num_by_filename(filename) + ) + } else { + format!("{}/devup-ui.css", option.css_dir) + }; if !code.contains(option.package.as_str()) { // skip if not using package return Ok(ExtractOutput { styles: HashSet::new(), code: code.to_string(), map: None, + css_file, }); } let allocator = Allocator::default(); @@ -111,9 +124,12 @@ pub fn extract( &allocator, filename, &option.package, - &option - .css_file - .unwrap_or(format!("{}/devup-ui.css", option.package)), + &css_file, + if option.split_css { + Some(filename.to_string()) + } else { + None + }, ); visitor.visit_program(&mut program); let result = Codegen::new() @@ -127,6 +143,7 @@ pub fn extract( styles: visitor.styles, code: result.code, map: result.map.map(|m| m.to_json_string()), + css_file, }) } @@ -171,7 +188,8 @@ mod tests { "const a = 1;", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false }, ) .unwrap() @@ -184,7 +202,8 @@ mod tests { "", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false }, ) .unwrap() @@ -200,7 +219,11 @@ mod tests { r#"import {Box} from '@devup-ui/core' {}} aria-valuenow={24} key={2} tabIndex={1} id="id" /> "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_file: None } + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: false, + } ) .unwrap() )); @@ -214,7 +237,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -233,7 +257,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -248,7 +273,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -261,7 +287,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -276,7 +303,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -289,7 +317,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -352,7 +381,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -366,7 +396,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -380,7 +411,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -395,7 +427,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -410,7 +443,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -425,7 +459,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -446,7 +481,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -468,7 +504,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -489,7 +526,8 @@ mod tests { ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -508,7 +546,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -523,7 +562,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -538,7 +578,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -553,7 +594,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -567,7 +609,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -588,7 +631,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -603,7 +647,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -622,7 +667,8 @@ mod tests { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -655,7 +701,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -674,7 +721,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -692,7 +740,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -705,7 +754,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -724,7 +774,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -739,7 +790,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -754,7 +806,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -769,7 +822,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -788,7 +842,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -803,7 +858,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -818,7 +874,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -837,7 +894,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -852,7 +910,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -867,7 +926,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -882,7 +942,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -897,7 +958,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -916,7 +978,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -935,7 +998,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -954,7 +1018,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -969,7 +1034,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -988,7 +1054,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1003,7 +1070,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1022,7 +1090,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1037,7 +1106,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1052,7 +1122,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1067,7 +1138,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1082,7 +1154,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1097,7 +1170,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1112,7 +1186,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1127,7 +1202,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1142,7 +1218,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1161,7 +1238,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1176,7 +1254,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1191,7 +1270,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1206,7 +1286,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1221,7 +1302,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1236,7 +1318,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1255,7 +1338,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1270,7 +1354,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1289,7 +1374,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1304,7 +1390,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1319,7 +1406,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1334,7 +1422,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1349,7 +1438,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1364,7 +1454,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1379,7 +1470,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1394,7 +1486,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1413,7 +1506,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1428,7 +1522,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1443,7 +1538,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1458,7 +1554,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1477,7 +1574,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1492,7 +1590,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1507,7 +1606,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1522,7 +1622,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1540,7 +1641,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1555,7 +1657,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1576,7 +1679,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1610,7 +1714,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1629,7 +1734,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1648,7 +1754,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1667,7 +1774,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1686,7 +1794,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1705,7 +1814,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1722,7 +1832,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1746,7 +1857,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1765,7 +1877,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1780,7 +1893,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1795,7 +1909,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1810,7 +1925,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1825,7 +1941,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1840,7 +1957,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1855,7 +1973,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1876,7 +1995,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1895,7 +2015,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1917,7 +2038,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1938,7 +2060,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1962,7 +2085,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -1985,7 +2109,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2007,7 +2132,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2035,7 +2161,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2058,7 +2185,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2083,7 +2211,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2108,7 +2237,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2133,7 +2263,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2158,7 +2289,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2179,7 +2311,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2196,7 +2329,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2211,7 +2345,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2229,7 +2364,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2250,7 +2386,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2269,7 +2406,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2290,7 +2428,8 @@ import clsx from 'clsx' ", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2311,7 +2450,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2328,7 +2468,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2346,7 +2487,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2363,7 +2505,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2383,7 +2526,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2398,7 +2542,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2413,7 +2558,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2428,7 +2574,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2448,7 +2595,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2474,7 +2622,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2489,7 +2638,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2504,7 +2654,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2520,7 +2671,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2535,7 +2687,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2550,7 +2703,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2565,7 +2719,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2590,7 +2745,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2614,7 +2770,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2633,7 +2790,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2652,7 +2810,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2667,7 +2826,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2682,7 +2842,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2701,7 +2862,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2716,7 +2878,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2731,7 +2894,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2749,7 +2913,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2764,7 +2929,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2779,7 +2945,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2799,7 +2966,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2816,7 +2984,8 @@ import clsx from 'clsx' "const a = 1;", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false }, ) .unwrap_err() @@ -2831,7 +3000,8 @@ import clsx from 'clsx' "import {} '@devup-ui/core';\na a = 1;", ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false }, ) .unwrap_err() @@ -2851,7 +3021,8 @@ import clsx from 'clsx' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2866,7 +3037,8 @@ useTheme(); "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2904,7 +3076,8 @@ export { };"#, ExtractOption { package: "@devup-ui/react".to_string(), - css_file: None + css_dir: "@devup-ui/react".to_string(), + split_css: false } ) .unwrap() @@ -2938,7 +3111,8 @@ export { };"#, ExtractOption { package: "@devup-ui/react".to_string(), - css_file: None + css_dir: "@devup-ui/react".to_string(), + split_css: false } ) .unwrap() @@ -2954,7 +3128,8 @@ e(o, { className: "a", bg: "red" }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2970,7 +3145,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" } }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2986,7 +3162,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -2997,16 +3174,16 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) #[serial] fn support_transpile_cjs() { reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_file: None }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_file: None }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_file: None }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_file: None }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); } #[test] @@ -3019,7 +3196,11 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) r#"import {Flex} from '@devup-ui/core' "#, - ExtractOption { package: "@devup-ui/core".to_string(), css_file: None } + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: false, + } ) .unwrap() )); @@ -3037,7 +3218,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3052,7 +3234,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3067,7 +3250,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3086,7 +3270,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3101,7 +3286,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3116,7 +3302,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3135,7 +3322,8 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3169,7 +3357,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3188,7 +3377,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3203,7 +3393,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3218,7 +3409,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3233,7 +3425,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3248,7 +3441,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3266,7 +3460,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3281,7 +3476,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3296,7 +3492,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3311,7 +3508,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3326,7 +3524,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3341,7 +3540,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3356,7 +3556,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3375,7 +3576,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3390,7 +3592,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3405,7 +3608,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3420,7 +3624,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3443,7 +3648,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3458,7 +3664,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3477,7 +3684,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3492,7 +3700,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3507,7 +3716,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3522,7 +3732,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3540,7 +3751,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3555,7 +3767,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3570,7 +3783,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3609,7 +3823,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3628,7 +3843,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3643,7 +3859,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3658,7 +3875,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3673,7 +3891,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3692,7 +3911,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3706,7 +3926,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3725,7 +3946,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3740,7 +3962,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3758,7 +3981,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3777,7 +4001,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3792,7 +4017,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3810,7 +4036,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3825,7 +4052,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3844,7 +4072,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3863,7 +4092,8 @@ export default function Card({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3886,7 +4116,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3905,7 +4136,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3920,7 +4152,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3939,7 +4172,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3958,7 +4192,8 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -3979,7 +4214,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4001,7 +4237,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4019,7 +4256,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4038,7 +4276,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4069,7 +4308,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4088,7 +4328,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4103,7 +4344,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4118,7 +4360,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4133,7 +4376,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4148,7 +4392,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4167,7 +4412,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4186,7 +4432,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4200,7 +4447,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4222,7 +4470,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4245,7 +4494,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4264,7 +4514,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4283,7 +4534,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4306,7 +4558,8 @@ import {Button} from '@devup/ui' "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4341,7 +4594,8 @@ export { };"#, ExtractOption { package: "@devup-ui/react".to_string(), - css_file: None + css_dir: "@devup-ui/react".to_string(), + split_css: false } ) .unwrap() @@ -4356,7 +4610,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4371,7 +4626,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4386,7 +4642,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4408,7 +4665,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4431,7 +4689,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4446,7 +4705,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4472,7 +4732,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4494,7 +4755,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4516,7 +4778,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4537,7 +4800,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4554,7 +4818,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4572,7 +4837,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4589,7 +4855,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4606,7 +4873,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4623,7 +4891,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4640,7 +4909,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4657,7 +4927,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4677,7 +4948,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4692,7 +4964,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4711,7 +4984,8 @@ export { "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4731,7 +5005,8 @@ e(o, { styleVars: { c: "yellow" } }) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4754,7 +5029,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4773,7 +5049,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4792,7 +5069,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4811,7 +5089,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4830,7 +5109,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4849,7 +5129,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4868,7 +5149,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4883,7 +5165,8 @@ globalCss(...{}) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4898,7 +5181,8 @@ globalCss(...{div: {bg: "red"}}) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4914,7 +5198,8 @@ globalCss(...{div: {bg: "red"}, ...{span: {bg: "blue"}}}) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4937,7 +5222,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4952,7 +5238,8 @@ globalCss() "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4967,7 +5254,8 @@ globalCss(1) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -4995,7 +5283,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5027,7 +5316,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5059,7 +5349,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5099,7 +5390,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5122,7 +5414,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5139,7 +5432,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5156,7 +5450,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5174,7 +5469,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5194,7 +5490,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5209,7 +5506,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5224,7 +5522,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5240,7 +5539,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5261,7 +5561,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5278,7 +5579,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5295,7 +5597,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5327,7 +5630,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5350,7 +5654,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5372,7 +5677,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5393,7 +5699,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5416,7 +5723,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5439,7 +5747,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5477,7 +5786,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5498,7 +5808,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5515,7 +5826,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5536,7 +5848,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5554,7 +5867,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5571,7 +5885,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5589,7 +5904,8 @@ globalCss({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5604,7 +5920,8 @@ globalCss({}) "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5619,7 +5936,8 @@ globalCss() "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5641,7 +5959,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5660,7 +5979,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5679,7 +5999,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5698,7 +6019,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5717,7 +6039,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5736,7 +6059,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5755,7 +6079,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5774,7 +6099,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5809,7 +6135,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5828,7 +6155,8 @@ keyframes(...{ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5850,7 +6178,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5893,7 +6222,8 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false } ) .unwrap() @@ -5938,7 +6268,71 @@ keyframes({ "#, ExtractOption { package: "@devup-ui/core".to_string(), - css_file: None + css_dir: "@devup-ui/core".to_string(), + split_css: false + } + ) + .unwrap() + )); + } + + #[test] + #[serial] + fn extract_just_tsx_in_multiple_files() { + reset_class_map(); + assert_debug_snapshot!(ToBTreeSet::from( + extract( + "test.tsx", + r"import {Box} from '@devup-ui/core' + /> + ", + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: true + } + ) + .unwrap() + )); + assert_debug_snapshot!(ToBTreeSet::from( + extract( + "test.tsx", + r"import {Box as C} from '@devup-ui/core' + + ", + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: true + } + ) + .unwrap() + )); + + assert_debug_snapshot!(ToBTreeSet::from( + extract( + "test1.tsx", + r"import {Box} from '@devup-ui/core' + /> + ", + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: true + } + ) + .unwrap() + )); + assert_debug_snapshot!(ToBTreeSet::from( + extract( + "test1.tsx", + r"import {Box as C} from '@devup-ui/core' + + ", + ExtractOption { + package: "@devup-ui/core".to_string(), + css_dir: "@devup-ui/core".to_string(), + split_css: true } ) .unwrap() diff --git a/libs/extractor/src/prop_modify_utils.rs b/libs/extractor/src/prop_modify_utils.rs index b3444736..990ce197 100644 --- a/libs/extractor/src/prop_modify_utils.rs +++ b/libs/extractor/src/prop_modify_utils.rs @@ -18,6 +18,7 @@ pub fn modify_prop_object<'a>( styles: &mut [ExtractStyleProp<'a>], style_order: Option, style_vars: Option>, + filename: Option<&str>, ) { let mut class_name_prop = None; let mut style_prop = None; @@ -54,6 +55,7 @@ pub fn modify_prop_object<'a>( styles, style_order, &spread_props, + filename, ) { props.push(ast_builder.object_property_kind_object_property( SPAN, @@ -65,9 +67,14 @@ pub fn modify_prop_object<'a>( false, )); } - if let Some(ex) = - get_style_expression(ast_builder, &style_prop, styles, &style_vars, &spread_props) - { + if let Some(ex) = get_style_expression( + ast_builder, + &style_prop, + styles, + &style_vars, + &spread_props, + filename, + ) { props.push(ast_builder.object_property_kind_object_property( SPAN, PropertyKind::Init, @@ -86,6 +93,7 @@ pub fn modify_props<'a>( styles: &mut [ExtractStyleProp<'a>], style_order: Option, style_vars: Option>, + filename: Option<&str>, ) { let mut class_name_prop = None; let mut style_prop = None; @@ -131,6 +139,7 @@ pub fn modify_props<'a>( styles, style_order, &spread_props, + filename, ) { props.push(ast_builder.jsx_attribute_item_attribute( SPAN, @@ -142,9 +151,14 @@ pub fn modify_props<'a>( }), )); } - if let Some(ex) = - get_style_expression(ast_builder, &style_prop, styles, &style_vars, &spread_props) - { + if let Some(ex) = get_style_expression( + ast_builder, + &style_prop, + styles, + &style_vars, + &spread_props, + filename, + ) { props.push(ast_builder.jsx_attribute_item_attribute( SPAN, ast_builder.jsx_attribute_name_identifier(SPAN, "style"), @@ -159,6 +173,7 @@ pub fn get_class_name_expression<'a>( styles: &mut [ExtractStyleProp<'a>], style_order: Option, spread_props: &[Expression<'a>], + filename: Option<&str>, ) -> Option> { // should modify class name prop merge_string_expressions( @@ -167,7 +182,7 @@ pub fn get_class_name_expression<'a>( class_name_prop .as_ref() .map(|class_name| convert_class_name(ast_builder, class_name)), - gen_class_names(ast_builder, styles, style_order), + gen_class_names(ast_builder, styles, style_order, filename), ] .into_iter() .flatten() @@ -202,11 +217,12 @@ pub fn get_style_expression<'a>( styles: &[ExtractStyleProp<'a>], style_vars: &Option>, spread_props: &[Expression<'a>], + filename: Option<&str>, ) -> Option> { merge_object_expressions( ast_builder, [ - gen_styles(ast_builder, styles), + gen_styles(ast_builder, styles, filename), style_vars .as_ref() .map(|style_vars| convert_style_vars(ast_builder, style_vars)), diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-2.snap b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-2.snap new file mode 100644 index 00000000..2b941ba9 --- /dev/null +++ b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-2.snap @@ -0,0 +1,27 @@ +--- +source: libs/extractor/src/lib.rs +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr\"import {Box as C} from '@devup-ui/core'\n \n \",\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: true\n}).unwrap())" +--- +ToBTreeSet { + styles: { + Static( + ExtractStaticStyle { + property: "margin", + value: "12px", + level: 0, + selector: None, + style_order: None, + }, + ), + Static( + ExtractStaticStyle { + property: "padding", + value: "8px", + level: 0, + selector: None, + style_order: None, + }, + ), + }, + code: "import \"@devup-ui/core/devup-ui-0.css\";\n
;\n", +} diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-3.snap b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-3.snap new file mode 100644 index 00000000..2638f0f7 --- /dev/null +++ b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-3.snap @@ -0,0 +1,27 @@ +--- +source: libs/extractor/src/lib.rs +expression: "ToBTreeSet::from(extract(\"test1.tsx\",\nr\"import {Box} from '@devup-ui/core'\n />\n \",\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: true\n}).unwrap())" +--- +ToBTreeSet { + styles: { + Static( + ExtractStaticStyle { + property: "margin", + value: "8px", + level: 0, + selector: None, + style_order: None, + }, + ), + Static( + ExtractStaticStyle { + property: "padding", + value: "4px", + level: 0, + selector: None, + style_order: None, + }, + ), + }, + code: "import \"@devup-ui/core/devup-ui-1.css\";\n
;\n", +} diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-4.snap b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-4.snap new file mode 100644 index 00000000..ed263de1 --- /dev/null +++ b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files-4.snap @@ -0,0 +1,27 @@ +--- +source: libs/extractor/src/lib.rs +expression: "ToBTreeSet::from(extract(\"test1.tsx\",\nr\"import {Box as C} from '@devup-ui/core'\n \n \",\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: true\n}).unwrap())" +--- +ToBTreeSet { + styles: { + Static( + ExtractStaticStyle { + property: "margin", + value: "12px", + level: 0, + selector: None, + style_order: None, + }, + ), + Static( + ExtractStaticStyle { + property: "padding", + value: "8px", + level: 0, + selector: None, + style_order: None, + }, + ), + }, + code: "import \"@devup-ui/core/devup-ui-1.css\";\n
;\n", +} diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files.snap b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files.snap new file mode 100644 index 00000000..b8aa1795 --- /dev/null +++ b/libs/extractor/src/snapshots/extractor__tests__extract_just_tsx_in_multiple_files.snap @@ -0,0 +1,27 @@ +--- +source: libs/extractor/src/lib.rs +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr\"import {Box} from '@devup-ui/core'\n />\n \",\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: true\n}).unwrap())" +--- +ToBTreeSet { + styles: { + Static( + ExtractStaticStyle { + property: "margin", + value: "8px", + level: 0, + selector: None, + style_order: None, + }, + ), + Static( + ExtractStaticStyle { + property: "padding", + value: "4px", + level: 0, + selector: None, + style_order: None, + }, + ), + }, + code: "import \"@devup-ui/core/devup-ui-0.css\";\n
;\n", +} diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap index b12be96b..18330c5a 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes(...{\n [`0%`]: { opacity: 0, ...{color: \"red\"} },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes(...{\n [`0%`]: { opacity: 0, ...{color: \"red\"} },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -45,5 +45,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap index bb7c4755..713b78ae 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": { opacity: 0 },\n \"50%\": { opacity: 0.5 },\n \"100%\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": { opacity: 0 },\n \"50%\": { opacity: 0.5 },\n \"100%\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap index 2c2536ce..6f5ffb34 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0\": { opacity: 0 },\n \"50\": { opacity: 0.5 },\n \"100\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0\": { opacity: 0 },\n \"50\": { opacity: 0.5 },\n \"100\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap index 8e92ff23..21cdbc88 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [\"0\"]: { opacity: 0 },\n [\"50\"]: { opacity: 0.5 },\n [\"100\"]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [\"0\"]: { opacity: 0 },\n [\"50\"]: { opacity: 0.5 },\n [\"100\"]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap index 59758203..a29e95e6 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [0]: { opacity: 0 },\n [50]: { opacity: 0.5 },\n [100]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [0]: { opacity: 0 },\n [50]: { opacity: 0.5 },\n [100]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap index 94129fb1..425d2e22 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n 0: { opacity: 0 },\n 50: { opacity: 0.5 },\n 100: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n 0: { opacity: 0 },\n 50: { opacity: 0.5 },\n 100: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap index ef8c4a9a..37a8139e 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap index 06c4f541..255c192e 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -38,5 +38,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap index 661aaa02..e0ed3c0f 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\n\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`1%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 1 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\n\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`1%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 1 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -104,5 +104,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n\"k0\";\n\"k1\";\n\"k2\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n\"a\";\n\"b\";\n\"c\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap index d19b80f8..6db83261 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n to: { opacity: 1 }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n to: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -29,5 +29,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap index 075670de..94ef8efe 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": `\n background-color: red;\n color: blue;\n `,\n \"100%\": `\n background-color: blue;\n color: red;\n `\n})\n\nkeyframes`\n 0% {\n background-color: red;\n color: blue;\n }\n 100% {\n background-color: blue;\n color: red;\n }\n`\nkeyframes({\n \"0%\": {\n backgroundColor: \"red\",\n color: \"blue\"\n },\n \"100%\": {\n backgroundColor: \"blue\",\n color: \"red\"\n }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": `\n background-color: red;\n color: blue;\n `,\n \"100%\": `\n background-color: blue;\n color: red;\n `\n})\n\nkeyframes`\n 0% {\n background-color: red;\n color: blue;\n }\n 100% {\n background-color: blue;\n color: red;\n }\n`\nkeyframes({\n \"0%\": {\n backgroundColor: \"red\",\n color: \"blue\"\n },\n \"100%\": {\n backgroundColor: \"blue\",\n color: \"red\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -43,5 +43,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n\"k0\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n\"a\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap index 411f8408..336b1206 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: `\n background-color: red;\n `,\n to: `\n background-color: blue;\n `\n})\n\nkeyframes`\n from {\n background-color: red;\n }\n to {\n background-color: blue;\n }\n`\nkeyframes({\n from: {\n backgroundColor: \"red\"\n },\n to: {\n backgroundColor: \"blue\"\n }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: `\n background-color: red;\n `,\n to: `\n background-color: blue;\n `\n})\n\nkeyframes`\n from {\n background-color: red;\n }\n to {\n background-color: blue;\n }\n`\nkeyframes({\n from: {\n backgroundColor: \"red\"\n },\n to: {\n backgroundColor: \"blue\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -29,5 +29,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n\"k0\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n\"a\";\n\"a\";\n", } diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap b/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap index 8ec12b32..0afb7e84 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n [true]: { opacity: 0.5 },\n to: { opacity: 1, color: dy }\n})\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n [true]: { opacity: 0.5 },\n to: { opacity: 1, color: dy }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" --- ToBTreeSet { styles: { @@ -29,5 +29,5 @@ ToBTreeSet { }, ), }, - code: "import \"@devup-ui/core/devup-ui.css\";\n\"k0\";\n", + code: "import \"@devup-ui/core/devup-ui.css\";\n\"a\";\n", } diff --git a/libs/extractor/src/visit.rs b/libs/extractor/src/visit.rs index 6b2ea4d7..aeb5f029 100644 --- a/libs/extractor/src/visit.rs +++ b/libs/extractor/src/visit.rs @@ -48,12 +48,19 @@ pub struct DevupVisitor<'a> { util_imports: HashMap>, jsx_object: Option, package: String, + split_filename: Option, pub css_file: String, pub styles: HashSet, } impl<'a> DevupVisitor<'a> { - pub fn new(allocator: &'a Allocator, filename: &str, package: &str, css_file: &str) -> Self { + pub fn new( + allocator: &'a Allocator, + filename: &str, + package: &str, + css_file: &str, + split_filename: Option, + ) -> Self { Self { ast: AstBuilder::new(allocator), filename: filename.to_string(), @@ -65,6 +72,7 @@ impl<'a> DevupVisitor<'a> { import_object: None, jsx_object: None, util_imports: HashMap::new(), + split_filename, } } } @@ -168,8 +176,12 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { .expression_string_literal(SPAN, self.ast.atom(""), None) } else { // css can not reachable - let class_name = - gen_class_names(&self.ast, &mut styles, style_order); + let class_name = gen_class_names( + &self.ast, + &mut styles, + style_order, + self.split_filename.as_deref(), + ); // already set style order self.styles @@ -197,7 +209,9 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { }, ); - let name = keyframes.extract().to_string(); + let name = keyframes + .extract(self.split_filename.as_deref()) + .to_string(); self.styles.insert(ExtractStyleValue::Keyframes(keyframes)); self.ast .expression_string_literal(SPAN, self.ast.atom(&name), None) @@ -249,6 +263,7 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { }) .collect::>(), None, + self.split_filename.as_deref(), ); if let Some(cls) = class_name { @@ -266,7 +281,9 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { let keyframes = ExtractKeyframes { keyframes: keyframes_to_keyframes_style(&css_str), }; - let name = keyframes.extract().to_string(); + let name = keyframes + .extract(self.split_filename.as_deref()) + .to_string(); self.styles.insert(ExtractStyleValue::Keyframes(keyframes)); *it = self @@ -363,6 +380,7 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { &mut props_styles, style_order, style_vars, + self.split_filename.as_deref(), ); } @@ -551,7 +569,14 @@ impl<'a> VisitMut<'a> for DevupVisitor<'a> { .rev() .for_each(|ex| props_styles.push(ExtractStyleProp::Static(ex))); - modify_props(&self.ast, attrs, &mut props_styles, style_order, style_vars); + modify_props( + &self.ast, + attrs, + &mut props_styles, + style_order, + style_vars, + self.split_filename.as_deref(), + ); props_styles .iter() diff --git a/libs/sheet/src/lib.rs b/libs/sheet/src/lib.rs index 7026c331..14d05745 100644 --- a/libs/sheet/src/lib.rs +++ b/libs/sheet/src/lib.rs @@ -102,23 +102,29 @@ impl ExtractStyle for StyleSheetCss { type PropertyMap = BTreeMap>>; -fn deserialize_btree_map_u8<'de, D>(deserializer: D) -> Result +fn deserialize_btree_map_u8<'de, D>( + deserializer: D, +) -> Result, D::Error> where D: Deserializer<'de>, { - let mut result = BTreeMap::new(); - for (key, value) in - BTreeMap::>>::deserialize( - deserializer, - )? + let mut result: BTreeMap = BTreeMap::new(); + for (key, value) in BTreeMap::< + String, + BTreeMap>>, + >::deserialize(deserializer)? { - let mut tmp_map = BTreeMap::new(); + let mut tmp_map: PropertyMap = BTreeMap::new(); for (key, value) in value.into_iter() { - tmp_map.insert(key.parse().map_err(Error::custom)?, value); + let mut inner_tmp_map = BTreeMap::new(); + for (key, value) in value.into_iter() { + inner_tmp_map.insert(key.parse().map_err(Error::custom)?, value); + } + tmp_map.insert(key.parse().map_err(Error::custom)?, inner_tmp_map); } - result.insert(key.parse().map_err(Error::custom)?, tmp_map); + result.insert(key, tmp_map); } Ok(result) @@ -126,10 +132,10 @@ where #[derive(Default, Deserialize, Serialize, Debug)] pub struct StyleSheet { #[serde(deserialize_with = "deserialize_btree_map_u8")] - pub properties: PropertyMap, + pub properties: BTreeMap, pub css: BTreeMap>, #[serde(default)] - pub keyframes: BTreeMap>>, + pub keyframes: BTreeMap>>>, #[serde(default)] pub global_css_files: BTreeSet, #[serde(default)] @@ -149,6 +155,7 @@ impl StyleSheet { value: &str, selector: Option<&StyleSelector>, style_order: Option, + filename: Option<&str>, ) -> bool { // register global css file for cache if let Some(StyleSelector::Global(_, file)) = selector { @@ -156,6 +163,8 @@ impl StyleSheet { } self.properties + .entry(filename.unwrap_or_default().to_string()) + .or_default() .entry(style_order.unwrap_or(255)) .or_default() .entry(level) @@ -198,8 +207,14 @@ impl StyleSheet { &mut self, name: &str, keyframes: BTreeMap>, + filename: Option<&str>, ) -> bool { - let map = self.keyframes.entry(name.to_string()).or_default(); + let map = self + .keyframes + .entry(filename.unwrap_or_default().to_string()) + .or_default() + .entry(name.to_string()) + .or_default(); if map == &keyframes { return false; } @@ -217,7 +232,12 @@ impl StyleSheet { self.font_faces.remove(file); - for map in self.properties.values_mut() { + for map in self + .properties + .entry("".to_string()) + .or_default() + .values_mut() + { for props in map.values_mut() { props.retain(|prop| { if let Some(StyleSelector::Global(_, f)) = prop.selector.as_ref() { @@ -285,160 +305,180 @@ impl StyleSheet { } } - pub fn create_css(&self) -> String { + pub fn create_css(&self, filename: Option<&str>) -> String { let mut css = self .imports .values() .flatten() .map(|import| format!("@import \"{import}\";")) .collect::(); - css.push_str(&self.theme.to_css()); - - for (name, map) in self.keyframes.iter() { - css.push_str(&format!( - "@keyframes {name}{{{}}}", - map.iter() - .map(|(key, props)| format!( - "{key}{{{}}}", - props + + let write_global = filename.is_none(); + + if write_global { + css.push_str(&self.theme.to_css()); + for (_, font_faces) in self.font_faces.iter() { + for font_face in font_faces.iter() { + css.push_str(&format!( + "@font-face{{{}}}", + font_face .iter() .map(|(key, value)| format!("{key}:{value}")) .collect::>() .join(";") - )) - .collect::() - )); - } + )); + } + } - for (_, font_faces) in self.font_faces.iter() { - for font_face in font_faces.iter() { - css.push_str(&format!( - "@font-face{{{}}}", - font_face - .iter() - .map(|(key, value)| format!("{key}:{value}")) - .collect::>() - .join(";") - )); + // global css + for (_, _css) in self.css.iter() { + for _css in _css.iter() { + css.push_str(&_css.extract()); + } } + } else { + // import global css + css.push_str("@import \"./devup-ui.css\";"); } - for (_, _css) in self.css.iter() { - for _css in _css.iter() { - css.push_str(&_css.extract()); + if let Some(keyframes) = self + .keyframes + .get(&filename.unwrap_or_default().to_string()) + { + for (name, map) in keyframes { + css.push_str(&format!( + "@keyframes {name}{{{}}}", + map.iter() + .map(|(key, props)| format!( + "{key}{{{}}}", + props + .iter() + .map(|(key, value)| format!("{key}:{value}")) + .collect::>() + .join(";") + )) + .collect::() + )); } } // order - for (_, map) in self.properties.iter() { - for (level, props) in map.iter() { - let (mut global_props, rest): (Vec<_>, Vec<_>) = props - .iter() - .partition(|prop| matches!(prop.selector, Some(StyleSelector::Global(_, _)))); - global_props.sort(); - let (mut medias, mut sorted_props): (Vec<&StyleSheetProperty>, Vec<_>) = - rest.iter().partition(|prop| { - matches!( - prop.selector, - Some(StyleSelector::Media { - query: _, - selector: _ - }) + if let Some(maps) = self + .properties + .get(&filename.unwrap_or_default().to_string()) + { + for (_, map) in maps.iter() { + for (level, props) in map.iter() { + let (mut global_props, rest): (Vec<_>, Vec<_>) = + props.iter().partition(|prop| { + matches!(prop.selector, Some(StyleSelector::Global(_, _))) + }); + global_props.sort(); + let (mut medias, mut sorted_props): (Vec<&StyleSheetProperty>, Vec<_>) = + rest.iter().partition(|prop| { + matches!( + prop.selector, + Some(StyleSelector::Media { + query: _, + selector: _ + }) + ) + }); + sorted_props.sort(); + medias.sort(); + let medias = { + let mut map = BTreeMap::new(); + for prop in medias { + if let Some(StyleSelector::Media { query, .. }) = &prop.selector { + map.entry(query).or_insert_with(Vec::new).push(prop); + } + } + map + }; + + let break_point = if *level == 0 { + None + } else { + Some( + self.theme + .breakpoints + .iter() + .enumerate() + .find(|(idx, _)| (*idx as u8) == *level) + .map(|(_, bp)| *bp) + .unwrap_or_else(|| { + self.theme.breakpoints.last().cloned().unwrap_or(0) + }), ) - }); - sorted_props.sort(); - medias.sort(); - let medias = { - let mut map = BTreeMap::new(); - for prop in medias { - if let Some(StyleSelector::Media { query, .. }) = &prop.selector { - map.entry(query).or_insert_with(Vec::new).push(prop); + }; + + if !global_props.is_empty() { + let mut selector_map: BTreeMap<_, Vec<_>> = BTreeMap::new(); + for prop in global_props { + if let Some(StyleSelector::Global(selector, _)) = &prop.selector { + selector_map.entry(selector.clone()).or_default().push(prop); + } } - } - map - }; - - let break_point = if *level == 0 { - None - } else { - Some( - self.theme - .breakpoints - .iter() - .enumerate() - .find(|(idx, _)| (*idx as u8) == *level) - .map(|(_, bp)| *bp) - .unwrap_or_else(|| self.theme.breakpoints.last().cloned().unwrap_or(0)), - ) - }; - - if !global_props.is_empty() { - // 같은 selector 끼리 모아서 CSS를 생성해야 함 - use std::collections::BTreeMap; - let mut selector_map: BTreeMap<_, Vec<_>> = BTreeMap::new(); - for prop in global_props { - if let Some(StyleSelector::Global(selector, _)) = &prop.selector { - selector_map.entry(selector.clone()).or_default().push(prop); + let mut inner_css = String::new(); + for (selector, props) in selector_map { + inner_css.push_str(&format!( + "{}{{{}}}", + selector, + props + .into_iter() + .map(|prop| format!("{}:{}", prop.property, prop.value)) + .collect::>() + .join(";") + )); } + css.push_str( + if let Some(break_point) = break_point { + format!("@media(min-width:{break_point}px){{{inner_css}}}") + } else { + inner_css + } + .as_str(), + ); } - let mut inner_css = String::new(); - for (selector, props) in selector_map { - // props는 같은 selector를 가진 property들의 Vec - inner_css.push_str(&format!( - "{}{{{}}}", - selector, - props - .into_iter() - .map(|prop| format!("{}:{}", prop.property, prop.value)) - .collect::>() - .join(";") - )); - } - css.push_str( - if let Some(break_point) = break_point { - format!("@media(min-width:{break_point}px){{{inner_css}}}") - } else { - inner_css - } - .as_str(), - ); - } - if !sorted_props.is_empty() { - let inner_css = sorted_props - .into_iter() - .map(ExtractStyle::extract) - .collect::(); - css.push_str( - if let Some(break_point) = break_point { - format!("@media(min-width:{break_point}px){{{inner_css}}}") - } else { - inner_css - } - .as_str(), - ); - } - for (media, props) in medias { - let inner_css = props - .into_iter() - .map(ExtractStyle::extract) - .collect::(); - css.push_str( - if let Some(break_point) = break_point { - format!("@media(min-width:{break_point}px)and {media}{{{inner_css}}}") - } else { - format!( - "@media{}{{{}}}", - if media.starts_with("(") { - media.clone() - } else { - format!(" {media}") - }, - inner_css.as_str() - ) - } - .as_str(), - ); + if !sorted_props.is_empty() { + let inner_css = sorted_props + .into_iter() + .map(ExtractStyle::extract) + .collect::(); + css.push_str( + if let Some(break_point) = break_point { + format!("@media(min-width:{break_point}px){{{inner_css}}}") + } else { + inner_css + } + .as_str(), + ); + } + for (media, props) in medias { + let inner_css = props + .into_iter() + .map(ExtractStyle::extract) + .collect::(); + css.push_str( + if let Some(break_point) = break_point { + format!( + "@media(min-width:{break_point}px)and {media}{{{inner_css}}}" + ) + } else { + format!( + "@media{}{{{}}}", + if media.starts_with("(") { + media.clone() + } else { + format!(" {media}") + }, + inner_css.as_str() + ) + } + .as_str(), + ); + } } } } @@ -472,14 +512,14 @@ mod tests { #[test] fn test_create_css_sort_test() { let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background-color", 1, "red", None, None); - sheet.add_property("test", "background", 1, "some", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background-color", 1, "red", None, None, None); + sheet.add_property("test", "background", 1, "some", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "border", 0, "1px solid", None, None); - sheet.add_property("test", "border-color", 0, "red", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "border", 0, "1px solid", None, None, None); + sheet.add_property("test", "border-color", 0, "red", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] fn test_create_css_with_selector_sort_test() { @@ -491,12 +531,13 @@ mod tests { "red", Some(&"hover".into()), None, + None, ); - sheet.add_property("test", "background-color", 1, "some", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background-color", 1, "some", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background-color", 1, "red", None, None); + sheet.add_property("test", "background-color", 1, "red", None, None, None); sheet.add_property( "test", "background-color", @@ -504,30 +545,31 @@ mod tests { "some", Some(&"hover".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background-color", 1, "red", None, None); - sheet.add_property("test", "background", 1, "some", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background-color", 1, "red", None, None, None); + sheet.add_property("test", "background", 1, "some", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] fn test_create_css_with_basic_sort_test() { let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background-color", 1, "red", None, Some(0)); - sheet.add_property("test", "background", 1, "some", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background-color", 1, "red", None, Some(0), None); + sheet.add_property("test", "background", 1, "some", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "border", 0, "1px solid", None, None); - sheet.add_property("test", "border-color", 0, "red", None, Some(0)); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "border", 0, "1px solid", None, None, None); + sheet.add_property("test", "border-color", 0, "red", None, Some(0), None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "display", 0, "flex", None, Some(0)); - sheet.add_property("test", "display", 0, "block", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "display", 0, "flex", None, Some(0), None); + sheet.add_property("test", "display", 0, "block", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -540,33 +582,42 @@ mod tests { "red", Some(&"hover".into()), None, + None, ); - sheet.add_property("test", "background-color", 1, "some", None, Some(0)); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background-color", 1, "some", None, Some(0), None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "display", 0, "flex", None, Some(0)); - sheet.add_property("test", "display", 0, "none", None, None); - sheet.add_property("test", "display", 2, "flex", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "display", 0, "flex", None, Some(0), None); + sheet.add_property("test", "display", 0, "none", None, None, None); + sheet.add_property("test", "display", 2, "flex", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] fn test_create_css() { let mut sheet = StyleSheet::default(); - sheet.add_property("test", "margin", 1, "40px", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "margin", 1, "40px", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_css("test.tsx", "div {display:flex;}"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "margin", 2, "40px", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "margin", 2, "40px", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background", 0, "red", Some(&"hover".into()), None); + sheet.add_property( + "test", + "background", + 0, + "red", + Some(&"hover".into()), + None, + None, + ); sheet.add_property( "test", "background", @@ -574,8 +625,9 @@ mod tests { "blue", Some(&"active".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -585,6 +637,7 @@ mod tests { "red", Some(&StyleSelector::from("group-focus-visible")), None, + None, ); sheet.add_property( "test", @@ -593,8 +646,9 @@ mod tests { "blue", Some(&StyleSelector::from("group-focus-visible")), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -604,6 +658,7 @@ mod tests { "red", Some(&StyleSelector::from("group-focus-visible")), None, + None, ); sheet.add_property( "test", @@ -612,8 +667,9 @@ mod tests { "blue", Some(&StyleSelector::from("hover")), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -623,6 +679,7 @@ mod tests { "red", Some(&"*:hover &".into()), None, + None, ); sheet.add_property( "test", @@ -631,8 +688,9 @@ mod tests { "blue", Some(&StyleSelector::from("group-focus-visible")), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -642,8 +700,9 @@ mod tests { "red", Some(&["theme-dark", "hover"].into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -653,8 +712,9 @@ mod tests { "red", Some(&["wrong", "hover"].into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -664,8 +724,9 @@ mod tests { "red", Some(&"*[disabled='true'] &:hover".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -675,8 +736,9 @@ mod tests { "red", Some(&"&[disabled='true']".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -686,8 +748,9 @@ mod tests { "red", Some(&"&[disabled='true'], &[disabled='true']".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -695,51 +758,51 @@ mod tests { let mut sheet = StyleSheet::default(); sheet.add_css("test.tsx", "div {display:flex;}"); sheet.add_css("test2.tsx", "div {display:flex;}"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); sheet.rm_global_css("test.tsx"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); sheet.rm_global_css("wrong.tsx"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] fn test_style_order_create_css() { let mut sheet = StyleSheet::default(); - sheet.add_property("test", "margin-left", 0, "40px", None, Some(1)); - sheet.add_property("test", "margin-right", 0, "40px", None, Some(1)); - - sheet.add_property("test", "margin-left", 1, "40px", None, Some(1)); - sheet.add_property("test", "margin-right", 1, "40px", None, Some(1)); - sheet.add_property("test", "margin-left", 1, "44px", None, Some(1)); - sheet.add_property("test", "margin-right", 1, "44px", None, Some(1)); - sheet.add_property("test", "margin-left", 1, "40px", None, Some(1)); - sheet.add_property("test", "margin-right", 1, "44px", None, Some(1)); - sheet.add_property("test", "margin-left", 1, "44px", None, Some(1)); - sheet.add_property("test", "margin-right", 1, "44px", None, Some(1)); - sheet.add_property("test", "margin-left", 1, "50px", None, Some(2)); - sheet.add_property("test", "margin-right", 1, "50px", None, Some(2)); - sheet.add_property("test", "margin-left", 1, "60px", None, None); - sheet.add_property("test", "margin-right", 1, "60px", None, None); - sheet.add_property("test", "margin-left", 0, "70px", None, None); - sheet.add_property("test", "margin-right", 0, "70px", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "margin-left", 0, "40px", None, Some(1), None); + sheet.add_property("test", "margin-right", 0, "40px", None, Some(1), None); + + sheet.add_property("test", "margin-left", 1, "40px", None, Some(1), None); + sheet.add_property("test", "margin-right", 1, "40px", None, Some(1), None); + sheet.add_property("test", "margin-left", 1, "44px", None, Some(1), None); + sheet.add_property("test", "margin-right", 1, "44px", None, Some(1), None); + sheet.add_property("test", "margin-left", 1, "40px", None, Some(1), None); + sheet.add_property("test", "margin-right", 1, "44px", None, Some(1), None); + sheet.add_property("test", "margin-left", 1, "44px", None, Some(1), None); + sheet.add_property("test", "margin-right", 1, "44px", None, Some(1), None); + sheet.add_property("test", "margin-left", 1, "50px", None, Some(2), None); + sheet.add_property("test", "margin-right", 1, "50px", None, Some(2), None); + sheet.add_property("test", "margin-left", 1, "60px", None, None, None); + sheet.add_property("test", "margin-right", 1, "60px", None, None, None); + sheet.add_property("test", "margin-left", 0, "70px", None, None, None); + sheet.add_property("test", "margin-right", 0, "70px", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); - sheet.add_property("test", "background", 0, "red", None, Some(3)); - sheet.add_property("test", "background", 0, "blue", None, Some(17)); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "background", 0, "red", None, Some(3), None); + sheet.add_property("test", "background", 0, "blue", None, Some(17), None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] fn wrong_breakpoint() { let mut sheet = StyleSheet::default(); - sheet.add_property("test", "margin-left", 10, "40px", None, None); - sheet.add_property("test", "margin-right", 10, "40px", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "margin-left", 10, "40px", None, None, None); + sheet.add_property("test", "margin-right", 10, "40px", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -752,6 +815,7 @@ mod tests { "40px", Some(&"group-hover".into()), None, + None, ); sheet.add_property( "test", @@ -760,6 +824,7 @@ mod tests { "40px", Some(&"group-hover".into()), None, + None, ); sheet.add_property( "test", @@ -768,6 +833,7 @@ mod tests { "50px", Some(&"group-hover".into()), None, + None, ); sheet.add_property( "test", @@ -776,8 +842,9 @@ mod tests { "50px", Some(&"group-hover".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -790,6 +857,7 @@ mod tests { "40px", Some(&"theme-dark".into()), None, + None, ); sheet.add_property( "test", @@ -798,6 +866,7 @@ mod tests { "40px", Some(&"theme-dark".into()), None, + None, ); sheet.add_property( "test", @@ -806,6 +875,7 @@ mod tests { "40px", Some(&"theme-dark".into()), None, + None, ); sheet.add_property( "test", @@ -814,6 +884,7 @@ mod tests { "40px", Some(&"theme-dark".into()), None, + None, ); sheet.add_property( "test", @@ -822,6 +893,7 @@ mod tests { "50px", Some(&"theme-light".into()), None, + None, ); sheet.add_property( "test", @@ -830,8 +902,9 @@ mod tests { "50px", Some(&"theme-light".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -841,6 +914,7 @@ mod tests { "50px", Some(&"theme-light".into()), None, + None, ); sheet.add_property( "test", @@ -849,9 +923,10 @@ mod tests { "50px", Some(&"theme-light".into()), None, + None, ); - sheet.add_property("test", "margin-left", 0, "41px", None, None); - sheet.add_property("test", "margin-right", 0, "41px", None, None); + sheet.add_property("test", "margin-left", 0, "41px", None, None, None); + sheet.add_property("test", "margin-right", 0, "41px", None, None, None); sheet.add_property( "test", "margin-left", @@ -859,6 +934,7 @@ mod tests { "51px", Some(&"theme-light".into()), None, + None, ); sheet.add_property( "test", @@ -867,10 +943,11 @@ mod tests { "51px", Some(&"theme-light".into()), None, + None, ); - sheet.add_property("test", "margin-left", 0, "42px", None, None); - sheet.add_property("test", "margin-right", 0, "42px", None, None); - assert_debug_snapshot!(sheet.create_css()); + sheet.add_property("test", "margin-left", 0, "42px", None, None, None); + sheet.add_property("test", "margin-right", 0, "42px", None, None, None); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -880,6 +957,7 @@ mod tests { "50px", Some(&["theme-light", "active"].into()), None, + None, ); sheet.add_property( "test", @@ -888,6 +966,7 @@ mod tests { "50px", Some(&["theme-light", "active"].into()), None, + None, ); sheet.add_property( "test", @@ -896,6 +975,7 @@ mod tests { "50px", Some(&["theme-light", "hover"].into()), None, + None, ); sheet.add_property( "test", @@ -904,8 +984,9 @@ mod tests { "50px", Some(&["theme-light", "hover"].into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -918,6 +999,7 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); sheet.add_property( "test", @@ -926,8 +1008,17 @@ mod tests { "40px", Some(&"print".into()), None, + None, + ); + sheet.add_property( + "test", + "margin-top", + 0, + "40px", + Some(&"print".into()), + None, + None, ); - sheet.add_property("test", "margin-top", 0, "40px", Some(&"print".into()), None); sheet.add_property( "test", "margin-bottom", @@ -935,6 +1026,7 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); sheet.add_property( @@ -944,6 +1036,7 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); sheet.add_property( "test", @@ -952,8 +1045,17 @@ mod tests { "40px", Some(&"print".into()), None, + None, + ); + sheet.add_property( + "test", + "margin-top", + 1, + "40px", + Some(&"print".into()), + None, + None, ); - sheet.add_property("test", "margin-top", 1, "40px", Some(&"print".into()), None); sheet.add_property( "test", "margin-bottom", @@ -961,8 +1063,9 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -972,6 +1075,7 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); sheet.add_property( "test", @@ -980,11 +1084,12 @@ mod tests { "40px", Some(&"print".into()), None, + None, ); - sheet.add_property("test", "margin-top", 0, "40px", None, None); - sheet.add_property("test", "margin-bottom", 0, "40px", None, None); + sheet.add_property("test", "margin-top", 0, "40px", None, None, None); + sheet.add_property("test", "margin-bottom", 0, "40px", None, None, None); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -1000,6 +1105,7 @@ mod tests { selector: Some("&:hover".to_string()), }), None, + None, ); sheet.add_property( "test", @@ -1011,9 +1117,10 @@ mod tests { selector: Some("&:hover".to_string()), }), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -1022,16 +1129,18 @@ mod tests { let sheet: StyleSheet = serde_json::from_str( r##"{ "properties": { - "255": { - "0": [ - { - "className": "test", - "property": "mx", - "value": "40px", - "selector": null, - "basic": false - } - ] + "": { + "255": { + "0": [ + { + "className": "test", + "property": "mx", + "value": "40px", + "selector": null, + "basic": false + } + ] + } } }, "css": {}, @@ -1101,8 +1210,9 @@ mod tests { "test.tsx".to_string(), )), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( "test", @@ -1114,8 +1224,9 @@ mod tests { "test.tsx".to_string(), )), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); @@ -1129,6 +1240,7 @@ mod tests { "test.tsx".to_string(), )), None, + None, ); sheet.add_property( "test", @@ -1140,8 +1252,9 @@ mod tests { "test.tsx".to_string(), )), None, + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -1154,6 +1267,7 @@ mod tests { "test.tsx".to_string(), )), Some(0), + None, ); sheet.add_property( "test", @@ -1165,8 +1279,9 @@ mod tests { "test.tsx".to_string(), )), Some(255), + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); sheet.add_property( "test", @@ -1178,6 +1293,7 @@ mod tests { "test2.tsx".to_string(), )), Some(255), + None, ); sheet.add_property( @@ -1187,10 +1303,11 @@ mod tests { "red", Some(&StyleSelector::Selector("&:hover".to_string())), Some(255), + None, ); sheet.rm_global_css("test.tsx"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -1203,6 +1320,7 @@ mod tests { "test.tsx".to_string(), )), Some(0), + None, ); sheet.add_property( "test", @@ -1214,12 +1332,13 @@ mod tests { "test.tsx".to_string(), )), Some(0), + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); sheet.rm_global_css("test.tsx"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); let mut sheet = StyleSheet::default(); sheet.add_property( @@ -1232,6 +1351,7 @@ mod tests { "test.tsx".to_string(), )), Some(0), + None, ); sheet.add_property( "test", @@ -1243,12 +1363,13 @@ mod tests { "test2.tsx".to_string(), )), Some(0), + None, ); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); sheet.rm_global_css("test.tsx"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } #[test] @@ -1259,19 +1380,19 @@ mod tests { sheet.add_import("test2.tsx", "@devup-ui/core/css/global2.css"); sheet.add_import("test3.tsx", "@devup-ui/core/css/global3.css"); sheet.add_import("test4.tsx", "@devup-ui/core/css/global4.css"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } { let mut sheet = StyleSheet::default(); sheet.add_import("test.tsx", "@devup-ui/core/css/global.css"); sheet.add_import("test.tsx", "@devup-ui/core/css/new-global.css"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } { let mut sheet = StyleSheet::default(); sheet.add_import("test.tsx", "@devup-ui/core/css/global.css"); sheet.add_import("test.tsx", "@devup-ui/core/css/global.css"); - assert_debug_snapshot!(sheet.create_css()); + assert_debug_snapshot!(sheet.create_css(None)); } } @@ -1361,8 +1482,8 @@ mod tests { vec![(String::from("opacity"), String::from("1"))], ); - sheet.add_keyframes("fadeIn", keyframes); - let past = sheet.create_css(); + sheet.add_keyframes("fadeIn", keyframes, None); + let past = sheet.create_css(None); assert_debug_snapshot!(past); let mut keyframes: BTreeMap> = BTreeMap::new(); @@ -1390,9 +1511,9 @@ mod tests { vec![(String::from("opacity"), String::from("1"))], ); - sheet.add_keyframes("fadeIn", keyframes); + sheet.add_keyframes("fadeIn", keyframes, None); - let now = sheet.create_css(); + let now = sheet.create_css(None); assert_debug_snapshot!(now); assert_eq!(past, now); } @@ -1410,7 +1531,7 @@ mod tests { sheet.add_font_face("test.tsx", &font_face_props); - let css = sheet.create_css(); + let css = sheet.create_css(None); assert!(css.contains("@font-face")); assert!(css.contains("font-family:Roboto")); assert!(css.contains("src:url('/fonts/Roboto-Regular.ttf')")); diff --git a/libs/sheet/src/snapshots/sheet__tests__deserialize.snap b/libs/sheet/src/snapshots/sheet__tests__deserialize.snap index a4d88a1f..0b11d02d 100644 --- a/libs/sheet/src/snapshots/sheet__tests__deserialize.snap +++ b/libs/sheet/src/snapshots/sheet__tests__deserialize.snap @@ -4,13 +4,15 @@ expression: sheet --- StyleSheet { properties: { - 255: { - 0: { - StyleSheetProperty { - class_name: "test", - property: "mx", - value: "40px", - selector: None, + "": { + 255: { + 0: { + StyleSheetProperty { + class_name: "test", + property: "mx", + value: "40px", + selector: None, + }, }, }, }, diff --git a/packages/next-plugin/src/plugin.ts b/packages/next-plugin/src/plugin.ts index bdb07c40..18628692 100644 --- a/packages/next-plugin/src/plugin.ts +++ b/packages/next-plugin/src/plugin.ts @@ -30,17 +30,18 @@ export function DevupUI( const { package: libPackage = '@devup-ui/react', interfacePath = 'df', - cssFile = resolve(interfacePath, 'devup-ui.css'), + cssDir = resolve(interfacePath, 'devup-ui'), + splitCss = true, } = options const sheetFile = join(interfacePath, 'sheet.json') const classMapFile = join(interfacePath, 'classMap.json') const gitignoreFile = join(interfacePath, '.gitignore') if (!existsSync(interfacePath)) mkdirSync(interfacePath) - if (!existsSync(cssFile)) writeFileSync(cssFile, '/* devup-ui */') + if (!existsSync(cssDir)) mkdirSync(cssDir) if (!existsSync(gitignoreFile)) writeFileSync(gitignoreFile, '*') const rules: NonNullable = { - [basename(cssFile)]: [ + [basename(cssDir)]: [ { loader: '@devup-ui/webpack-plugin/css-loader', options: { @@ -53,10 +54,11 @@ export function DevupUI( loader: '@devup-ui/webpack-plugin/loader', options: { package: libPackage, - cssFile: cssFile, + cssDir, sheetFile, classMapFile, watch: process.env.NODE_ENV === 'development', + splitCss, }, }, ], @@ -67,9 +69,9 @@ export function DevupUI( const { webpack } = config config.webpack = (config, _options) => { - options.cssFile ??= resolve( + options.cssDir ??= resolve( _options.dev ? (options.interfacePath ?? 'df') : '.next/cache', - `devup-ui_${_options.buildId}.css`, + `devup-ui_${_options.buildId}`, ) config.plugins.push( new DevupUIWebpackPlugin({ diff --git a/packages/rsbuild-plugin/src/plugin.ts b/packages/rsbuild-plugin/src/plugin.ts index bb6edfc6..7c953977 100644 --- a/packages/rsbuild-plugin/src/plugin.ts +++ b/packages/rsbuild-plugin/src/plugin.ts @@ -12,6 +12,7 @@ export interface DevupUIRsbuildPluginOptions { extractCss: boolean debug: boolean include: string[] + splitCss: boolean } let globalCss = '' @@ -22,6 +23,7 @@ export const DevupUIRsbuildPlugin = ({ extractCss = true, interfacePath = 'df', cssFile = resolve(interfacePath, 'devup-ui.css'), + splitCss = true, }: Partial = {}): RsbuildPlugin => ({ name: 'devup-ui-rsbuild-plugin', @@ -60,7 +62,7 @@ export const DevupUIRsbuildPlugin = ({ code: retCode, css, map, - } = codeExtract(resourcePath, code, libPackage, cssFile) + } = codeExtract(resourcePath, code, libPackage, cssFile, splitCss) if (css && globalCss.length < css.length) { globalCss = css diff --git a/packages/vite-plugin/src/plugin.ts b/packages/vite-plugin/src/plugin.ts index 30aa64f2..f2f36a89 100644 --- a/packages/vite-plugin/src/plugin.ts +++ b/packages/vite-plugin/src/plugin.ts @@ -20,10 +20,14 @@ export interface DevupUIPluginOptions { extractCss: boolean debug: boolean include: string[] + splitCss: boolean } function writeDataFiles( - options: Omit, + options: Omit< + DevupUIPluginOptions, + 'extractCss' | 'debug' | 'include' | 'splitCss' + >, ) { if (!existsSync(options.interfacePath)) mkdirSync(options.interfacePath) if (existsSync(options.devupPath)) { @@ -61,6 +65,7 @@ export function DevupUI({ extractCss = true, debug = false, include = [], + splitCss = true, }: Partial = {}): PluginOption { setDebug(debug) try { @@ -163,7 +168,7 @@ export function DevupUI({ code: retCode, css, map, - } = codeExtract(fileName, code, libPackage, cssFile) + } = codeExtract(fileName, code, libPackage, cssFile, splitCss) if (css && globalCss.length < css.length) { globalCss = css diff --git a/packages/webpack-plugin/src/__tests__/loader.test.ts b/packages/webpack-plugin/src/__tests__/loader.test.ts index 1b5e981f..fa12640e 100644 --- a/packages/webpack-plugin/src/__tests__/loader.test.ts +++ b/packages/webpack-plugin/src/__tests__/loader.test.ts @@ -38,6 +38,7 @@ describe('devupUILoader', () => { css: 'css', free: vi.fn(), map: '{}', + css_file: 'cssFile', }) devupUILoader.bind(t as any)(Buffer.from('code'), 'index.tsx') @@ -74,6 +75,7 @@ describe('devupUILoader', () => { css: undefined, free: vi.fn(), map: undefined, + css_file: 'cssFile', }) devupUILoader.bind(t as any)(Buffer.from('code'), 'index.tsx') @@ -126,6 +128,7 @@ describe('devupUILoader', () => { css: 'css', free: vi.fn(), map: undefined, + css_file: 'cssFile', }) devupUILoader.bind(t as any)(Buffer.from('code'), 'index.tsx') diff --git a/packages/webpack-plugin/src/__tests__/plugin.test.ts b/packages/webpack-plugin/src/__tests__/plugin.test.ts index 67c0664c..0ec01648 100644 --- a/packages/webpack-plugin/src/__tests__/plugin.test.ts +++ b/packages/webpack-plugin/src/__tests__/plugin.test.ts @@ -48,7 +48,7 @@ describe('devupUIPlugin', () => { expect( new DevupUIWebpackPlugin({ package: 'new-package', - cssFile: 'new-css-file', + cssDir: 'new-css-file', devupPath: 'new-devup-path', interfacePath: 'new-interface-path', watch: false, @@ -163,7 +163,7 @@ describe('devupUIPlugin', () => { vi.mocked(mkdirSync) const plugin = new DevupUIWebpackPlugin({ - cssFile: 'css', + cssDir: 'css', }) plugin.apply({ options: { diff --git a/packages/webpack-plugin/src/css-loader.ts b/packages/webpack-plugin/src/css-loader.ts index 3503ea30..916b8f67 100644 --- a/packages/webpack-plugin/src/css-loader.ts +++ b/packages/webpack-plugin/src/css-loader.ts @@ -4,11 +4,17 @@ import type { RawLoaderDefinitionFunction } from 'webpack' let prevData = '' let prevTime = '' +function getFileNumByFilename(filename: string) { + if (filename.endsWith('devup-ui.css')) return null + return parseInt(filename.split('devup-ui-')[1].split('.')[0]) +} + const devupUICssLoader: RawLoaderDefinitionFunction<{ watch: boolean }> = function (source, map, meta) { const { watch } = this.getOptions() - if (!watch) return this.callback(null, getCss()) + const fileNum = getFileNumByFilename(this.resourcePath) + if (!watch) return this.callback(null, getCss(fileNum)) const stringSource = (this._compiler as any)?.__DEVUP_CACHE || source.toString() @@ -17,6 +23,6 @@ const devupUICssLoader: RawLoaderDefinitionFunction<{ return } prevTime = stringSource - this.callback(null, (prevData = getCss()), map, meta) + this.callback(null, (prevData = getCss(fileNum)), map, meta) } export default devupUICssLoader diff --git a/packages/webpack-plugin/src/loader.ts b/packages/webpack-plugin/src/loader.ts index 752d57a4..2971df94 100644 --- a/packages/webpack-plugin/src/loader.ts +++ b/packages/webpack-plugin/src/loader.ts @@ -1,15 +1,16 @@ import { writeFile } from 'node:fs/promises' -import { dirname, relative } from 'node:path' +import { basename, dirname, join, relative } from 'node:path' import { codeExtract, exportClassMap, exportSheet } from '@devup-ui/wasm' import type { RawLoaderDefinitionFunction } from 'webpack' export interface DevupUILoaderOptions { package: string - cssFile: string + cssDir: string sheetFile: string classMapFile: string watch: boolean + splitCss: boolean } const devupUILoader: RawLoaderDefinitionFunction = @@ -17,34 +18,40 @@ const devupUILoader: RawLoaderDefinitionFunction = const { watch, package: libPackage, - cssFile, + cssDir, sheetFile, classMapFile, + splitCss, } = this.getOptions() const callback = this.async() const id = this.resourcePath try { - let rel = relative(dirname(this.resourcePath), cssFile).replaceAll( + let rel = relative(dirname(this.resourcePath), cssDir).replaceAll( '\\', '/', ) if (!rel.startsWith('./')) rel = `./${rel}` - const { code, css, map } = codeExtract( + const { code, css, map, css_file } = codeExtract( id, source.toString(), libPackage, rel, + splitCss, ) const sourceMap = map ? JSON.parse(map) : null - if (css && watch) { + if (css) { const content = `${this.resourcePath} ${Date.now()}` - if (this._compiler) (this._compiler as any).__DEVUP_CACHE = content + if (watch && this._compiler) + (this._compiler as any).__DEVUP_CACHE = content // should be reset css Promise.all([ - writeFile(cssFile, `/* ${content} */`), - writeFile(sheetFile, exportSheet()), - writeFile(classMapFile, exportClassMap()), + writeFile( + join(cssDir, basename(css_file)), + watch ? `/* ${content} */` : css, + ), + watch ? writeFile(sheetFile, exportSheet()) : null, + watch ? writeFile(classMapFile, exportClassMap()) : null, ]) .catch(console.error) .finally(() => callback(null, code, sourceMap)) diff --git a/packages/webpack-plugin/src/plugin.ts b/packages/webpack-plugin/src/plugin.ts index f67512e4..b7dc85d3 100644 --- a/packages/webpack-plugin/src/plugin.ts +++ b/packages/webpack-plugin/src/plugin.ts @@ -21,12 +21,13 @@ import { type Compiler } from 'webpack' export interface DevupUIWebpackPluginOptions { package: string - cssFile: string + cssDir: string devupPath: string interfacePath: string watch: boolean debug: boolean include: string[] + splitCss: boolean } export class DevupUIWebpackPlugin { @@ -36,23 +37,25 @@ export class DevupUIWebpackPlugin { package: libPackage = '@devup-ui/react', devupPath = 'devup.json', interfacePath = 'df', - cssFile = resolve(interfacePath, 'devup-ui.css'), + cssDir = resolve(interfacePath, 'devup-ui'), watch = false, debug = false, include = [], + splitCss = true, }: Partial = {}) { this.options = { package: libPackage, - cssFile, + cssDir, devupPath, interfacePath, watch, debug, include, + splitCss, } } - writeDataFiles() { + async writeDataFiles() { registerTheme( JSON.parse(readFileSync(this.options.devupPath, 'utf-8'))?.['theme'], ) @@ -73,10 +76,9 @@ export class DevupUIWebpackPlugin { ) } - if (this.options.watch) { - writeFileSync(this.options.cssFile, `/* ${Date.now()} */`, { - encoding: 'utf-8', - }) + if (this.options.watch && !existsSync(this.options.cssDir)) { + mkdirSync(this.options.cssDir, { recursive: true }) + writeFileSync(join(this.options.cssDir, 'devup-ui.css'), '') } } @@ -135,9 +137,10 @@ export class DevupUIWebpackPlugin { compilation.fileDependencies.add(resolve(this.options.devupPath)) }) } - // Create an empty CSS file - if (!existsSync(this.options.cssFile)) - writeFileSync(this.options.cssFile, '', { encoding: 'utf-8' }) + if (!existsSync(this.options.cssDir)) { + mkdirSync(this.options.cssDir, { recursive: true }) + writeFileSync(join(this.options.cssDir, 'devup-ui.css'), '') + } compiler.options.plugins.push( new compiler.webpack.DefinePlugin({ @@ -148,7 +151,9 @@ export class DevupUIWebpackPlugin { compiler.hooks.done.tap('DevupUIWebpackPlugin', (stats) => { if (!stats.hasErrors()) { // write css file - writeFileSync(this.options.cssFile, getCss(), { encoding: 'utf-8' }) + writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { + encoding: 'utf-8', + }) } }) } @@ -169,16 +174,17 @@ export class DevupUIWebpackPlugin { ), options: { package: this.options.package, - cssFile: this.options.cssFile, + cssDir: this.options.cssDir, sheetFile, classMapFile, watch: this.options.watch, + splitCss: this.options.splitCss, }, }, ], }, { - test: this.options.cssFile, + test: this.options.cssDir, enforce: 'pre', use: [ { From 17c640217c4a74013fbc7bec7fa553cae3d53145 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Wed, 27 Aug 2025 01:22:13 +0900 Subject: [PATCH 02/12] Add FileMap --- packages/webpack-plugin/src/loader.ts | 9 ++++++++- packages/webpack-plugin/src/plugin.ts | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/webpack-plugin/src/loader.ts b/packages/webpack-plugin/src/loader.ts index 2971df94..52065c68 100644 --- a/packages/webpack-plugin/src/loader.ts +++ b/packages/webpack-plugin/src/loader.ts @@ -1,7 +1,12 @@ import { writeFile } from 'node:fs/promises' import { basename, dirname, join, relative } from 'node:path' -import { codeExtract, exportClassMap, exportSheet } from '@devup-ui/wasm' +import { + codeExtract, + exportClassMap, + exportFileMap, + exportSheet, +} from '@devup-ui/wasm' import type { RawLoaderDefinitionFunction } from 'webpack' export interface DevupUILoaderOptions { @@ -21,6 +26,7 @@ const devupUILoader: RawLoaderDefinitionFunction = cssDir, sheetFile, classMapFile, + fileMapFile, splitCss, } = this.getOptions() const callback = this.async() @@ -52,6 +58,7 @@ const devupUILoader: RawLoaderDefinitionFunction = ), watch ? writeFile(sheetFile, exportSheet()) : null, watch ? writeFile(classMapFile, exportClassMap()) : null, + watch ? writeFile(fileMapFile, exportFileMap()) : null, ]) .catch(console.error) .finally(() => callback(null, code, sourceMap)) diff --git a/packages/webpack-plugin/src/plugin.ts b/packages/webpack-plugin/src/plugin.ts index b7dc85d3..8d35c07e 100644 --- a/packages/webpack-plugin/src/plugin.ts +++ b/packages/webpack-plugin/src/plugin.ts @@ -13,6 +13,7 @@ import { getDefaultTheme, getThemeInterface, importClassMap, + importFileMap, importSheet, registerTheme, setDebug, @@ -96,6 +97,7 @@ export class DevupUIWebpackPlugin { const sheetFile = join(this.options.interfacePath, 'sheet.json') const classMapFile = join(this.options.interfacePath, 'classMap.json') + const fileMapFile = join(this.options.interfacePath, 'fileMap.json') if (this.options.watch) { try { // load sheet @@ -103,6 +105,8 @@ export class DevupUIWebpackPlugin { importSheet(JSON.parse(readFileSync(sheetFile, 'utf-8'))) if (existsSync(classMapFile)) importClassMap(JSON.parse(readFileSync(classMapFile, 'utf-8'))) + if (existsSync(fileMapFile)) + importFileMap(JSON.parse(readFileSync(fileMapFile, 'utf-8'))) } catch (error) { console.error(error) } @@ -177,6 +181,7 @@ export class DevupUIWebpackPlugin { cssDir: this.options.cssDir, sheetFile, classMapFile, + fileMapFile, watch: this.options.watch, splitCss: this.options.splitCss, }, From 2edb047aba2b9127ebdc5dfbb9f5689de19e9f16 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Wed, 27 Aug 2025 01:40:01 +0900 Subject: [PATCH 03/12] Fix FileMap --- Cargo.lock | 1 + bindings/devup-ui-wasm/Cargo.toml | 1 + bindings/devup-ui-wasm/src/lib.rs | 4 ++-- libs/css/Cargo.toml | 2 +- packages/webpack-plugin/src/loader.ts | 1 + packages/webpack-plugin/src/plugin.ts | 17 +++++++++++------ 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51069850..23cc3cdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -274,6 +274,7 @@ dependencies = [ name = "devup-ui-wasm" version = "0.1.0" dependencies = [ + "bimap", "console_error_panic_hook", "css", "extractor", diff --git a/bindings/devup-ui-wasm/Cargo.toml b/bindings/devup-ui-wasm/Cargo.toml index 8fbdd2cd..b8502e0d 100644 --- a/bindings/devup-ui-wasm/Cargo.toml +++ b/bindings/devup-ui-wasm/Cargo.toml @@ -29,6 +29,7 @@ once_cell = "1.21.3" js-sys = "0.3.77" serde_json = "1.0.143" serde-wasm-bindgen = "0.6.5" +bimap = { version = "0.6.3", features = ["serde"] } [dev-dependencies] wasm-bindgen-test = "0.3.50" diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 6f4e5b81..64ac7239 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -1,5 +1,5 @@ use css::class_map::{get_class_map, set_class_map}; -use css::file_map::{get_file_map, get_filename_by_file_num}; +use css::file_map::{get_file_map, get_filename_by_file_num, set_file_map}; use extractor::extract_style::ExtractStyleProperty; use extractor::extract_style::extract_style_value::ExtractStyleValue; use extractor::extract_style::style_property::StyleProperty; @@ -223,7 +223,7 @@ pub fn export_class_map() -> Result { #[wasm_bindgen(js_name = "importFileMap")] pub fn import_file_map(sheet_object: JsValue) -> Result<(), JsValue> { - set_class_map( + set_file_map( serde_wasm_bindgen::from_value(sheet_object) .map_err(|e| JsValue::from_str(e.to_string().as_str()))?, ); diff --git a/libs/css/Cargo.toml b/libs/css/Cargo.toml index 0ea9246b..b5c66528 100644 --- a/libs/css/Cargo.toml +++ b/libs/css/Cargo.toml @@ -9,7 +9,7 @@ phf = { version = "0.13", features = ["macros"] } serial_test = "3.2.0" serde = { version = "1.0.219", features = ["derive"] } regex = "1.11.2" -bimap = { version = "0.6.3", features = ["serde"] } +bimap = { version = "0.6.3" } [dev-dependencies] rstest = "0.26.1" diff --git a/packages/webpack-plugin/src/loader.ts b/packages/webpack-plugin/src/loader.ts index 52065c68..31065d65 100644 --- a/packages/webpack-plugin/src/loader.ts +++ b/packages/webpack-plugin/src/loader.ts @@ -14,6 +14,7 @@ export interface DevupUILoaderOptions { cssDir: string sheetFile: string classMapFile: string + fileMapFile: string watch: boolean splitCss: boolean } diff --git a/packages/webpack-plugin/src/plugin.ts b/packages/webpack-plugin/src/plugin.ts index 8d35c07e..ba191519 100644 --- a/packages/webpack-plugin/src/plugin.ts +++ b/packages/webpack-plugin/src/plugin.ts @@ -77,10 +77,12 @@ export class DevupUIWebpackPlugin { ) } - if (this.options.watch && !existsSync(this.options.cssDir)) { + if (!existsSync(this.options.cssDir)) mkdirSync(this.options.cssDir, { recursive: true }) - writeFileSync(join(this.options.cssDir, 'devup-ui.css'), '') - } + if (this.options.watch) + writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { + encoding: 'utf-8', + }) } apply(compiler: Compiler) { @@ -141,10 +143,13 @@ export class DevupUIWebpackPlugin { compilation.fileDependencies.add(resolve(this.options.devupPath)) }) } - if (!existsSync(this.options.cssDir)) { + if (!existsSync(this.options.cssDir)) mkdirSync(this.options.cssDir, { recursive: true }) - writeFileSync(join(this.options.cssDir, 'devup-ui.css'), '') - } + + if (this.options.watch) + writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { + encoding: 'utf-8', + }) compiler.options.plugins.push( new compiler.webpack.DefinePlugin({ From b78390088f0954074bbe77f55fe805c2bc78a87f Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Wed, 27 Aug 2025 12:17:33 +0900 Subject: [PATCH 04/12] Fix str --- bindings/devup-ui-wasm/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 64ac7239..a4ec2f1e 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -177,7 +177,7 @@ impl Output { } Some(sheet.create_css(if self.split_css { - Some(self.filename.as_str()) + Some(&self.filename) } else { None })) @@ -197,42 +197,42 @@ pub fn is_debug() -> bool { #[wasm_bindgen(js_name = "importSheet")] pub fn import_sheet(sheet_object: JsValue) -> Result<(), JsValue> { *GLOBAL_STYLE_SHEET.lock().unwrap() = serde_wasm_bindgen::from_value(sheet_object) - .map_err(|e| JsValue::from_str(e.to_string().as_str()))?; + .map_err(|e| JsValue::from_str(&e.to_string()))?; Ok(()) } #[wasm_bindgen(js_name = "exportSheet")] pub fn export_sheet() -> Result { serde_json::to_string(&*GLOBAL_STYLE_SHEET.lock().unwrap()) - .map_err(|e| JsValue::from_str(e.to_string().as_str())) + .map_err(|e| JsValue::from_str(&e.to_string())) } #[wasm_bindgen(js_name = "importClassMap")] pub fn import_class_map(sheet_object: JsValue) -> Result<(), JsValue> { set_class_map( serde_wasm_bindgen::from_value(sheet_object) - .map_err(|e| JsValue::from_str(e.to_string().as_str()))?, + .map_err(|e| JsValue::from_str(&e.to_string()))?, ); Ok(()) } #[wasm_bindgen(js_name = "exportClassMap")] pub fn export_class_map() -> Result { - serde_json::to_string(&get_class_map()).map_err(|e| JsValue::from_str(e.to_string().as_str())) + serde_json::to_string(&get_class_map()).map_err(|e| JsValue::from_str(&e.to_string())) } #[wasm_bindgen(js_name = "importFileMap")] pub fn import_file_map(sheet_object: JsValue) -> Result<(), JsValue> { set_file_map( serde_wasm_bindgen::from_value(sheet_object) - .map_err(|e| JsValue::from_str(e.to_string().as_str()))?, + .map_err(|e| JsValue::from_str(&e.to_string()))?, ); Ok(()) } #[wasm_bindgen(js_name = "exportFileMap")] pub fn export_file_map() -> Result { - serde_json::to_string(&get_file_map()).map_err(|e| JsValue::from_str(e.to_string().as_str())) + serde_json::to_string(&get_file_map()).map_err(|e| JsValue::from_str(&e.to_string())) } #[wasm_bindgen(js_name = "codeExtract")] From a9204609bb840d9ba64d02b77d2851bb54363110 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:07:24 +0900 Subject: [PATCH 05/12] Refactor option --- Cargo.lock | 125 +- apps/landing/next.config.ts | 13 +- apps/landing/package.json | 6 +- apps/next/package.json | 2 +- apps/rsbuild/package.json | 4 +- apps/vite-lib/package.json | 2 +- apps/vite/package.json | 2 +- benchmark/next-chakra-ui/package.json | 4 +- benchmark/next-devup-ui/package.json | 2 +- benchmark/next-kuma-ui/package.json | 2 +- benchmark/next-mui/package.json | 2 +- bindings/devup-ui-wasm/src/lib.rs | 22 +- libs/css/src/lib.rs | 29 +- libs/extractor/Cargo.toml | 14 +- libs/extractor/src/lib.rs | 642 +++--- ...extractor__tests__extract_keyframs-10.snap | 2 +- .../extractor__tests__extract_keyframs-2.snap | 2 +- .../extractor__tests__extract_keyframs-3.snap | 2 +- .../extractor__tests__extract_keyframs-4.snap | 2 +- .../extractor__tests__extract_keyframs-5.snap | 2 +- .../extractor__tests__extract_keyframs-6.snap | 2 +- .../extractor__tests__extract_keyframs-7.snap | 2 +- .../extractor__tests__extract_keyframs-8.snap | 2 +- .../extractor__tests__extract_keyframs-9.snap | 2 +- .../extractor__tests__extract_keyframs.snap | 2 +- ...or__tests__extract_keyframs_literal-2.snap | 2 +- ...ctor__tests__extract_keyframs_literal.snap | 2 +- ...ractor__tests__extract_wrong_keyframs.snap | 2 +- package.json | 2 +- packages/components/package.json | 12 +- .../next-plugin/src/__tests__/plugin.test.ts | 30 +- packages/next-plugin/src/plugin.ts | 20 +- packages/rsbuild-plugin/package.json | 2 +- .../src/__tests__/index.test.ts | 2 +- .../src/__tests__/plugin.test.ts | 88 +- packages/rsbuild-plugin/src/index.ts | 5 +- packages/rsbuild-plugin/src/plugin.ts | 109 +- .../vite-plugin/src/__tests__/plugin.test.ts | 583 ++--- packages/vite-plugin/src/plugin.ts | 154 +- packages/vite-plugin/tsconfig.json | 19 +- .../src/__tests__/css-loader.test.ts | 4 + .../src/__tests__/loader.test.ts | 57 +- .../src/__tests__/plugin.test.ts | 597 +++-- packages/webpack-plugin/src/loader.ts | 7 +- packages/webpack-plugin/src/plugin.ts | 233 +- packages/webpack-plugin/tsconfig.json | 19 +- pnpm-lock.yaml | 2034 +++++++++-------- tsconfig.json | 24 + vitest.config.ts | 4 +- vitest.setup.ts | 36 + 50 files changed, 2452 insertions(+), 2486 deletions(-) create mode 100644 tsconfig.json create mode 100644 vitest.setup.ts diff --git a/Cargo.lock b/Cargo.lock index 23cc3cdf..87f4ef92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -263,7 +263,7 @@ version = "0.1.0" dependencies = [ "bimap", "once_cell", - "phf 0.13.1", + "phf", "regex", "rstest", "serde", @@ -327,7 +327,7 @@ dependencies = [ "oxc_parser", "oxc_span", "oxc_syntax", - "phf 0.13.1", + "phf", "rstest", "serial_test", "strum", @@ -658,9 +658,9 @@ dependencies = [ [[package]] name = "oxc_allocator" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e887a8496b18a4bce4a760ae2dbd50e5137fa2a27ee99087797d7b8e860a7b5c" +checksum = "1dad79355dfb8a36a772d2aa758e429ae02f533d33c314f538d20ef188db0147" dependencies = [ "allocator-api2", "bumpalo", @@ -671,9 +671,9 @@ dependencies = [ [[package]] name = "oxc_ast" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931e1fae25d9669204681577381f6e90d2c9fe502d306c862f46ff72bcef8cf7" +checksum = "a9987f0e42aef7eb2deccec8dec26b17c658c8616bb7260a53037b765db708f0" dependencies = [ "bitflags", "oxc_allocator", @@ -687,11 +687,11 @@ dependencies = [ [[package]] name = "oxc_ast_macros" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5958a8ac69a955048dabcfcbf8af791dbb7f598bbea5bae33243240f3846457c" +checksum = "08b4b00b34d96543ca44ce82e2e48098197b651b639ff211df48d1725215db08" dependencies = [ - "phf 0.12.1", + "phf", "proc-macro2", "quote", "syn", @@ -699,9 +699,9 @@ dependencies = [ [[package]] name = "oxc_ast_visit" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95d2ce2cb5be550d7a94fc3b927d4247d69aea57943baafbf6547362831e69a5" +checksum = "522d1393ad48548702a8ff9b747100e9c0959dbd37cd677e12d9ffb5eb7f6490" dependencies = [ "oxc_allocator", "oxc_ast", @@ -711,9 +711,9 @@ dependencies = [ [[package]] name = "oxc_cfg" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d950f4f67648b1995c836bd96ae423cdf6800b2332d1ba5b18fd81166daad2f1" +checksum = "0bdf2665550303cfdc9843e4a7f6d88f3216075f42e38b2c2cc0224bf0ba1632" dependencies = [ "bitflags", "itertools 0.14.0", @@ -726,9 +726,9 @@ dependencies = [ [[package]] name = "oxc_codegen" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e252dc98109ed7ee39120255f566ee13f8e6016d86fa38137e99768165f60e7" +checksum = "081b3d96db8e9f1677d56a959873f971285bf565276c11d61e7b61affee15790" dependencies = [ "bitflags", "cow-utils", @@ -748,15 +748,15 @@ dependencies = [ [[package]] name = "oxc_data_structures" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b3258dc882e0348934e2a9973cd0d9e3c465642b729842320d23abf835175a" +checksum = "e2d124d0e1498479cd9410b494fe12d4018a1db55400508c0f8d9d0817934dc6" [[package]] name = "oxc_diagnostics" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc24fdf0407c9ecb202efb99fa9870f3623994ae8daae56e696a511894d67ba" +checksum = "0befbac8654a5a1cef8ee9b31ff6cf669c9abde763f30fb12c2c284993c86498" dependencies = [ "cow-utils", "oxc-miette", @@ -765,9 +765,9 @@ dependencies = [ [[package]] name = "oxc_ecmascript" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61cfc9801af5b0068e11061ff8100fb38c2ca0875c696aa405b5505d212b5e2f" +checksum = "1c59f9f0cfb236ae7b1e8f1be956f3585078256d8a4f8881cbe3b02edd7c57b1" dependencies = [ "cow-utils", "num-bigint", @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "oxc_estree" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac265e2cd8c77ac8d4230f1538e8ff9f6f5d9e41b9107af58f8d3c4626b028" +checksum = "70bffad4cb83abd3db5310ccdb5f298b19377244d43eda7ec3912b544452bcb2" [[package]] name = "oxc_index" @@ -792,9 +792,9 @@ checksum = "2fa07b0cfa997730afed43705766ef27792873fdf5215b1391949fec678d2392" [[package]] name = "oxc_parser" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b4427e7c4d4507bb4561c113e25bbbb737d03355f311d3fb606f0029fdcb3f6" +checksum = "90a651f61f532b9c5485c65786363b42c3a711ba60871746740409f381b49bea" dependencies = [ "bitflags", "cow-utils", @@ -815,25 +815,25 @@ dependencies = [ [[package]] name = "oxc_regular_expression" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ec07cb1081ed5798e2ef7d3e10154784cd1bf47c5170ff3d519d44bc97ad07" +checksum = "8b97261c926b800200a07309eefc7b5801432ed3a91b76b5ea9780f97fc961d4" dependencies = [ "bitflags", "oxc_allocator", "oxc_ast_macros", "oxc_diagnostics", "oxc_span", - "phf 0.12.1", + "phf", "rustc-hash", "unicode-id-start", ] [[package]] name = "oxc_semantic" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8191888545927293275ff32593584327dbd2c5805345abba1236f6febe55b567" +checksum = "b594d9a93b359ba5421118c0cc2664795138e171ffb60c345e621fc8ea4cf4dd" dependencies = [ "itertools 0.14.0", "oxc_allocator", @@ -846,7 +846,7 @@ dependencies = [ "oxc_index", "oxc_span", "oxc_syntax", - "phf 0.12.1", + "phf", "rustc-hash", "self_cell", ] @@ -867,9 +867,9 @@ dependencies = [ [[package]] name = "oxc_span" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008d14e804d79adac31c5cb5b27fbfde52055a0cf86276c9b822cfa40b24d75c" +checksum = "1948fe931738f956b2c673804bce7f93b3dc8fcb4575485ef65adc15fcae3d92" dependencies = [ "compact_str", "oxc-miette", @@ -880,9 +880,9 @@ dependencies = [ [[package]] name = "oxc_syntax" -version = "0.82.3" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675313926fe94e71b9cdf6ed0338e0bfb40e827e2b5fd0c65a059aff002e7fa2" +checksum = "ad28a43d5b4ccf4f286b68f377d364790c098128729b44a52421cf9de2ce3ec0" dependencies = [ "bitflags", "cow-utils", @@ -894,7 +894,7 @@ dependencies = [ "oxc_estree", "oxc_index", "oxc_span", - "phf 0.12.1", + "phf", "rustc-hash", "unicode-id-start", ] @@ -940,38 +940,17 @@ dependencies = [ "serde", ] -[[package]] -name = "phf" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" -dependencies = [ - "phf_macros 0.12.1", - "phf_shared 0.12.1", - "serde", -] - [[package]] name = "phf" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ - "phf_macros 0.13.1", - "phf_shared 0.13.1", + "phf_macros", + "phf_shared", "serde", ] -[[package]] -name = "phf_generator" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b" -dependencies = [ - "fastrand", - "phf_shared 0.12.1", -] - [[package]] name = "phf_generator" version = "0.13.1" @@ -979,20 +958,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" dependencies = [ "fastrand", - "phf_shared 0.13.1", -] - -[[package]] -name = "phf_macros" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713258393a82f091ead52047ca779d37e5766226d009de21696c4e667044368" -dependencies = [ - "phf_generator 0.12.1", - "phf_shared 0.12.1", - "proc-macro2", - "quote", - "syn", + "phf_shared", ] [[package]] @@ -1001,22 +967,13 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", + "phf_generator", + "phf_shared", "proc-macro2", "quote", "syn", ] -[[package]] -name = "phf_shared" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" -dependencies = [ - "siphasher", -] - [[package]] name = "phf_shared" version = "0.13.1" diff --git a/apps/landing/next.config.ts b/apps/landing/next.config.ts index 25083af8..43b915ec 100644 --- a/apps/landing/next.config.ts +++ b/apps/landing/next.config.ts @@ -10,13 +10,8 @@ const withMDX = createMDX({ }) export default withMDX( - DevupUI( - { - pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], - output: 'export', - }, - { - include: ['@devup-ui/components', '@devup-ui/reset-css'], - }, - ), + DevupUI({ + pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], + output: 'export', + }), ) diff --git a/apps/landing/package.json b/apps/landing/package.json index e5c7229a..dbdd0c7a 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -16,15 +16,15 @@ "@devup-ui/reset-css": "workspace:*", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", - "@next/mdx": "^15.5.0", + "@next/mdx": "^15.5.2", "@types/mdx": "^2.0.13", "body-scroll-lock": "3.1.5", "clsx": "^2.1.1", - "next": "^15.5.0", + "next": "^15.5.2", "react": "^19.1.1", "react-dom": "^19.1.1", "react-markdown": "^10.1.0", - "react-syntax-highlighter": "^15.6.1", + "react-syntax-highlighter": "^15.6.6", "remark-gfm": "^4.0.1" }, "devDependencies": { diff --git a/apps/next/package.json b/apps/next/package.json index 77dc77ba..bb6490a7 100644 --- a/apps/next/package.json +++ b/apps/next/package.json @@ -12,7 +12,7 @@ "dependencies": { "react": "^19.1.1", "react-dom": "^19.1.1", - "next": "^15.5.0", + "next": "^15.5.2", "@devup-ui/react": "workspace:*" }, "devDependencies": { diff --git a/apps/rsbuild/package.json b/apps/rsbuild/package.json index 1d7b4c02..372902aa 100644 --- a/apps/rsbuild/package.json +++ b/apps/rsbuild/package.json @@ -15,8 +15,8 @@ "@devup-ui/react": "workspace:*" }, "devDependencies": { - "@rsbuild/core": "^1.4.15", - "@rsbuild/plugin-react": "^1.3.5", + "@rsbuild/core": "^1.5.1", + "@rsbuild/plugin-react": "^1.4.0", "@devup-ui/rsbuild-plugin": "workspace:*" } } \ No newline at end of file diff --git a/apps/vite-lib/package.json b/apps/vite-lib/package.json index de0727b6..04ba5b10 100644 --- a/apps/vite-lib/package.json +++ b/apps/vite-lib/package.json @@ -18,7 +18,7 @@ "devDependencies": { "vite-plugin-dts": "^4.5.4", "@devup-ui/vite-plugin": "workspace:*", - "@vitejs/plugin-react": "^5.0.1", + "@vitejs/plugin-react": "^5.0.2", "vite": "^7.1.3", "typescript": "^5", "@types/node": "^24", diff --git a/apps/vite/package.json b/apps/vite/package.json index 7560f723..1a0829da 100644 --- a/apps/vite/package.json +++ b/apps/vite/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@devup-ui/vite-plugin": "workspace:*", "vite": "^7.1.3", - "@vitejs/plugin-react": "^5.0.1", + "@vitejs/plugin-react": "^5.0.2", "typescript": "^5", "@types/node": "^24", "@types/react": "^19", diff --git a/benchmark/next-chakra-ui/package.json b/benchmark/next-chakra-ui/package.json index 6b8d7c04..57b17791 100644 --- a/benchmark/next-chakra-ui/package.json +++ b/benchmark/next-chakra-ui/package.json @@ -10,9 +10,9 @@ "lint": "next lint" }, "dependencies": { - "@chakra-ui/react": "^3.25.0", + "@chakra-ui/react": "^3.26.0", "@emotion/react": "^11.14.0", - "next": "^15.5.0", + "next": "^15.5.2", "next-themes": "^0.4.6", "react": "^19.1.1", "react-dom": "^19.1.1", diff --git a/benchmark/next-devup-ui/package.json b/benchmark/next-devup-ui/package.json index 88e8e973..ade75d14 100644 --- a/benchmark/next-devup-ui/package.json +++ b/benchmark/next-devup-ui/package.json @@ -12,7 +12,7 @@ "dependencies": { "react": "^19.1.1", "react-dom": "^19.1.1", - "next": "^15.5.0", + "next": "^15.5.2", "@devup-ui/react": "workspace:*" }, "devDependencies": { diff --git a/benchmark/next-kuma-ui/package.json b/benchmark/next-kuma-ui/package.json index 2d20bf33..d9d248a2 100644 --- a/benchmark/next-kuma-ui/package.json +++ b/benchmark/next-kuma-ui/package.json @@ -12,7 +12,7 @@ "dependencies": { "react": "^19.1.1", "react-dom": "^19.1.1", - "next": "^15.5.0", + "next": "^15.5.2", "@kuma-ui/core": "^1.5.9" }, "devDependencies": { diff --git a/benchmark/next-mui/package.json b/benchmark/next-mui/package.json index 9cd01cc8..8d0ea7bb 100644 --- a/benchmark/next-mui/package.json +++ b/benchmark/next-mui/package.json @@ -13,7 +13,7 @@ "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@mui/material": "7.3.1", - "next": "^15.5.0", + "next": "^15.5.2", "next-themes": "^0.4.6", "react": "^19.1.1", "react-dom": "^19.1.1", diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index a4ec2f1e..84631582 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -19,7 +19,7 @@ pub struct Output { styles: HashSet, map: Option, default_collected: bool, - split_css: bool, + single_css: bool, filename: String, css_file: String, } @@ -61,7 +61,7 @@ impl Output { for style in self.styles.iter() { match style { ExtractStyleValue::Static(st) => { - let (cls, _) = match style.extract(if self.split_css { + let (cls, _) = match style.extract(if !self.single_css { Some(self.filename.as_str()) } else { None @@ -81,7 +81,7 @@ impl Output { st.value(), st.selector(), st.style_order(), - if self.split_css { + if !self.single_css { Some(self.filename.as_str()) } else { None @@ -91,7 +91,7 @@ impl Output { } } ExtractStyleValue::Dynamic(dy) => { - let (cls, variable) = match style.extract(if self.split_css { + let (cls, variable) = match style.extract(if !self.single_css { Some(self.filename.as_str()) } else { None @@ -111,7 +111,7 @@ impl Output { &format!("var({})", variable.unwrap()), dy.selector(), dy.style_order(), - if self.split_css { + if !self.single_css { Some(self.filename.as_str()) } else { None @@ -124,7 +124,7 @@ impl Output { ExtractStyleValue::Keyframes(keyframes) => { if sheet.add_keyframes( &keyframes - .extract(if self.split_css { + .extract(if !self.single_css { Some(self.filename.as_str()) } else { None @@ -148,7 +148,7 @@ impl Output { ) }) .collect(), - if self.split_css { + if !self.single_css { Some(self.filename.as_str()) } else { None @@ -176,7 +176,7 @@ impl Output { return None; } - Some(sheet.create_css(if self.split_css { + Some(sheet.create_css(if !self.single_css { Some(&self.filename) } else { None @@ -241,7 +241,7 @@ pub fn code_extract( code: &str, package: &str, css_dir: String, - split_css: bool, + single_css: bool, ) -> Result { let mut sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); @@ -251,7 +251,7 @@ pub fn code_extract( ExtractOption { package: package.to_string(), css_dir, - split_css, + single_css, }, ) { Ok(output) => Ok(Output { @@ -259,7 +259,7 @@ pub fn code_extract( styles: output.styles, map: output.map, default_collected: sheet.rm_global_css(filename), - split_css, + single_css, filename: filename.to_string(), css_file: output.css_file, }), diff --git a/libs/css/src/lib.rs b/libs/css/src/lib.rs index a17fec91..5e65f47f 100644 --- a/libs/css/src/lib.rs +++ b/libs/css/src/lib.rs @@ -107,7 +107,7 @@ pub fn sheet_to_classname( if is_debug() { let selector = selector.unwrap_or_default().trim(); format!( - "{}-{}-{}-{}-{}-{}", + "{}-{}-{}-{}-{}{}", property.trim(), level, optimize_value(value.unwrap_or_default()), @@ -119,17 +119,21 @@ pub fn sheet_to_classname( hasher.finish().to_string() }, style_order.unwrap_or(255), - filename.unwrap_or_default() + filename + .map(|v| format!("-{}", get_file_num_by_filename(v))) + .unwrap_or_default(), ) } else { let key = format!( - "{}-{}-{}-{}-{}-{}", + "{}-{}-{}-{}-{}{}", property.trim(), level, optimize_value(value.unwrap_or_default()), selector.unwrap_or_default().trim(), style_order.unwrap_or(255), - filename.unwrap_or_default() + filename + .map(|v| format!("-{}", get_file_num_by_filename(v))) + .unwrap_or_default(), ); let mut map = GLOBAL_CLASS_MAP.lock().unwrap(); let filename = filename.map(|v| v.to_string()).unwrap_or_default(); @@ -321,7 +325,7 @@ mod tests { { let map = GLOBAL_CLASS_MAP.lock().unwrap(); assert_eq!( - map.get("").unwrap().get("background-0-#FF000080--255-"), + map.get("").unwrap().get("background-0-#FF000080--255"), Some(&2) ); } @@ -337,10 +341,7 @@ mod tests { { let map = GLOBAL_CLASS_MAP.lock().unwrap(); - assert_eq!( - map.get("").unwrap().get("background-0-#FFF--255-"), - Some(&3) - ); + assert_eq!(map.get("").unwrap().get("background-0-#FFF--255"), Some(&3)); } assert_eq!( @@ -356,7 +357,7 @@ mod tests { { let map = GLOBAL_CLASS_MAP.lock().unwrap(); assert_eq!( - map.get("").unwrap().get("background-0-#FFFA--255-"), + map.get("").unwrap().get("background-0-#FFFA--255"), Some(&4) ); } @@ -524,19 +525,19 @@ mod tests { set_debug(true); assert_eq!( sheet_to_classname("background", 0, None, None, None, None), - "background-0---255-" + "background-0---255" ); assert_eq!( sheet_to_classname("background", 0, Some("red"), Some("hover"), None, None), - "background-0-red-12448419602614487988-255-" + "background-0-red-12448419602614487988-255" ); assert_eq!( sheet_to_classname("background", 1, None, None, None, None), - "background-1---255-" + "background-1---255" ); assert_eq!( sheet_to_classname("background", 1, Some("red"), Some("hover"), None, None), - "background-1-red-12448419602614487988-255-" + "background-1-red-12448419602614487988-255" ); } diff --git a/libs/extractor/Cargo.toml b/libs/extractor/Cargo.toml index a0214628..2b20bc78 100644 --- a/libs/extractor/Cargo.toml +++ b/libs/extractor/Cargo.toml @@ -4,13 +4,13 @@ version = "0.1.0" edition = "2024" [dependencies] -oxc_parser = "0.82.3" -oxc_syntax = "0.82.3" -oxc_span = "0.82.3" -oxc_allocator = "0.82.3" -oxc_ast = "0.82.3" -oxc_ast_visit = "0.82.3" -oxc_codegen = "0.82.3" +oxc_parser = "0.83.0" +oxc_syntax = "0.83.0" +oxc_span = "0.83.0" +oxc_allocator = "0.83.0" +oxc_ast = "0.83.0" +oxc_ast_visit = "0.83.0" +oxc_codegen = "0.83.0" css = { path = "../css" } phf = "0.13" strum = "0.27.2" diff --git a/libs/extractor/src/lib.rs b/libs/extractor/src/lib.rs index 85578ab3..f9932c50 100644 --- a/libs/extractor/src/lib.rs +++ b/libs/extractor/src/lib.rs @@ -83,7 +83,7 @@ pub struct ExtractOutput { pub struct ExtractOption { pub package: String, pub css_dir: String, - pub split_css: bool, + pub single_css: bool, } pub fn extract( @@ -92,14 +92,14 @@ pub fn extract( option: ExtractOption, ) -> Result> { let source_type = SourceType::from_path(filename)?; - let css_file = if option.split_css { + let css_file = if option.single_css { + format!("{}/devup-ui.css", option.css_dir) + } else { format!( "{}/devup-ui-{}.css", option.css_dir, get_file_num_by_filename(filename) ) - } else { - format!("{}/devup-ui.css", option.css_dir) }; if !code.contains(option.package.as_str()) { // skip if not using package @@ -125,7 +125,7 @@ pub fn extract( filename, &option.package, &css_file, - if option.split_css { + if !option.single_css { Some(filename.to_string()) } else { None @@ -189,7 +189,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true }, ) .unwrap() @@ -203,7 +203,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true }, ) .unwrap() @@ -222,7 +222,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false, + single_css: true, } ) .unwrap() @@ -238,7 +238,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -258,7 +258,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -274,7 +274,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -288,7 +288,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -304,7 +304,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -318,7 +318,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -382,7 +382,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -397,7 +397,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -412,7 +412,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -428,7 +428,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -444,7 +444,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -460,7 +460,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -482,7 +482,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -505,7 +505,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -527,7 +527,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -547,7 +547,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -563,7 +563,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -579,7 +579,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -595,7 +595,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -610,7 +610,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -632,7 +632,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -648,7 +648,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -668,7 +668,7 @@ mod tests { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -702,7 +702,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -722,7 +722,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -741,7 +741,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -755,7 +755,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -775,7 +775,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -791,7 +791,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -807,7 +807,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -823,7 +823,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -843,7 +843,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -859,7 +859,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -875,7 +875,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -895,7 +895,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -911,7 +911,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -927,7 +927,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -943,7 +943,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -959,7 +959,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -979,7 +979,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -999,7 +999,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1019,7 +1019,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1035,7 +1035,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1055,7 +1055,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1071,7 +1071,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1091,7 +1091,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1107,7 +1107,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1123,7 +1123,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1139,7 +1139,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1155,7 +1155,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1171,7 +1171,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1187,7 +1187,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1203,7 +1203,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1219,7 +1219,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1239,7 +1239,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1255,7 +1255,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1271,7 +1271,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1287,7 +1287,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1303,7 +1303,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1319,7 +1319,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1339,7 +1339,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1355,7 +1355,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1375,7 +1375,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1391,7 +1391,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1407,7 +1407,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1423,7 +1423,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1439,7 +1439,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1455,7 +1455,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1471,7 +1471,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1487,7 +1487,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1507,7 +1507,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1523,7 +1523,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1539,7 +1539,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1555,7 +1555,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1575,7 +1575,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1591,7 +1591,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1607,7 +1607,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1623,7 +1623,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1642,7 +1642,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1658,7 +1658,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1680,7 +1680,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1715,7 +1715,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1735,7 +1735,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1755,7 +1755,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1775,7 +1775,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1795,7 +1795,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1815,7 +1815,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1833,7 +1833,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1858,7 +1858,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1878,7 +1878,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1894,7 +1894,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1910,7 +1910,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1926,7 +1926,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1942,7 +1942,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1958,7 +1958,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1974,7 +1974,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -1996,7 +1996,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2016,7 +2016,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2039,7 +2039,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2061,7 +2061,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2086,7 +2086,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2110,7 +2110,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2133,7 +2133,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2162,7 +2162,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2186,7 +2186,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2212,7 +2212,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2238,7 +2238,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2264,7 +2264,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2290,7 +2290,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2312,7 +2312,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2330,7 +2330,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2346,7 +2346,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2365,7 +2365,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2387,7 +2387,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2407,7 +2407,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2429,7 +2429,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2451,7 +2451,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2469,7 +2469,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2488,7 +2488,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2506,7 +2506,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2527,7 +2527,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2543,7 +2543,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2559,7 +2559,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2575,7 +2575,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2596,7 +2596,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2623,7 +2623,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2639,7 +2639,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2655,7 +2655,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2672,7 +2672,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2688,7 +2688,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2704,7 +2704,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2720,7 +2720,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2746,7 +2746,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2771,7 +2771,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2791,7 +2791,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2811,7 +2811,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2827,7 +2827,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2843,7 +2843,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2863,7 +2863,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2879,7 +2879,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2895,7 +2895,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2914,7 +2914,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2930,7 +2930,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2946,7 +2946,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2967,7 +2967,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -2985,7 +2985,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true }, ) .unwrap_err() @@ -3001,7 +3001,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true }, ) .unwrap_err() @@ -3022,7 +3022,7 @@ import clsx from 'clsx' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3038,7 +3038,7 @@ useTheme(); ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3077,7 +3077,7 @@ export { ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3112,7 +3112,7 @@ export { ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3129,7 +3129,7 @@ e(o, { className: "a", bg: "red" }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3146,7 +3146,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" } }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3163,7 +3163,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3174,16 +3174,16 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) #[serial] fn support_transpile_cjs() { reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),single_css:true }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.cjs", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const {jsx:e1, jsxs:e2}=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e2("div",{children:[e1(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e1(r.Text,{typography:"header",children:"typo"}),e1(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),single_css:true }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:"header",children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),single_css:true }).unwrap())); reset_class_map(); - assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),split_css:false }).unwrap())); + assert_debug_snapshot!(ToBTreeSet::from(extract("test.js", r#""use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@devup-ui/react");function t(){return e.jsxs("div",{children:[e.jsx(r.Box,{_hover:{bg:"blue"},bg:"$text",color:"red",children:"hello"}),e.jsx(r.Text,{typography:`header`,children:"typo"}),e.jsx(r.Flex,{as:"section",mt:2,children:"section"})]})}exports.Lib=t;"#, ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(),single_css:true }).unwrap())); } #[test] @@ -3199,7 +3199,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false, + single_css: true, } ) .unwrap() @@ -3219,7 +3219,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3235,7 +3235,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3251,7 +3251,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3271,7 +3271,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3287,7 +3287,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3303,7 +3303,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3323,7 +3323,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3358,7 +3358,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3378,7 +3378,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3394,7 +3394,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3410,7 +3410,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3426,7 +3426,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3442,7 +3442,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3461,7 +3461,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3477,7 +3477,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3493,7 +3493,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3509,7 +3509,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3525,7 +3525,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3541,7 +3541,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3557,7 +3557,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3577,7 +3577,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3593,7 +3593,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3609,7 +3609,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3625,7 +3625,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3649,7 +3649,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3665,7 +3665,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3685,7 +3685,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3701,7 +3701,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3717,7 +3717,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3733,7 +3733,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3752,7 +3752,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3768,7 +3768,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3784,7 +3784,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3824,7 +3824,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3844,7 +3844,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3860,7 +3860,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3876,7 +3876,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3892,7 +3892,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3912,7 +3912,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3927,7 +3927,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3947,7 +3947,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3963,7 +3963,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -3982,7 +3982,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4002,7 +4002,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4018,7 +4018,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4037,7 +4037,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4053,7 +4053,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4073,7 +4073,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4093,7 +4093,7 @@ export default function Card({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4117,7 +4117,7 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4137,7 +4137,7 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4153,7 +4153,7 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4173,7 +4173,7 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4193,7 +4193,7 @@ PROCESS_DATA.map(({ id, title, content }, idx) => ( ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4215,7 +4215,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4238,7 +4238,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4257,7 +4257,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4277,7 +4277,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4309,7 +4309,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4329,7 +4329,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4345,7 +4345,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4361,7 +4361,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4377,7 +4377,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4393,7 +4393,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4413,7 +4413,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4433,7 +4433,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4448,7 +4448,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4471,7 +4471,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4495,7 +4495,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4515,7 +4515,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4535,7 +4535,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4559,7 +4559,7 @@ import {Button} from '@devup/ui' ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4595,7 +4595,7 @@ export { ExtractOption { package: "@devup-ui/react".to_string(), css_dir: "@devup-ui/react".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4611,7 +4611,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4627,7 +4627,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4643,7 +4643,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4666,7 +4666,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4690,7 +4690,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4706,7 +4706,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4733,7 +4733,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4756,7 +4756,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4779,7 +4779,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4801,7 +4801,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4819,7 +4819,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4838,7 +4838,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4856,7 +4856,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4874,7 +4874,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4892,7 +4892,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4910,7 +4910,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4928,7 +4928,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4949,7 +4949,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4965,7 +4965,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -4985,7 +4985,7 @@ export { ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5006,7 +5006,7 @@ e(o, { styleVars: { c: "yellow" } }) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5030,7 +5030,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5050,7 +5050,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5070,7 +5070,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5090,7 +5090,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5110,7 +5110,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5130,7 +5130,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5150,7 +5150,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5166,7 +5166,7 @@ globalCss(...{}) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5182,7 +5182,7 @@ globalCss(...{div: {bg: "red"}}) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5199,7 +5199,7 @@ globalCss(...{div: {bg: "red"}, ...{span: {bg: "blue"}}}) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5223,7 +5223,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5239,7 +5239,7 @@ globalCss() ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5255,7 +5255,7 @@ globalCss(1) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5284,7 +5284,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5317,7 +5317,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5350,7 +5350,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5391,7 +5391,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5415,7 +5415,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5433,7 +5433,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5451,7 +5451,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5470,7 +5470,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5491,7 +5491,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5507,7 +5507,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5523,7 +5523,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5540,7 +5540,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5562,7 +5562,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5580,7 +5580,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5598,7 +5598,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5631,7 +5631,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5655,7 +5655,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5678,7 +5678,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5700,7 +5700,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5724,7 +5724,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5748,7 +5748,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5787,7 +5787,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5809,7 +5809,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5827,7 +5827,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5849,7 +5849,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5868,7 +5868,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5886,7 +5886,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5905,7 +5905,7 @@ globalCss({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5921,7 +5921,7 @@ globalCss({}) ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5937,7 +5937,7 @@ globalCss() ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5960,7 +5960,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -5980,7 +5980,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6000,7 +6000,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6020,7 +6020,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6040,7 +6040,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6060,7 +6060,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6080,7 +6080,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6100,7 +6100,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6136,7 +6136,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6156,7 +6156,7 @@ keyframes(...{ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6179,7 +6179,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6223,7 +6223,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6269,7 +6269,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: false + single_css: true } ) .unwrap() @@ -6289,7 +6289,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: true + single_css: false } ) .unwrap() @@ -6303,7 +6303,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: true + single_css: false } ) .unwrap() @@ -6318,7 +6318,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: true + single_css: false } ) .unwrap() @@ -6332,7 +6332,7 @@ keyframes({ ExtractOption { package: "@devup-ui/core".to_string(), css_dir: "@devup-ui/core".to_string(), - split_css: true + single_css: false } ) .unwrap() diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap index 18330c5a..f16d7429 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-10.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes(...{\n [`0%`]: { opacity: 0, ...{color: \"red\"} },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes(...{\n [`0%`]: { opacity: 0, ...{color: \"red\"} },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap index 713b78ae..63f6616f 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-2.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": { opacity: 0 },\n \"50%\": { opacity: 0.5 },\n \"100%\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": { opacity: 0 },\n \"50%\": { opacity: 0.5 },\n \"100%\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap index 6f5ffb34..72c5dbea 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-3.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0\": { opacity: 0 },\n \"50\": { opacity: 0.5 },\n \"100\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0\": { opacity: 0 },\n \"50\": { opacity: 0.5 },\n \"100\": { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap index 21cdbc88..7cee23eb 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-4.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [\"0\"]: { opacity: 0 },\n [\"50\"]: { opacity: 0.5 },\n [\"100\"]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [\"0\"]: { opacity: 0 },\n [\"50\"]: { opacity: 0.5 },\n [\"100\"]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap index a29e95e6..30dbafca 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-5.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [0]: { opacity: 0 },\n [50]: { opacity: 0.5 },\n [100]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [0]: { opacity: 0 },\n [50]: { opacity: 0.5 },\n [100]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap index 425d2e22..c3db1ef8 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-6.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n 0: { opacity: 0 },\n 50: { opacity: 0.5 },\n 100: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n 0: { opacity: 0 },\n 50: { opacity: 0.5 },\n 100: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap index 37a8139e..21cbd09b 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-7.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap index 255c192e..fc13a89a 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-8.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap index e0ed3c0f..6544c112 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs-9.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\n\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`1%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 1 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\n\nkeyframes({\n [`0`]: { opacity: 0 },\n [`50`]: { opacity: 0.5 },\n [`100`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`1%`]: { opacity: 0 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n});\nkeyframes({\n [`0%`]: { opacity: 1 },\n [`50%`]: { opacity: 0.5 },\n [`100%`]: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap index 6db83261..f81d0881 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n to: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n to: { opacity: 1 }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap index 94ef8efe..0720f40c 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal-2.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": `\n background-color: red;\n color: blue;\n `,\n \"100%\": `\n background-color: blue;\n color: red;\n `\n})\n\nkeyframes`\n 0% {\n background-color: red;\n color: blue;\n }\n 100% {\n background-color: blue;\n color: red;\n }\n`\nkeyframes({\n \"0%\": {\n backgroundColor: \"red\",\n color: \"blue\"\n },\n \"100%\": {\n backgroundColor: \"blue\",\n color: \"red\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n \"0%\": `\n background-color: red;\n color: blue;\n `,\n \"100%\": `\n background-color: blue;\n color: red;\n `\n})\n\nkeyframes`\n 0% {\n background-color: red;\n color: blue;\n }\n 100% {\n background-color: blue;\n color: red;\n }\n`\nkeyframes({\n \"0%\": {\n backgroundColor: \"red\",\n color: \"blue\"\n },\n \"100%\": {\n backgroundColor: \"blue\",\n color: \"red\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap index 336b1206..9af1b2c3 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_keyframs_literal.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: `\n background-color: red;\n `,\n to: `\n background-color: blue;\n `\n})\n\nkeyframes`\n from {\n background-color: red;\n }\n to {\n background-color: blue;\n }\n`\nkeyframes({\n from: {\n backgroundColor: \"red\"\n },\n to: {\n backgroundColor: \"blue\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: `\n background-color: red;\n `,\n to: `\n background-color: blue;\n `\n})\n\nkeyframes`\n from {\n background-color: red;\n }\n to {\n background-color: blue;\n }\n`\nkeyframes({\n from: {\n backgroundColor: \"red\"\n },\n to: {\n backgroundColor: \"blue\"\n }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap b/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap index 0afb7e84..be151bf8 100644 --- a/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap +++ b/libs/extractor/src/snapshots/extractor__tests__extract_wrong_keyframs.snap @@ -1,6 +1,6 @@ --- source: libs/extractor/src/lib.rs -expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n [true]: { opacity: 0.5 },\n to: { opacity: 1, color: dy }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, split_css: false\n}).unwrap())" +expression: "ToBTreeSet::from(extract(\"test.tsx\",\nr#\"import { keyframes } from \"@devup-ui/core\";\nkeyframes({\n from: { opacity: 0 },\n [true]: { opacity: 0.5 },\n to: { opacity: 1, color: dy }\n})\n\"#,\nExtractOption\n{\n package: \"@devup-ui/core\".to_string(), css_file: None, single_css: true\n}).unwrap())" --- ToBTreeSet { styles: { diff --git a/package.json b/package.json index 471894b6..d8874be0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "eslint-plugin-devup": "^2.0.5", - "eslint": "^9.33.0", + "eslint": "^9.34.0", "vitest": "^3.2.4", "@vitest/coverage-v8": "^3.2.4", "@changesets/cli": "^2.29.6", diff --git a/packages/components/package.json b/packages/components/package.json index 0177c593..7a50e04f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -49,13 +49,13 @@ }, "devDependencies": { "@devup-ui/vite-plugin": "workspace:*", - "@storybook/addon-docs": "^9.1.2", - "@storybook/addon-onboarding": "^9.1.2", - "@storybook/react-vite": "^9.1.2", - "@types/react": "^19.1.10", - "eslint-plugin-storybook": "^9.1.2", + "@storybook/addon-docs": "^9.1.3", + "@storybook/addon-onboarding": "^9.1.3", + "@storybook/react-vite": "^9.1.3", + "@types/react": "^19.1.12", + "eslint-plugin-storybook": "^9.1.3", "rollup-plugin-preserve-directives": "^0.4.0", - "storybook": "^9.1.2", + "storybook": "^9.1.3", "typescript": "^5.9.2", "vite": "^7.1.3", "vite-plugin-dts": "^4.5.4", diff --git a/packages/next-plugin/src/__tests__/plugin.test.ts b/packages/next-plugin/src/__tests__/plugin.test.ts index 43c259a6..dbad6070 100644 --- a/packages/next-plugin/src/__tests__/plugin.test.ts +++ b/packages/next-plugin/src/__tests__/plugin.test.ts @@ -8,7 +8,7 @@ import { DevupUI } from '../plugin' vi.mock('@devup-ui/webpack-plugin') vi.mock('node:fs') -describe('plugin', () => { +describe('DevupUINextPlugin', () => { describe('webpack', () => { it('should apply webpack plugin', async () => { const ret = DevupUI({}) @@ -16,7 +16,7 @@ describe('plugin', () => { ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId' } as any) expect(DevupUIWebpackPlugin).toHaveBeenCalledWith({ - cssFile: resolve('.next/cache', 'devup-ui_tmpBuildId.css'), + cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'), }) }) @@ -26,7 +26,7 @@ describe('plugin', () => { ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId', dev: true } as any) expect(DevupUIWebpackPlugin).toHaveBeenCalledWith({ - cssFile: resolve('df', 'devup-ui_tmpBuildId.css'), + cssDir: resolve('df', 'devup-ui_tmpBuildId'), watch: true, }) }) @@ -43,7 +43,7 @@ describe('plugin', () => { expect(DevupUIWebpackPlugin).toHaveBeenCalledWith({ package: 'new-package', - cssFile: resolve('.next/cache', 'devup-ui_tmpBuildId.css'), + cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'), }) }) @@ -62,7 +62,7 @@ describe('plugin', () => { expect(DevupUIWebpackPlugin).toHaveBeenCalledWith({ package: 'new-package', - cssFile: resolve('.next/cache', 'devup-ui_tmpBuildId.css'), + cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'), }) expect(webpack).toHaveBeenCalled() }) @@ -76,7 +76,7 @@ describe('plugin', () => { expect(ret).toEqual({ turbopack: { rules: { - 'devup-ui.css': [ + 'devup-ui': [ { loader: '@devup-ui/webpack-plugin/css-loader', options: { @@ -89,10 +89,12 @@ describe('plugin', () => { loader: '@devup-ui/webpack-plugin/loader', options: { package: '@devup-ui/react', - cssFile: resolve('df', 'devup-ui.css'), + cssDir: resolve('df', 'devup-ui'), sheetFile: join('df', 'sheet.json'), classMapFile: join('df', 'classMap.json'), + fileMapFile: join('df', 'fileMap.json'), watch: false, + singleCss: false, }, }, ], @@ -110,7 +112,7 @@ describe('plugin', () => { expect(ret).toEqual({ turbopack: { rules: { - 'devup-ui.css': [ + 'devup-ui': [ { loader: '@devup-ui/webpack-plugin/css-loader', options: { @@ -123,10 +125,12 @@ describe('plugin', () => { loader: '@devup-ui/webpack-plugin/loader', options: { package: '@devup-ui/react', - cssFile: resolve('df', 'devup-ui.css'), + cssDir: resolve('df', 'devup-ui'), sheetFile: join('df', 'sheet.json'), classMapFile: join('df', 'classMap.json'), + fileMapFile: join('df', 'fileMap.json'), watch: false, + singleCss: false, }, }, ], @@ -134,10 +138,10 @@ describe('plugin', () => { }, }) expect(mkdirSync).toHaveBeenCalledWith('df') - expect(writeFileSync).toHaveBeenCalledWith( - resolve('df', 'devup-ui.css'), - '/* devup-ui */', - ) + // expect(writeFileSync).toHaveBeenCalledWith( + // resolve('df', 'devup-ui', 'devup-ui.css'), + // '/* devup-ui */', + // ) expect(writeFileSync).toHaveBeenCalledWith(join('df', '.gitignore'), '*') }) }) diff --git a/packages/next-plugin/src/plugin.ts b/packages/next-plugin/src/plugin.ts index 18628692..0265be7c 100644 --- a/packages/next-plugin/src/plugin.ts +++ b/packages/next-plugin/src/plugin.ts @@ -29,15 +29,16 @@ export function DevupUI( config.turbopack.rules ??= {} const { package: libPackage = '@devup-ui/react', - interfacePath = 'df', - cssDir = resolve(interfacePath, 'devup-ui'), - splitCss = true, + distDir = 'df', + cssDir = resolve(distDir, 'devup-ui'), + singleCss = false, } = options - const sheetFile = join(interfacePath, 'sheet.json') - const classMapFile = join(interfacePath, 'classMap.json') - const gitignoreFile = join(interfacePath, '.gitignore') - if (!existsSync(interfacePath)) mkdirSync(interfacePath) + const sheetFile = join(distDir, 'sheet.json') + const classMapFile = join(distDir, 'classMap.json') + const fileMapFile = join(distDir, 'fileMap.json') + const gitignoreFile = join(distDir, '.gitignore') + if (!existsSync(distDir)) mkdirSync(distDir) if (!existsSync(cssDir)) mkdirSync(cssDir) if (!existsSync(gitignoreFile)) writeFileSync(gitignoreFile, '*') const rules: NonNullable = { @@ -57,8 +58,9 @@ export function DevupUI( cssDir, sheetFile, classMapFile, + fileMapFile, watch: process.env.NODE_ENV === 'development', - splitCss, + singleCss, }, }, ], @@ -70,7 +72,7 @@ export function DevupUI( const { webpack } = config config.webpack = (config, _options) => { options.cssDir ??= resolve( - _options.dev ? (options.interfacePath ?? 'df') : '.next/cache', + _options.dev ? (options.distDir ?? 'df') : '.next/cache', `devup-ui_${_options.buildId}`, ) config.plugins.push( diff --git a/packages/rsbuild-plugin/package.json b/packages/rsbuild-plugin/package.json index faa8c1a3..e51660f1 100644 --- a/packages/rsbuild-plugin/package.json +++ b/packages/rsbuild-plugin/package.json @@ -56,7 +56,7 @@ "@rsbuild/core": "*" }, "devDependencies": { - "@rsbuild/core": "^1.4.15", + "@rsbuild/core": "^1.5.1", "vite": "^7.1.3", "vite-plugin-dts": "^4.5.4", "vitest": "^3.2.4", diff --git a/packages/rsbuild-plugin/src/__tests__/index.test.ts b/packages/rsbuild-plugin/src/__tests__/index.test.ts index 5cdfcadf..66ebd170 100644 --- a/packages/rsbuild-plugin/src/__tests__/index.test.ts +++ b/packages/rsbuild-plugin/src/__tests__/index.test.ts @@ -2,7 +2,7 @@ describe('export', () => { it('should export DevupUIVitePlugin', async () => { const index = await import('../index') expect({ ...index }).toEqual({ - DevupUIRsbuildPlugin: expect.any(Function), + DevupUI: expect.any(Function), }) }) }) diff --git a/packages/rsbuild-plugin/src/__tests__/plugin.test.ts b/packages/rsbuild-plugin/src/__tests__/plugin.test.ts index e2c2b0d5..fec7f4a9 100644 --- a/packages/rsbuild-plugin/src/__tests__/plugin.test.ts +++ b/packages/rsbuild-plugin/src/__tests__/plugin.test.ts @@ -1,19 +1,16 @@ -import { mkdir, writeFile } from 'node:fs/promises' +import { existsSync } from 'node:fs' +import { mkdir, readFile, writeFile } from 'node:fs/promises' import { resolve } from 'node:path' -import { codeExtract } from '@devup-ui/wasm' +import { codeExtract, getThemeInterface } from '@devup-ui/wasm' import { vi } from 'vitest' -import { DevupUIRsbuildPlugin } from '../plugin' +import { DevupUI } from '../plugin' // Mock dependencies vi.mock('node:fs/promises') -vi.mock('@devup-ui/wasm', () => ({ - codeExtract: vi.fn().mockReturnValue({ - code: '', - css: '', - }), -})) +vi.mock('node:fs') +vi.mock('@devup-ui/wasm') describe('DevupUIRsbuildPlugin', () => { beforeEach(() => { @@ -23,15 +20,15 @@ describe('DevupUIRsbuildPlugin', () => { }) it('should export DevupUIRsbuildPlugin', () => { - expect(DevupUIRsbuildPlugin).toBeDefined() + expect(DevupUI).toBeDefined() }) it('should be a function', () => { - expect(DevupUIRsbuildPlugin).toBeInstanceOf(Function) + expect(DevupUI).toBeInstanceOf(Function) }) it('should return a plugin object with correct name', async () => { - const plugin = DevupUIRsbuildPlugin() + const plugin = DevupUI() expect(plugin).toBeDefined() expect(plugin.name).toBe('devup-ui-rsbuild-plugin') expect(typeof plugin.setup).toBe('function') @@ -43,8 +40,39 @@ describe('DevupUIRsbuildPlugin', () => { expect(transform).toHaveBeenCalled() }) + it('should write data files', async () => { + vi.mocked(readFile).mockResolvedValueOnce(JSON.stringify({})) + vi.mocked(getThemeInterface).mockReturnValue('interface code') + vi.mocked(existsSync).mockImplementation((path) => { + if (path === 'devup.json') return true + return false + }) + const plugin = DevupUI() + expect(plugin).toBeDefined() + expect(plugin.setup).toBeDefined() + const transform = vi.fn() + await plugin.setup({ + transform, + } as any) + }) + + it('should error when write data files', async () => { + vi.mocked(readFile).mockRejectedValueOnce(new Error('error')) + vi.mocked(existsSync).mockImplementation((path) => { + if (path === 'devup.json') return true + return false + }) + const plugin = DevupUI() + expect(plugin).toBeDefined() + expect(plugin.setup).toBeDefined() + const transform = vi.fn() + await plugin.setup({ + transform, + } as any) + }) + it('should not register css transform', async () => { - const plugin = DevupUIRsbuildPlugin({ + const plugin = DevupUI({ extractCss: false, }) expect(plugin).toBeDefined() @@ -67,12 +95,12 @@ describe('DevupUIRsbuildPlugin', () => { include: ['src/**/*'], } - const plugin = DevupUIRsbuildPlugin(customOptions) + const plugin = DevupUI(customOptions) expect(plugin).toBeDefined() expect(plugin.name).toBe('devup-ui-rsbuild-plugin') }) it('should transform css', async () => { - const plugin = DevupUIRsbuildPlugin() + const plugin = DevupUI() expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() @@ -82,7 +110,7 @@ describe('DevupUIRsbuildPlugin', () => { expect(transform).toHaveBeenCalled() expect(transform).toHaveBeenCalledWith( { - test: resolve('df', 'devup-ui.css'), + test: /\.(tsx|ts|js|mjs|jsx)$/, }, expect.any(Function), ) @@ -98,7 +126,7 @@ describe('DevupUIRsbuildPlugin', () => { ).toBe('') }) it('should transform code', async () => { - const plugin = DevupUIRsbuildPlugin() + const plugin = DevupUI() expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() @@ -122,6 +150,7 @@ describe('DevupUIRsbuildPlugin', () => { vi.mocked(codeExtract).mockReturnValue({ code: '
', css: '', + css_file: 'devup-ui.css', } as any) await expect( transform.mock.calls[1][1]({ @@ -133,9 +162,19 @@ const App = () => `, code: '
', map: undefined, }) + await expect( + transform.mock.calls[1][1]({ + code: `import { Box } from '@devup-ui/react' +const App = () => `, + resourcePath: 'node_modules/@wrong-ui/react/index.tsx', + }), + ).resolves.toEqual( + `import { Box } from '@devup-ui/react' +const App = () => `, + ) }) it('should transform with include', async () => { - const plugin = DevupUIRsbuildPlugin({ + const plugin = DevupUI({ include: ['lib'], }) expect(plugin).toBeDefined() @@ -154,6 +193,7 @@ const App = () => `, vi.mocked(codeExtract).mockReturnValue({ code: '
', css: '.devup-ui-1 { color: red; }', + css_file: 'devup-ui.css', } as any) const ret = await transform.mock.calls[1][1]({ code: `import { Box } from '@devup-ui/react' @@ -165,11 +205,9 @@ const App = () => `, map: undefined, }) expect(writeFile).toHaveBeenCalledWith( - resolve('df', 'devup-ui.css'), + resolve('df', 'devup-ui', 'devup-ui.css'), expect.stringMatching(/\/\* src\/App\.tsx \d+ \*\//), - { - encoding: 'utf-8', - }, + 'utf-8', ) const ret1 = await transform.mock.calls[1][1]({ @@ -177,7 +215,9 @@ const App = () => `, const App = () => `, resourcePath: 'node_modules/@devup-ui/react/index.tsx', }) - expect(ret1).toBe(`import { Box } from '@devup-ui/react' -const App = () => `) + expect(ret1).toEqual({ + code: `
`, + map: undefined, + }) }) }) diff --git a/packages/rsbuild-plugin/src/index.ts b/packages/rsbuild-plugin/src/index.ts index ddbd8397..46c6e437 100644 --- a/packages/rsbuild-plugin/src/index.ts +++ b/packages/rsbuild-plugin/src/index.ts @@ -1,4 +1 @@ -export { - DevupUIRsbuildPlugin, - type DevupUIRsbuildPluginOptions, -} from './plugin' +export { DevupUI, type DevupUIRsbuildPluginOptions } from './plugin' diff --git a/packages/rsbuild-plugin/src/plugin.ts b/packages/rsbuild-plugin/src/plugin.ts index 7c953977..33ba33df 100644 --- a/packages/rsbuild-plugin/src/plugin.ts +++ b/packages/rsbuild-plugin/src/plugin.ts @@ -1,43 +1,88 @@ -import { mkdir, writeFile } from 'node:fs/promises' -import { join, resolve } from 'node:path' +import { existsSync } from 'node:fs' +import { mkdir, readFile, writeFile } from 'node:fs/promises' +import { basename, join, resolve } from 'node:path' -import { codeExtract } from '@devup-ui/wasm' +import { + codeExtract, + getThemeInterface, + registerTheme, + setDebug, +} from '@devup-ui/wasm' import type { RsbuildPlugin } from '@rsbuild/core' export interface DevupUIRsbuildPluginOptions { package: string - cssFile: string - devupPath: string - interfacePath: string + cssDir: string + devupFile: string + distDir: string extractCss: boolean debug: boolean include: string[] - splitCss: boolean + singleCss: boolean } let globalCss = '' -export const DevupUIRsbuildPlugin = ({ +async function writeDataFiles( + options: Omit< + DevupUIRsbuildPluginOptions, + 'extractCss' | 'debug' | 'include' | 'singleCss' + >, +) { + try { + const content = existsSync(options.devupFile) + ? await readFile(options.devupFile, 'utf-8') + : undefined + + if (content) { + registerTheme(JSON.parse(content)?.['theme'] ?? {}) + const interfaceCode = getThemeInterface( + options.package, + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + + if (interfaceCode) { + await writeFile(join(options.distDir, 'theme.d.ts'), interfaceCode, { + encoding: 'utf-8', + }) + } + } else { + registerTheme({}) + } + } catch (error) { + console.error(error) + registerTheme({}) + } + if (!existsSync(options.cssDir)) + await mkdir(options.cssDir, { recursive: true }) +} + +export const DevupUI = ({ include = [], package: libPackage = '@devup-ui/react', extractCss = true, - interfacePath = 'df', - cssFile = resolve(interfacePath, 'devup-ui.css'), - splitCss = true, + distDir = 'df', + cssDir = resolve(distDir, 'devup-ui'), + devupFile = 'devup.json', + debug = false, + singleCss = false, }: Partial = {}): RsbuildPlugin => ({ name: 'devup-ui-rsbuild-plugin', - async setup(api) { - if (!extractCss) return - await mkdir(interfacePath, { recursive: true }) - await writeFile(join(interfacePath, '.gitignore'), '*', { - encoding: 'utf-8', + setDebug(debug) + await writeDataFiles({ + package: libPackage, + cssDir, + devupFile, + distDir, }) - await writeFile(cssFile, '') + if (!extractCss) return api.transform( { - test: cssFile, + test: cssDir, }, () => globalCss, ) @@ -48,27 +93,27 @@ export const DevupUIRsbuildPlugin = ({ }, async ({ code, resourcePath }) => { if ( - include.length - ? new RegExp( - `node_modules(?!(${include - .map((i) => `.*${i}`) - .join('|') - .replaceAll('/', '[\\/\\\\_]')})([\\/\\\\.]|$))`, - ).test(resourcePath) - : resourcePath.includes('node_modules') + new RegExp( + `node_modules(?!.*(${['@devup-ui', ...include] + .join('|') + .replaceAll('/', '[\\/\\\\_]')})([\\/\\\\.]|$))`, + ).test(resourcePath) ) return code const { code: retCode, css, map, - } = codeExtract(resourcePath, code, libPackage, cssFile, splitCss) + css_file, + } = codeExtract(resourcePath, code, libPackage, cssDir, singleCss) - if (css && globalCss.length < css.length) { - globalCss = css - await writeFile(cssFile, `/* ${resourcePath} ${Date.now()} */`, { - encoding: 'utf-8', - }) + if (css) { + if (globalCss.length < css.length) globalCss = css + await writeFile( + join(cssDir, basename(css_file)), + `/* ${resourcePath} ${Date.now()} */`, + 'utf-8', + ) } return { code: retCode, diff --git a/packages/vite-plugin/src/__tests__/plugin.test.ts b/packages/vite-plugin/src/__tests__/plugin.test.ts index 32fe9bf8..de5a399b 100644 --- a/packages/vite-plugin/src/__tests__/plugin.test.ts +++ b/packages/vite-plugin/src/__tests__/plugin.test.ts @@ -1,5 +1,5 @@ -import { existsSync, readFileSync, writeFileSync } from 'node:fs' -import { writeFile } from 'node:fs/promises' +import { existsSync } from 'node:fs' +import { mkdir, readFile, writeFile } from 'node:fs/promises' import { dirname, join, resolve } from 'node:path' import { fileURLToPath } from 'node:url' @@ -8,6 +8,8 @@ import { getCss, getDefaultTheme, getThemeInterface, + registerTheme, + setDebug, } from '@devup-ui/wasm' import { describe } from 'vitest' @@ -23,443 +25,230 @@ beforeEach(() => { vi.resetAllMocks() }) -describe('devupUIPlugin', () => { +describe('devupUIVitePlugin', () => { console.error = vi.fn() - it('should write data files', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) - vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - } - const plugin = DevupUI(options) + it('should apply default options', () => { + const plugin = DevupUI({}) expect(plugin).toEqual({ name: 'devup-ui', + config: expect.any(Function), load: expect.any(Function), resolveId: expect.any(Function), - config: expect.any(Function), watchChange: expect.any(Function), enforce: 'pre', transform: expect.any(Function), apply: expect.any(Function), generateBundle: expect.any(Function), + configResolved: expect.any(Function), }) - expect(existsSync).toHaveBeenCalledWith(devupPath) - expect(getThemeInterface).toHaveBeenCalledWith( - libPackage, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', - ) - expect(readFileSync).toHaveBeenCalledWith(devupPath, 'utf-8') - expect(existsSync).toHaveBeenCalledWith(interfacePath) - expect((plugin as any).config()).toEqual({ - define: { - 'process.env.DEVUP_UI_DEFAULT_THEME': JSON.stringify(getDefaultTheme()), - }, - server: { - watch: { - ignored: [`!${devupPath}`], - }, - }, - optimizeDeps: { - exclude: [], - }, - build: { - rollupOptions: { - output: { - manualChunks: expect.any(Function), - }, - }, - }, - }) - vi.clearAllMocks() - vi.mocked(existsSync).mockReturnValue(true) - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - ;(plugin as any).watchChange(devupPath) - expect(readFileSync).toBeCalledTimes(1) + expect((plugin as any).apply()).toBe(true) + }) + it.each( + globalThis.createTestMatrix({ + debug: [true, false], + singleCss: [true, false], + extractCss: [true, false], + }), + )('should apply options', async (options) => { + const plugin = DevupUI(options) + expect(setDebug).toHaveBeenCalledWith(options.debug) + if (options.extractCss) { + expect( + (plugin as any) + .config() + .build.rollupOptions.output.manualChunks('devup-ui.css', 'code'), + ).toEqual(options.singleCss ? 'devup-ui.css' : undefined) + } else { + expect((plugin as any).config().build).toBeUndefined() + } + }) - vi.clearAllMocks() - vi.mocked(existsSync).mockReturnValue(true) - ;(plugin as any).watchChange('dif') - expect(readFileSync).toBeCalledTimes(0) + it.each( + createTestMatrix({ + watch: [true, false], + existsDevupFile: [true, false], + existsDistDir: [true, false], + existsSheetFile: [true, false], + existsClassMapFile: [true, false], + existsFileMapFile: [true, false], + existsCssDir: [true, false], + getDefaultTheme: ['theme', ''], + }), + )('should write data files', async (options) => { + vi.mocked(writeFile).mockResolvedValueOnce(undefined) + vi.mocked(readFile).mockResolvedValueOnce(JSON.stringify({})) + vi.mocked(getThemeInterface).mockReturnValue('interface code') + vi.mocked(getDefaultTheme).mockReturnValue(options.getDefaultTheme) + vi.mocked(existsSync).mockImplementation((path) => { + if (path === 'devup.json') return options.existsDevupFile + if (path === 'df') return options.existsDistDir + if (path === resolve('df', 'devup-ui')) return options.existsCssDir + if (path === join('df', 'sheet.json')) return options.existsSheetFile + if (path === join('df', 'classMap.json')) + return options.existsClassMapFile + if (path === join('df', 'fileMap.json')) return options.existsFileMapFile + return false + }) + const plugin = DevupUI({}) + await (plugin as any).configResolved() + if (options.existsDevupFile) { + expect(readFile).toHaveBeenCalledWith('devup.json', 'utf-8') + expect(registerTheme).toHaveBeenCalledWith({}) + expect(getThemeInterface).toHaveBeenCalledWith( + '@devup-ui/react', + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + expect(writeFile).toHaveBeenCalledWith( + join('df', 'theme.d.ts'), + 'interface code', + 'utf-8', + ) + } else { + expect(registerTheme).toHaveBeenCalledWith({}) + } - vi.clearAllMocks() - vi.mocked(existsSync).mockReturnValue(false) - ;(plugin as any).watchChange(devupPath) - expect(readFileSync).toBeCalledTimes(0) + const config = (plugin as any).config() + if (options.getDefaultTheme) { + expect(config.define).toEqual({ + 'process.env.DEVUP_UI_DEFAULT_THEME': JSON.stringify( + options.getDefaultTheme, + ), + }) + } else { + expect(config.define).toEqual({}) + } + }) - vi.clearAllMocks() + it('should reset data files when load error', async () => { + vi.mocked(writeFile).mockResolvedValueOnce(undefined) + vi.mocked(getThemeInterface).mockReturnValue('interface code') vi.mocked(existsSync).mockReturnValue(true) - vi.mocked(readFileSync).mockImplementation(() => { + vi.mocked(readFile).mockImplementation(() => { throw new Error('error') }) - ;(plugin as any).watchChange(devupPath) - expect(readFileSync).toBeCalledTimes(1) - - vi.clearAllMocks() - ;(plugin as any).transform('code', 'file') - expect(readFileSync).toBeCalledTimes(0) - - vi.clearAllMocks() - ;(plugin as any).transform('code', 'node_modules') - expect(readFileSync).toBeCalledTimes(0) - - vi.clearAllMocks() - ;(plugin as any).transform('code', 'wrong.css') - expect(readFileSync).toBeCalledTimes(0) - - vi.clearAllMocks() - vi.mocked(codeExtract).mockReturnValueOnce({ - css: 'css code', - code: 'code', - } as any) - ;(plugin as any).transform('code', 'correct.ts') - expect(writeFile).toBeCalledTimes(1) - - vi.clearAllMocks() - vi.mocked(codeExtract).mockReturnValueOnce({ - css: undefined, - code: 'code', - } as any) - ;(plugin as any).transform('code', 'correct.ts') - expect(writeFile).toBeCalledTimes(0) - ;(plugin as any).apply({}, { command: 'serve' }) - vi.clearAllMocks() - vi.mocked(codeExtract).mockReturnValueOnce({ - css: 'css code next', - code: 'code', - } as any) - ;(plugin as any).transform('code', 'correct.ts') - expect(writeFile).toBeCalledTimes(1) + const plugin = DevupUI({}) + await (plugin as any).configResolved() + expect(registerTheme).toHaveBeenCalledWith({}) + expect(writeFile).not.toHaveBeenCalled() }) - it('should transform code', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) + + it('should watch change', async () => { + vi.mocked(writeFile).mockResolvedValueOnce(undefined) vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - } - const plugin = DevupUI(options) - expect(plugin).toEqual({ - name: 'devup-ui', - load: expect.any(Function), - resolveId: expect.any(Function), - config: expect.any(Function), - watchChange: expect.any(Function), - enforce: 'pre', - transform: expect.any(Function), - apply: expect.any(Function), - generateBundle: expect.any(Function), - }) - expect(existsSync).toHaveBeenCalledWith(devupPath) - expect(getThemeInterface).toHaveBeenCalledWith( - libPackage, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', + vi.mocked(existsSync).mockReturnValue(true) + vi.mocked(readFile).mockResolvedValueOnce( + JSON.stringify({ theme: 'theme' }), ) - expect(readFileSync).toHaveBeenCalledWith(devupPath, 'utf-8') - expect(existsSync).toHaveBeenCalledWith(interfacePath) - vi.clearAllMocks() - vi.mocked(codeExtract).mockReturnValueOnce({ - css: 'css code 1223444', - code: 'code', - } as any) - // eslint-disable-next-line prefer-spread - ;(plugin as any).apply(null, { - command: 'serve', - }) - vi.stubEnv('NODE_ENV', 'development') - ;(plugin as any).transform('code', 'correct.ts') - expect(writeFile).toBeCalledTimes(1) - }) - it('should not extract code', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) - vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - extractCss: false, - } - const plugin = DevupUI(options) - expect(plugin).toEqual({ - name: 'devup-ui', - load: expect.any(Function), - resolveId: expect.any(Function), - config: expect.any(Function), - watchChange: expect.any(Function), - enforce: 'pre', - transform: expect.any(Function), - apply: expect.any(Function), - generateBundle: expect.any(Function), - }) - expect(existsSync).toHaveBeenCalledWith(devupPath) - expect(getThemeInterface).toHaveBeenCalledWith( - libPackage, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', + const plugin = DevupUI({}) + await (plugin as any).watchChange('devup.json') + expect(writeFile).toHaveBeenCalledWith( + join('df', 'theme.d.ts'), + 'interface code', + 'utf-8', ) - expect(readFileSync).toHaveBeenCalledWith(devupPath, 'utf-8') - expect(existsSync).toHaveBeenCalledWith(interfacePath) - vi.clearAllMocks() - ;(plugin as any).transform('code', 'correct.tsx') - expect(readFileSync).toBeCalledTimes(0) + + await (plugin as any).watchChange('wrong') }) - it('should catch error', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) + + it('should print error when watch change error', async () => { + vi.mocked(writeFile).mockResolvedValueOnce(undefined) vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - vi.mocked(writeFileSync).mockImplementation(() => { + vi.mocked(existsSync).mockReturnValueOnce(true).mockReturnValueOnce(false) + vi.mocked(mkdir).mockImplementation(() => { throw new Error('error') }) - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - } + const plugin = DevupUI({}) + await (plugin as any).watchChange('devup.json') + expect(console.error).toHaveBeenCalledWith(expect.any(Error)) + }) + + it.each( + createTestMatrix({ + singleCss: [true, false], + }), + )('should resolveId', (options) => { const plugin = DevupUI(options) - expect(plugin).toEqual({ - name: 'devup-ui', - load: expect.any(Function), - resolveId: expect.any(Function), - config: expect.any(Function), - watchChange: expect.any(Function), - enforce: 'pre', - transform: expect.any(Function), - apply: expect.any(Function), - generateBundle: expect.any(Function), - }) - expect(existsSync).toHaveBeenCalledWith(devupPath) - expect(getThemeInterface).toHaveBeenCalledWith( - libPackage, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', - ) - expect(readFileSync).toHaveBeenCalledWith(devupPath, 'utf-8') - expect(existsSync).toHaveBeenCalledWith(interfacePath) + expect( + (plugin as any).resolveId(resolve('df', 'devup-ui', 'devup-ui.css')), + ).toEqual(options.singleCss ? expect.any(String) : undefined) }) - it('should return true on apply', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) - vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - } + it.each( + createTestMatrix({ + singleCss: [true, false], + }), + )('should load', (options) => { + vi.mocked(getCss).mockReturnValue('css code') const plugin = DevupUI(options) - expect(plugin).toEqual({ - name: 'devup-ui', - config: expect.any(Function), - load: expect.any(Function), - resolveId: expect.any(Function), - watchChange: expect.any(Function), - enforce: 'pre', - transform: expect.any(Function), - apply: expect.any(Function), - generateBundle: expect.any(Function), - }) - expect(existsSync).toHaveBeenCalledWith(devupPath) - expect(getThemeInterface).toHaveBeenCalledWith( - libPackage, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', + expect((plugin as any).load('devup-ui.css')).toEqual( + options.singleCss ? expect.any(String) : undefined, ) - expect(readFileSync).toHaveBeenCalledWith(devupPath, 'utf-8') - expect(existsSync).toHaveBeenCalledWith(interfacePath) - expect((plugin as any).apply({}, { command: 'build' })).toBe(true) }) - it('should include', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - const plugin = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - include: ['@devup/product-system'], - }) + it.each( + createTestMatrix({ + extractCss: [true, false], + }), + )('should transform', async (options) => { + vi.mocked(getCss).mockReturnValue('css code') vi.mocked(codeExtract).mockReturnValue({ css: 'css code', code: 'code', + css_file: 'devup-ui.css', } as any) - ;(plugin as any).transform('code', 'node_modules/@devup/test/dist/index.js') - expect(codeExtract).toBeCalledTimes(0) - ;(plugin as any).transform( - 'code', - 'node_modules/@devup/product-system/dist/index.js', - ) - expect(codeExtract).toHaveBeenCalledWith( - 'node_modules/@devup/product-system/dist/index.js', - 'code', - libPackage, - cssFile, - ) - ;(plugin as any).transform( - 'code', - 'C:/devfive/minions-front/apps/vendor/node_modules/.vite/deps/@devup_product-system.js?v=63f19272', - ) - expect(codeExtract).toHaveBeenCalledWith( - 'C:/devfive/minions-front/apps/vendor/node_modules/.vite/deps/@devup_product-system.js', - 'code', - libPackage, - cssFile, - ) - }) - describe('basic', () => { - const devupPath = 'devup.json' - const interfacePath = 'df' - const cssFile = join(_dirname, 'devup-ui.css') - const libPackage = '@devup-ui/react' - vi.mocked(existsSync).mockReturnValueOnce(false).mockReturnValueOnce(true) - vi.mocked(getThemeInterface).mockReturnValue('interface code') - vi.mocked(readFileSync).mockReturnValueOnce('{"theme": {}}') - const options = { - package: libPackage, - cssFile, - devupPath, - interfacePath, - } const plugin = DevupUI(options) - it('should merge chunks', () => { - expect( - (plugin as any) - .config() - .build.rollupOptions.output.manualChunks('code', 'code'), - ).toBeUndefined() - expect( - (plugin as any) - .config() - .build.rollupOptions.output.manualChunks('devup-ui.css', 'code'), - ).toEqual('devup-ui.css') - expect( - (plugin as any) - .config() - .build.rollupOptions.output.manualChunks('devup-ui.css?v=1', 'code'), - ).toEqual('devup-ui.css') + expect(await (plugin as any).transform('code', 'devup-ui.wrong')).toEqual( + undefined, + ) + expect(await (plugin as any).transform('code', 'devup-ui.tsx')).toEqual( + options.extractCss ? { code: 'code' } : undefined, + ) - const plugin1 = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - extractCss: false, - }) - expect((plugin1 as any).config().build).toBeUndefined() - }) - it('should resolveId', () => { - expect((plugin as any).resolveId('code', 'code')).toBeUndefined() + if (options.extractCss) { expect( - (plugin as any) - .resolveId(cssFile, 'code') - .startsWith('devup-ui.css?t='), - ).toBe(true) - }) - it('should load', () => { - Date.now = () => 1 - expect((plugin as any).load('code')).toBeUndefined() - expect((plugin as any).load(cssFile)).toBeUndefined() - vi.mocked(getCss).mockReturnValueOnce('css code') + await (plugin as any).transform('code', 'node_modules/test/index.tsx'), + ).toEqual(undefined) expect( - (plugin as any).load('devup-ui.css?v=some').length.toString(), - ).toBe('css code'.length.toString()) - }) - it('should generate bundle', () => { - const plugin = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - }) - const bundle = { - 'devup-ui.css': { - source: 'css code', - }, - } as any - ;(plugin as any).generateBundle({}, bundle) - expect(bundle['devup-ui.css'].source).toBe('css code') - }) - - it('should generate bundle without extractCss', () => { - const plugin = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - extractCss: false, - }) - const bundle = { - 'devup-ui.css': { - source: 'no', - }, - } as any - ;(plugin as any).generateBundle({}, bundle) - expect(bundle['devup-ui.css'].source).toBe('no') - }) - - it('should define process.env.DEVUP_UI_DEFAULT_THEME', () => { - vi.mocked(getDefaultTheme).mockReturnValue('defaultTheme') - const plugin = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - }) - expect((plugin as any).config().define).toEqual({ - 'process.env.DEVUP_UI_DEFAULT_THEME': '"defaultTheme"', - }) - }) + await (plugin as any).transform( + 'code', + 'node_modules/@devup-ui/hello/index.tsx', + ), + ).toEqual({ code: 'code' }) + + vi.mocked(codeExtract).mockReturnValue({ + css: 'css code test next', + code: 'code', + css_file: 'devup-ui.css', + } as any) + expect( + await (plugin as any).transform( + 'code', + 'node_modules/@devup-ui/hello/index.tsx', + ), + ).toEqual({ code: 'code' }) + } + }) - it('should undefine process.env.DEVUP_UI_DEFAULT_THEME', () => { - vi.mocked(getDefaultTheme).mockReturnValue(undefined) - const plugin = DevupUI({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - }) - expect((plugin as any).config().define).toStrictEqual({}) - }) + it.each( + createTestMatrix({ + extractCss: [true, false], + }), + )('should generateBundle', async (options) => { + vi.mocked(getCss).mockReturnValue('css code test') + const plugin = DevupUI({ extractCss: options.extractCss, singleCss: true }) + const bundle = { + 'devup-ui.css': { source: 'css code' }, + } as any + ;(plugin as any).load('devup-ui.css') + await (plugin as any).generateBundle({}, bundle) + if (options.extractCss) { + expect(bundle['devup-ui.css'].source).toEqual('css code test') + } else { + expect(bundle['devup-ui.css'].source).toEqual('css code') + } }) }) diff --git a/packages/vite-plugin/src/plugin.ts b/packages/vite-plugin/src/plugin.ts index f2f36a89..4da40297 100644 --- a/packages/vite-plugin/src/plugin.ts +++ b/packages/vite-plugin/src/plugin.ts @@ -1,6 +1,6 @@ -import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' -import { writeFile } from 'node:fs/promises' -import { join, resolve } from 'node:path' +import { existsSync } from 'node:fs' +import { mkdir, readFile, writeFile } from 'node:fs/promises' +import { basename, join, resolve } from 'node:path' import { codeExtract, @@ -14,77 +14,76 @@ import { normalizePath, type PluginOption, type UserConfig } from 'vite' export interface DevupUIPluginOptions { package: string - cssFile: string - devupPath: string - interfacePath: string + cssDir: string + devupFile: string + distDir: string extractCss: boolean debug: boolean include: string[] - splitCss: boolean + singleCss: boolean } -function writeDataFiles( +async function writeDataFiles( options: Omit< DevupUIPluginOptions, - 'extractCss' | 'debug' | 'include' | 'splitCss' + 'extractCss' | 'debug' | 'include' | 'singleCss' >, ) { - if (!existsSync(options.interfacePath)) mkdirSync(options.interfacePath) - if (existsSync(options.devupPath)) { - registerTheme( - JSON.parse(readFileSync(options.devupPath, 'utf-8'))?.['theme'], - ) - const interfaceCode = getThemeInterface( - options.package, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', - ) - if (interfaceCode) { - writeFileSync(join(options.interfacePath, 'theme.d.ts'), interfaceCode, { - encoding: 'utf-8', - }) + try { + const content = existsSync(options.devupFile) + ? await readFile(options.devupFile, 'utf-8') + : undefined + + if (content) { + registerTheme(JSON.parse(content)?.['theme'] ?? {}) + const interfaceCode = getThemeInterface( + options.package, + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + + if (interfaceCode) { + await writeFile( + join(options.distDir, 'theme.d.ts'), + interfaceCode, + 'utf-8', + ) + } + } else { + registerTheme({}) } + } catch (error) { + console.error(error) + registerTheme({}) } - if (!existsSync(options.cssFile)) - writeFileSync(options.cssFile, '', { - encoding: 'utf-8', - }) - writeFileSync(join(options.interfacePath, '.gitignore'), '*', { - encoding: 'utf-8', - }) + if (!existsSync(options.cssDir)) + await mkdir(options.cssDir, { recursive: true }) } let globalCss = '' export function DevupUI({ package: libPackage = '@devup-ui/react', - devupPath = 'devup.json', - interfacePath = 'df', - cssFile = resolve(interfacePath, 'devup-ui.css'), + devupFile = 'devup.json', + distDir = 'df', + cssDir = resolve(distDir, 'devup-ui'), extractCss = true, debug = false, include = [], - splitCss = true, + singleCss = false, }: Partial = {}): PluginOption { setDebug(debug) - try { - writeDataFiles({ - package: libPackage, - cssFile, - devupPath, - interfacePath, - }) - } catch (error) { - console.error(error) - } - const theme = getDefaultTheme() - const define: Record = {} - if (theme) { - define['process.env.DEVUP_UI_DEFAULT_THEME'] = JSON.stringify(theme) - } return { name: 'devup-ui', + async configResolved() { + await writeDataFiles({ + package: libPackage, + cssDir, + devupFile, + distDir, + }) + }, config() { const theme = getDefaultTheme() const define: Record = {} @@ -94,7 +93,7 @@ export function DevupUI({ const ret: Omit = { server: { watch: { - ignored: [`!${devupPath}`], + ignored: [`!${devupFile}`], }, }, define, @@ -108,7 +107,7 @@ export function DevupUI({ output: { manualChunks(id) { // merge devup css files - if (id.startsWith('devup-ui.css')) { + if (singleCss && id.endsWith('devup-ui.css')) { return `devup-ui.css` } }, @@ -121,15 +120,15 @@ export function DevupUI({ apply() { return true }, - watchChange(id) { - if (resolve(id) !== resolve(devupPath)) return - if (existsSync(devupPath)) { + async watchChange(id) { + if (resolve(id) !== resolve(devupFile)) return + if (existsSync(devupFile)) { try { - writeDataFiles({ + await writeDataFiles({ package: libPackage, - cssFile, - devupPath, - interfacePath, + cssDir, + devupFile, + distDir, }) } catch (error) { console.error(error) @@ -137,11 +136,14 @@ export function DevupUI({ } }, resolveId(id) { - if (normalizePath(id) === normalizePath(cssFile)) + if ( + singleCss && + normalizePath(id) === normalizePath(join(cssDir, 'devup-ui.css')) + ) return `devup-ui.css?t=${Date.now().toString() + globalCss.length}` }, load(id) { - if (id.split('?')[0] === 'devup-ui.css') + if (singleCss && id.split('?')[0] === 'devup-ui.css') // for no share env like storybook return (globalCss = getCss()) }, @@ -150,31 +152,31 @@ export function DevupUI({ if (!extractCss) return const fileName = id.split('?')[0] + if (!/\.(tsx|ts|js|mjs|jsx)$/i.test(fileName)) return if ( - include.length - ? new RegExp( - `node_modules(?!(${include - .map((i) => `.*${i}`) - .join('|') - .replaceAll('/', '[\\/\\\\_]')})([\\/\\\\.]|$))`, - ).test(fileName) - : id.includes('node_modules') + new RegExp( + `node_modules(?!.*(${['@devup-ui', ...include] + .join('|') + .replaceAll('/', '[\\/\\\\_]')})([\\/\\\\.]|$))`, + ).test(fileName) ) { return } - if (!/\.(tsx|ts|js|mjs|jsx)$/i.test(fileName)) return const { code: retCode, css, map, - } = codeExtract(fileName, code, libPackage, cssFile, splitCss) + css_file, + } = codeExtract(fileName, code, libPackage, cssDir, singleCss) - if (css && globalCss.length < css.length) { - globalCss = css - await writeFile(cssFile, `/* ${id} ${Date.now()} */`, { - encoding: 'utf-8', - }) + if (css) { + if (globalCss.length < css.length) globalCss = css + await writeFile( + join(cssDir, basename(css_file)), + `/* ${id} ${Date.now()} */`, + 'utf-8', + ) } return { code: retCode, diff --git a/packages/vite-plugin/tsconfig.json b/packages/vite-plugin/tsconfig.json index 4c6e75be..30053bb9 100644 --- a/packages/vite-plugin/tsconfig.json +++ b/packages/vite-plugin/tsconfig.json @@ -1,6 +1,10 @@ { "compilerOptions": { - "types": ["vite/client", "vitest/importMeta", "vitest/globals"], + "types": [ + "vite/client", + "vitest/importMeta", + "vitest/globals" + ], "strict": true, "target": "ESNext", "declaration": true, @@ -22,5 +26,14 @@ "noEmit": true, "baseUrl": ".", "jsx": "react-jsx" - } -} + }, + "include": [ + "src", + "vite.config.ts", + "../../vitest.setup.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/packages/webpack-plugin/src/__tests__/css-loader.test.ts b/packages/webpack-plugin/src/__tests__/css-loader.test.ts index 1cbc2fb2..965842a0 100644 --- a/packages/webpack-plugin/src/__tests__/css-loader.test.ts +++ b/packages/webpack-plugin/src/__tests__/css-loader.test.ts @@ -20,6 +20,7 @@ describe('devupUICssLoader', () => { devupUICssLoader.bind({ callback, addContextDependency, + resourcePath: 'devup-ui.css', getOptions: () => ({ watch: false }), } as any)(Buffer.from('data'), '') expect(callback).toBeCalledWith(null, 'get css') @@ -34,6 +35,7 @@ describe('devupUICssLoader', () => { callback, addContextDependency, getOptions: () => ({ watch: true }), + resourcePath: 'devup-ui.css', } as any)(Buffer.from('data'), '') expect(callback).toBeCalledWith(null, 'get css', '', undefined) expect(getCss).toBeCalledTimes(1) @@ -42,6 +44,7 @@ describe('devupUICssLoader', () => { callback, addContextDependency, getOptions: () => ({ watch: true }), + resourcePath: 'devup-ui.css', } as any)(Buffer.from('data'), '') expect(getCss).toBeCalledTimes(0) @@ -55,6 +58,7 @@ describe('devupUICssLoader', () => { __DEVUP_CACHE: 'data', }, getOptions: () => ({ watch: true }), + resourcePath: 'devup-ui-10.css', } as any)(Buffer.from(''), '') expect(getCss).toBeCalledTimes(0) diff --git a/packages/webpack-plugin/src/__tests__/loader.test.ts b/packages/webpack-plugin/src/__tests__/loader.test.ts index fa12640e..3e38903a 100644 --- a/packages/webpack-plugin/src/__tests__/loader.test.ts +++ b/packages/webpack-plugin/src/__tests__/loader.test.ts @@ -1,6 +1,12 @@ import { writeFile } from 'node:fs/promises' +import { join } from 'node:path' -import { codeExtract, exportClassMap, exportSheet } from '@devup-ui/wasm' +import { + codeExtract, + exportClassMap, + exportFileMap, + exportSheet, +} from '@devup-ui/wasm' import devupUILoader from '../loader' @@ -20,10 +26,12 @@ describe('devupUILoader', () => { const t = { getOptions: () => ({ package: 'package', - cssFile: 'cssFile', + cssDir: 'cssFile', sheetFile: 'sheetFile', classMapFile: 'classMapFile', + fileMapFile: 'fileMapFile', watch: true, + singleCss: true, }), async: vi.fn().mockReturnValue(vi.fn()), resourcePath: 'index.tsx', @@ -32,6 +40,7 @@ describe('devupUILoader', () => { } vi.mocked(exportSheet).mockReturnValue('sheet') vi.mocked(exportClassMap).mockReturnValue('classMap') + vi.mocked(exportFileMap).mockReturnValue('fileMap') vi.mocked(codeExtract).mockReturnValue({ code: 'code', @@ -48,13 +57,18 @@ describe('devupUILoader', () => { 'code', 'package', './cssFile', + true, ) await vi.waitFor(() => { expect(t.async()).toHaveBeenCalledWith(null, 'code', {}) + expect(writeFile).toHaveBeenCalledWith( + join('cssFile', 'cssFile'), + '/* index.tsx 0 */', + ) + expect(writeFile).toHaveBeenCalledWith('sheetFile', 'sheet') + expect(writeFile).toHaveBeenCalledWith('classMapFile', 'classMap') + expect(writeFile).toHaveBeenCalledWith('fileMapFile', 'fileMap') }) - expect(writeFile).toHaveBeenCalledWith('cssFile', '/* index.tsx 0 */') - expect(writeFile).toHaveBeenCalledWith('sheetFile', 'sheet') - expect(writeFile).toHaveBeenCalledWith('classMapFile', 'classMap') expect(t._compiler.__DEVUP_CACHE).toBe('index.tsx 0') }) @@ -63,8 +77,9 @@ describe('devupUILoader', () => { const t = { getOptions: () => ({ package: 'package', - cssFile: 'cssFile', + cssDir: 'cssFile', watch: false, + singleCss: true, }), async: vi.fn().mockReturnValue(vi.fn()), resourcePath: 'index.tsx', @@ -85,6 +100,7 @@ describe('devupUILoader', () => { 'code', 'package', './cssFile', + true, ) expect(t.async()).toHaveBeenCalledWith(null, 'code', null) expect(writeFile).not.toHaveBeenCalledWith('cssFile', 'css', { @@ -96,8 +112,9 @@ describe('devupUILoader', () => { const t = { getOptions: () => ({ package: 'package', - cssFile: 'cssFile', + cssDir: 'cssFile', watch: false, + singleCss: true, }), async: vi.fn().mockReturnValue(vi.fn()), resourcePath: 'index.tsx', @@ -116,8 +133,9 @@ describe('devupUILoader', () => { const t = { getOptions: () => ({ package: 'package', - cssFile: 'cssFile', + cssDir: 'cssFile', watch: true, + singleCss: true, }), async: vi.fn().mockReturnValue(vi.fn()), resourcePath: 'index.tsx', @@ -138,6 +156,29 @@ describe('devupUILoader', () => { 'code', 'package', './cssFile', + true, ) }) + + it('should load with nowatch', () => { + const t = { + getOptions: () => ({ + package: 'package', + cssDir: 'cssFile', + watch: false, + singleCss: true, + }), + async: vi.fn().mockReturnValue(vi.fn()), + resourcePath: 'index.tsx', + addDependency: vi.fn(), + } + vi.mocked(codeExtract).mockReturnValue({ + code: 'code', + css: 'css', + free: vi.fn(), + map: undefined, + css_file: 'cssFile', + }) + devupUILoader.bind(t as any)(Buffer.from('code'), 'index.tsx') + }) }) diff --git a/packages/webpack-plugin/src/__tests__/plugin.test.ts b/packages/webpack-plugin/src/__tests__/plugin.test.ts index 0ec01648..4571dc3c 100644 --- a/packages/webpack-plugin/src/__tests__/plugin.test.ts +++ b/packages/webpack-plugin/src/__tests__/plugin.test.ts @@ -1,17 +1,16 @@ -import { - existsSync, - mkdirSync, - readFileSync, - stat, - writeFileSync, -} from 'node:fs' +import { existsSync } from 'node:fs' +import { mkdir, readFile, stat, writeFile } from 'node:fs/promises' import { join, resolve } from 'node:path' import { getCss, getDefaultTheme, getThemeInterface, + importClassMap, + importFileMap, + importSheet, registerTheme, + setDebug, } from '@devup-ui/wasm' import { describe } from 'vitest' @@ -19,6 +18,7 @@ import { DevupUIWebpackPlugin } from '../plugin' vi.mock('@devup-ui/wasm') vi.mock('node:fs') +vi.mock('node:fs/promises') beforeEach(() => { vi.resetAllMocks() @@ -26,343 +26,320 @@ beforeEach(() => { afterAll(() => { vi.restoreAllMocks() }) +function createCompiler() { + return { + options: { + module: { + rules: [], + }, + plugins: [], + }, + webpack: { + DefinePlugin: vi.fn(), + }, + hooks: { + watchRun: { + tapPromise: vi.fn(), + }, + beforeRun: { + tapPromise: vi.fn(), + }, + done: { + tapPromise: vi.fn(), + }, + afterCompile: { + tap: vi.fn(), + }, + }, + } as any +} -describe('devupUIPlugin', () => { +describe('devupUIWebpackPlugin', () => { console.error = vi.fn() - describe('no watch', () => { - it('should apply default options', () => { - import.meta.resolve = vi.fn().mockReturnValue('resolved') - expect(new DevupUIWebpackPlugin({}).options).toEqual({ - include: [], - package: '@devup-ui/react', - cssFile: resolve('df', 'devup-ui.css'), - devupPath: 'devup.json', - interfacePath: 'df', - watch: false, - debug: false, - }) - }) - it('should apply custom options', () => { - import.meta.resolve = vi.fn().mockReturnValue('resolved') - expect( - new DevupUIWebpackPlugin({ - package: 'new-package', - cssDir: 'new-css-file', - devupPath: 'new-devup-path', - interfacePath: 'new-interface-path', - watch: false, - }).options, - ).toEqual({ - include: [], - package: 'new-package', - cssFile: 'new-css-file', - devupPath: 'new-devup-path', - interfacePath: 'new-interface-path', - watch: false, - debug: false, - }) + it('should apply default options', () => { + expect(new DevupUIWebpackPlugin({}).options).toEqual({ + include: [], + package: '@devup-ui/react', + cssDir: resolve('df', 'devup-ui'), + devupFile: 'devup.json', + distDir: 'df', + watch: false, + debug: false, + singleCss: false, }) + }) - it('should write data files', () => { - vi.mocked(readFileSync).mockReturnValue('{"theme": "theme"}') - vi.mocked(getThemeInterface).mockReturnValue('interfaceCode') - vi.mocked(getCss).mockReturnValue('css') - vi.mocked(existsSync).mockReturnValue(false) - vi.mocked(writeFileSync).mockReturnValue() - vi.mocked(mkdirSync) - - const plugin = new DevupUIWebpackPlugin({}) - plugin.writeDataFiles() - - expect(readFileSync).toHaveBeenCalledWith('devup.json', 'utf-8') - expect(registerTheme).toHaveBeenCalledWith('theme') - expect(getThemeInterface).toHaveBeenCalledWith( - '@devup-ui/react', - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', - ) - expect(writeFileSync).toHaveBeenCalledWith( - join('df', 'theme.d.ts'), - 'interfaceCode', - { - encoding: 'utf-8', - }, - ) + describe.each( + globalThis.createTestMatrix({ + watch: [true, false], + debug: [true, false], + singleCss: [true, false], + include: [['lib'], []], + package: ['@devup-ui/react', '@devup-ui/core'], + cssDir: [resolve('df', 'devup-ui'), resolve('df', 'devup-ui-core')], + devupFile: ['devup.json', 'devup-core.json'], + distDir: ['df', 'df-core'], + }), + )('options', (options) => { + it('should apply options', () => { + expect(new DevupUIWebpackPlugin(options).options).toEqual(options) }) - it('should catch error', () => { - vi.mocked(existsSync).mockReturnValue(true) - vi.mocked(stat).mockImplementation((_, callback) => { - ;(callback as any)(new Error('error'), null) - }) - vi.mocked(readFileSync).mockImplementation(() => { - throw new Error('error') - }) - const plugin = new DevupUIWebpackPlugin({ - devupPath: 'custom-devup.json', - }) - - vi.mocked(getCss).mockReturnValue('css') - const compiler = { - options: { - module: { - rules: [], - }, - plugins: [], - }, - hooks: { - afterCompile: { - tap: vi.fn(), - }, - done: { - tap: vi.fn(), - }, - watchRun: { - tapAsync: vi.fn(), - }, - }, - webpack: { - DefinePlugin: vi.fn(), - }, - } as any - plugin.apply(compiler) - // asyncCompile - const add = vi.fn() - vi.mocked(compiler.hooks.afterCompile.tap).mock.calls[0][1]({ - fileDependencies: { - add, - }, - }) - expect(add).toHaveBeenCalledWith(resolve('custom-devup.json')) - expect(compiler.hooks.done.tap).toHaveBeenCalled() - - vi.mocked(compiler.hooks.done.tap).mock.calls[0][1]({ - hasErrors: () => true, - }) + it.each( + createTestMatrix({ + readFile: [{ theme: 'theme' }, { theme: 'theme-core' }, undefined], + getThemeInterface: ['interfaceCode', ''], + getCss: ['css', 'css-core'], + }), + )('should write data files', async (_options) => { + vi.mocked(readFile).mockResolvedValue(JSON.stringify(_options.readFile)) + vi.mocked(getThemeInterface).mockReturnValue(_options.getThemeInterface) + vi.mocked(getCss).mockReturnValue(_options.getCss) + vi.mocked(existsSync).mockReturnValueOnce(_options.readFile !== undefined) + vi.mocked(writeFile).mockResolvedValue() + vi.mocked(mkdir) - vi.mocked(compiler.hooks.done.tap).mock.calls[0][1]({ - hasErrors: () => false, - }) - expect(writeFileSync).toHaveBeenCalledWith( - resolve('df', 'devup-ui.css'), - 'css', - { - encoding: 'utf-8', - }, - ) - }) + const plugin = new DevupUIWebpackPlugin(options) + await plugin.writeDataFiles() - it('should skip writing css file', () => { - vi.mocked(readFileSync).mockReturnValue('{"theme": "theme"}') - vi.mocked(getThemeInterface).mockReturnValue('interfaceCode') - vi.mocked(getCss).mockReturnValue('css') - vi.mocked(existsSync).mockReturnValue(false) - vi.mocked(writeFileSync).mockReturnValue() - vi.mocked(mkdirSync) + if (_options.readFile !== undefined) { + expect(readFile).toHaveBeenCalledWith(options.devupFile, 'utf-8') - const plugin = new DevupUIWebpackPlugin({ - cssDir: 'css', - }) - plugin.apply({ - options: { - module: { - rules: [], - }, - plugins: [], - }, - hooks: { - afterCompile: { - tap: vi.fn(), - }, - done: { - tap: vi.fn(), - }, - watchRun: { - tapAsync: vi.fn(), - }, - }, - webpack: { - DefinePlugin: vi.fn(), - }, - } as any) - - expect(writeFileSync).toHaveBeenCalledWith('css', '', { - encoding: 'utf-8', - }) + expect(registerTheme).toHaveBeenCalledWith( + _options.readFile?.theme ?? {}, + ) + expect(getThemeInterface).toHaveBeenCalledWith( + options.package, + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + if (_options.getThemeInterface) + expect(writeFile).toHaveBeenCalledWith( + join(options.distDir, 'theme.d.ts'), + _options.getThemeInterface, + { + encoding: 'utf-8', + }, + ) + else expect(writeFile).toHaveBeenCalledTimes(options.watch ? 1 : 0) + } else expect(readFile).not.toHaveBeenCalled() + if (options.watch) + expect(writeFile).toHaveBeenCalledWith( + join(options.cssDir, 'devup-ui.css'), + _options.getCss, + ) + else + expect(writeFile).toHaveBeenCalledTimes( + _options.getThemeInterface && _options.readFile !== undefined ? 1 : 0, + ) }) }) - describe('watch', () => { - it('should write css file', () => { - vi.mocked(readFileSync).mockReturnValue('{"theme": "theme"}') - vi.mocked(getThemeInterface).mockReturnValue('interfaceCode') - vi.mocked(getCss).mockReturnValue('css') - vi.mocked(writeFileSync).mockReturnValue() - vi.mocked(mkdirSync) - const plugin = new DevupUIWebpackPlugin({ - watch: true, - }) - const compiler = { - options: { - module: { - rules: [], - }, - plugins: [], - }, - hooks: { - afterCompile: { - tap: vi.fn(), - }, - done: { - tap: vi.fn(), - }, - watchRun: { - tapAsync: vi.fn(), - }, + it.each( + createTestMatrix({ + include: [ + { + input: ['lib'], + output: new RegExp('node_modules(?!.*(@devup-ui|lib)([\\/\\\\.]|$))'), }, - webpack: { - DefinePlugin: vi.fn(), + { + input: [], + output: new RegExp('node_modules(?!.*(@devup-ui)([\\/\\\\.]|$))'), }, - } as any - plugin.apply(compiler) - - expect(writeFileSync).toHaveBeenCalledWith( - resolve('df', 'devup-ui.css'), - '', { - encoding: 'utf-8', + input: ['lib', 'lib2'], + output: new RegExp( + 'node_modules(?!.*(@devup-ui|lib|lib2)([\\/\\\\.]|$))', + ), }, - ) - expect(compiler.hooks.done.tap).not.toHaveBeenCalled() + ], + }), + )('should set include', async (options) => { + const plugin = new DevupUIWebpackPlugin({ + include: options.include.input, }) - it('should register devup watch', () => { - const plugin = new DevupUIWebpackPlugin({ - watch: true, - }) - const compiler = { - options: { - module: { - rules: [], - }, - plugins: [], - }, - hooks: { - afterCompile: { - tap: vi.fn(), - }, - done: { - tap: vi.fn(), - }, - watchRun: { - tapAsync: vi.fn(), - }, - }, - webpack: { - DefinePlugin: vi.fn(), - }, - } as any - vi.mocked(existsSync).mockReturnValue(true) - plugin.apply(compiler) - // watchRun - const callback = vi.fn() - vi.mocked(compiler.hooks.watchRun.tapAsync).mock.calls[0][1]( - null, - callback, - ) - expect(callback).toHaveBeenCalled() - expect(registerTheme).toBeCalledTimes(0) + vi.mocked(existsSync).mockReturnValue(false) + vi.mocked(mkdir) + vi.mocked(writeFile) + vi.mocked(readFile) + vi.mocked(getThemeInterface) + vi.mocked(getCss) + vi.mocked(registerTheme) + vi.mocked(stat) + vi.mocked(readFile) - vi.mocked(stat).mockImplementation((_, callback) => { - ;(callback as any)(null, { mtimeMs: 1 }) - }) - vi.mocked(readFileSync).mockReturnValue('{"theme": "theme"}') - vi.mocked(writeFileSync).mockReturnValue() - vi.mocked(registerTheme).mockReturnValue() - vi.mocked(stat).mockImplementation((_, callback) => { - ;(callback as any)(null, { mtimeMs: 2 }) - }) - vi.mocked(console.error).mockReturnValue() + const compiler = createCompiler() + await plugin.apply(compiler) + expect(compiler.options.module.rules.length).toBe(2) - plugin.apply(compiler as any) + expect(compiler.options.module.rules[0].exclude).toEqual( + options.include.output, + ) + }) - vi.mocked(compiler.hooks.watchRun.tapAsync).mock.calls[0][1]( - null, - callback, - ) - expect(registerTheme).toHaveBeenCalled() - vi.mocked(stat).mockImplementation((_, callback) => { - ;(callback as any)(null, { mtimeMs: 3 }) - }) - expect(registerTheme).toBeCalledTimes(1) - vi.mocked(compiler.hooks.watchRun.tapAsync).mock.calls[0][1]( - null, - callback, - ) - expect(registerTheme).toBeCalledTimes(2) + it.each( + createTestMatrix({ + debug: [true, false], + }), + )('should set debug', async (options) => { + const plugin = new DevupUIWebpackPlugin(options) - vi.mocked(stat).mockImplementation((_, callback) => { - ;(callback as any)(1) - }) + const compiler = createCompiler() - plugin.apply(compiler as any) - - vi.mocked(compiler.hooks.watchRun.tapAsync).mock.calls[0][1]( - null, - callback, - ) + await plugin.apply(compiler) + expect(setDebug).toHaveBeenCalledWith(options.debug) + }) - expect(console.error).toHaveBeenCalledWith( - 'Error checking devup.json:', - 1, - ) + it('should reset data files when load error', async () => { + const plugin = new DevupUIWebpackPlugin({ + watch: true, + }) + const compiler = createCompiler() + vi.mocked(readFile).mockImplementation(() => { + throw new Error('error') }) + vi.mocked(existsSync).mockReturnValue(true) + plugin.apply(compiler as any) + await compiler.hooks.watchRun.tapPromise.mock.calls[0][1]() + expect(importSheet).toHaveBeenCalledWith({}) + expect(importClassMap).toHaveBeenCalledWith({}) + expect(importFileMap).toHaveBeenCalledWith({}) }) - it('should include lib', () => { - vi.mocked(readFileSync).mockReturnValue('{"theme": "theme"}') - vi.mocked(getThemeInterface).mockReturnValue('interfaceCode') - vi.mocked(getCss).mockReturnValue('css') - vi.mocked(writeFileSync).mockReturnValue() - vi.mocked(mkdirSync) - + it.each( + createTestMatrix({ + watch: [true, false], + existsDevupFile: [true, false], + existsDistDir: [true, false], + existsSheetFile: [true, false], + existsClassMapFile: [true, false], + existsFileMapFile: [true, false], + existsCssDir: [true, false], + }), + )('should apply', async (options) => { const plugin = new DevupUIWebpackPlugin({ - include: ['lib'], + watch: options.watch, }) - const compiler = { - options: { - module: { - rules: [], - }, - plugins: [], - }, - hooks: { - afterCompile: { - tap: vi.fn(), - }, - done: { - tap: vi.fn(), - }, - watchRun: { - tapAsync: vi.fn(), - }, - }, - webpack: { - DefinePlugin: vi.fn(), - }, - } as any + const compiler = createCompiler() + + vi.mocked(existsSync).mockImplementation((path) => { + if (path === plugin.options.devupFile) return options.existsDevupFile + if (path === plugin.options.distDir) return options.existsDistDir + if (path === plugin.options.cssDir) return options.existsCssDir + if (path === join(plugin.options.distDir, 'sheet.json')) + return options.existsSheetFile + if (path === join(plugin.options.distDir, 'classMap.json')) + return options.existsClassMapFile + if (path === join(plugin.options.distDir, 'fileMap.json')) + return options.existsFileMapFile + return false + }) + vi.mocked(getDefaultTheme).mockReturnValue('defaultTheme') + vi.mocked(stat).mockResolvedValueOnce({ + mtimeMs: 1, + } as any) + vi.mocked(stat).mockResolvedValueOnce({ + mtimeMs: 2, + } as any) + vi.mocked(mkdir) + if (options.existsSheetFile) + vi.mocked(readFile).mockResolvedValueOnce('{"sheet": "sheet"}') + if (options.existsClassMapFile) + vi.mocked(readFile).mockResolvedValueOnce('{"classMap": "classMap"}') + if (options.existsFileMapFile) + vi.mocked(readFile).mockResolvedValueOnce('{"fileMap": "fileMap"}') + plugin.apply(compiler) + await compiler.hooks[ + options.watch ? 'watchRun' : 'beforeRun' + ].tapPromise.mock.calls[0][1]() + await compiler.hooks[ + options.watch ? 'watchRun' : 'beforeRun' + ].tapPromise.mock.calls[0][1]() - expect(writeFileSync).toHaveBeenCalledWith( - resolve('df', 'devup-ui.css'), - '', - { - encoding: 'utf-8', - }, + if (options.existsDistDir) + expect(mkdir).not.toHaveBeenCalledWith(plugin.options.distDir, { + recursive: true, + }) + else + expect(mkdir).toHaveBeenCalledWith(plugin.options.distDir, { + recursive: true, + }) + expect(writeFile).toHaveBeenCalledWith( + join(plugin.options.distDir, '.gitignore'), + '*', + 'utf-8', ) + if (options.watch) { + if (options.existsSheetFile) + expect(importSheet).toHaveBeenCalledWith( + JSON.parse('{"sheet": "sheet"}'), + ) + if (options.existsClassMapFile) + expect(importClassMap).toHaveBeenCalledWith( + JSON.parse('{"classMap": "classMap"}'), + ) + if (options.existsFileMapFile) + expect(importFileMap).toHaveBeenCalledWith( + JSON.parse('{"fileMap": "fileMap"}'), + ) + expect(compiler.hooks.watchRun.tapPromise).toHaveBeenCalled() + + await compiler.hooks.watchRun.tapPromise.mock.calls[1][1]() + if (options.existsDevupFile) { + expect(stat).toHaveBeenCalledWith(plugin.options.devupFile) + await compiler.hooks.watchRun.tapPromise.mock.calls[1][1]() + } else { + expect(stat).not.toHaveBeenCalled() + } + } else expect(compiler.hooks.watchRun.tapPromise).not.toHaveBeenCalled() + if (options.existsDevupFile) { + expect(compiler.hooks.afterCompile.tap).toHaveBeenCalled() + const add = vi.fn() + compiler.hooks.afterCompile.tap.mock.calls[0][1]({ + fileDependencies: { + add, + }, + }) + expect(add).toHaveBeenCalledWith(resolve(plugin.options.devupFile)) + } else expect(compiler.hooks.afterCompile.tap).not.toHaveBeenCalled() + if (options.existsCssDir) { + expect(mkdir).not.toHaveBeenCalledWith(plugin.options.cssDir, { + recursive: true, + }) + } else { + expect(mkdir).toHaveBeenCalledWith(plugin.options.cssDir, { + recursive: true, + }) + } + expect(compiler.webpack.DefinePlugin).toHaveBeenCalledWith({ 'process.env.DEVUP_UI_DEFAULT_THEME': JSON.stringify(getDefaultTheme()), }) + + if (!options.watch) { + expect(compiler.hooks.done.tapPromise).toHaveBeenCalled() + compiler.hooks.done.tapPromise.mock.calls[0][1]({ + hasErrors: () => true, + }) + expect(writeFile).not.toHaveBeenCalledWith( + join(plugin.options.cssDir, 'devup-ui.css'), + getCss(), + 'utf-8', + ) + + await compiler.hooks.done.tapPromise.mock.calls[0][1]({ + hasErrors: () => false, + }) + expect(writeFile).toHaveBeenCalledWith( + join(plugin.options.cssDir, 'devup-ui.css'), + getCss(), + 'utf-8', + ) + } else { + expect(compiler.hooks.done.tapPromise).not.toHaveBeenCalled() + } }) }) diff --git a/packages/webpack-plugin/src/loader.ts b/packages/webpack-plugin/src/loader.ts index 31065d65..6b5830fb 100644 --- a/packages/webpack-plugin/src/loader.ts +++ b/packages/webpack-plugin/src/loader.ts @@ -16,7 +16,7 @@ export interface DevupUILoaderOptions { classMapFile: string fileMapFile: string watch: boolean - splitCss: boolean + singleCss: boolean } const devupUILoader: RawLoaderDefinitionFunction = @@ -28,7 +28,7 @@ const devupUILoader: RawLoaderDefinitionFunction = sheetFile, classMapFile, fileMapFile, - splitCss, + singleCss, } = this.getOptions() const callback = this.async() const id = this.resourcePath @@ -38,13 +38,14 @@ const devupUILoader: RawLoaderDefinitionFunction = '\\', '/', ) + if (!rel.startsWith('./')) rel = `./${rel}` const { code, css, map, css_file } = codeExtract( id, source.toString(), libPackage, rel, - splitCss, + singleCss, ) const sourceMap = map ? JSON.parse(map) : null if (css) { diff --git a/packages/webpack-plugin/src/plugin.ts b/packages/webpack-plugin/src/plugin.ts index ba191519..3e54ca33 100644 --- a/packages/webpack-plugin/src/plugin.ts +++ b/packages/webpack-plugin/src/plugin.ts @@ -1,10 +1,5 @@ -import { - existsSync, - mkdirSync, - readFileSync, - stat, - writeFileSync, -} from 'node:fs' +import { existsSync } from 'node:fs' +import { mkdir, readFile, stat, writeFile } from 'node:fs/promises' import { createRequire } from 'node:module' import { join, resolve } from 'node:path' @@ -23,132 +18,150 @@ import { type Compiler } from 'webpack' export interface DevupUIWebpackPluginOptions { package: string cssDir: string - devupPath: string - interfacePath: string + devupFile: string + distDir: string watch: boolean debug: boolean include: string[] - splitCss: boolean + singleCss: boolean } export class DevupUIWebpackPlugin { options: DevupUIWebpackPluginOptions + sheetFile: string + classMapFile: string + fileMapFile: string constructor({ package: libPackage = '@devup-ui/react', - devupPath = 'devup.json', - interfacePath = 'df', - cssDir = resolve(interfacePath, 'devup-ui'), + devupFile = 'devup.json', + distDir = 'df', + cssDir = resolve(distDir, 'devup-ui'), watch = false, debug = false, include = [], - splitCss = true, + singleCss = false, }: Partial = {}) { this.options = { package: libPackage, cssDir, - devupPath, - interfacePath, + devupFile, + distDir, watch, debug, include, - splitCss, + singleCss, } + + this.sheetFile = join(this.options.distDir, 'sheet.json') + this.classMapFile = join(this.options.distDir, 'classMap.json') + this.fileMapFile = join(this.options.distDir, 'fileMap.json') } async writeDataFiles() { - registerTheme( - JSON.parse(readFileSync(this.options.devupPath, 'utf-8'))?.['theme'], - ) - const interfaceCode = getThemeInterface( - this.options.package, - 'DevupThemeColors', - 'DevupThemeTypography', - 'DevupTheme', - ) - - if (interfaceCode) { - writeFileSync( - join(this.options.interfacePath, 'theme.d.ts'), - interfaceCode, - { - encoding: 'utf-8', - }, - ) + try { + const content = existsSync(this.options.devupFile) + ? await readFile(this.options.devupFile, 'utf-8') + : undefined + + if (content) { + registerTheme(JSON.parse(content)?.['theme'] ?? {}) + const interfaceCode = getThemeInterface( + this.options.package, + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + + if (interfaceCode) { + await writeFile( + join(this.options.distDir, 'theme.d.ts'), + interfaceCode, + { + encoding: 'utf-8', + }, + ) + } + } else { + registerTheme({}) + } + } catch (error) { + console.error(error) + registerTheme({}) } - if (!existsSync(this.options.cssDir)) - mkdirSync(this.options.cssDir, { recursive: true }) - if (this.options.watch) - writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { - encoding: 'utf-8', - }) + await Promise.all([ + !existsSync(this.options.cssDir) + ? mkdir(this.options.cssDir, { recursive: true }) + : Promise.resolve(), + this.options.watch + ? writeFile(join(this.options.cssDir, 'devup-ui.css'), getCss()) + : Promise.resolve(), + ]) } apply(compiler: Compiler) { setDebug(this.options.debug) - // read devup.json - const existsDevup = existsSync(this.options.devupPath) - - if (!existsSync(this.options.interfacePath)) - mkdirSync(this.options.interfacePath) - - writeFileSync(join(this.options.interfacePath, '.gitignore'), '*', { - encoding: 'utf-8', - }) + let initialized = false + const existsDevup = existsSync(this.options.devupFile) + compiler.hooks[this.options.watch ? 'watchRun' : 'beforeRun'].tapPromise( + 'DevupUIWebpackPlugin', + async () => { + if (initialized) return + initialized = true + // read devup.json + if (!existsSync(this.options.distDir)) + await mkdir(this.options.distDir, { recursive: true }) + await writeFile(join(this.options.distDir, '.gitignore'), '*', 'utf-8') + + if (this.options.watch) { + try { + // load sheet + await Promise.all([ + existsSync(this.sheetFile) + ? readFile(this.sheetFile, 'utf-8').then((content) => + importSheet(JSON.parse(content)), + ) + : Promise.resolve(), + existsSync(this.classMapFile) + ? readFile(this.classMapFile, 'utf-8').then((content) => + importClassMap(JSON.parse(content)), + ) + : Promise.resolve(), + existsSync(this.fileMapFile) + ? readFile(this.fileMapFile, 'utf-8').then((content) => + importFileMap(JSON.parse(content)), + ) + : Promise.resolve(), + ]) + } catch (error) { + console.error(error) + importSheet({}) + importClassMap({}) + importFileMap({}) + } + } + await this.writeDataFiles() + }, + ) - const sheetFile = join(this.options.interfacePath, 'sheet.json') - const classMapFile = join(this.options.interfacePath, 'classMap.json') - const fileMapFile = join(this.options.interfacePath, 'fileMap.json') if (this.options.watch) { - try { - // load sheet - if (existsSync(sheetFile)) - importSheet(JSON.parse(readFileSync(sheetFile, 'utf-8'))) - if (existsSync(classMapFile)) - importClassMap(JSON.parse(readFileSync(classMapFile, 'utf-8'))) - if (existsSync(fileMapFile)) - importFileMap(JSON.parse(readFileSync(fileMapFile, 'utf-8'))) - } catch (error) { - console.error(error) - } let lastModifiedTime: number | null = null - compiler.hooks.watchRun.tapAsync( - 'DevupUIWebpackPlugin', - (_, callback) => { - if (existsDevup) - stat(this.options.devupPath, (err, stats) => { - if (err) { - console.error(`Error checking ${this.options.devupPath}:`, err) - return - } - - const modifiedTime = stats.mtimeMs - if (lastModifiedTime && lastModifiedTime !== modifiedTime) - this.writeDataFiles() - - lastModifiedTime = modifiedTime - }) - callback() - }, - ) - } - if (existsDevup) { - try { - this.writeDataFiles() - } catch (error) { - console.error(error) - } - compiler.hooks.afterCompile.tap('DevupUIWebpackPlugin', (compilation) => { - compilation.fileDependencies.add(resolve(this.options.devupPath)) + compiler.hooks.watchRun.tapPromise('DevupUIWebpackPlugin', async () => { + if (existsDevup) { + const stats = await stat(this.options.devupFile) + + const modifiedTime = stats.mtimeMs + if (lastModifiedTime && lastModifiedTime !== modifiedTime) + await this.writeDataFiles() + + lastModifiedTime = modifiedTime + } }) } - if (!existsSync(this.options.cssDir)) - mkdirSync(this.options.cssDir, { recursive: true }) - - if (this.options.watch) - writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { - encoding: 'utf-8', + if (existsDevup) + compiler.hooks.afterCompile.tap('DevupUIWebpackPlugin', (compilation) => { + compilation.fileDependencies.add(resolve(this.options.devupFile)) }) compiler.options.plugins.push( @@ -157,12 +170,14 @@ export class DevupUIWebpackPlugin { }), ) if (!this.options.watch) { - compiler.hooks.done.tap('DevupUIWebpackPlugin', (stats) => { + compiler.hooks.done.tapPromise('DevupUIWebpackPlugin', async (stats) => { if (!stats.hasErrors()) { // write css file - writeFileSync(join(this.options.cssDir, 'devup-ui.css'), getCss(), { - encoding: 'utf-8', - }) + await writeFile( + join(this.options.cssDir, 'devup-ui.css'), + getCss(), + 'utf-8', + ) } }) } @@ -171,9 +186,9 @@ export class DevupUIWebpackPlugin { { test: /\.(tsx|ts|js|mjs|jsx)$/, exclude: new RegExp( - this.options.include.length - ? `node_modules(?!.*(${this.options.include.join('|').replaceAll('/', '[\\/\\\\]')})([\\/\\\\]|$))` - : 'node_modules', + `node_modules(?!.*(${['@devup-ui', ...this.options.include] + .join('|') + .replaceAll('/', '[\\/\\\\_]')})([\\/\\\\.]|$))`, ), enforce: 'pre', use: [ @@ -184,11 +199,11 @@ export class DevupUIWebpackPlugin { options: { package: this.options.package, cssDir: this.options.cssDir, - sheetFile, - classMapFile, - fileMapFile, + sheetFile: this.sheetFile, + classMapFile: this.classMapFile, + fileMapFile: this.fileMapFile, watch: this.options.watch, - splitCss: this.options.splitCss, + singleCss: this.options.singleCss, }, }, ], diff --git a/packages/webpack-plugin/tsconfig.json b/packages/webpack-plugin/tsconfig.json index 4c6e75be..30053bb9 100644 --- a/packages/webpack-plugin/tsconfig.json +++ b/packages/webpack-plugin/tsconfig.json @@ -1,6 +1,10 @@ { "compilerOptions": { - "types": ["vite/client", "vitest/importMeta", "vitest/globals"], + "types": [ + "vite/client", + "vitest/importMeta", + "vitest/globals" + ], "strict": true, "target": "ESNext", "declaration": true, @@ -22,5 +26,14 @@ "noEmit": true, "baseUrl": ".", "jsx": "react-jsx" - } -} + }, + "include": [ + "src", + "vite.config.ts", + "../../vitest.setup.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40c5af20..a8947cb6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 6.8.0 '@testing-library/react': specifier: ^16.3.0 - version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.1.8(@types/react@19.1.11))(@types/react@19.1.11)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.1.9(@types/react@19.1.12))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@types/node': specifier: ^24.3.0 version: 24.3.0 @@ -30,7 +30,7 @@ importers: specifier: ^3.2.4 version: 3.2.4(vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(happy-dom@18.0.1)(jiti@2.5.1)(terser@5.43.1)) eslint: - specifier: ^9.33.0 + specifier: ^9.34.0 version: 9.34.0(jiti@2.5.1) eslint-plugin-devup: specifier: ^2.0.5 @@ -58,10 +58,10 @@ importers: version: 3.1.0(acorn@8.15.0)(webpack@5.101.3) '@mdx-js/react': specifier: ^3.1.0 - version: 3.1.0(@types/react@19.1.11)(react@19.1.1) + version: 3.1.0(@types/react@19.1.12)(react@19.1.1) '@next/mdx': - specifier: ^15.5.0 - version: 15.5.0(@mdx-js/loader@3.1.0(acorn@8.15.0)(webpack@5.101.3))(@mdx-js/react@3.1.0(@types/react@19.1.11)(react@19.1.1)) + specifier: ^15.5.2 + version: 15.5.2(@mdx-js/loader@3.1.0(acorn@8.15.0)(webpack@5.101.3))(@mdx-js/react@3.1.0(@types/react@19.1.12)(react@19.1.1)) '@types/mdx': specifier: ^2.0.13 version: 2.0.13 @@ -72,8 +72,8 @@ importers: specifier: ^2.1.1 version: 2.1.1 next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.1 version: 19.1.1 @@ -82,9 +82,9 @@ importers: version: 19.1.1(react@19.1.1) react-markdown: specifier: ^10.1.0 - version: 10.1.0(@types/react@19.1.11)(react@19.1.1) + version: 10.1.0(@types/react@19.1.12)(react@19.1.1) react-syntax-highlighter: - specifier: ^15.6.1 + specifier: ^15.6.6 version: 15.6.6(react@19.1.1) remark-gfm: specifier: ^4.0.1 @@ -101,10 +101,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) '@types/react-syntax-highlighter': specifier: ^15.5.13 version: 15.5.13 @@ -124,8 +124,8 @@ importers: specifier: workspace:* version: link:../../packages/react next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.1 version: 19.1.1 @@ -141,10 +141,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) typescript: specifier: ^5 version: 5.9.2 @@ -165,11 +165,11 @@ importers: specifier: workspace:* version: link:../../packages/rsbuild-plugin '@rsbuild/core': - specifier: ^1.4.15 - version: 1.4.16 + specifier: ^1.5.1 + version: 1.5.1 '@rsbuild/plugin-react': - specifier: ^1.3.5 - version: 1.3.5(@rsbuild/core@1.4.16) + specifier: ^1.4.0 + version: 1.4.0(@rsbuild/core@1.5.1) apps/vite: dependencies: @@ -194,13 +194,13 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) '@vitejs/plugin-react': - specifier: ^5.0.1 - version: 5.0.1(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + specifier: ^5.0.2 + version: 5.0.2(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) typescript: specifier: ^5 version: 5.9.2 @@ -225,10 +225,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@vitejs/plugin-react': - specifier: ^5.0.1 - version: 5.0.1(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + specifier: ^5.0.2 + version: 5.0.2(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) typescript: specifier: ^5 version: 5.9.2 @@ -237,19 +237,19 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) benchmark/next-chakra-ui: dependencies: '@chakra-ui/react': - specifier: ^3.25.0 - version: 3.25.0(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^3.26.0 + version: 3.26.0(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@emotion/react': specifier: ^11.14.0 - version: 11.14.0(@types/react@19.1.11)(react@19.1.1) + version: 11.14.0(@types/react@19.1.12)(react@19.1.1) next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) next-themes: specifier: ^0.4.6 version: 0.4.6(react-dom@19.1.1(react@19.1.1))(react@19.1.1) @@ -268,10 +268,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) typescript: specifier: ^5 version: 5.9.2 @@ -282,8 +282,8 @@ importers: specifier: workspace:* version: link:../../packages/react next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.1 version: 19.1.1 @@ -299,10 +299,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) typescript: specifier: ^5 version: 5.9.2 @@ -311,10 +311,10 @@ importers: dependencies: '@kuma-ui/core': specifier: ^1.5.9 - version: 1.5.9(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + version: 1.5.9(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.1 version: 19.1.1 @@ -324,16 +324,16 @@ importers: devDependencies: '@kuma-ui/next-plugin': specifier: ^1.3.3 - version: 1.3.3(@babel/core@7.28.3)(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3) + version: 1.3.3(@babel/core@7.28.3)(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3) '@types/node': specifier: ^24 version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) typescript: specifier: ^5 version: 5.9.2 @@ -342,16 +342,16 @@ importers: dependencies: '@emotion/react': specifier: ^11.14.0 - version: 11.14.0(@types/react@19.1.11)(react@19.1.1) + version: 11.14.0(@types/react@19.1.12)(react@19.1.1) '@emotion/styled': specifier: ^11.14.1 - version: 11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1) + version: 11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1) '@mui/material': specifier: 7.3.1 - version: 7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + version: 7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) next: - specifier: ^15.5.0 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) next-themes: specifier: ^0.4.6 version: 0.4.6(react-dom@19.1.1(react@19.1.1))(react@19.1.1) @@ -370,10 +370,10 @@ importers: version: 24.3.0 '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 '@types/react-dom': specifier: ^19 - version: 19.1.8(@types/react@19.1.11) + version: 19.1.9(@types/react@19.1.12) typescript: specifier: ^5 version: 5.9.2 @@ -399,25 +399,25 @@ importers: specifier: workspace:* version: link:../vite-plugin '@storybook/addon-docs': - specifier: ^9.1.2 - version: 9.1.3(@types/react@19.1.11)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))) + specifier: ^9.1.3 + version: 9.1.3(@types/react@19.1.12)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))) '@storybook/addon-onboarding': - specifier: ^9.1.2 + specifier: ^9.1.3 version: 9.1.3(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))) '@storybook/react-vite': - specifier: ^9.1.2 - version: 9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.48.1)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + specifier: ^9.1.3 + version: 9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.49.0)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) '@types/react': - specifier: ^19.1.10 - version: 19.1.11 + specifier: ^19.1.12 + version: 19.1.12 eslint-plugin-storybook: - specifier: ^9.1.2 + specifier: ^9.1.3 version: 9.1.3(eslint@9.34.0(jiti@2.5.1))(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2) rollup-plugin-preserve-directives: specifier: ^0.4.0 - version: 0.4.0(rollup@4.48.1) + version: 0.4.0(rollup@4.49.0) storybook: - specifier: ^9.1.2 + specifier: ^9.1.3 version: 9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) typescript: specifier: ^5.9.2 @@ -427,7 +427,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(happy-dom@18.0.1)(jiti@2.5.1)(terser@5.43.1) @@ -439,10 +439,10 @@ importers: version: link:../webpack-plugin browserslist: specifier: latest - version: 4.25.3 + version: 4.25.4 next: specifier: ^15.5 - version: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) devDependencies: '@types/webpack': specifier: ^5.28.5 @@ -455,7 +455,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(happy-dom@18.0.1)(jiti@2.5.1)(terser@5.43.1) @@ -471,10 +471,10 @@ importers: devDependencies: '@types/react': specifier: ^19 - version: 19.1.11 + version: 19.1.12 rollup-plugin-preserve-directives: specifier: ^0.4.0 - version: 0.4.0(rollup@4.48.1) + version: 0.4.0(rollup@4.49.0) typescript: specifier: ^5.9.2 version: 5.9.2 @@ -483,7 +483,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) packages/reset-css: dependencies: @@ -493,7 +493,7 @@ importers: devDependencies: rollup-plugin-preserve-directives: specifier: ^0.4.0 - version: 0.4.0(rollup@4.48.1) + version: 0.4.0(rollup@4.49.0) typescript: specifier: ^5.9.2 version: 5.9.2 @@ -502,7 +502,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) packages/rsbuild-plugin: dependencies: @@ -511,8 +511,8 @@ importers: version: link:../../bindings/devup-ui-wasm devDependencies: '@rsbuild/core': - specifier: ^1.4.15 - version: 1.4.16 + specifier: ^1.5.1 + version: 1.5.1 typescript: specifier: ^5.9.2 version: 5.9.2 @@ -521,7 +521,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(happy-dom@18.0.1)(jiti@2.5.1)(terser@5.43.1) @@ -540,7 +540,7 @@ importers: version: 5.9.2 vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) packages/webpack-plugin: dependencies: @@ -559,7 +559,7 @@ importers: version: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) vite-plugin-dts: specifier: ^4.5.4 - version: 4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) + version: 4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0)(happy-dom@18.0.1)(jiti@2.5.1)(terser@5.43.1) @@ -573,8 +573,8 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@ark-ui/react@5.20.0': - resolution: {integrity: sha512-nvvVjA8uWpTYdNNafRADd7ygUd65zFbJ4zegwp/I7y2Q5Y3otIdoqiJilcA2APuyRckUB/IEQPX/exDFEtRkxQ==} + '@ark-ui/react@5.22.0': + resolution: {integrity: sha512-cH3xVhKRn0ZsP2Jg2RZAziI38obIfTMC3Q6ZWtWeYL5k9fq6K8sa1XjdJclBRSD0vYYvR1ynHG9ThicWKKANtQ==} peerDependencies: react: '>=18.0.0' react-dom: '>=18.0.0' @@ -1144,8 +1144,8 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@chakra-ui/react@3.25.0': - resolution: {integrity: sha512-RYScSA7WGA8lz5fAKo/7mpagm2M+GLcgzSlPCy7rlFaC6XpfCdcqvqyNF9LOWEiwaSB87hK9wmXm7BbiiNFEIQ==} + '@chakra-ui/react@3.26.0': + resolution: {integrity: sha512-VuhFMLklzrjTWIst1B+uQggxOn9+GxVd+0LHLtsQKA+JtKUDqNfKymeWlb1/pKrmqH184+gwZJRjTtr6/+0cIQ==} peerDependencies: '@emotion/react': '>=11' react: '>=18' @@ -1206,14 +1206,14 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@emnapi/core@1.4.5': - resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==} + '@emnapi/core@1.5.0': + resolution: {integrity: sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==} - '@emnapi/runtime@1.4.5': - resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} + '@emnapi/runtime@1.5.0': + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} - '@emnapi/wasi-threads@1.0.4': - resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==} + '@emnapi/wasi-threads@1.1.0': + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} '@emotion/babel-plugin@11.13.5': resolution: {integrity: sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==} @@ -1598,8 +1598,8 @@ packages: '@floating-ui/core@1.7.3': resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==} - '@floating-ui/dom@1.7.3': - resolution: {integrity: sha512-uZA413QEpNuhtb3/iIKoYMSK07keHPYeXF02Zhd6e213j+d1NamLix/mCLxBUDW/Gx52sPH2m+chlUsyaBs/Ag==} + '@floating-ui/dom@1.7.4': + resolution: {integrity: sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==} '@floating-ui/utils@0.2.10': resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==} @@ -1881,23 +1881,23 @@ packages: '@microsoft/tsdoc@0.15.1': resolution: {integrity: sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==} - '@module-federation/error-codes@0.17.1': - resolution: {integrity: sha512-n6Elm4qKSjwAPxLUGtwnl7qt4y1dxB8OpSgVvXBIzqI9p27a3ZXshLPLnumlpPg1Qudaj8sLnSnFtt9yGpt5yQ==} + '@module-federation/error-codes@0.18.0': + resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==} - '@module-federation/runtime-core@0.17.1': - resolution: {integrity: sha512-LCtIFuKgWPQ3E+13OyrVpuTPOWBMI/Ggwsq1Q874YeT8Px28b8tJRCj09DjyRFyhpSPyV/uG80T6iXPAUoLIfQ==} + '@module-federation/runtime-core@0.18.0': + resolution: {integrity: sha512-ZyYhrDyVAhUzriOsVfgL6vwd+5ebYm595Y13KeMf6TKDRoUHBMTLGQ8WM4TDj8JNsy7LigncK8C03fn97of0QQ==} - '@module-federation/runtime-tools@0.17.1': - resolution: {integrity: sha512-4kr6zTFFwGywJx6whBtxsc84V+COAuuBpEdEbPZN//YLXhNB0iz2IGsy9r9wDl+06h84bD+3dQ05l9euRLgXzQ==} + '@module-federation/runtime-tools@0.18.0': + resolution: {integrity: sha512-fSga9o4t1UfXNV/Kh6qFvRyZpPp3EHSPRISNeyT8ZoTpzDNiYzhtw0BPUSSD8m6C6XQh2s/11rI4g80UY+d+hA==} - '@module-federation/runtime@0.17.1': - resolution: {integrity: sha512-vKEN32MvUbpeuB/s6UXfkHDZ9N5jFyDDJnj83UTJ8n4N1jHIJu9VZ6Yi4/Ac8cfdvU8UIK9bIbfVXWbUYZUDsw==} + '@module-federation/runtime@0.18.0': + resolution: {integrity: sha512-+C4YtoSztM7nHwNyZl6dQKGUVJdsPrUdaf3HIKReg/GQbrt9uvOlUWo2NXMZ8vDAnf/QRrpSYAwXHmWDn9Obaw==} - '@module-federation/sdk@0.17.1': - resolution: {integrity: sha512-nlUcN6UTEi+3HWF+k8wPy7gH0yUOmCT+xNatihkIVR9REAnr7BUvHFGlPJmx7WEbLPL46+zJUbtQHvLzXwFhng==} + '@module-federation/sdk@0.18.0': + resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==} - '@module-federation/webpack-bundler-runtime@0.17.1': - resolution: {integrity: sha512-Swspdgf4PzcbvS9SNKFlBzfq8h/Qxwqjq/xRSqw1pqAZWondZQzwTTqPXhgrg0bFlz7qWjBS/6a8KuH/gRvGaQ==} + '@module-federation/webpack-bundler-runtime@0.18.0': + resolution: {integrity: sha512-TEvErbF+YQ+6IFimhUYKK3a5wapD90d90sLsNpcu2kB3QGT7t4nIluE25duXuZDVUKLz86tEPrza/oaaCWTpvQ==} '@mui/core-downloads-tracker@7.3.1': resolution: {integrity: sha512-+mIK1Z0BhOaQ0vCgOkT1mSrIpEHLo338h4/duuL4TBLXPvUMit732mnwJY3W40Avy30HdeSfwUAAGRkKmwRaEQ==} @@ -1982,11 +1982,11 @@ packages: '@napi-rs/wasm-runtime@1.0.3': resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} - '@next/env@15.5.0': - resolution: {integrity: sha512-sDaprBAfzCQiOgo2pO+LhnV0Wt2wBgartjrr+dpcTORYVnnXD0gwhHhiiyIih9hQbq+JnbqH4odgcFWhqCGidw==} + '@next/env@15.5.2': + resolution: {integrity: sha512-Qe06ew4zt12LeO6N7j8/nULSOe3fMXE4dM6xgpBQNvdzyK1sv5y4oAP3bq4LamrvGCZtmRYnW8URFCeX5nFgGg==} - '@next/mdx@15.5.0': - resolution: {integrity: sha512-TxfWpIDHx9Xy/GgZwegrl+HxjzeQml0bTclxX72SqJLi83IhJaFiglQbfMTotB2hDRbxCGKpPYh0X20+r1Trtw==} + '@next/mdx@15.5.2': + resolution: {integrity: sha512-Lz9mdoKRfSNc7T1cSk3gzryhRcc7ErsiAWba1HBoInCX4ZpGUQXmiZLAAyrIgDl7oS/UHxsgKtk2qp/Df4gKBg==} peerDependencies: '@mdx-js/loader': '>=0.15.0' '@mdx-js/react': '>=0.15.0' @@ -1996,50 +1996,50 @@ packages: '@mdx-js/react': optional: true - '@next/swc-darwin-arm64@15.5.0': - resolution: {integrity: sha512-v7Jj9iqC6enxIRBIScD/o0lH7QKvSxq2LM8UTyqJi+S2w2QzhMYjven4vgu/RzgsdtdbpkyCxBTzHl/gN5rTRg==} + '@next/swc-darwin-arm64@15.5.2': + resolution: {integrity: sha512-8bGt577BXGSd4iqFygmzIfTYizHb0LGWqH+qgIF/2EDxS5JsSdERJKA8WgwDyNBZgTIIA4D8qUtoQHmxIIquoQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@15.5.0': - resolution: {integrity: sha512-s2Nk6ec+pmYmAb/utawuURy7uvyYKDk+TRE5aqLRsdnj3AhwC9IKUBmhfnLmY/+P+DnwqpeXEFIKe9tlG0p6CA==} + '@next/swc-darwin-x64@15.5.2': + resolution: {integrity: sha512-2DjnmR6JHK4X+dgTXt5/sOCu/7yPtqpYt8s8hLkHFK3MGkka2snTv3yRMdHvuRtJVkPwCGsvBSwmoQCHatauFQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@15.5.0': - resolution: {integrity: sha512-mGlPJMZReU4yP5fSHjOxiTYvZmwPSWn/eF/dcg21pwfmiUCKS1amFvf1F1RkLHPIMPfocxLViNWFvkvDB14Isg==} + '@next/swc-linux-arm64-gnu@15.5.2': + resolution: {integrity: sha512-3j7SWDBS2Wov/L9q0mFJtEvQ5miIqfO4l7d2m9Mo06ddsgUK8gWfHGgbjdFlCp2Ek7MmMQZSxpGFqcC8zGh2AA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.5.0': - resolution: {integrity: sha512-biWqIOE17OW/6S34t1X8K/3vb1+svp5ji5QQT/IKR+VfM3B7GvlCwmz5XtlEan2ukOUf9tj2vJJBffaGH4fGRw==} + '@next/swc-linux-arm64-musl@15.5.2': + resolution: {integrity: sha512-s6N8k8dF9YGc5T01UPQ08yxsK6fUow5gG1/axWc1HVVBYQBgOjca4oUZF7s4p+kwhkB1bDSGR8QznWrFZ/Rt5g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@15.5.0': - resolution: {integrity: sha512-zPisT+obYypM/l6EZ0yRkK3LEuoZqHaSoYKj+5jiD9ESHwdr6QhnabnNxYkdy34uCigNlWIaCbjFmQ8FY5AlxA==} + '@next/swc-linux-x64-gnu@15.5.2': + resolution: {integrity: sha512-o1RV/KOODQh6dM6ZRJGZbc+MOAHww33Vbs5JC9Mp1gDk8cpEO+cYC/l7rweiEalkSm5/1WGa4zY7xrNwObN4+Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.5.0': - resolution: {integrity: sha512-+t3+7GoU9IYmk+N+FHKBNFdahaReoAktdOpXHFIPOU1ixxtdge26NgQEEkJkCw2dHT9UwwK5zw4mAsURw4E8jA==} + '@next/swc-linux-x64-musl@15.5.2': + resolution: {integrity: sha512-/VUnh7w8RElYZ0IV83nUcP/J4KJ6LLYliiBIri3p3aW2giF+PAVgZb6mk8jbQSB3WlTai8gEmCAr7kptFa1H6g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@15.5.0': - resolution: {integrity: sha512-d8MrXKh0A+c9DLiy1BUFwtg3Hu90Lucj3k6iKTUdPOv42Ve2UiIG8HYi3UAb8kFVluXxEfdpCoPPCSODk5fDcw==} + '@next/swc-win32-arm64-msvc@15.5.2': + resolution: {integrity: sha512-sMPyTvRcNKXseNQ/7qRfVRLa0VhR0esmQ29DD6pqvG71+JdVnESJaHPA8t7bc67KD5spP3+DOCNLhqlEI2ZgQg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@15.5.0': - resolution: {integrity: sha512-Fe1tGHxOWEyQjmygWkkXSwhFcTJuimrNu52JEuwItrKJVV4iRjbWp9I7zZjwqtiNnQmxoEvoisn8wueFLrNpvQ==} + '@next/swc-win32-x64-msvc@15.5.2': + resolution: {integrity: sha512-W5VvyZHnxG/2ukhZF/9Ikdra5fdNftxI6ybeVKYvBPDtyx7x4jPPSNduUkfH5fo3zG0JQ0bPxgy41af2JX5D4Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -2070,8 +2070,8 @@ packages: '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} - '@rolldown/pluginutils@1.0.0-beta.32': - resolution: {integrity: sha512-QReCdvxiUZAPkvp1xpAg62IeNzykOFA6syH2CnClif4YmALN1XKpB39XneL80008UbtMShthSVDKmrx05N1q/g==} + '@rolldown/pluginutils@1.0.0-beta.34': + resolution: {integrity: sha512-LyAREkZHP5pMom7c24meKmJCdhf2hEyvam2q0unr3or9ydwDL+DJ8chTF6Av/RFPb3rH8UFBdMzO5MxTZW97oA==} '@rollup/pluginutils@5.2.0': resolution: {integrity: sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==} @@ -2082,171 +2082,171 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.48.1': - resolution: {integrity: sha512-rGmb8qoG/zdmKoYELCBwu7vt+9HxZ7Koos3pD0+sH5fR3u3Wb/jGcpnqxcnWsPEKDUyzeLSqksN8LJtgXjqBYw==} + '@rollup/rollup-android-arm-eabi@4.49.0': + resolution: {integrity: sha512-rlKIeL854Ed0e09QGYFlmDNbka6I3EQFw7iZuugQjMb11KMpJCLPFL4ZPbMfaEhLADEL1yx0oujGkBQ7+qW3eA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.48.1': - resolution: {integrity: sha512-4e9WtTxrk3gu1DFE+imNJr4WsL13nWbD/Y6wQcyku5qadlKHY3OQ3LJ/INrrjngv2BJIHnIzbqMk1GTAC2P8yQ==} + '@rollup/rollup-android-arm64@4.49.0': + resolution: {integrity: sha512-cqPpZdKUSQYRtLLr6R4X3sD4jCBO1zUmeo3qrWBCqYIeH8Q3KRL4F3V7XJ2Rm8/RJOQBZuqzQGWPjjvFUcYa/w==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.48.1': - resolution: {integrity: sha512-+XjmyChHfc4TSs6WUQGmVf7Hkg8ferMAE2aNYYWjiLzAS/T62uOsdfnqv+GHRjq7rKRnYh4mwWb4Hz7h/alp8A==} + '@rollup/rollup-darwin-arm64@4.49.0': + resolution: {integrity: sha512-99kMMSMQT7got6iYX3yyIiJfFndpojBmkHfTc1rIje8VbjhmqBXE+nb7ZZP3A5skLyujvT0eIUCUsxAe6NjWbw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.48.1': - resolution: {integrity: sha512-upGEY7Ftw8M6BAJyGwnwMw91rSqXTcOKZnnveKrVWsMTF8/k5mleKSuh7D4v4IV1pLxKAk3Tbs0Lo9qYmii5mQ==} + '@rollup/rollup-darwin-x64@4.49.0': + resolution: {integrity: sha512-y8cXoD3wdWUDpjOLMKLx6l+NFz3NlkWKcBCBfttUn+VGSfgsQ5o/yDUGtzE9HvsodkP0+16N0P4Ty1VuhtRUGg==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.48.1': - resolution: {integrity: sha512-P9ViWakdoynYFUOZhqq97vBrhuvRLAbN/p2tAVJvhLb8SvN7rbBnJQcBu8e/rQts42pXGLVhfsAP0k9KXWa3nQ==} + '@rollup/rollup-freebsd-arm64@4.49.0': + resolution: {integrity: sha512-3mY5Pr7qv4GS4ZvWoSP8zha8YoiqrU+e0ViPvB549jvliBbdNLrg2ywPGkgLC3cmvN8ya3za+Q2xVyT6z+vZqA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.48.1': - resolution: {integrity: sha512-VLKIwIpnBya5/saccM8JshpbxfyJt0Dsli0PjXozHwbSVaHTvWXJH1bbCwPXxnMzU4zVEfgD1HpW3VQHomi2AQ==} + '@rollup/rollup-freebsd-x64@4.49.0': + resolution: {integrity: sha512-C9KzzOAQU5gU4kG8DTk+tjdKjpWhVWd5uVkinCwwFub2m7cDYLOdtXoMrExfeBmeRy9kBQMkiyJ+HULyF1yj9w==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.48.1': - resolution: {integrity: sha512-3zEuZsXfKaw8n/yF7t8N6NNdhyFw3s8xJTqjbTDXlipwrEHo4GtIKcMJr5Ed29leLpB9AugtAQpAHW0jvtKKaQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.49.0': + resolution: {integrity: sha512-OVSQgEZDVLnTbMq5NBs6xkmz3AADByCWI4RdKSFNlDsYXdFtlxS59J+w+LippJe8KcmeSSM3ba+GlsM9+WwC1w==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.48.1': - resolution: {integrity: sha512-leo9tOIlKrcBmmEypzunV/2w946JeLbTdDlwEZ7OnnsUyelZ72NMnT4B2vsikSgwQifjnJUbdXzuW4ToN1wV+Q==} + '@rollup/rollup-linux-arm-musleabihf@4.49.0': + resolution: {integrity: sha512-ZnfSFA7fDUHNa4P3VwAcfaBLakCbYaxCk0jUnS3dTou9P95kwoOLAMlT3WmEJDBCSrOEFFV0Y1HXiwfLYJuLlA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.48.1': - resolution: {integrity: sha512-Vy/WS4z4jEyvnJm+CnPfExIv5sSKqZrUr98h03hpAMbE2aI0aD2wvK6GiSe8Gx2wGp3eD81cYDpLLBqNb2ydwQ==} + '@rollup/rollup-linux-arm64-gnu@4.49.0': + resolution: {integrity: sha512-Z81u+gfrobVK2iV7GqZCBfEB1y6+I61AH466lNK+xy1jfqFLiQ9Qv716WUM5fxFrYxwC7ziVdZRU9qvGHkYIJg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.48.1': - resolution: {integrity: sha512-x5Kzn7XTwIssU9UYqWDB9VpLpfHYuXw5c6bJr4Mzv9kIv242vmJHbI5PJJEnmBYitUIfoMCODDhR7KoZLot2VQ==} + '@rollup/rollup-linux-arm64-musl@4.49.0': + resolution: {integrity: sha512-zoAwS0KCXSnTp9NH/h9aamBAIve0DXeYpll85shf9NJ0URjSTzzS+Z9evmolN+ICfD3v8skKUPyk2PO0uGdFqg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.48.1': - resolution: {integrity: sha512-yzCaBbwkkWt/EcgJOKDUdUpMHjhiZT/eDktOPWvSRpqrVE04p0Nd6EGV4/g7MARXXeOqstflqsKuXVM3H9wOIQ==} + '@rollup/rollup-linux-loongarch64-gnu@4.49.0': + resolution: {integrity: sha512-2QyUyQQ1ZtwZGiq0nvODL+vLJBtciItC3/5cYN8ncDQcv5avrt2MbKt1XU/vFAJlLta5KujqyHdYtdag4YEjYQ==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.48.1': - resolution: {integrity: sha512-UK0WzWUjMAJccHIeOpPhPcKBqax7QFg47hwZTp6kiMhQHeOYJeaMwzeRZe1q5IiTKsaLnHu9s6toSYVUlZ2QtQ==} + '@rollup/rollup-linux-ppc64-gnu@4.49.0': + resolution: {integrity: sha512-k9aEmOWt+mrMuD3skjVJSSxHckJp+SiFzFG+v8JLXbc/xi9hv2icSkR3U7uQzqy+/QbbYY7iNB9eDTwrELo14g==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.48.1': - resolution: {integrity: sha512-3NADEIlt+aCdCbWVZ7D3tBjBX1lHpXxcvrLt/kdXTiBrOds8APTdtk2yRL2GgmnSVeX4YS1JIf0imFujg78vpw==} + '@rollup/rollup-linux-riscv64-gnu@4.49.0': + resolution: {integrity: sha512-rDKRFFIWJ/zJn6uk2IdYLc09Z7zkE5IFIOWqpuU0o6ZpHcdniAyWkwSUWE/Z25N/wNDmFHHMzin84qW7Wzkjsw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.48.1': - resolution: {integrity: sha512-euuwm/QTXAMOcyiFCcrx0/S2jGvFlKJ2Iro8rsmYL53dlblp3LkUQVFzEidHhvIPPvcIsxDhl2wkBE+I6YVGzA==} + '@rollup/rollup-linux-riscv64-musl@4.49.0': + resolution: {integrity: sha512-FkkhIY/hYFVnOzz1WeV3S9Bd1h0hda/gRqvZCMpHWDHdiIHn6pqsY3b5eSbvGccWHMQ1uUzgZTKS4oGpykf8Tw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.48.1': - resolution: {integrity: sha512-w8mULUjmPdWLJgmTYJx/W6Qhln1a+yqvgwmGXcQl2vFBkWsKGUBRbtLRuKJUln8Uaimf07zgJNxOhHOvjSQmBQ==} + '@rollup/rollup-linux-s390x-gnu@4.49.0': + resolution: {integrity: sha512-gRf5c+A7QiOG3UwLyOOtyJMD31JJhMjBvpfhAitPAoqZFcOeK3Kc1Veg1z/trmt+2P6F/biT02fU19GGTS529A==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.48.1': - resolution: {integrity: sha512-90taWXCWxTbClWuMZD0DKYohY1EovA+W5iytpE89oUPmT5O1HFdf8cuuVIylE6vCbrGdIGv85lVRzTcpTRZ+kA==} + '@rollup/rollup-linux-x64-gnu@4.49.0': + resolution: {integrity: sha512-BR7+blScdLW1h/2hB/2oXM+dhTmpW3rQt1DeSiCP9mc2NMMkqVgjIN3DDsNpKmezffGC9R8XKVOLmBkRUcK/sA==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.48.1': - resolution: {integrity: sha512-2Gu29SkFh1FfTRuN1GR1afMuND2GKzlORQUP3mNMJbqdndOg7gNsa81JnORctazHRokiDzQ5+MLE5XYmZW5VWg==} + '@rollup/rollup-linux-x64-musl@4.49.0': + resolution: {integrity: sha512-hDMOAe+6nX3V5ei1I7Au3wcr9h3ktKzDvF2ne5ovX8RZiAHEtX1A5SNNk4zt1Qt77CmnbqT+upb/umzoPMWiPg==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.48.1': - resolution: {integrity: sha512-6kQFR1WuAO50bxkIlAVeIYsz3RUx+xymwhTo9j94dJ+kmHe9ly7muH23sdfWduD0BA8pD9/yhonUvAjxGh34jQ==} + '@rollup/rollup-win32-arm64-msvc@4.49.0': + resolution: {integrity: sha512-wkNRzfiIGaElC9kXUT+HLx17z7D0jl+9tGYRKwd8r7cUqTL7GYAvgUY++U2hK6Ar7z5Z6IRRoWC8kQxpmM7TDA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.48.1': - resolution: {integrity: sha512-RUyZZ/mga88lMI3RlXFs4WQ7n3VyU07sPXmMG7/C1NOi8qisUg57Y7LRarqoGoAiopmGmChUhSwfpvQ3H5iGSQ==} + '@rollup/rollup-win32-ia32-msvc@4.49.0': + resolution: {integrity: sha512-gq5aW/SyNpjp71AAzroH37DtINDcX1Qw2iv9Chyz49ZgdOP3NV8QCyKZUrGsYX9Yyggj5soFiRCgsL3HwD8TdA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.48.1': - resolution: {integrity: sha512-8a/caCUN4vkTChxkaIJcMtwIVcBhi4X2PQRoT+yCK3qRYaZ7cURrmJFL5Ux9H9RaMIXj9RuihckdmkBX3zZsgg==} + '@rollup/rollup-win32-x64-msvc@4.49.0': + resolution: {integrity: sha512-gEtqFbzmZLFk2xKh7g0Rlo8xzho8KrEFEkzvHbfUGkrgXOpZ4XagQ6n+wIZFNh1nTb8UD16J4nFSFKXYgnbdBg==} cpu: [x64] os: [win32] - '@rsbuild/core@1.4.16': - resolution: {integrity: sha512-t2684BBkqAh+dw/v00ySQc5P5SMul4a428L1qHwwIWFPAZ0bnus/hw/wI8nM2AQpMcKfJPkdyVSGm4ueCYPtPw==} - engines: {node: '>=16.10.0'} + '@rsbuild/core@1.5.1': + resolution: {integrity: sha512-ScXC3nm1drXDyT9OahHxXJ8Tg+1oE5IN2+ZwJzNl0cLJD8Jmbjl4zMUN7zZdRPqjaTCz67IAjws+HN+PSKHBaw==} + engines: {node: '>=18.12.0'} hasBin: true - '@rsbuild/plugin-react@1.3.5': - resolution: {integrity: sha512-L/GoHgJV4j+EQbI4KOhe5EscM0OHgnSat1eR0Nt5P3JZxpJV2ryO5Yfx5jElPWOkYZZCuk+EWhHWDQ4CkeC5BQ==} + '@rsbuild/plugin-react@1.4.0': + resolution: {integrity: sha512-YhhOUOonJBjnKpUf7E4iXKidldPWAGmYBRtDjQgcSmW4tbW0DasFpNCqLn5870Q2Ly6oCU06sLv+8G597I36+w==} peerDependencies: '@rsbuild/core': 1.x - '@rspack/binding-darwin-arm64@1.4.11': - resolution: {integrity: sha512-PrmBVhR8MC269jo6uQ+BMy1uwIDx0HAJYLQRQur8gXiehWabUBCRg/d4U9KR7rLzdaSScRyc5JWXR52T7/4MfA==} + '@rspack/binding-darwin-arm64@1.5.0': + resolution: {integrity: sha512-7909YLNnKf0BYxiCpCWOk13WyWS4493Kxk1NQwy9KPLY9ydQExk84KVsix2NuNBaI8Pnk3aVLBPJiSNXtHLjnA==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.4.11': - resolution: {integrity: sha512-YIV8Wzy+JY0SoSsVtN4wxFXOjzxxVPnVXNswrrfqVUTPr9jqGOFYUWCGpbt8lcCgfuBFm6zN8HpOsKm1xUNsVA==} + '@rspack/binding-darwin-x64@1.5.0': + resolution: {integrity: sha512-poGuQsGKCMQqSswgrz8X+frqMVTdmtzUDyvi/p9BLwW+2DwWgmywU8jwE+BYtjfWp1tErBSTlLxmEPQTdcIQgQ==} cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@1.4.11': - resolution: {integrity: sha512-ms6uwECUIcu+6e82C5HJhRMHnfsI+l33v7XQezntzRPN0+sG3EpikEoT7SGbgt4vDwaWLR7wS20suN4qd5r3GA==} + '@rspack/binding-linux-arm64-gnu@1.5.0': + resolution: {integrity: sha512-Bvmk8h3tRhN9UgOtH+vK0SgFM3qEO36eJz7oddOl4lJQxBf2GNA87bGtkMtX+AVPz/PUn7r82uWxrlVNQHAbFg==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.4.11': - resolution: {integrity: sha512-9evq0DOdxMN/H8VM8ZmyY9NSuBgILNVV6ydBfVPMHPx4r1E7JZGpWeKDegZcS5Erw3sS9kVSIxyX78L5PDzzKw==} + '@rspack/binding-linux-arm64-musl@1.5.0': + resolution: {integrity: sha512-bH7UwkbACDYT37YnN9kkhaF9niFFK9ndcdNvYFFr1oUT4W9Ie3V9b41EXijqp3pyh0mDSeeLPFY0aEx1t3e7Pw==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.4.11': - resolution: {integrity: sha512-bHYFLxPPYBOSaHdQbEoCYGMQ1gOrEWj7Mro/DLfSHZi1a0okcQ2Q1y0i1DczReim3ZhLGNrK7k1IpFXCRbAobQ==} + '@rspack/binding-linux-x64-gnu@1.5.0': + resolution: {integrity: sha512-xZ5dwNrE5KtpQyMd9israpJTcTQ3UYUUq23fTcNc79xE5aspkGixDFAYoql4YkhO0O+JWRmdSaFAn6jD+IQWQA==} cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.4.11': - resolution: {integrity: sha512-wrm4E7q2k4+cwT6Uhp6hIQ3eUe/YoaUttj6j5TqHYZX6YeLrNPtD9+ne6lQQ17BV8wmm6NZsmoFIJ5xIptpRhQ==} + '@rspack/binding-linux-x64-musl@1.5.0': + resolution: {integrity: sha512-mv65jYvcyYPkPZJ9kjSvTAcH0o7C5jfICWCQcMmN1tCGD3b8gmf9GqSZ8e+W/JkuvrJ05qTo/PvEq9nhu+pNIg==} cpu: [x64] os: [linux] - '@rspack/binding-wasm32-wasi@1.4.11': - resolution: {integrity: sha512-hiYxHZjaZ17wQtXyLCK0IdtOvMWreGVTiGsaHCxyeT+SldDG+r16bXNjmlqfZsjlfl1mkAqKz1dg+mMX28OTqw==} + '@rspack/binding-wasm32-wasi@1.5.0': + resolution: {integrity: sha512-8rVpl6xfaAFJgo1wCd+emksfl+/8nlehrtkmjY9bj79Ou+kp07L9e1B+UU0jfs8e7aLPntQuF68kzLHwYLzWIQ==} cpu: [wasm32] - '@rspack/binding-win32-arm64-msvc@1.4.11': - resolution: {integrity: sha512-+HF/mnjmTr8PC1dccRt1bkrD2tPDGeqvXC1BBLYd/Klq1VbtIcnrhfmvQM6KaXbiLcY9VWKzcZPOTmnyZ8TaHQ==} + '@rspack/binding-win32-arm64-msvc@1.5.0': + resolution: {integrity: sha512-dWSmNm+GR6WSkOwbhlUcot4Oqwyon+1PRZ9E0vIMFHKGvESf9CQjgHAX0QE9G0kJmRM5x3I16J4x44Kw3W/98Q==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.4.11': - resolution: {integrity: sha512-EU2fQGwrRfwFd/tcOInlD0jy6gNQE4Q3Ayj0Is+cX77sbhPPyyOz0kZDEaQ4qaN2VU8w4Hu/rrD7c0GAKLFvCw==} + '@rspack/binding-win32-ia32-msvc@1.5.0': + resolution: {integrity: sha512-YtOrFEkwhO3Y3sY6Jq0OOYPY7NBTNYuwJ6epTgzPEDGs2cBnwZfzhq0jmD/koWtv1L9+twX95vKosBdauF0tNA==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.4.11': - resolution: {integrity: sha512-1Nc5ZzWqfvE+iJc47qtHFzYYnHsC3awavXrCo74GdGip1vxtksM3G30BlvAQHHVtEmULotWqPbjZpflw/Xk9Ag==} + '@rspack/binding-win32-x64-msvc@1.5.0': + resolution: {integrity: sha512-V4fcPVYWJgDkIkSsFwmUdwC9lkL8+1dzDOwyTWe6KW2MYHF2D148WPHNyVVE6gum12TShpbIsh0j4NiiMhkMtw==} cpu: [x64] os: [win32] - '@rspack/binding@1.4.11': - resolution: {integrity: sha512-maGl/zRwnl0QVwkBCkgjn5PH20L9HdlRIdkYhEsfTepy5x2QZ0ti/0T49djjTJQrqb+S1i6wWQymMMMMMsxx6Q==} + '@rspack/binding@1.5.0': + resolution: {integrity: sha512-UGXQmwEu2gdO+tnGv2q4rOWJdWioy6dlLXeZOLYAZVh3mrfKJhZWtDEygX9hCdE5thWNRTlEvx30QQchJAszIQ==} - '@rspack/core@1.4.11': - resolution: {integrity: sha512-JtKnL6p7Kc/YgWQJF3Woo4OccbgKGyT/4187W4dyex8BMkdQcbqCNIdi6dFk02hwQzxpOOxRSBI4hlGRbz7oYQ==} - engines: {node: '>=16.0.0'} + '@rspack/core@1.5.0': + resolution: {integrity: sha512-eEtiKV+CUcAtnt1K+eiHDzmBXQcNM8CfCXOzr0+gHGp4w4Zks2B8RF36sYD03MM2bg8VRXXsf0MicQ8FvRMCOg==} + engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' peerDependenciesMeta: @@ -2257,8 +2257,8 @@ packages: resolution: {integrity: sha512-VynGOEsVw2s8TAlLf/uESfrgfrq2+rcXB1muPJYBWbsm1Oa6r5qVQhjA5ggM6z/coYPrsVMgovl3Ff7Q7OCp1w==} engines: {node: '>=16.0.0'} - '@rspack/plugin-react-refresh@1.4.3': - resolution: {integrity: sha512-wZx4vWgy5oMEvgyNGd/oUKcdnKaccYWHCRkOqTdAPJC3WcytxhTX+Kady8ERurSBiLyQpoMiU3Iyd+F1Y2Arbw==} + '@rspack/plugin-react-refresh@1.5.0': + resolution: {integrity: sha512-pYOmc1mrK8Ui/7VWUgjKt9YqrxFn4woURTgGpFYWwsFvJxmWm05zog4fUbChvErbaBHkx1aA+KHxIvM/6tFODg==} peerDependencies: react-refresh: '>=0.10.0 <1.0.0' webpack-hot-middleware: 2.x @@ -2471,8 +2471,8 @@ packages: '@types/prop-types@15.7.15': resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} - '@types/react-dom@19.1.8': - resolution: {integrity: sha512-xG7xaBMJCpcK0RpN8jDbAACQo54ycO6h4dSSmgv8+fu6ZIAdANkx/WsawASUjVXYfy+J9AbUpRMNNEsXCDfDBQ==} + '@types/react-dom@19.1.9': + resolution: {integrity: sha512-qXRuZaOsAdXKFyOhRBg6Lqqc0yay13vN7KrIg4L7N4aaHN68ma9OK3NE1BoDFgFOTfM7zg+3/8+2n8rLUH3OKQ==} peerDependencies: '@types/react': ^19.0.0 @@ -2484,8 +2484,8 @@ packages: peerDependencies: '@types/react': '*' - '@types/react@19.1.11': - resolution: {integrity: sha512-lr3jdBw/BGj49Eps7EvqlUaoeA0xpj3pc0RoJkHpYaCHkVK7i28dKyImLQb3JVlqs3aYSXf7qYuWOW/fgZnTXQ==} + '@types/react@19.1.12': + resolution: {integrity: sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w==} '@types/resolve@1.20.6': resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} @@ -2567,8 +2567,8 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} - '@vitejs/plugin-react@5.0.1': - resolution: {integrity: sha512-DE4UNaBXwtVoDJ0ccBdLVjFTWL70NRuWNCxEieTI3lrq9ORB9aOCQEKstwDXBl87NvFdbqh/p7eINGyj0BthJA==} + '@vitejs/plugin-react@5.0.2': + resolution: {integrity: sha512-tmyFgixPZCx2+e6VO9TNITWcCQl8+Nl/E8YbAyPVv85QCc7/A3JrdfG2A8gIzvVhWuzMOVrFW1aReaNxrI6tbw==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: vite: ^6 @@ -2691,221 +2691,224 @@ packages: '@xtuc/long@4.2.2': resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - '@zag-js/accordion@1.21.7': - resolution: {integrity: sha512-pRgo78OwzpvnPsXBVPCEaLPoL+hbmAWk5MFbT86VhcSKkJt4SGGpBcpFxXxCwvLEB/+/8dNXn1Q37MkONhY41g==} + '@zag-js/accordion@1.22.1': + resolution: {integrity: sha512-P3jsauxnAGKBhuqs9gdivjEiSu7N7KnKRlgWlIpyti35askz8swHsqxsfkc2ASs9tcPKnPvuZDHIxXmJmZSLuQ==} + + '@zag-js/anatomy@1.22.1': + resolution: {integrity: sha512-I5OvOuJBt6hEqbpqVkWCOEoDfGMnKuLx+S0h7Un5SyAwnif3F1dSqDYujU28bCy8FtKs36vsq/izxufXyiXSEg==} - '@zag-js/anatomy@1.21.7': - resolution: {integrity: sha512-efILCL7IvlAkwU+FEeInSYHrvObDPnTJAMF5XNOhYkL7LtSlGl2lcWKrWg6I3zWYElQr3q2B8nrkI+FYx2mnlg==} + '@zag-js/angle-slider@1.22.1': + resolution: {integrity: sha512-Nitjwwo2NVUEK+PabDnOfqizErnFIZZKThtcpQikAhE1J4MX3H128MANu1hJXNkvVYXyZmhTvzjt6XZc2j7YyQ==} - '@zag-js/angle-slider@1.21.7': - resolution: {integrity: sha512-D4mbQVtvNfmHik87VhxPEXC1SHB373EfHDA7aO26/u823sl6LgdbfK8dzf/vF42sfLaFrpFxyULdMEwSXulg1Q==} + '@zag-js/aria-hidden@1.22.1': + resolution: {integrity: sha512-vPfAE35BfYPS1UbYRcNw8/kMl7uayE7LyRncK/gPMnoQMjmEKW0nXmD5WlCHFLdGX9WFGYTIde8k4U8ay+oqcg==} - '@zag-js/aria-hidden@1.21.7': - resolution: {integrity: sha512-vgumdnvbRhNf4o1tg2iuYS9wMWy9EdrDnsAKv6wslS9hgEAKunYI8phbrlxd7v8Va9PVJMYdEUIbaUKs6VqQuQ==} + '@zag-js/async-list@1.22.1': + resolution: {integrity: sha512-/evBfhDW3Rj3An5fHW8SYINM/pkxeOe/Uk7rRlBreHVn2PdAay4sj1gax4hlUUFEbqyvBgbHpR/atwfdxSuWYQ==} - '@zag-js/auto-resize@1.21.7': - resolution: {integrity: sha512-gcG0rXYuFa9lnzpsaXgpoVVV016jg9rU6YKXgs9qtLk+JBWWrJn+NH8LWfCr/QHlpBSyZEqXYz0L1zzhCi7v7Q==} + '@zag-js/auto-resize@1.22.1': + resolution: {integrity: sha512-O+tKmqwLko74DCmwdouxBZqEtIQB6Rt2pyXdlyBXLB7UnYXEIvEUzf8XK39I5AHXp6NlLqx77GtLn1qiBtKrkQ==} - '@zag-js/avatar@1.21.7': - resolution: {integrity: sha512-P+vc2QB9eRKcNOce2gi7rTq0ylM5tRsIOemXewCaIhhXOqqLPlxaTJIih0mx8Qd0+qBN+lSW2MhrDLg7zMK3cw==} + '@zag-js/avatar@1.22.1': + resolution: {integrity: sha512-SAz9XaFD8jg4LODkS51s6KrNcYF/PvAcRkCE9TDiuiCeFdgB6+JFKBNk0iM9og8Tk4Doe/3qIA/I12qKNW9pAw==} - '@zag-js/carousel@1.21.7': - resolution: {integrity: sha512-/J/uNGYXwM9v3oHQOnuYx/9Q1aFyg/S6dHZZ09dYLj7npUtBBKhq3gFrE/xive2jcmIChuKICmaTFTUDEj0w0g==} + '@zag-js/carousel@1.22.1': + resolution: {integrity: sha512-bFbCRe5xarBtD3NnozHmCmrGJ+nLRhqLQFq+RG13fl1hlhUJaJ5AsS7e8L1r2ZLdbVVrsB0lUuW/ocfJ/G4MSw==} - '@zag-js/checkbox@1.21.7': - resolution: {integrity: sha512-CeMlEHgvYMj8SnlCOXRwvcTnumEbpdCSnpb2emn+2KUrZsBNYRhoPPAdBO0qlK2u0PRz2WtiPwh4jLPt9Y8arQ==} + '@zag-js/checkbox@1.22.1': + resolution: {integrity: sha512-A/cZb89Aeb2k/KGl3ITS2fuLBXwq6Rnq9aFirfKs/UHrY16fopRbRjfqOxF6wm8lWoFk3gqmRGgybo8qsIfxog==} - '@zag-js/clipboard@1.21.7': - resolution: {integrity: sha512-NjdHwMyfoT93sTcKfFEsRGMaL36fxwFzXNMS6cOInwan5KYEg/0Jyq6cxr50Nb9C9WgBAMsXJ2TMlfJbN+YtxQ==} + '@zag-js/clipboard@1.22.1': + resolution: {integrity: sha512-rKTPRKvLtcJ1c/CDvnWDRpqAteFS20UQe+mQpO83ACMCRZAfkXP3UOzBL53mh59+LIVlDxgZbMlwRiNiqqKhmA==} - '@zag-js/collapsible@1.21.7': - resolution: {integrity: sha512-B1GC/hqDi5N+aWRHVDbHFDlfAzl/co87aDBLPYrwOBVfZFAJzqS+o5JLBVrBCfl2E6yWtquNq4klpoUaM56fSQ==} + '@zag-js/collapsible@1.22.1': + resolution: {integrity: sha512-vKfDe/fzm3ndDfaueqW/XgGaWCHVD8MuLFtRRyv3jX3ubdNYn5R/j7ftQURdYyqRlPI3Si50FWSAtOqtvs4y9Q==} - '@zag-js/collection@1.21.7': - resolution: {integrity: sha512-KzxLN30/S4zH9gaut8WlIzx2MNcA46QuKpPMglj+OrKCdT1jiK9zARvISwRGSziFQXxgn5Aw6yzYvNwbYGIp9A==} + '@zag-js/collection@1.22.1': + resolution: {integrity: sha512-jjeSKALTH3iK2vTI6uAh2NCtS9n+e2r1cGERKCfNkbt86U6VSp9xiXqalUsEI4ovNIPcgg0+/nzixoVwFO1Vgg==} - '@zag-js/color-picker@1.21.7': - resolution: {integrity: sha512-xKukVvj1v/mf9T54qYW3KA1uaw+lDPBCHvrMEEGb58mNmaL0rDFJlyFTYOhP8+Sg4yvlgEQLph9jarAf385vxQ==} + '@zag-js/color-picker@1.22.1': + resolution: {integrity: sha512-vUx8Ef0CZ/VPARIPh2ur76HH1AL3FVObNgtX64kPNUDUI+Z/L/q6CBfIeGcElVQ/Y6QowrqAXjVyPGArmmohmw==} - '@zag-js/color-utils@1.21.7': - resolution: {integrity: sha512-4YfyGfCvlIb0K0Sr9A7izuCA59pSRSuXX7su5QCyGS7r+HOv0ehkJeIZ2S1+AWn2gWRFk9A24CPHnHAZDgiEdQ==} + '@zag-js/color-utils@1.22.1': + resolution: {integrity: sha512-Bee1KvYOV0yWQbODN+O2zPmdUaH+rymEmIHLfKNipPo5GVmxWqAe8oTQDyquzsUtoPE5MFgW5avg8tgSlCFcBA==} - '@zag-js/combobox@1.21.7': - resolution: {integrity: sha512-XkK+y2XkfWAIUdYJEN66bBs7NeVq1TiWwJAh+jR4C0l2ZAuGMQcsGBVAhKQBfya9byrndLFx1ybPXphgWk1ZRQ==} + '@zag-js/combobox@1.22.1': + resolution: {integrity: sha512-N4tGTmezfHGaKB0+aDB5yMuVzBv2ShgsAx1uizom6ElcvlYD2rsQTr3xLc4wyOR7fx0z6fFDo1+63/Dt3y0t4A==} - '@zag-js/core@1.21.7': - resolution: {integrity: sha512-mFaygzRqRty/tKo6bAvSioFQevFXJ/9LEKUovObEzriNBgrIFwxdrRhHmua26fpFimZJQeVZk5qePBKLy6xvGQ==} + '@zag-js/core@1.22.1': + resolution: {integrity: sha512-4BNrwO9Tadq2Z0d2xSSQs4O/o3OarEHzXM2FQqx46vrwSE57qUghnZex429ZQ51fuk8AL5Lowt26a9JxE9sVPg==} - '@zag-js/date-picker@1.21.7': - resolution: {integrity: sha512-STMxblsONzYzvaRFCkeNIQCEDSEFix9D9gLTqCdSrG7fmhjoKz1lIGpRCTj20hlwhPn6J6B0cwxcocdZxxaLUA==} + '@zag-js/date-picker@1.22.1': + resolution: {integrity: sha512-ja482LloO7AGfFYXTfGV+qV484QWUM1cnF3hWtROd4Vdx/NONwn0w7TEJH+XbO3HaoUC5XpeacWLFQugGCsRjg==} peerDependencies: '@internationalized/date': '>=3.0.0' - '@zag-js/date-utils@1.21.7': - resolution: {integrity: sha512-HR1ZsoQoiZL5Jtgfs+MGh0eJ33lHwMQa9d0yhBmjeOy7yuwNvD77wjn4oFiLi7qFkwQKRsimJluDIDblXRtJQg==} + '@zag-js/date-utils@1.22.1': + resolution: {integrity: sha512-OWIWxihfFFyQDEaA35a/Fdfp3+GyGUgTUbutMD3BrbnPjKNLm0RyvAgZiq0zPTY7CzpYRbZ2J98GDU+CTERCjA==} peerDependencies: '@internationalized/date': '>=3.0.0' - '@zag-js/dialog@1.21.7': - resolution: {integrity: sha512-nS4FO0580Ijp8xjaOnyv8/VEfcd8MZ2X/3UEo7Y+A1paryXpvfgJ1GyhHpSXA/HWEW9g/TYG30Vj8sgVyDxZIA==} + '@zag-js/dialog@1.22.1': + resolution: {integrity: sha512-b5KwMPYKc9RenZwxrAAHu6aHPz7tqPy4Mxa/YR5zo1pXBV4amA7u2xnqyncRaK65Z7y5QKmpmDuBp+0PnXxNIA==} - '@zag-js/dismissable@1.21.7': - resolution: {integrity: sha512-hAJkAycdFfIYcv/lx28s4Kpo1PM1ZwV7n/fCa5w+r11NEMVdEKsqnIl/k/icI7HwkRivB7mePW2CCTkJCuMiLw==} + '@zag-js/dismissable@1.22.1': + resolution: {integrity: sha512-0DzbykJu9QoXYw4Zcjte69Mtk6ThNRCXWxxCKBf930V8Bw3Ha7vfY5bgdb4RFT5K+BQP3E8vLT+PzIaDINn2Xw==} - '@zag-js/dom-query@1.21.7': - resolution: {integrity: sha512-3oU6tbauM3D4558CCHULgbw872YHZ537pHDOdr9Q3rzUgFkEvSlxKpDAomsCwLSmgSkeUxLikiep8WV1ZXaYDw==} + '@zag-js/dom-query@1.22.1': + resolution: {integrity: sha512-mtvGj2z3rkl40mkjd+QwoOHvxqpiOkY4mtVjzNzgzcbVtUN63Mz7giW8OZB+KLy37hwFX0B8JfiQncU8IOHNpw==} - '@zag-js/editable@1.21.7': - resolution: {integrity: sha512-25GI8BopcVjKMwATzXjAgXDLazZiD6e7ZVoPE+YrRO0TTsU6QNN0sGjrst5TsOQXx7oORcA6xR9kjElZjzY6Ag==} + '@zag-js/editable@1.22.1': + resolution: {integrity: sha512-NY7VeKYuNLQzi+yZYmWliif0Qd/2PTKtDeqtnVypv8XSHqTbVeS2N9dqTru1g4RP+eGQWx0za12hjmCVU4DuMQ==} - '@zag-js/file-upload@1.21.7': - resolution: {integrity: sha512-Ngber4zUw7CAylxTvtDBV0bhrgh6LwTBdYRph12Z9W+f2AVVBKyhlG1Y7nYJ03nrmhCcu9d43YwVE9x18jSF1Q==} + '@zag-js/file-upload@1.22.1': + resolution: {integrity: sha512-4iKpqxVLafLbQejcPoZcygtNURsezIlWRigHvVPd2pLsXPa8erbdcEZ8X4QvGp77xcW2QTkuSxB+BSCrEEAotA==} - '@zag-js/file-utils@1.21.7': - resolution: {integrity: sha512-cT4Z+W3iQ7kjOeuC8ASvgrgyrePtkWvy3daMZBrkJALS/pU6TCTsS8qm8u/3bjb/GzKLxxsi4UccMrxCAmXgIQ==} + '@zag-js/file-utils@1.22.1': + resolution: {integrity: sha512-cZAJ5MAZCe7IfHfN+3xSNb9e6mA812U8BPJr/jNPN+qLQh/PkQDwKaGM33o2Me50r18iGTAswEkETnaFZt3wkw==} - '@zag-js/floating-panel@1.21.7': - resolution: {integrity: sha512-dhK3hrugUVHoDS5Y27RLAn1dNrsOw2CTA0U6RWGx7oedzM20/PqO/DTuU/F+7gtbteLmW98PvXBRbV2uPyJTJA==} + '@zag-js/floating-panel@1.22.1': + resolution: {integrity: sha512-YGjLoYt2xSk4pkTgsR0z/7U7V5OdaicSOZa0HDtskH4MkKPxQxrgf2G4e8dNsw8hnQwfVuoc0RGPGW0BArVr6A==} - '@zag-js/focus-trap@1.21.7': - resolution: {integrity: sha512-I4coXNhqtnkBOv7HFu3YOUceK+t3wzb1Fj1farFhkLmAMEnF45wpmdUHdXIZD2IUO8KusvHybMNfAgiB3PncKQ==} + '@zag-js/focus-trap@1.22.1': + resolution: {integrity: sha512-6W9cG0LEVICt0srVfWSpamKzsnRxXMdl3gV+GQ5HvkCCk1Sw6Io4tc3QvSSvaWcfyhM07feerOsa2ah7qiT/ig==} - '@zag-js/focus-visible@1.21.7': - resolution: {integrity: sha512-0rcXo3QhHN3wbv+fQ+JTCSRv89PRMCs4NjnYi/6smXpEQ4dcsLpN8od+hp1JhiSvYUcoVqF5Gb2Jtj5ICWCxfA==} + '@zag-js/focus-visible@1.22.1': + resolution: {integrity: sha512-TuBEux3UTivo9VXPPe79q9JfTwaP/uIshL1KPifg51ofGYesWjMGeE5S5MAuaSzUmH9+3CpnwP7h7f65s3D0kw==} - '@zag-js/highlight-word@1.21.7': - resolution: {integrity: sha512-WlD9QH+EWy0qI/mJ3GH1Bbg3dvUnMaw23y1gtS5UXP3axMnGUwtXn56rdfVwB9HUaTC/dnHQ/IlFeUZEY3a/6w==} + '@zag-js/highlight-word@1.22.1': + resolution: {integrity: sha512-mcPg4/ED3MNDzj5b3t4EEIKkvdyvVUJ9pqbyRUoj76KI+ZWXXJIw5PNAkG5vUVVUXKKjfzPVninIqWv1Bh9Bvg==} - '@zag-js/hover-card@1.21.7': - resolution: {integrity: sha512-5NldOslgsUkKAnQsdlaGbSLbOdc/XdhR14dTrjAyEhOTUpeJv6tNnVxJJxTWgOi1/76tfTZ7eytpjQGu0p5GMQ==} + '@zag-js/hover-card@1.22.1': + resolution: {integrity: sha512-sGcWASPrt0f8oOpBdyDyka0Mkya4TdlBEOvB9qOvnkcIX2bc6YFUtWQN1L1M/K6nv8D0wSZK0p18JBaqGlHmBQ==} - '@zag-js/i18n-utils@1.21.7': - resolution: {integrity: sha512-s+dxmQZ4F5whWtcRXzEZ/Gi0H6fbJNkVcri1nLfa3w/dXIX/O7CTYbD2WA4ilxgDpq2K50LdmKOiy1FyAggCuw==} + '@zag-js/i18n-utils@1.22.1': + resolution: {integrity: sha512-45KUYB9tu1br6NmgtaNW9NviozYCYUxJ8aZTI/Y6vKotXK/Pn3bIlaiOaq4Zel7TalGYT8gVnwgPe2E6H5sqTg==} - '@zag-js/interact-outside@1.21.7': - resolution: {integrity: sha512-Kyk1NiezatK8JXrTnErCtj3T2/VD+VgtntXbMQyaxd181KIHaeE9kcV7Y+FhGJ4XOCOeIm4C1Irn1gGo7IJwmQ==} + '@zag-js/interact-outside@1.22.1': + resolution: {integrity: sha512-+iZ3xHC9+jVo2FCC4B9c9ntcXv19shVOqQGDr2cD30Hwmwtm9kCOdVydMqv3Lp3UhR8a105MXEVUAKg53WbCoA==} - '@zag-js/json-tree-utils@1.21.7': - resolution: {integrity: sha512-hepOzIbGZd2WX4/ZKydQsspVj/pmWW7UsiB5OnrKV4CAsdP0XIo1QB8xdOwGAez58huhWIr7l1oN+pTSaClC8A==} + '@zag-js/json-tree-utils@1.22.1': + resolution: {integrity: sha512-z/15CTtXJHGUvecAAlPnUAaAK83Wxh5WlW9qEpgXlXdB5k7gnWVzH4qN9vDwlSShyZgqaFVqn+muxqaCTYv8Zg==} - '@zag-js/listbox@1.21.7': - resolution: {integrity: sha512-M6rEZ1QLAFg8GUnw6vcwBLoSzjizcF9JhYK0fcz7sWSSRCw1g4q3UxDvUjWnRvLPxm6ijpnuzGRoGMnaQ4uFbA==} + '@zag-js/listbox@1.22.1': + resolution: {integrity: sha512-M017Oq0s9PRR5ZwlJkmLhQHucEta/DZ5eHl/t+9yQqHnYRwWKo2ZXLyXquC1wihbHk81E0a1veDw8vBYpfRovA==} - '@zag-js/live-region@1.21.7': - resolution: {integrity: sha512-xvjAjx+aMP3QypMWz8broq1s1EDDYt94VBemrOgrM3eLE5KumZ4lTI1o0Jmh2gNxzJoO65BBk26/ePrhdEjphg==} + '@zag-js/live-region@1.22.1': + resolution: {integrity: sha512-xjrlCbcgIw+iXxSXnjXAv+WX9r/bMwp4HOIxWOD99360XvatQ2ZGhLH9lfixiXeHLvm6hjWsP92MjYefSLDFSA==} - '@zag-js/menu@1.21.7': - resolution: {integrity: sha512-xc+AhLtpgXaoVMwVaNU0A4N/WJBmp179y4UxrkqV0c+Maaou6CIFO1B1t5K+I9ts5X+jLPz8uMu7Rl16ybU1gg==} + '@zag-js/menu@1.22.1': + resolution: {integrity: sha512-a5pgQgcpVTVyY6JM8k1WGqelHVKSPwV2CwOv2oGjHWXIr2fpRCAKqZRtytE5PvUP/CZArk8bCjatmgOWe1RdPQ==} - '@zag-js/number-input@1.21.7': - resolution: {integrity: sha512-klF1oqWO0+w/AKNN/2iUZ5WMAGfElxawLHiHF5EosfMJSTNPmrwbiqW45/apHsafoCteE+rYoiTffXr1iieJXw==} + '@zag-js/number-input@1.22.1': + resolution: {integrity: sha512-E4DROYvSo5TFJMkSmnq+f75wSTL/N7SK6MR8ssNlA2oQp69iVWXhIlFLe4knekX02QJzK1MF97aVU332kAYTeQ==} - '@zag-js/pagination@1.21.7': - resolution: {integrity: sha512-tOF86rSLK+iSD5wdsDR4LcxdbPM0jozQzyQ4gMpvPnD5DNstx4p16tE66UErt0tJPXA66Tpxq/PYZ5z9ZYIZQA==} + '@zag-js/pagination@1.22.1': + resolution: {integrity: sha512-Jeix+sXcfMPm5jer2W4PHSUCgu9a11aC/AOBk6dkxbX8XL23fYXJu5YyOVVq0iQIDWzX4Uij1N/vBha64ARmcA==} - '@zag-js/password-input@1.21.7': - resolution: {integrity: sha512-ouSI8ick5bVH+VMHN3AeOVWxicnU/RAseQgnMnaDbFhQpH4D1KKlxkvtYkTjJsHEiLYnKjKXwJ6v890UgXg+oA==} + '@zag-js/password-input@1.22.1': + resolution: {integrity: sha512-EcCH0V2tbJbexy62nVDUXCMg/XVEcd0PGcBgUfziyaLlDnJz2HWkfe0MzpEiidJwfJfhvvf2DapX9mAyqzZhhw==} - '@zag-js/pin-input@1.21.7': - resolution: {integrity: sha512-c8LivZNcj/A/XBDATBJATFUgZty4fANjZUKRMplXhv8x8Ug1Keyxl6ZWN2h85SrL7vVi3wFhWK6RKtGk7gxuQQ==} + '@zag-js/pin-input@1.22.1': + resolution: {integrity: sha512-tyI5mVi+zmsDEVuZZTOA7fVyxxGwmD8A2snF6nRkFK11o5xnnZaXt44Z7XrPeljTMSLKt+rdF0y/9Q05Auc4tg==} - '@zag-js/popover@1.21.7': - resolution: {integrity: sha512-Iz8Uz3iBEvND9ijLhdglQTosrahLqqA8l7kAfezjsaZdQk3P4XrjJmILzwIr4E9S7aunyDBvra4oAG8qu+bBDQ==} + '@zag-js/popover@1.22.1': + resolution: {integrity: sha512-27VVkhaEOtiHJYj2j++AzYlAzpMcW0ED05TV9wIT1q0EYzASWxweSBajbnCiQf9TIYzCImDiNVDaCMl5D+TamQ==} - '@zag-js/popper@1.21.7': - resolution: {integrity: sha512-Y017a4+eKNTeJhdgkrZMOhpEoLsr7RklRWM0J2A29w/pAcvDny6HERAJJQRwaWU8W305dNrfrUYgMjzCGfPnQQ==} + '@zag-js/popper@1.22.1': + resolution: {integrity: sha512-vBI5WpvE/3ugsimjZaNisOwcECiYfzc+3LIJwaU8od62kInZ1XF6m096BvV7JGwP0FjkMPJrgjcv7weDtY2iDQ==} - '@zag-js/presence@1.21.7': - resolution: {integrity: sha512-0yuQx7182boWzwZ28rTL3dtryIfBixggoSdH/6772O1eiAw/M3bWV5F+Zs/4ox0AqViznrM9/08m4S0OV7BsGw==} + '@zag-js/presence@1.22.1': + resolution: {integrity: sha512-9+pkKnjcHbNxk/80HzLdDjpiKGV/I208wAe0Njmej6q6Z79ED6cb7tXiOgAS7w/ZLWxwQW7B9oMJ3guVflBHwQ==} - '@zag-js/progress@1.21.7': - resolution: {integrity: sha512-BQZ+f6BV9rHxfuaLVUJqF24wTaLNHASxDq91LVbxz9F94wCL48tf4cHYsRA7tP0CvK6UZM2rCPlSKe+u5hSukA==} + '@zag-js/progress@1.22.1': + resolution: {integrity: sha512-2U1IJLb1mhBLEgac8x8qaEv3qgr+pHdw6pn9mCCJVBcyFaSqliWps6X+vi+qKokFLrpjCjdAKuuf48ItNfFFcw==} - '@zag-js/qr-code@1.21.7': - resolution: {integrity: sha512-rS9oF+YKuUXReCqX+eUkyISe+Zz7481QSll2ITWKXjWleV3HEKjB9QAX/Ta1b98GuRiiegEvnstYc607g7MrlQ==} + '@zag-js/qr-code@1.22.1': + resolution: {integrity: sha512-HIRlNsPNcp5buiTZx7DrX/gCtouGAH4VJc8Q6HBUkaBbiiijVEuYN0aNAjZIdm2pDtrh4KaYjMPuIH8IrV554Q==} - '@zag-js/radio-group@1.21.7': - resolution: {integrity: sha512-L8Ufz2x/OyWYkHv93vKPo6DDmpBJcxnEy2+paymPtSvtQtDB4Co8TyKZffX8s6mp8WAguR0kWBGa4P/bD+Avlw==} + '@zag-js/radio-group@1.22.1': + resolution: {integrity: sha512-eqvY1y/Ui4nQOU8XE9tGShOCbI/YdSHFeH/tDJe2Yy+1kqO4bENxFJ3R1P097KusJgeb2SYzhID27whUslOq7g==} - '@zag-js/rating-group@1.21.7': - resolution: {integrity: sha512-0shQctnULQ+uMv/Rod8qczksugPZJ2ggMQ58l7j2HuE+Y3+a8qMx9SIRMqLaHeQ03CYgZP9BjGNX68Jxp45UYg==} + '@zag-js/rating-group@1.22.1': + resolution: {integrity: sha512-QxBK+hpfkQ4yFHUr1YOSwEQ3LuTrdS32J9zV8UyHu8HbgwzfR7L8ZAa1PUUmG65tupzua2pbn1NioOkMvDmBOQ==} - '@zag-js/react@1.21.7': - resolution: {integrity: sha512-gnJcR+IYXhFG1LTHCC7XXnhWqD8wP7zutmJEncNltNLNAgGzv6OMcIwMJIIYL55Rb/okNjpGDnDMMH5JuxkR3A==} + '@zag-js/react@1.22.1': + resolution: {integrity: sha512-TcIKkNo9EFel+d92nb7104voKJNDiMkqq9nn7Ozq/TE8A62JPf5zk8y8zqoxTbGDTTk+tDjW7Sm1IKb4r6rX4w==} peerDependencies: react: '>=18.0.0' react-dom: '>=18.0.0' - '@zag-js/rect-utils@1.21.7': - resolution: {integrity: sha512-KTgUksXH3TlC2sLl5np8bhPQp2P7x+qPj8CHQg2xwA4e9XkjwI29mXOZlz1Ww3uj1yNBabomBsIQpPQJW+Jf+g==} + '@zag-js/rect-utils@1.22.1': + resolution: {integrity: sha512-jtI03SR9kF0AcBffoFI/TKXn5KyhjNCtsGlqbWw0dKbhWTNy1v432FDC5opmmnH8W5LjjWebIzo4QtO5+632QQ==} - '@zag-js/remove-scroll@1.21.7': - resolution: {integrity: sha512-RzbyAVuvMz2sQH0Drti7v3ac7KIqr3NbltzMl5cQ+apsmr/PTjZzk/VO5lf3ma8Y4ERgn90fX+f2lZgv0USBNQ==} + '@zag-js/remove-scroll@1.22.1': + resolution: {integrity: sha512-2TrS8ljp8SADX5xRB/+KGBCBYbYTeH0k5IEalG2rt8ReNyNAW1JfCrm53KCVoCg9YmxKF3MrxPgPT83MNFsJhQ==} - '@zag-js/scroll-area@1.21.7': - resolution: {integrity: sha512-ge8CD2wXi2T1Zk+DvgnHNOCG0mKJb6hx2XoEHxiqVYsRdyLXS2hBnCxRA7HYIoJ3P82YWOPVEXq0jjw8UTJylw==} + '@zag-js/scroll-area@1.22.1': + resolution: {integrity: sha512-BuWKGR3n1yMktYqfTx+U9iwpXkJJhDXW4yin7u/lLMAE0DXR4byyo8aollCkuzZdZbK7NmUG2zVQHUMZ1QaR6w==} - '@zag-js/scroll-snap@1.21.7': - resolution: {integrity: sha512-I89BpSlxHAD9oTsSB2j+10eCvl7lO8eiryDXPinyWINqQ383dmQKsC4Shas5FRbmIdT2TghpN7JPS6ydbNppuw==} + '@zag-js/scroll-snap@1.22.1': + resolution: {integrity: sha512-kctqJiteALaavoHEpYBDSPgUErIdwAoY5jcrU4Mq5L8FjtI4tSNr8BWcXzSBK2UVqaKN+vDo+PDcj7XIXTUQJA==} - '@zag-js/select@1.21.7': - resolution: {integrity: sha512-EpzJSDxhd1rYyg7xmrWgYH94LRl4eurxdFprZA7J/h/exQoNkYg7txfHkD1vmFVJYUpnbB7DR7/lVy7IAhWbWg==} + '@zag-js/select@1.22.1': + resolution: {integrity: sha512-sWq0RqlJvmj0heJDpfS3OfM1ynSSCW+fYY5v3T/QyH4qneqB8OJjgh8EEBaHlOkbqv/oBsk855U8/o6jegfUxw==} - '@zag-js/signature-pad@1.21.7': - resolution: {integrity: sha512-b7aWctlrKR8QM0TYUsCSqPr7s6PcFT3Fh9p3cI4HYn0thhJjkW7XnIdiljlTAta3MsC9uK8x/IvlwJ8SQMgj8A==} + '@zag-js/signature-pad@1.22.1': + resolution: {integrity: sha512-iD8tBCHSmRI6kdtHO8dNRZrfjGTxfWgweLlNXKu5JV2JkzPBhDCxpthHI9k8LJ0cgUM5/EW4HdEpjO9h47FsaA==} - '@zag-js/slider@1.21.7': - resolution: {integrity: sha512-luZdHZVvqgLCyWyQ2vsgBPXT8iEqEXk6ZGP1Y9sLwZrlg+iWTAZXaqVFNPjMw+xcFc3985lG6bn3qld/WkO0jA==} + '@zag-js/slider@1.22.1': + resolution: {integrity: sha512-aricrX99r21RAS9TyPNTJL8gE8mNRSQMy7TIXTa9aoeRjN0Cf6+PSksKfmPdP9l249/nplGqvC25Ck7XUVJn6A==} - '@zag-js/splitter@1.21.7': - resolution: {integrity: sha512-Ub327Wu8myap1N15lF8fVgrgZ8dprnRPbYWXCPRy8m6L/YQerSlFwBnLZQok/AaNnZzydNx4DjyoGGoZByDjsA==} + '@zag-js/splitter@1.22.1': + resolution: {integrity: sha512-ZMuFlVvqO2WYD7AECEB51iiFpN7A30Q28NfkIVR98xugwUX1OJq1IizKRSbLgC/LmseHPp3OvotxjZX6FqkK4Q==} - '@zag-js/steps@1.21.7': - resolution: {integrity: sha512-pvYGlWKMZCh/h12101AJCdMAJ0zyx3k5cv0SbCxzzxuXUsaWPIOPzAwTIudmDuiR72TiqEOUOCZc5eTJGJub4Q==} + '@zag-js/steps@1.22.1': + resolution: {integrity: sha512-eJCHbHG9aGAbzb/IQCqpmk6fmwSmIfocAxNKVTljroD6OHkBtqgaZQVS3q4xyjz61nB/d/0ZlsvpCVjm1EhwBw==} - '@zag-js/store@1.21.7': - resolution: {integrity: sha512-NSB3B9w1jZRr+j4RiSsEIavq0Q5KVcuQtITAst6XvBdrr4ZXkezOw6OA9MovGeaGrgUfRhzCHruMDiNHUtlUcQ==} + '@zag-js/store@1.22.1': + resolution: {integrity: sha512-KrMWi/Fa4cqOjx2zDSMIu6vztFYik+V3K6VPWRVONM4FkboLpTqAEayzwgTTNqMK9iYYZIYjhiPhAVLW9iLuBg==} - '@zag-js/switch@1.21.7': - resolution: {integrity: sha512-DWfiKm7qp6HZZGn3VWEvsB2sWJ539sBPzpETEG/QGgcrSNxlFjM09/p94ROw+WIazxQAJXvi6erkvPXUdgnzpg==} + '@zag-js/switch@1.22.1': + resolution: {integrity: sha512-ipmBHEqtcrPYr5WS5Juj5dt4GFIqr81NYVNe8RHMW8jIHgHhRCRj3TokGXVlZ7HdseCKTTNNrcvRFBr1sJBbOw==} - '@zag-js/tabs@1.21.7': - resolution: {integrity: sha512-v+zKTBGrcejghKynXHIMVeNfKBdzzwy1bu+/xFNCUb4OUOHL0sFJjWEdmfew+++qluSRj/u+zNlPDX7AhQewxg==} + '@zag-js/tabs@1.22.1': + resolution: {integrity: sha512-B0WHW36uuR+pu/24X0yI4eyvSwo7WmqOc5C3ohZHOf03zkmMJdtMtVQSotKr7qhGMt5updCgs68MR7jAmmc1Lw==} - '@zag-js/tags-input@1.21.7': - resolution: {integrity: sha512-3XAipb/mzPTAALv4UeOEJqiAiQDpma0CoTXq43of1JsIcvrEDMRUgFGFrYRDLojh3vHbzSPNxJX8mq1KioYvGg==} + '@zag-js/tags-input@1.22.1': + resolution: {integrity: sha512-/56pCeSIW+g+ish3Gjed7iNcPSbQEsBCBsCn6FU/JfjwyhLM0sAtn1vkE/eR92hvDX3klV12XzEMBGe4Egr3GQ==} - '@zag-js/time-picker@1.21.7': - resolution: {integrity: sha512-MGr93OZXnDwkpVO9fuZon5LoL33RlL7R2R0vhc33Ti270uJqR+wlCEmzaaDmZZKh3IVyfwFvQtdTEdiD/2KcvA==} + '@zag-js/time-picker@1.22.1': + resolution: {integrity: sha512-7fqCtyDbuaelffLZ8q9infns+HQKqFMjL4k2V5zALAWdYu2NzvlMYHgj2Ue9AI4VI5QaE1nnwV6hxwS4Zpglvg==} peerDependencies: '@internationalized/date': '>=3.0.0' - '@zag-js/timer@1.21.7': - resolution: {integrity: sha512-3AW+KpnZI7xRJWazInrr6jxgvtGcOhi1oQCSJus5znfcGFh6QD/xtrdxjjCfcI9TaIK2VNyHrWbKyBYTGGyRPA==} + '@zag-js/timer@1.22.1': + resolution: {integrity: sha512-VmXnXjecuF4tXFdBRuMHxO8mQX3/vxagE4vx0M0gKwbGoGrXnhYGvULiPL3RlJj8OR8pIfYuP2lbCrt8XM625A==} - '@zag-js/toast@1.21.7': - resolution: {integrity: sha512-Eoi0kxoscujf4AeHgOkyElCrwYXQsYlsX6swjmpDGXYDRaVBQX0n/3J7AX2qMfuHBr6YkbXYJEbjS1VoFR2HbA==} + '@zag-js/toast@1.22.1': + resolution: {integrity: sha512-cxcfbMftA//ggOAlxG3q04WZVL/mMVklvtQ2rSyj3oRmnwocJPYXtJzKIRazWBjji3u3BOA+ZeOI1AcGrfp/TQ==} - '@zag-js/toggle-group@1.21.7': - resolution: {integrity: sha512-oB/+LVu4mrRGTgj/6kAg/2QTOFGrAwnrx3TObFWjWg/naK0pQAeccX937J4IvKDsE1s4q+w+qi3oO11hEPagQA==} + '@zag-js/toggle-group@1.22.1': + resolution: {integrity: sha512-StxnGsPwzB60pGHTD7sNOqIMXjEPMl3lYQk0i2F5MIQWlTRkYdp4ivh73xBRYVtqK15gqacuWXw87EDzKcNwcA==} - '@zag-js/toggle@1.21.7': - resolution: {integrity: sha512-8lLHYjhAu9xBSmlxpsuOgsppjcEzcvk/k9sCHuJ9gHDLK/Ds2+V22JeKLfxKR2KxbApVmlAulWL0PLcfhyVYcg==} + '@zag-js/toggle@1.22.1': + resolution: {integrity: sha512-KK9VK8ZkA/ep7KxQFaeVE/zHVm90fkp9q6q4inyQkUdURUg0vovTFI3c5q/c1zm9/g51vbNf5qCXWU4m9sQK8A==} - '@zag-js/tooltip@1.21.7': - resolution: {integrity: sha512-FpnzcVWvc0NbIbvX4yCsr5+hv0z3vLrE3H9UVNpz/JDE29I2LRp0bpazxpE5TpXsSRM0EBqlM4MgYdGMokwk4g==} + '@zag-js/tooltip@1.22.1': + resolution: {integrity: sha512-0ub0p22CzYnaXv0prAnWNjqUBkdw4nO4yGk5qntaodajpLNQ4gSdq7Hj4afHzJqwbKAkwb3KzJFqcqIm9Y/dfw==} - '@zag-js/tour@1.21.7': - resolution: {integrity: sha512-bIcYg8dBL2k/ubc1JljZL5mfuJ3PX6VMLPJVy8puK7KbU0TszW6kgoj0x3ckqCfI5IlpuMvRuLyXjIFEtVCuyw==} + '@zag-js/tour@1.22.1': + resolution: {integrity: sha512-VhHC65NgBaCjlVsw1M4Me0P6PCtmD9oi9gRzN2fEUESdpM/QT5Yw6PAAPP1AEo5okv+V2rRBgSKOu9ZyYHa+IQ==} - '@zag-js/tree-view@1.21.7': - resolution: {integrity: sha512-OfzGcdO1sV4KU+GOlLYKSa92ryhmMKJeOfxjwaD+ursb86iBzZtThE7V9I+SV/X2jry0GBUJwgPwc6nTlDwuvw==} + '@zag-js/tree-view@1.22.1': + resolution: {integrity: sha512-AQmOn1mB+nLJEaq0xdSVnTI8Vt3nB3OweqdB12jkbdIOcWI9eY0RfhiNHC0k0mgAw+dMjyn84op/gOd9VVdtmA==} - '@zag-js/types@1.21.7': - resolution: {integrity: sha512-9LfflObSapy3SNiB2EX8bXjf0nqj/QJka7y3wftkXfNYI/U3urp7hL4d3MQlcChuu+NCxkpG3GnjkhCLFsWkHw==} + '@zag-js/types@1.22.1': + resolution: {integrity: sha512-lvpDSMR96e7H7TdwOiVpMzj6css5Ydix1nBi7BlmjME6v5OPR0KZwVDGD6h5UtTeVjPq8dPaqM8TJWw+QwbQSw==} - '@zag-js/utils@1.21.7': - resolution: {integrity: sha512-XARSLvc/W/3EGJ+q203ulcvFWCCebLu2wvBNZwSLtL1Zk/9TpmmPXye3/m6GYMeo5vVOrVM/qJ/653PnJFJSYw==} + '@zag-js/utils@1.22.1': + resolution: {integrity: sha512-VXY4gjHaTENHW+wjnKKENZ2jcaW0vnG2a5lYEMuZR4dpNCKH217yFr/bCNrI44y2s1W3LWhWmpEjfZluP6udYg==} acorn-import-phases@1.0.4: resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} @@ -3044,8 +3047,8 @@ packages: resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==} engines: {node: '>=4'} - ast-v8-to-istanbul@0.3.4: - resolution: {integrity: sha512-cxrAnZNLBnQwBPByK4CeDaw5sWZtMilJE/Q3iDA0aamgaIVNDF9T6K2/8DfYDZEejZ2jNnDrG9m8MY72HFd0KA==} + ast-v8-to-istanbul@0.3.5: + resolution: {integrity: sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==} astring@1.9.0: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} @@ -3117,8 +3120,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - browserslist@4.25.3: - resolution: {integrity: sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==} + browserslist@4.25.4: + resolution: {integrity: sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -3361,8 +3364,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.5.209: - resolution: {integrity: sha512-Xoz0uMrim9ZETCQt8UgM5FxQF9+imA7PBpokoGcZloA1uw2LeHzTlip5cb5KOAsXZLjh/moN2vReN3ZjJmjI9A==} + electron-to-chromium@1.5.211: + resolution: {integrity: sha512-IGBvimJkotaLzFnwIVgW9/UD/AOJ2tByUmeOrtqBfACSbAw5b1G0XpvdaieKyc7ULmbwXVx+4e4Be8pOPBrYkw==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -4476,8 +4479,8 @@ packages: react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc - next@15.5.0: - resolution: {integrity: sha512-N1lp9Hatw3a9XLt0307lGB4uTKsXDhyOKQo7uYMzX4i0nF/c27grcGXkLdb7VcT8QPYLBa8ouIyEoUQJ2OyeNQ==} + next@15.5.2: + resolution: {integrity: sha512-H8Otr7abj1glFhbGnvUt3gz++0AF1+QoCXEBmd/6aKbfdFwrn0LpA836Ed5+00va/7HQSDD+mOoVhn3tNy3e/Q==} engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} hasBin: true peerDependencies: @@ -4896,8 +4899,8 @@ packages: peerDependencies: rollup: 2.x || 3.x || 4.x - rollup@4.48.1: - resolution: {integrity: sha512-jVG20NvbhTYDkGAty2/Yh7HK6/q3DGSRH4o8ALKGArmMuaauM9kLfoMZ+WliPwA5+JHr2lTn3g557FxBV87ifg==} + rollup@4.49.0: + resolution: {integrity: sha512-3IVq0cGJ6H7fKXXEdVt+RcYvRCt8beYY9K1760wGQwSAHZcS9eot1zDG5axUbcp/kWRi5zKIIDX8MoKv/TzvZA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -5558,68 +5561,69 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.30 - '@ark-ui/react@5.20.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@ark-ui/react@5.22.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: '@internationalized/date': 3.8.2 - '@zag-js/accordion': 1.21.7 - '@zag-js/anatomy': 1.21.7 - '@zag-js/angle-slider': 1.21.7 - '@zag-js/auto-resize': 1.21.7 - '@zag-js/avatar': 1.21.7 - '@zag-js/carousel': 1.21.7 - '@zag-js/checkbox': 1.21.7 - '@zag-js/clipboard': 1.21.7 - '@zag-js/collapsible': 1.21.7 - '@zag-js/collection': 1.21.7 - '@zag-js/color-picker': 1.21.7 - '@zag-js/color-utils': 1.21.7 - '@zag-js/combobox': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/date-picker': 1.21.7(@internationalized/date@3.8.2) - '@zag-js/date-utils': 1.21.7(@internationalized/date@3.8.2) - '@zag-js/dialog': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/editable': 1.21.7 - '@zag-js/file-upload': 1.21.7 - '@zag-js/file-utils': 1.21.7 - '@zag-js/floating-panel': 1.21.7 - '@zag-js/focus-trap': 1.21.7 - '@zag-js/highlight-word': 1.21.7 - '@zag-js/hover-card': 1.21.7 - '@zag-js/i18n-utils': 1.21.7 - '@zag-js/json-tree-utils': 1.21.7 - '@zag-js/listbox': 1.21.7 - '@zag-js/menu': 1.21.7 - '@zag-js/number-input': 1.21.7 - '@zag-js/pagination': 1.21.7 - '@zag-js/password-input': 1.21.7 - '@zag-js/pin-input': 1.21.7 - '@zag-js/popover': 1.21.7 - '@zag-js/presence': 1.21.7 - '@zag-js/progress': 1.21.7 - '@zag-js/qr-code': 1.21.7 - '@zag-js/radio-group': 1.21.7 - '@zag-js/rating-group': 1.21.7 - '@zag-js/react': 1.21.7(react-dom@19.1.1(react@19.1.1))(react@19.1.1) - '@zag-js/scroll-area': 1.21.7 - '@zag-js/select': 1.21.7 - '@zag-js/signature-pad': 1.21.7 - '@zag-js/slider': 1.21.7 - '@zag-js/splitter': 1.21.7 - '@zag-js/steps': 1.21.7 - '@zag-js/switch': 1.21.7 - '@zag-js/tabs': 1.21.7 - '@zag-js/tags-input': 1.21.7 - '@zag-js/time-picker': 1.21.7(@internationalized/date@3.8.2) - '@zag-js/timer': 1.21.7 - '@zag-js/toast': 1.21.7 - '@zag-js/toggle': 1.21.7 - '@zag-js/toggle-group': 1.21.7 - '@zag-js/tooltip': 1.21.7 - '@zag-js/tour': 1.21.7 - '@zag-js/tree-view': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/accordion': 1.22.1 + '@zag-js/anatomy': 1.22.1 + '@zag-js/angle-slider': 1.22.1 + '@zag-js/async-list': 1.22.1 + '@zag-js/auto-resize': 1.22.1 + '@zag-js/avatar': 1.22.1 + '@zag-js/carousel': 1.22.1 + '@zag-js/checkbox': 1.22.1 + '@zag-js/clipboard': 1.22.1 + '@zag-js/collapsible': 1.22.1 + '@zag-js/collection': 1.22.1 + '@zag-js/color-picker': 1.22.1 + '@zag-js/color-utils': 1.22.1 + '@zag-js/combobox': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/date-picker': 1.22.1(@internationalized/date@3.8.2) + '@zag-js/date-utils': 1.22.1(@internationalized/date@3.8.2) + '@zag-js/dialog': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/editable': 1.22.1 + '@zag-js/file-upload': 1.22.1 + '@zag-js/file-utils': 1.22.1 + '@zag-js/floating-panel': 1.22.1 + '@zag-js/focus-trap': 1.22.1 + '@zag-js/highlight-word': 1.22.1 + '@zag-js/hover-card': 1.22.1 + '@zag-js/i18n-utils': 1.22.1 + '@zag-js/json-tree-utils': 1.22.1 + '@zag-js/listbox': 1.22.1 + '@zag-js/menu': 1.22.1 + '@zag-js/number-input': 1.22.1 + '@zag-js/pagination': 1.22.1 + '@zag-js/password-input': 1.22.1 + '@zag-js/pin-input': 1.22.1 + '@zag-js/popover': 1.22.1 + '@zag-js/presence': 1.22.1 + '@zag-js/progress': 1.22.1 + '@zag-js/qr-code': 1.22.1 + '@zag-js/radio-group': 1.22.1 + '@zag-js/rating-group': 1.22.1 + '@zag-js/react': 1.22.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + '@zag-js/scroll-area': 1.22.1 + '@zag-js/select': 1.22.1 + '@zag-js/signature-pad': 1.22.1 + '@zag-js/slider': 1.22.1 + '@zag-js/splitter': 1.22.1 + '@zag-js/steps': 1.22.1 + '@zag-js/switch': 1.22.1 + '@zag-js/tabs': 1.22.1 + '@zag-js/tags-input': 1.22.1 + '@zag-js/time-picker': 1.22.1(@internationalized/date@3.8.2) + '@zag-js/timer': 1.22.1 + '@zag-js/toast': 1.22.1 + '@zag-js/toggle': 1.22.1 + '@zag-js/toggle-group': 1.22.1 + '@zag-js/tooltip': 1.22.1 + '@zag-js/tour': 1.22.1 + '@zag-js/tree-view': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 react: 19.1.1 react-dom: 19.1.1(react@19.1.1) @@ -5667,7 +5671,7 @@ snapshots: dependencies: '@babel/compat-data': 7.28.0 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.25.3 + browserslist: 4.25.4 lru-cache: 5.1.1 semver: 6.3.1 @@ -6362,11 +6366,11 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@chakra-ui/react@3.25.0(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@chakra-ui/react@3.26.0(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: - '@ark-ui/react': 5.20.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + '@ark-ui/react': 5.22.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@emotion/is-prop-valid': 1.3.1 - '@emotion/react': 11.14.0(@types/react@19.1.11)(react@19.1.1) + '@emotion/react': 11.14.0(@types/react@19.1.12)(react@19.1.1) '@emotion/serialize': 1.3.3 '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.1.1) '@emotion/utils': 1.4.2 @@ -6520,18 +6524,18 @@ snapshots: human-id: 4.1.1 prettier: 2.8.8 - '@emnapi/core@1.4.5': + '@emnapi/core@1.5.0': dependencies: - '@emnapi/wasi-threads': 1.0.4 + '@emnapi/wasi-threads': 1.1.0 tslib: 2.8.1 optional: true - '@emnapi/runtime@1.4.5': + '@emnapi/runtime@1.5.0': dependencies: tslib: 2.8.1 optional: true - '@emnapi/wasi-threads@1.0.4': + '@emnapi/wasi-threads@1.1.0': dependencies: tslib: 2.8.1 optional: true @@ -6568,7 +6572,7 @@ snapshots: '@emotion/memoize@0.9.0': {} - '@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1)': + '@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 '@emotion/babel-plugin': 11.13.5 @@ -6580,7 +6584,7 @@ snapshots: hoist-non-react-statics: 3.3.2 react: 19.1.1 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 transitivePeerDependencies: - supports-color @@ -6594,18 +6598,18 @@ snapshots: '@emotion/sheet@1.4.0': {} - '@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1)': + '@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 '@emotion/babel-plugin': 11.13.5 '@emotion/is-prop-valid': 1.3.1 - '@emotion/react': 11.14.0(@types/react@19.1.11)(react@19.1.1) + '@emotion/react': 11.14.0(@types/react@19.1.12)(react@19.1.1) '@emotion/serialize': 1.3.3 '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.1.1) '@emotion/utils': 1.4.2 react: 19.1.1 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 transitivePeerDependencies: - supports-color @@ -6811,7 +6815,7 @@ snapshots: dependencies: '@floating-ui/utils': 0.2.10 - '@floating-ui/dom@1.7.3': + '@floating-ui/dom@1.7.4': dependencies: '@floating-ui/core': 1.7.3 '@floating-ui/utils': 0.2.10 @@ -6905,7 +6909,7 @@ snapshots: '@img/sharp-wasm32@0.34.3': dependencies: - '@emnapi/runtime': 1.4.5 + '@emnapi/runtime': 1.5.0 optional: true '@img/sharp-win32-arm64@0.34.3': @@ -6977,10 +6981,10 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@kuma-ui/babel-plugin@1.2.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': + '@kuma-ui/babel-plugin@1.2.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': dependencies: '@babel/core': 7.28.3 - '@kuma-ui/core': 1.5.9(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + '@kuma-ui/core': 1.5.9(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) '@kuma-ui/sheet': 1.3.1 '@kuma-ui/system': 1.7.6 transitivePeerDependencies: @@ -6989,11 +6993,11 @@ snapshots: - react - supports-color - '@kuma-ui/compiler@1.3.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': + '@kuma-ui/compiler@1.3.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': dependencies: '@babel/core': 7.28.3 - '@kuma-ui/babel-plugin': 1.2.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) - '@kuma-ui/core': 1.5.9(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + '@kuma-ui/babel-plugin': 1.2.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + '@kuma-ui/core': 1.5.9(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) '@kuma-ui/sheet': 1.3.1 '@kuma-ui/system': 1.7.6 '@kuma-ui/wasm': 1.0.3 @@ -7004,7 +7008,7 @@ snapshots: - react - supports-color - '@kuma-ui/core@1.5.9(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': + '@kuma-ui/core@1.5.9(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)': dependencies: '@kuma-ui/sheet': 1.3.1 '@kuma-ui/system': 1.7.6 @@ -7012,23 +7016,23 @@ snapshots: react: 19.1.1 stylis: 4.3.6 optionalDependencies: - '@types/react': 19.1.11 - next: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + '@types/react': 19.1.12 + next: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) - '@kuma-ui/next-plugin@1.3.3(@babel/core@7.28.3)(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3)': + '@kuma-ui/next-plugin@1.3.3(@babel/core@7.28.3)(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3)': dependencies: '@babel/preset-env': 7.28.3(@babel/core@7.28.3) '@babel/preset-react': 7.27.1(@babel/core@7.28.3) '@babel/preset-typescript': 7.27.1(@babel/core@7.28.3) - '@kuma-ui/core': 1.5.9(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) - '@kuma-ui/webpack-plugin': 1.4.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3) + '@kuma-ui/core': 1.5.9(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + '@kuma-ui/webpack-plugin': 1.4.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3) babel-loader: 9.2.1(@babel/core@7.28.3)(webpack@5.101.3) browserslist: 4.21.5 - next: 15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + next: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: 19.1.1 webpack: 5.101.3 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 transitivePeerDependencies: - '@babel/core' - supports-color @@ -7044,9 +7048,9 @@ snapshots: '@kuma-ui/wasm@1.0.3': {} - '@kuma-ui/webpack-plugin@1.4.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3)': + '@kuma-ui/webpack-plugin@1.4.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1)(webpack@5.101.3)': dependencies: - '@kuma-ui/compiler': 1.3.3(@types/react@19.1.11)(next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) + '@kuma-ui/compiler': 1.3.3(@types/react@19.1.12)(next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1))(react@19.1.1) '@kuma-ui/sheet': 1.3.1 '@kuma-ui/system': 1.7.6 esbuild: 0.18.20 @@ -7114,10 +7118,10 @@ snapshots: - acorn - supports-color - '@mdx-js/react@3.1.0(@types/react@19.1.11)(react@19.1.1)': + '@mdx-js/react@3.1.0(@types/react@19.1.12)(react@19.1.1)': dependencies: '@types/mdx': 2.0.13 - '@types/react': 19.1.11 + '@types/react': 19.1.12 react: 19.1.1 '@microsoft/api-extractor-model@7.30.7(@types/node@24.3.0)': @@ -7155,42 +7159,42 @@ snapshots: '@microsoft/tsdoc@0.15.1': {} - '@module-federation/error-codes@0.17.1': {} + '@module-federation/error-codes@0.18.0': {} - '@module-federation/runtime-core@0.17.1': + '@module-federation/runtime-core@0.18.0': dependencies: - '@module-federation/error-codes': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/error-codes': 0.18.0 + '@module-federation/sdk': 0.18.0 - '@module-federation/runtime-tools@0.17.1': + '@module-federation/runtime-tools@0.18.0': dependencies: - '@module-federation/runtime': 0.17.1 - '@module-federation/webpack-bundler-runtime': 0.17.1 + '@module-federation/runtime': 0.18.0 + '@module-federation/webpack-bundler-runtime': 0.18.0 - '@module-federation/runtime@0.17.1': + '@module-federation/runtime@0.18.0': dependencies: - '@module-federation/error-codes': 0.17.1 - '@module-federation/runtime-core': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/error-codes': 0.18.0 + '@module-federation/runtime-core': 0.18.0 + '@module-federation/sdk': 0.18.0 - '@module-federation/sdk@0.17.1': {} + '@module-federation/sdk@0.18.0': {} - '@module-federation/webpack-bundler-runtime@0.17.1': + '@module-federation/webpack-bundler-runtime@0.18.0': dependencies: - '@module-federation/runtime': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/runtime': 0.18.0 + '@module-federation/sdk': 0.18.0 '@mui/core-downloads-tracker@7.3.1': {} - '@mui/material@7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@mui/material@7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 '@mui/core-downloads-tracker': 7.3.1 - '@mui/system': 7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1) - '@mui/types': 7.4.5(@types/react@19.1.11) - '@mui/utils': 7.3.1(@types/react@19.1.11)(react@19.1.1) + '@mui/system': 7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1) + '@mui/types': 7.4.5(@types/react@19.1.12) + '@mui/utils': 7.3.1(@types/react@19.1.12)(react@19.1.1) '@popperjs/core': 2.11.8 - '@types/react-transition-group': 4.4.12(@types/react@19.1.11) + '@types/react-transition-group': 4.4.12(@types/react@19.1.12) clsx: 2.1.1 csstype: 3.1.3 prop-types: 15.8.1 @@ -7199,20 +7203,20 @@ snapshots: react-is: 19.1.1 react-transition-group: 4.4.5(react-dom@19.1.1(react@19.1.1))(react@19.1.1) optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.1.11)(react@19.1.1) - '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1) - '@types/react': 19.1.11 + '@emotion/react': 11.14.0(@types/react@19.1.12)(react@19.1.1) + '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1) + '@types/react': 19.1.12 - '@mui/private-theming@7.3.1(@types/react@19.1.11)(react@19.1.1)': + '@mui/private-theming@7.3.1(@types/react@19.1.12)(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 - '@mui/utils': 7.3.1(@types/react@19.1.11)(react@19.1.1) + '@mui/utils': 7.3.1(@types/react@19.1.12)(react@19.1.1) prop-types: 15.8.1 react: 19.1.1 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 - '@mui/styled-engine@7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(react@19.1.1)': + '@mui/styled-engine@7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 '@emotion/cache': 11.14.0 @@ -7222,81 +7226,81 @@ snapshots: prop-types: 15.8.1 react: 19.1.1 optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.1.11)(react@19.1.1) - '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1) + '@emotion/react': 11.14.0(@types/react@19.1.12)(react@19.1.1) + '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1) - '@mui/system@7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1)': + '@mui/system@7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 - '@mui/private-theming': 7.3.1(@types/react@19.1.11)(react@19.1.1) - '@mui/styled-engine': 7.3.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1))(react@19.1.1) - '@mui/types': 7.4.5(@types/react@19.1.11) - '@mui/utils': 7.3.1(@types/react@19.1.11)(react@19.1.1) + '@mui/private-theming': 7.3.1(@types/react@19.1.12)(react@19.1.1) + '@mui/styled-engine': 7.3.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1))(react@19.1.1) + '@mui/types': 7.4.5(@types/react@19.1.12) + '@mui/utils': 7.3.1(@types/react@19.1.12)(react@19.1.1) clsx: 2.1.1 csstype: 3.1.3 prop-types: 15.8.1 react: 19.1.1 optionalDependencies: - '@emotion/react': 11.14.0(@types/react@19.1.11)(react@19.1.1) - '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.11)(react@19.1.1))(@types/react@19.1.11)(react@19.1.1) - '@types/react': 19.1.11 + '@emotion/react': 11.14.0(@types/react@19.1.12)(react@19.1.1) + '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.1.12)(react@19.1.1))(@types/react@19.1.12)(react@19.1.1) + '@types/react': 19.1.12 - '@mui/types@7.4.5(@types/react@19.1.11)': + '@mui/types@7.4.5(@types/react@19.1.12)': dependencies: '@babel/runtime': 7.28.3 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 - '@mui/utils@7.3.1(@types/react@19.1.11)(react@19.1.1)': + '@mui/utils@7.3.1(@types/react@19.1.12)(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 - '@mui/types': 7.4.5(@types/react@19.1.11) + '@mui/types': 7.4.5(@types/react@19.1.12) '@types/prop-types': 15.7.15 clsx: 2.1.1 prop-types: 15.8.1 react: 19.1.1 react-is: 19.1.1 optionalDependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 '@napi-rs/wasm-runtime@1.0.3': dependencies: - '@emnapi/core': 1.4.5 - '@emnapi/runtime': 1.4.5 + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 '@tybys/wasm-util': 0.10.0 optional: true - '@next/env@15.5.0': {} + '@next/env@15.5.2': {} - '@next/mdx@15.5.0(@mdx-js/loader@3.1.0(acorn@8.15.0)(webpack@5.101.3))(@mdx-js/react@3.1.0(@types/react@19.1.11)(react@19.1.1))': + '@next/mdx@15.5.2(@mdx-js/loader@3.1.0(acorn@8.15.0)(webpack@5.101.3))(@mdx-js/react@3.1.0(@types/react@19.1.12)(react@19.1.1))': dependencies: source-map: 0.7.6 optionalDependencies: '@mdx-js/loader': 3.1.0(acorn@8.15.0)(webpack@5.101.3) - '@mdx-js/react': 3.1.0(@types/react@19.1.11)(react@19.1.1) + '@mdx-js/react': 3.1.0(@types/react@19.1.12)(react@19.1.1) - '@next/swc-darwin-arm64@15.5.0': + '@next/swc-darwin-arm64@15.5.2': optional: true - '@next/swc-darwin-x64@15.5.0': + '@next/swc-darwin-x64@15.5.2': optional: true - '@next/swc-linux-arm64-gnu@15.5.0': + '@next/swc-linux-arm64-gnu@15.5.2': optional: true - '@next/swc-linux-arm64-musl@15.5.0': + '@next/swc-linux-arm64-musl@15.5.2': optional: true - '@next/swc-linux-x64-gnu@15.5.0': + '@next/swc-linux-x64-gnu@15.5.2': optional: true - '@next/swc-linux-x64-musl@15.5.0': + '@next/swc-linux-x64-musl@15.5.2': optional: true - '@next/swc-win32-arm64-msvc@15.5.0': + '@next/swc-win32-arm64-msvc@15.5.2': optional: true - '@next/swc-win32-x64-msvc@15.5.0': + '@next/swc-win32-x64-msvc@15.5.2': optional: true '@nodelib/fs.scandir@2.1.5': @@ -7320,148 +7324,148 @@ snapshots: '@popperjs/core@2.11.8': {} - '@rolldown/pluginutils@1.0.0-beta.32': {} + '@rolldown/pluginutils@1.0.0-beta.34': {} - '@rollup/pluginutils@5.2.0(rollup@4.48.1)': + '@rollup/pluginutils@5.2.0(rollup@4.49.0)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.48.1 + rollup: 4.49.0 - '@rollup/rollup-android-arm-eabi@4.48.1': + '@rollup/rollup-android-arm-eabi@4.49.0': optional: true - '@rollup/rollup-android-arm64@4.48.1': + '@rollup/rollup-android-arm64@4.49.0': optional: true - '@rollup/rollup-darwin-arm64@4.48.1': + '@rollup/rollup-darwin-arm64@4.49.0': optional: true - '@rollup/rollup-darwin-x64@4.48.1': + '@rollup/rollup-darwin-x64@4.49.0': optional: true - '@rollup/rollup-freebsd-arm64@4.48.1': + '@rollup/rollup-freebsd-arm64@4.49.0': optional: true - '@rollup/rollup-freebsd-x64@4.48.1': + '@rollup/rollup-freebsd-x64@4.49.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.48.1': + '@rollup/rollup-linux-arm-gnueabihf@4.49.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.48.1': + '@rollup/rollup-linux-arm-musleabihf@4.49.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.48.1': + '@rollup/rollup-linux-arm64-gnu@4.49.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.48.1': + '@rollup/rollup-linux-arm64-musl@4.49.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.48.1': + '@rollup/rollup-linux-loongarch64-gnu@4.49.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.48.1': + '@rollup/rollup-linux-ppc64-gnu@4.49.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.48.1': + '@rollup/rollup-linux-riscv64-gnu@4.49.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.48.1': + '@rollup/rollup-linux-riscv64-musl@4.49.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.48.1': + '@rollup/rollup-linux-s390x-gnu@4.49.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.48.1': + '@rollup/rollup-linux-x64-gnu@4.49.0': optional: true - '@rollup/rollup-linux-x64-musl@4.48.1': + '@rollup/rollup-linux-x64-musl@4.49.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.48.1': + '@rollup/rollup-win32-arm64-msvc@4.49.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.48.1': + '@rollup/rollup-win32-ia32-msvc@4.49.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.48.1': + '@rollup/rollup-win32-x64-msvc@4.49.0': optional: true - '@rsbuild/core@1.4.16': + '@rsbuild/core@1.5.1': dependencies: - '@rspack/core': 1.4.11(@swc/helpers@0.5.17) + '@rspack/core': 1.5.0(@swc/helpers@0.5.17) '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.45.1 jiti: 2.5.1 - '@rsbuild/plugin-react@1.3.5(@rsbuild/core@1.4.16)': + '@rsbuild/plugin-react@1.4.0(@rsbuild/core@1.5.1)': dependencies: - '@rsbuild/core': 1.4.16 - '@rspack/plugin-react-refresh': 1.4.3(react-refresh@0.17.0) + '@rsbuild/core': 1.5.1 + '@rspack/plugin-react-refresh': 1.5.0(react-refresh@0.17.0) react-refresh: 0.17.0 transitivePeerDependencies: - webpack-hot-middleware - '@rspack/binding-darwin-arm64@1.4.11': + '@rspack/binding-darwin-arm64@1.5.0': optional: true - '@rspack/binding-darwin-x64@1.4.11': + '@rspack/binding-darwin-x64@1.5.0': optional: true - '@rspack/binding-linux-arm64-gnu@1.4.11': + '@rspack/binding-linux-arm64-gnu@1.5.0': optional: true - '@rspack/binding-linux-arm64-musl@1.4.11': + '@rspack/binding-linux-arm64-musl@1.5.0': optional: true - '@rspack/binding-linux-x64-gnu@1.4.11': + '@rspack/binding-linux-x64-gnu@1.5.0': optional: true - '@rspack/binding-linux-x64-musl@1.4.11': + '@rspack/binding-linux-x64-musl@1.5.0': optional: true - '@rspack/binding-wasm32-wasi@1.4.11': + '@rspack/binding-wasm32-wasi@1.5.0': dependencies: '@napi-rs/wasm-runtime': 1.0.3 optional: true - '@rspack/binding-win32-arm64-msvc@1.4.11': + '@rspack/binding-win32-arm64-msvc@1.5.0': optional: true - '@rspack/binding-win32-ia32-msvc@1.4.11': + '@rspack/binding-win32-ia32-msvc@1.5.0': optional: true - '@rspack/binding-win32-x64-msvc@1.4.11': + '@rspack/binding-win32-x64-msvc@1.5.0': optional: true - '@rspack/binding@1.4.11': + '@rspack/binding@1.5.0': optionalDependencies: - '@rspack/binding-darwin-arm64': 1.4.11 - '@rspack/binding-darwin-x64': 1.4.11 - '@rspack/binding-linux-arm64-gnu': 1.4.11 - '@rspack/binding-linux-arm64-musl': 1.4.11 - '@rspack/binding-linux-x64-gnu': 1.4.11 - '@rspack/binding-linux-x64-musl': 1.4.11 - '@rspack/binding-wasm32-wasi': 1.4.11 - '@rspack/binding-win32-arm64-msvc': 1.4.11 - '@rspack/binding-win32-ia32-msvc': 1.4.11 - '@rspack/binding-win32-x64-msvc': 1.4.11 - - '@rspack/core@1.4.11(@swc/helpers@0.5.17)': - dependencies: - '@module-federation/runtime-tools': 0.17.1 - '@rspack/binding': 1.4.11 + '@rspack/binding-darwin-arm64': 1.5.0 + '@rspack/binding-darwin-x64': 1.5.0 + '@rspack/binding-linux-arm64-gnu': 1.5.0 + '@rspack/binding-linux-arm64-musl': 1.5.0 + '@rspack/binding-linux-x64-gnu': 1.5.0 + '@rspack/binding-linux-x64-musl': 1.5.0 + '@rspack/binding-wasm32-wasi': 1.5.0 + '@rspack/binding-win32-arm64-msvc': 1.5.0 + '@rspack/binding-win32-ia32-msvc': 1.5.0 + '@rspack/binding-win32-x64-msvc': 1.5.0 + + '@rspack/core@1.5.0(@swc/helpers@0.5.17)': + dependencies: + '@module-federation/runtime-tools': 0.18.0 + '@rspack/binding': 1.5.0 '@rspack/lite-tapable': 1.0.1 optionalDependencies: '@swc/helpers': 0.5.17 '@rspack/lite-tapable@1.0.1': {} - '@rspack/plugin-react-refresh@1.4.3(react-refresh@0.17.0)': + '@rspack/plugin-react-refresh@1.5.0(react-refresh@0.17.0)': dependencies: error-stack-parser: 2.1.4 html-entities: 2.6.0 @@ -7501,9 +7505,9 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@storybook/addon-docs@9.1.3(@types/react@19.1.11)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))': + '@storybook/addon-docs@9.1.3(@types/react@19.1.12)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))': dependencies: - '@mdx-js/react': 3.1.0(@types/react@19.1.11)(react@19.1.1) + '@mdx-js/react': 3.1.0(@types/react@19.1.12)(react@19.1.1) '@storybook/csf-plugin': 9.1.3(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))) '@storybook/icons': 1.4.0(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@storybook/react-dom-shim': 9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))) @@ -7543,10 +7547,10 @@ snapshots: react-dom: 19.1.1(react@19.1.1) storybook: 9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) - '@storybook/react-vite@9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.48.1)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))': + '@storybook/react-vite@9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rollup@4.49.0)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))': dependencies: '@joshwooding/vite-plugin-react-docgen-typescript': 0.6.1(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) - '@rollup/pluginutils': 5.2.0(rollup@4.48.1) + '@rollup/pluginutils': 5.2.0(rollup@4.49.0) '@storybook/builder-vite': 9.1.3(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)) '@storybook/react': 9.1.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(storybook@9.1.3(@testing-library/dom@10.4.1)(prettier@3.6.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)))(typescript@5.9.2) find-up: 7.0.0 @@ -7609,15 +7613,15 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 - '@testing-library/react@16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.1.8(@types/react@19.1.11))(@types/react@19.1.11)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@testing-library/react@16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.1.9(@types/react@19.1.12))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: '@babel/runtime': 7.28.3 '@testing-library/dom': 10.4.1 react: 19.1.1 react-dom: 19.1.1(react@19.1.1) optionalDependencies: - '@types/react': 19.1.11 - '@types/react-dom': 19.1.8(@types/react@19.1.11) + '@types/react': 19.1.12 + '@types/react-dom': 19.1.9(@types/react@19.1.12) '@testing-library/user-event@14.6.1(@testing-library/dom@10.4.1)': dependencies: @@ -7722,19 +7726,19 @@ snapshots: '@types/prop-types@15.7.15': {} - '@types/react-dom@19.1.8(@types/react@19.1.11)': + '@types/react-dom@19.1.9(@types/react@19.1.12)': dependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 '@types/react-syntax-highlighter@15.5.13': dependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 - '@types/react-transition-group@4.4.12(@types/react@19.1.11)': + '@types/react-transition-group@4.4.12(@types/react@19.1.12)': dependencies: - '@types/react': 19.1.11 + '@types/react': 19.1.12 - '@types/react@19.1.11': + '@types/react@19.1.12': dependencies: csstype: 3.1.3 @@ -7854,12 +7858,12 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@5.0.1(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))': + '@vitejs/plugin-react@5.0.2(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1))': dependencies: '@babel/core': 7.28.3 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.3) '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.28.3) - '@rolldown/pluginutils': 1.0.0-beta.32 + '@rolldown/pluginutils': 1.0.0-beta.34 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 vite: 6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1) @@ -7870,7 +7874,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 - ast-v8-to-istanbul: 0.3.4 + ast-v8-to-istanbul: 0.3.5 debug: 4.4.1 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 @@ -8052,514 +8056,518 @@ snapshots: '@xtuc/long@4.2.2': {} - '@zag-js/accordion@1.21.7': + '@zag-js/accordion@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/anatomy@1.21.7': {} + '@zag-js/anatomy@1.22.1': {} - '@zag-js/angle-slider@1.21.7': + '@zag-js/angle-slider@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/rect-utils': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/rect-utils': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/aria-hidden@1.21.7': {} + '@zag-js/aria-hidden@1.22.1': {} + + '@zag-js/async-list@1.22.1': + dependencies: + '@zag-js/core': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/auto-resize@1.21.7': + '@zag-js/auto-resize@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/avatar@1.21.7': + '@zag-js/avatar@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/carousel@1.21.7': + '@zag-js/carousel@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/scroll-snap': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/scroll-snap': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/checkbox@1.21.7': + '@zag-js/checkbox@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-visible': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-visible': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/clipboard@1.21.7': + '@zag-js/clipboard@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/collapsible@1.21.7': + '@zag-js/collapsible@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/collection@1.21.7': + '@zag-js/collection@1.22.1': dependencies: - '@zag-js/utils': 1.21.7 + '@zag-js/utils': 1.22.1 - '@zag-js/color-picker@1.21.7': + '@zag-js/color-picker@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/color-utils': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/color-utils': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/color-utils@1.21.7': + '@zag-js/color-utils@1.22.1': dependencies: - '@zag-js/utils': 1.21.7 + '@zag-js/utils': 1.22.1 - '@zag-js/combobox@1.21.7': + '@zag-js/combobox@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/aria-hidden': 1.21.7 - '@zag-js/collection': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/aria-hidden': 1.22.1 + '@zag-js/collection': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/core@1.21.7': + '@zag-js/core@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/dom-query': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/date-picker@1.21.7(@internationalized/date@3.8.2)': + '@zag-js/date-picker@1.22.1(@internationalized/date@3.8.2)': dependencies: '@internationalized/date': 3.8.2 - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/date-utils': 1.21.7(@internationalized/date@3.8.2) - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/live-region': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/date-utils@1.21.7(@internationalized/date@3.8.2)': + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/date-utils': 1.22.1(@internationalized/date@3.8.2) + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/live-region': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/date-utils@1.22.1(@internationalized/date@3.8.2)': dependencies: '@internationalized/date': 3.8.2 - '@zag-js/dialog@1.21.7': + '@zag-js/dialog@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/aria-hidden': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-trap': 1.21.7 - '@zag-js/remove-scroll': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/aria-hidden': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-trap': 1.22.1 + '@zag-js/remove-scroll': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/dismissable@1.21.7': + '@zag-js/dismissable@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 - '@zag-js/interact-outside': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/dom-query': 1.22.1 + '@zag-js/interact-outside': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/dom-query@1.21.7': + '@zag-js/dom-query@1.22.1': dependencies: - '@zag-js/types': 1.21.7 + '@zag-js/types': 1.22.1 - '@zag-js/editable@1.21.7': + '@zag-js/editable@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/interact-outside': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/interact-outside': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/file-upload@1.21.7': + '@zag-js/file-upload@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/file-utils': 1.21.7 - '@zag-js/i18n-utils': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/file-utils': 1.22.1 + '@zag-js/i18n-utils': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/file-utils@1.21.7': + '@zag-js/file-utils@1.22.1': dependencies: - '@zag-js/i18n-utils': 1.21.7 + '@zag-js/i18n-utils': 1.22.1 - '@zag-js/floating-panel@1.21.7': + '@zag-js/floating-panel@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/rect-utils': 1.21.7 - '@zag-js/store': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/rect-utils': 1.22.1 + '@zag-js/store': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/focus-trap@1.21.7': + '@zag-js/focus-trap@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/focus-visible@1.21.7': + '@zag-js/focus-visible@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/highlight-word@1.21.7': {} + '@zag-js/highlight-word@1.22.1': {} - '@zag-js/hover-card@1.21.7': + '@zag-js/hover-card@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/i18n-utils@1.21.7': + '@zag-js/i18n-utils@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/interact-outside@1.21.7': + '@zag-js/interact-outside@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/dom-query': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/json-tree-utils@1.21.7': {} + '@zag-js/json-tree-utils@1.22.1': {} - '@zag-js/listbox@1.21.7': + '@zag-js/listbox@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/collection': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-visible': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/collection': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-visible': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/live-region@1.21.7': {} + '@zag-js/live-region@1.22.1': {} - '@zag-js/menu@1.21.7': + '@zag-js/menu@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/rect-utils': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/rect-utils': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/number-input@1.21.7': + '@zag-js/number-input@1.22.1': dependencies: '@internationalized/number': 3.6.4 - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/pagination@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/password-input@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/pin-input@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/popover@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/aria-hidden': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-trap': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/remove-scroll': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/popper@1.21.7': - dependencies: - '@floating-ui/dom': 1.7.3 - '@zag-js/dom-query': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/presence@1.21.7': - dependencies: - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - - '@zag-js/progress@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/qr-code@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/pagination@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/password-input@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/pin-input@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/popover@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/aria-hidden': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-trap': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/remove-scroll': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/popper@1.22.1': + dependencies: + '@floating-ui/dom': 1.7.4 + '@zag-js/dom-query': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/presence@1.22.1': + dependencies: + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + + '@zag-js/progress@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/qr-code@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 proxy-memoize: 3.0.1 uqr: 0.1.2 - '@zag-js/radio-group@1.21.7': + '@zag-js/radio-group@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-visible': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-visible': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/rating-group@1.21.7': + '@zag-js/rating-group@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/react@1.21.7(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@zag-js/react@1.22.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: - '@zag-js/core': 1.21.7 - '@zag-js/store': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/core': 1.22.1 + '@zag-js/store': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - '@zag-js/rect-utils@1.21.7': {} + '@zag-js/rect-utils@1.22.1': {} - '@zag-js/remove-scroll@1.21.7': + '@zag-js/remove-scroll@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/scroll-area@1.21.7': + '@zag-js/scroll-area@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/scroll-snap@1.21.7': + '@zag-js/scroll-snap@1.22.1': dependencies: - '@zag-js/dom-query': 1.21.7 + '@zag-js/dom-query': 1.22.1 - '@zag-js/select@1.21.7': + '@zag-js/select@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/collection': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/collection': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/signature-pad@1.21.7': + '@zag-js/signature-pad@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 perfect-freehand: 1.2.2 - '@zag-js/slider@1.21.7': + '@zag-js/slider@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/splitter@1.21.7': + '@zag-js/splitter@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/steps@1.21.7': + '@zag-js/steps@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/store@1.21.7': + '@zag-js/store@1.22.1': dependencies: proxy-compare: 3.0.1 - '@zag-js/switch@1.21.7': + '@zag-js/switch@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-visible': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-visible': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/tabs@1.21.7': + '@zag-js/tabs@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/tags-input@1.21.7': + '@zag-js/tags-input@1.22.1': dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/auto-resize': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/interact-outside': 1.21.7 - '@zag-js/live-region': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 + '@zag-js/anatomy': 1.22.1 + '@zag-js/auto-resize': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/interact-outside': 1.22.1 + '@zag-js/live-region': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 - '@zag-js/time-picker@1.21.7(@internationalized/date@3.8.2)': + '@zag-js/time-picker@1.22.1(@internationalized/date@3.8.2)': dependencies: '@internationalized/date': 3.8.2 - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/timer@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/toast@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/toggle-group@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/toggle@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/tooltip@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-visible': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/store': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/tour@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dismissable': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/focus-trap': 1.21.7 - '@zag-js/interact-outside': 1.21.7 - '@zag-js/popper': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/tree-view@1.21.7': - dependencies: - '@zag-js/anatomy': 1.21.7 - '@zag-js/collection': 1.21.7 - '@zag-js/core': 1.21.7 - '@zag-js/dom-query': 1.21.7 - '@zag-js/types': 1.21.7 - '@zag-js/utils': 1.21.7 - - '@zag-js/types@1.21.7': + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/timer@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/toast@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/toggle-group@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/toggle@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/tooltip@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-visible': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/tour@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dismissable': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/focus-trap': 1.22.1 + '@zag-js/interact-outside': 1.22.1 + '@zag-js/popper': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/tree-view@1.22.1': + dependencies: + '@zag-js/anatomy': 1.22.1 + '@zag-js/collection': 1.22.1 + '@zag-js/core': 1.22.1 + '@zag-js/dom-query': 1.22.1 + '@zag-js/types': 1.22.1 + '@zag-js/utils': 1.22.1 + + '@zag-js/types@1.22.1': dependencies: csstype: 3.1.3 - '@zag-js/utils@1.21.7': {} + '@zag-js/utils@1.22.1': {} acorn-import-phases@1.0.4(acorn@8.15.0): dependencies: @@ -8709,7 +8717,7 @@ snapshots: dependencies: tslib: 2.8.1 - ast-v8-to-istanbul@0.3.4: + ast-v8-to-istanbul@0.3.5: dependencies: '@jridgewell/trace-mapping': 0.3.30 estree-walker: 3.0.3 @@ -8790,16 +8798,16 @@ snapshots: browserslist@4.21.5: dependencies: caniuse-lite: 1.0.30001737 - electron-to-chromium: 1.5.209 + electron-to-chromium: 1.5.211 node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.21.5) - browserslist@4.25.3: + browserslist@4.25.4: dependencies: caniuse-lite: 1.0.30001737 - electron-to-chromium: 1.5.209 + electron-to-chromium: 1.5.211 node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.25.3) + update-browserslist-db: 1.1.3(browserslist@4.25.4) buffer-from@1.1.2: {} @@ -8911,7 +8919,7 @@ snapshots: core-js-compat@3.45.1: dependencies: - browserslist: 4.25.3 + browserslist: 4.25.4 core-js@3.45.1: {} @@ -9019,7 +9027,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.209: {} + electron-to-chromium@1.5.211: {} emoji-regex@8.0.0: {} @@ -10587,9 +10595,9 @@ snapshots: react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - next@15.5.0(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1): + next@15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1): dependencies: - '@next/env': 15.5.0 + '@next/env': 15.5.2 '@swc/helpers': 0.5.15 caniuse-lite: 1.0.30001737 postcss: 8.4.31 @@ -10597,14 +10605,14 @@ snapshots: react-dom: 19.1.1(react@19.1.1) styled-jsx: 5.1.6(@babel/core@7.28.3)(react@19.1.1) optionalDependencies: - '@next/swc-darwin-arm64': 15.5.0 - '@next/swc-darwin-x64': 15.5.0 - '@next/swc-linux-arm64-gnu': 15.5.0 - '@next/swc-linux-arm64-musl': 15.5.0 - '@next/swc-linux-x64-gnu': 15.5.0 - '@next/swc-linux-x64-musl': 15.5.0 - '@next/swc-win32-arm64-msvc': 15.5.0 - '@next/swc-win32-x64-msvc': 15.5.0 + '@next/swc-darwin-arm64': 15.5.2 + '@next/swc-darwin-x64': 15.5.2 + '@next/swc-linux-arm64-gnu': 15.5.2 + '@next/swc-linux-arm64-musl': 15.5.2 + '@next/swc-linux-x64-gnu': 15.5.2 + '@next/swc-linux-x64-musl': 15.5.2 + '@next/swc-win32-arm64-msvc': 15.5.2 + '@next/swc-win32-x64-msvc': 15.5.2 sharp: 0.34.3 transitivePeerDependencies: - '@babel/core' @@ -10887,11 +10895,11 @@ snapshots: react-is@19.1.1: {} - react-markdown@10.1.0(@types/react@19.1.11)(react@19.1.1): + react-markdown@10.1.0(@types/react@19.1.12)(react@19.1.1): dependencies: '@types/hast': 3.0.4 '@types/mdast': 4.0.4 - '@types/react': 19.1.11 + '@types/react': 19.1.12 devlop: 1.1.0 hast-util-to-jsx-runtime: 2.3.6 html-url-attributes: 3.0.1 @@ -11104,36 +11112,36 @@ snapshots: reusify@1.1.0: {} - rollup-plugin-preserve-directives@0.4.0(rollup@4.48.1): + rollup-plugin-preserve-directives@0.4.0(rollup@4.49.0): dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.48.1) + '@rollup/pluginutils': 5.2.0(rollup@4.49.0) magic-string: 0.30.18 - rollup: 4.48.1 + rollup: 4.49.0 - rollup@4.48.1: + rollup@4.49.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.48.1 - '@rollup/rollup-android-arm64': 4.48.1 - '@rollup/rollup-darwin-arm64': 4.48.1 - '@rollup/rollup-darwin-x64': 4.48.1 - '@rollup/rollup-freebsd-arm64': 4.48.1 - '@rollup/rollup-freebsd-x64': 4.48.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.48.1 - '@rollup/rollup-linux-arm-musleabihf': 4.48.1 - '@rollup/rollup-linux-arm64-gnu': 4.48.1 - '@rollup/rollup-linux-arm64-musl': 4.48.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.48.1 - '@rollup/rollup-linux-ppc64-gnu': 4.48.1 - '@rollup/rollup-linux-riscv64-gnu': 4.48.1 - '@rollup/rollup-linux-riscv64-musl': 4.48.1 - '@rollup/rollup-linux-s390x-gnu': 4.48.1 - '@rollup/rollup-linux-x64-gnu': 4.48.1 - '@rollup/rollup-linux-x64-musl': 4.48.1 - '@rollup/rollup-win32-arm64-msvc': 4.48.1 - '@rollup/rollup-win32-ia32-msvc': 4.48.1 - '@rollup/rollup-win32-x64-msvc': 4.48.1 + '@rollup/rollup-android-arm-eabi': 4.49.0 + '@rollup/rollup-android-arm64': 4.49.0 + '@rollup/rollup-darwin-arm64': 4.49.0 + '@rollup/rollup-darwin-x64': 4.49.0 + '@rollup/rollup-freebsd-arm64': 4.49.0 + '@rollup/rollup-freebsd-x64': 4.49.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.49.0 + '@rollup/rollup-linux-arm-musleabihf': 4.49.0 + '@rollup/rollup-linux-arm64-gnu': 4.49.0 + '@rollup/rollup-linux-arm64-musl': 4.49.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.49.0 + '@rollup/rollup-linux-ppc64-gnu': 4.49.0 + '@rollup/rollup-linux-riscv64-gnu': 4.49.0 + '@rollup/rollup-linux-riscv64-musl': 4.49.0 + '@rollup/rollup-linux-s390x-gnu': 4.49.0 + '@rollup/rollup-linux-x64-gnu': 4.49.0 + '@rollup/rollup-linux-x64-musl': 4.49.0 + '@rollup/rollup-win32-arm64-msvc': 4.49.0 + '@rollup/rollup-win32-ia32-msvc': 4.49.0 + '@rollup/rollup-win32-x64-msvc': 4.49.0 fsevents: 2.3.3 run-parallel@1.2.0: @@ -11660,9 +11668,9 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - update-browserslist-db@1.1.3(browserslist@4.25.3): + update-browserslist-db@1.1.3(browserslist@4.25.4): dependencies: - browserslist: 4.25.3 + browserslist: 4.25.4 escalade: 3.2.0 picocolors: 1.1.1 @@ -11703,10 +11711,10 @@ snapshots: - tsx - yaml - vite-plugin-dts@4.5.4(@types/node@24.3.0)(rollup@4.48.1)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)): + vite-plugin-dts@4.5.4(@types/node@24.3.0)(rollup@4.49.0)(typescript@5.9.2)(vite@6.3.5(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)): dependencies: '@microsoft/api-extractor': 7.52.11(@types/node@24.3.0) - '@rollup/pluginutils': 5.2.0(rollup@4.48.1) + '@rollup/pluginutils': 5.2.0(rollup@4.49.0) '@volar/typescript': 2.4.23 '@vue/language-core': 2.2.0(typescript@5.9.2) compare-versions: 6.1.1 @@ -11728,7 +11736,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.48.1 + rollup: 4.49.0 tinyglobby: 0.2.14 optionalDependencies: '@types/node': 24.3.0 @@ -11800,7 +11808,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.14.1 acorn: 8.15.0 acorn-import-phases: 1.0.4(acorn@8.15.0) - browserslist: 4.25.3 + browserslist: 4.25.4 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.3 es-module-lexer: 1.7.0 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..2c8f4962 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ESNext", + "declaration": true, + "declarationMap": true, + "removeComments": true, + "sourceMap": true, + "useDefineForClassFields": true, + "allowJs": false, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "baseUrl": "." + } +} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index c42b1f14..c474ab61 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -24,6 +24,7 @@ export default defineConfig({ include: ['packages/*/src/**/__tests__/**/*.test.{ts,tsx}'], exclude: ['packages/*/src/**/__tests__/**/*.browser.test.{ts,tsx}'], globals: true, + setupFiles: ['./vitest.setup.ts'], environment: 'node', }, }, @@ -34,11 +35,12 @@ export default defineConfig({ environment: 'happy-dom', globals: true, css: true, - setupFiles: ['@testing-library/jest-dom/vitest'], + setupFiles: ['./vitest.setup.ts', '@testing-library/jest-dom/vitest'], }, plugins: [ DevupUI({ debug: true, + singleCss: true, }), ], }, diff --git a/vitest.setup.ts b/vitest.setup.ts new file mode 100644 index 00000000..442648f6 --- /dev/null +++ b/vitest.setup.ts @@ -0,0 +1,36 @@ +function cartesianProduct(arrays: T) { + return arrays.reduce( + (acc, curr) => acc.flatMap((x) => curr.map((y) => [...x, y])), + [[]], + ) +} + +function createTestMatrix>( + optionsMap: T, +): { + [K in keyof T]: T[K] extends (infer U)[] ? U : never +}[] { + const keys = Object.keys(optionsMap) + const values = Object.values(optionsMap) + + return cartesianProduct(values).map<{ + [K in keyof T]: T[K] extends (infer U)[] ? U : never + }>( + (combination) => + Object.fromEntries(keys.map((key, i) => [key, combination[i]])) as { + [K in keyof T]: T[K] extends (infer U)[] ? U : never + }, + ) +} + +globalThis.createTestMatrix = createTestMatrix + +declare global { + function createTestMatrix>( + optionsMap: T, + ): { + [K in keyof T]: T[K] extends (infer U)[] ? U : never + }[] +} + +export {} From 0a4d382883855806c975cdea31dddab87d126f9a Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:09:52 +0900 Subject: [PATCH 06/12] Add single bench --- benchmark.js | 20 +++++++ benchmark/next-devup-ui-single/.gitignore | 41 ++++++++++++++ benchmark/next-devup-ui-single/README.md | 1 + benchmark/next-devup-ui-single/next.config.ts | 7 +++ benchmark/next-devup-ui-single/package.json | 25 +++++++++ .../next-devup-ui-single/public/file.svg | 1 + .../next-devup-ui-single/public/globe.svg | 1 + .../next-devup-ui-single/public/next.svg | 1 + .../next-devup-ui-single/public/vercel.svg | 1 + .../next-devup-ui-single/public/window.svg | 1 + .../next-devup-ui-single/src/app/favicon.ico | Bin 0 -> 25931 bytes .../next-devup-ui-single/src/app/layout.tsx | 18 +++++++ .../next-devup-ui-single/src/app/page.tsx | 51 ++++++++++++++++++ benchmark/next-devup-ui-single/tsconfig.json | 41 ++++++++++++++ 14 files changed, 209 insertions(+) create mode 100644 benchmark/next-devup-ui-single/.gitignore create mode 100644 benchmark/next-devup-ui-single/README.md create mode 100644 benchmark/next-devup-ui-single/next.config.ts create mode 100644 benchmark/next-devup-ui-single/package.json create mode 100644 benchmark/next-devup-ui-single/public/file.svg create mode 100644 benchmark/next-devup-ui-single/public/globe.svg create mode 100644 benchmark/next-devup-ui-single/public/next.svg create mode 100644 benchmark/next-devup-ui-single/public/vercel.svg create mode 100644 benchmark/next-devup-ui-single/public/window.svg create mode 100644 benchmark/next-devup-ui-single/src/app/favicon.ico create mode 100644 benchmark/next-devup-ui-single/src/app/layout.tsx create mode 100644 benchmark/next-devup-ui-single/src/app/page.tsx create mode 100644 benchmark/next-devup-ui-single/tsconfig.json diff --git a/benchmark.js b/benchmark.js index 01f8a8ce..be81bf39 100644 --- a/benchmark.js +++ b/benchmark.js @@ -20,6 +20,11 @@ function clearBuildFile() { recursive: true, force: true, }) + if (existsSync('./benchmark/next-devup-ui-single/.next')) + rmSync('./benchmark/next-devup-ui-single/.next', { + recursive: true, + force: true, + }) if (existsSync('./benchmark/next-mui/.next')) rmSync('./benchmark/next-mui/.next', { recursive: true, @@ -30,6 +35,11 @@ function clearBuildFile() { recursive: true, force: true, }) + if (existsSync('./benchmark/next-devup-ui-single/df')) + rmSync('./benchmark/next-devup-ui-single/df', { + recursive: true, + force: true, + }) } function checkDirSize(path) { @@ -81,3 +91,13 @@ execSync('pnpm -F next-devup-ui-benchmark build', { }) console.timeEnd('devup-ui') console.info('devup-ui', checkDirSize('./benchmark/next-devup-ui/.next')) + +console.time('devup-ui-single') +execSync('pnpm -F next-devup-ui-single-benchmark build', { + stdio: 'inherit', +}) +console.timeEnd('devup-ui-single') +console.info( + 'devup-ui-single', + checkDirSize('./benchmark/next-devup-ui-single/.next'), +) diff --git a/benchmark/next-devup-ui-single/.gitignore b/benchmark/next-devup-ui-single/.gitignore new file mode 100644 index 00000000..5ef6a520 --- /dev/null +++ b/benchmark/next-devup-ui-single/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/benchmark/next-devup-ui-single/README.md b/benchmark/next-devup-ui-single/README.md new file mode 100644 index 00000000..665152ea --- /dev/null +++ b/benchmark/next-devup-ui-single/README.md @@ -0,0 +1 @@ +## Nextjs App diff --git a/benchmark/next-devup-ui-single/next.config.ts b/benchmark/next-devup-ui-single/next.config.ts new file mode 100644 index 00000000..9e94bd9b --- /dev/null +++ b/benchmark/next-devup-ui-single/next.config.ts @@ -0,0 +1,7 @@ +import { DevupUI } from '@devup-ui/next-plugin' + +const nextConfig = { + /* config options here */ +} + +export default DevupUI(nextConfig, { singleCss: true }) diff --git a/benchmark/next-devup-ui-single/package.json b/benchmark/next-devup-ui-single/package.json new file mode 100644 index 00000000..7488e9b4 --- /dev/null +++ b/benchmark/next-devup-ui-single/package.json @@ -0,0 +1,25 @@ +{ + "name": "next-devup-ui-single-benchmark", + "version": "0.1.0", + "type": "module", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build --experimental-debug-memory-usage", + "start": "next start", + "lint": "eslint" + }, + "dependencies": { + "react": "^19.1.1", + "react-dom": "^19.1.1", + "next": "^15.5.2", + "@devup-ui/react": "workspace:*" + }, + "devDependencies": { + "@devup-ui/next-plugin": "workspace:*", + "typescript": "^5", + "@types/node": "^24", + "@types/react": "^19", + "@types/react-dom": "^19" + } +} \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/public/file.svg b/benchmark/next-devup-ui-single/public/file.svg new file mode 100644 index 00000000..004145cd --- /dev/null +++ b/benchmark/next-devup-ui-single/public/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/public/globe.svg b/benchmark/next-devup-ui-single/public/globe.svg new file mode 100644 index 00000000..567f17b0 --- /dev/null +++ b/benchmark/next-devup-ui-single/public/globe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/public/next.svg b/benchmark/next-devup-ui-single/public/next.svg new file mode 100644 index 00000000..5174b28c --- /dev/null +++ b/benchmark/next-devup-ui-single/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/public/vercel.svg b/benchmark/next-devup-ui-single/public/vercel.svg new file mode 100644 index 00000000..77053960 --- /dev/null +++ b/benchmark/next-devup-ui-single/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/public/window.svg b/benchmark/next-devup-ui-single/public/window.svg new file mode 100644 index 00000000..b2b2a44f --- /dev/null +++ b/benchmark/next-devup-ui-single/public/window.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/benchmark/next-devup-ui-single/src/app/favicon.ico b/benchmark/next-devup-ui-single/src/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v7Ou#83zEDEFcKt(f1E0~=rqeEbTnMvWR#{+9pg%7G8y>u1OVRUSoox-ovF z2Ydma(;=YuBY(eI|04{hXzZD6_f(v~H;C~y5=DhAC{MMS>2fm~1H_t2$56pc$NH8( z5bH|<)71dV-_oCHIrzrT`2s-5w_+2CM0$95I6X8p^r!gHp+j_gd;9O<1~CEQQGS8) zS9Qh3#p&JM-G8rHekNmKVewU;pJRcTAog68KYo^dRo}(M>36U4Us zfgYWSiHZL3;lpWT=zNAW>Dh#mB!_@Lg%$ms8N-;aPqMn+C2HqZgz&9~Eu z4|Kp<`$q)Uw1R?y(~S>ePdonHxpV1#eSP1B;Ogo+-Pk}6#0GsZZ5!||ev2MGdh}_m z{DeR7?0-1^zVs&`AV6Vt;r3`I`OI_wgs*w=eO%_#7Kepl{B@xiyCANc(l zzIyd4y|c6PXWq9-|KM8(zIk8LPk(>a)zyFWjhT!$HJ$qX1vo@d25W<fvZQ2zUz5WRc(UnFMKHwe1| zWmlB1qdbiA(C0jmnV<}GfbKtmcu^2*P^O?MBLZKt|As~ge8&AAO~2K@zbXelK|4T<{|y4`raF{=72kC2Kn(L4YyenWgrPiv z@^mr$t{#X5VuIMeL!7Ab6_kG$&#&5p*Z{+?5U|TZ`B!7llpVmp@skYz&n^8QfPJzL z0G6K_OJM9x+Wu2gfN45phANGt{7=C>i34CV{Xqlx(fWpeAoj^N0Biu`w+MVcCUyU* zDZuzO0>4Z6fbu^T_arWW5n!E45vX8N=bxTVeFoep_G#VmNlQzAI_KTIc{6>c+04vr zx@W}zE5JNSU>!THJ{J=cqjz+4{L4A{Ob9$ZJ*S1?Ggg3klFp!+Y1@K+pK1DqI|_gq z5ZDXVpge8-cs!o|;K73#YXZ3AShj50wBvuq3NTOZ`M&qtjj#GOFfgExjg8Gn8>Vq5 z`85n+9|!iLCZF5$HJ$Iu($dm?8~-ofu}tEc+-pyke=3!im#6pk_Wo8IA|fJwD&~~F zc16osQ)EBo58U7XDuMexaPRjU@h8tXe%S{fA0NH3vGJFhuyyO!Uyl2^&EOpX{9As0 zWj+P>{@}jxH)8|r;2HdupP!vie{sJ28b&bo!8`D^x}TE$%zXNb^X1p@0PJ86`dZyj z%ce7*{^oo+6%&~I!8hQy-vQ7E)0t0ybH4l%KltWOo~8cO`T=157JqL(oq_rC%ea&4 z2NcTJe-HgFjNg-gZ$6!Y`SMHrlj}Etf7?r!zQTPPSv}{so2e>Fjs1{gzk~LGeesX%r(Lh6rbhSo_n)@@G-FTQy93;l#E)hgP@d_SGvyCp0~o(Y;Ee8{ zdVUDbHm5`2taPUOY^MAGOw*>=s7=Gst=D+p+2yON!0%Hk` zz5mAhyT4lS*T3LS^WSxUy86q&GnoHxzQ6vm8)VS}_zuqG?+3td68_x;etQAdu@sc6 zQJ&5|4(I?~3d-QOAODHpZ=hlSg(lBZ!JZWCtHHSj`0Wh93-Uk)_S%zsJ~aD>{`A0~ z9{AG(e|q3g5B%wYKRxiL2Y$8(4w6bzchKuloQW#e&S3n+P- z8!ds-%f;TJ1>)v)##>gd{PdS2Oc3VaR`fr=`O8QIO(6(N!A?pr5C#6fc~Ge@N%Vvu zaoAX2&(a6eWy_q&UwOhU)|P3J0Qc%OdhzW=F4D|pt0E4osw;%<%Dn58hAWD^XnZD= z>9~H(3bmLtxpF?a7su6J7M*x1By7YSUbxGi)Ot0P77`}P3{)&5Un{KD?`-e?r21!4vTTnN(4Y6Lin?UkSM z`MXCTC1@4A4~mvz%Rh2&EwY))LeoT=*`tMoqcEXI>TZU9WTP#l?uFv+@Dn~b(>xh2 z;>B?;Tz2SR&KVb>vGiBSB`@U7VIWFSo=LDSb9F{GF^DbmWAfpms8Sx9OX4CnBJca3 zlj9(x!dIjN?OG1X4l*imJNvRCk}F%!?SOfiOq5y^mZW)jFL@a|r-@d#f7 z2gmU8L3IZq0ynIws=}~m^#@&C%J6QFo~Mo4V`>v7MI-_!EBMMtb%_M&kvAaN)@ZVw z+`toz&WG#HkWDjnZE!6nk{e-oFdL^$YnbOCN}JC&{$#$O27@|Tn-skXr)2ml2~O!5 zX+gYoxhoc7qoU?C^3~&!U?kRFtnSEecWuH0B0OvLodgUAi}8p1 zrO6RSXHH}DMc$&|?D004DiOVMHV8kXCP@7NKB zgaZq^^O<7PoKEp72kby@W0Z!Y*Ay{&vfg#C&gG@YVR9g?FEocMUi1gSN$+V+ayF45{a zuDZDTN}mS|;BO%gEf}pjBfN2-gIrU#G5~cucA;dokXW89%>AyXJJI z9X4UlIWA|ZYHgbI z5?oFk@A=Ik7lrEQPDH!H+b`7_Y~aDb_qa=B2^Y&Ow41cU=4WDd40dp5(QS-WMN-=Y z9g;6_-JdNU;|6cPwf$ak*aJIcwL@1n$#l~zi{c{EW?T;DaW*E8DYq?Umtz{nJ&w-M zEMyTDrC&9K$d|kZe2#ws6)L=7K+{ zQw{XnV6UC$6-rW0emqm8wJoeZK)wJIcV?dST}Z;G0Arq{dVDu0&4kd%N!3F1*;*pW zR&qUiFzK=@44#QGw7k1`3t_d8&*kBV->O##t|tonFc2YWrL7_eqg+=+k;!F-`^b8> z#KWCE8%u4k@EprxqiV$VmmtiWxDLgnGu$Vs<8rppV5EajBXL4nyyZM$SWVm!wnCj-B!Wjqj5-5dNXukI2$$|Bu3Lrw}z65Lc=1G z^-#WuQOj$hwNGG?*CM_TO8Bg-1+qc>J7k5c51U8g?ZU5n?HYor;~JIjoWH-G>AoUP ztrWWLbRNqIjW#RT*WqZgPJXU7C)VaW5}MiijYbABmzoru6EmQ*N8cVK7a3|aOB#O& zBl8JY2WKfmj;h#Q!pN%9o@VNLv{OUL?rixHwOZuvX7{IJ{(EdPpuVFoQqIOa7giLVkBOKL@^smUA!tZ1CKRK}#SSM)iQHk)*R~?M!qkCruaS!#oIL1c z?J;U~&FfH#*98^G?i}pA{ z9Jg36t4=%6mhY(quYq*vSxptes9qy|7xSlH?G=S@>u>Ebe;|LVhs~@+06N<4CViBk zUiY$thvX;>Tby6z9Y1edAMQaiH zm^r3v#$Q#2T=X>bsY#D%s!bhs^M9PMAcHbCc0FMHV{u-dwlL;a1eJ63v5U*?Q_8JO zT#50!RD619#j_Uf))0ooADz~*9&lN!bBDRUgE>Vud-i5ck%vT=r^yD*^?Mp@Q^v+V zG#-?gKlr}Eeqifb{|So?HM&g91P8|av8hQoCmQXkd?7wIJwb z_^v8bbg`SAn{I*4bH$u(RZ6*xUhuA~hc=8czK8SHEKTzSxgbwi~9(OqJB&gwb^l4+m`k*Q;_?>Y-APi1{k zAHQ)P)G)f|AyjSgcCFps)Fh6Bca*Xznq36!pV6Az&m{O8$wGFD? zY&O*3*J0;_EqM#jh6^gMQKpXV?#1?>$ml1xvh8nSN>-?H=V;nJIwB07YX$e6vLxH( zqYwQ>qxwR(i4f)DLd)-$P>T-no_c!LsN@)8`e;W@)-Hj0>nJ-}Kla4-ZdPJzI&Mce zv)V_j;(3ERN3_@I$N<^|4Lf`B;8n+bX@bHbcZTopEmDI*Jfl)-pFDvo6svPRoo@(x z);_{lY<;);XzT`dBFpRmGrr}z5u1=pC^S-{ce6iXQlLGcItwJ^mZx{m$&DA_oEZ)B{_bYPq-HA zcH8WGoBG(aBU_j)vEy+_71T34@4dmSg!|M8Vf92Zj6WH7Q7t#OHQqWgFE3ARt+%!T z?oLovLVlnf?2c7pTc)~cc^($_8nyKwsN`RA-23ed3sdj(ys%pjjM+9JrctL;dy8a( z@en&CQmnV(()bu|Y%G1-4a(6x{aLytn$T-;(&{QIJB9vMox11U-1HpD@d(QkaJdEb zG{)+6Dos_L+O3NpWo^=gR?evp|CqEG?L&Ut#D*KLaRFOgOEK(Kq1@!EGcTfo+%A&I z=dLbB+d$u{sh?u)xP{PF8L%;YPPW53+@{>5W=Jt#wQpN;0_HYdw1{ksf_XhO4#2F= zyPx6Lx2<92L-;L5PD`zn6zwIH`Jk($?Qw({erA$^bC;q33hv!d!>%wRhj# zal^hk+WGNg;rJtb-EB(?czvOM=H7dl=vblBwAv>}%1@{}mnpUznfq1cE^sgsL0*4I zJ##!*B?=vI_OEVis5o+_IwMIRrpQyT_Sq~ZU%oY7c5JMIADzpD!Upz9h@iWg_>>~j zOLS;wp^i$-E?4<_cp?RiS%Rd?i;f*mOz=~(&3lo<=@(nR!_Rqiprh@weZlL!t#NCc zO!QTcInq|%#>OVgobj{~ixEUec`E25zJ~*DofsQdzIa@5^nOXj2T;8O`l--(QyU^$t?TGY^7#&FQ+2SS3B#qK*k3`ye?8jUYSajE5iBbJls75CCc(m3dk{t?- zopcER9{Z?TC)mk~gpi^kbbu>b-+a{m#8-y2^p$ka4n60w;Sc2}HMf<8JUvhCL0B&Btk)T`ctE$*qNW8L$`7!r^9T+>=<=2qaq-;ll2{`{Rg zc5a0ZUI$oG&j-qVOuKa=*v4aY#IsoM+1|c4Z)<}lEDvy;5huB@1RJPquU2U*U-;gu z=En2m+qjBzR#DEJDO`WU)hdd{Vj%^0V*KoyZ|5lzV87&g_j~NCjwv0uQVqXOb*QrQ zy|Qn`hxx(58c70$E;L(X0uZZ72M1!6oeg)(cdKO ze0gDaTz+ohR-#d)NbAH4x{I(21yjwvBQfmpLu$)|m{XolbgF!pmsqJ#D}(ylp6uC> z{bqtcI#hT#HW=wl7>p!38sKsJ`r8}lt-q%Keqy%u(xk=yiIJiUw6|5IvkS+#?JTBl z8H5(Q?l#wzazujH!8o>1xtn8#_w+397*_cy8!pQGP%K(Ga3pAjsaTbbXJlQF_+m+-UpUUent@xM zg%jqLUExj~o^vQ3Gl*>wh=_gOr2*|U64_iXb+-111aH}$TjeajM+I20xw(((>fej-@CIz4S1pi$(#}P7`4({6QS2CaQS4NPENDp>sAqD z$bH4KGzXGffkJ7R>V>)>tC)uax{UsN*dbeNC*v}#8Y#OWYwL4t$ePR?VTyIs!wea+ z5Urmc)X|^`MG~*dS6pGSbU+gPJoq*^a=_>$n4|P^w$sMBBy@f*Z^Jg6?n5?oId6f{ z$LW4M|4m502z0t7g<#Bx%X;9<=)smFolV&(V^(7Cv2-sxbxopQ!)*#ZRhTBpx1)Fc zNm1T%bONzv6@#|dz(w02AH8OXe>kQ#1FMCzO}2J_mST)+ExmBr9cva-@?;wnmWMOk z{3_~EX_xadgJGv&H@zK_8{(x84`}+c?oSBX*Ge3VdfTt&F}yCpFP?CpW+BE^cWY0^ zb&uBN!Ja3UzYHK-CTyA5=L zEMW{l3Usky#ly=7px648W31UNV@K)&Ub&zP1c7%)`{);I4b0Q<)B}3;NMG2JH=X$U zfIW4)4n9ZM`-yRj67I)YSLDK)qfUJ_ij}a#aZN~9EXrh8eZY2&=uY%2N0UFF7<~%M zsB8=erOWZ>Ct_#^tHZ|*q`H;A)5;ycw*IcmVxi8_0Xk}aJA^ath+E;xg!x+As(M#0=)3!NJR6H&9+zd#iP(m0PIW8$ z1Y^VX`>jm`W!=WpF*{ioM?C9`yOR>@0q=u7o>BP-eSHqCgMDj!2anwH?s%i2p+Q7D zzszIf5XJpE)IG4;d_(La-xenmF(tgAxK`Y4sQ}BSJEPs6N_U2vI{8=0C_F?@7<(G; zo$~G=8p+076G;`}>{MQ>t>7cm=zGtfbdDXm6||jUU|?X?CaE?(<6bKDYKeHlz}DA8 zXT={X=yp_R;HfJ9h%?eWvQ!dRgz&Su*JfNt!Wu>|XfU&68iRikRrHRW|ZxzRR^`eIGt zIeiDgVS>IeExKVRWW8-=A=yA`}`)ZkWBrZD`hpWIxBGkh&f#ijr449~m`j6{4jiJ*C!oVA8ZC?$1RM#K(_b zL9TW)kN*Y4%^-qPpMP7d4)o?Nk#>aoYHT(*g)qmRUb?**F@pnNiy6Fv9rEiUqD(^O zzyS?nBrX63BTRYduaG(0VVG2yJRe%o&rVrLjbxTaAFTd8s;<<@Qs>u(<193R8>}2_ zuwp{7;H2a*X7_jryzriZXMg?bTuegABb^87@SsKkr2)0Gyiax8KQWstw^v#ix45EVrcEhr>!NMhprl$InQMzjSFH54x5k9qHc`@9uKQzvL4ihcq{^B zPrVR=o_ic%Y>6&rMN)hTZsI7I<3&`#(nl+3y3ys9A~&^=4?PL&nd8)`OfG#n zwAMN$1&>K++c{^|7<4P=2y(B{jJsQ0a#U;HTo4ZmWZYvI{+s;Td{Yzem%0*k#)vjpB zia;J&>}ICate44SFYY3vEelqStQWFihx%^vQ@Do(sOy7yR2@WNv7Y9I^yL=nZr3mb zXKV5t@=?-Sk|b{XMhA7ZGB@2hqsx}4xwCW!in#C zI@}scZlr3-NFJ@NFaJlhyfcw{k^vvtGl`N9xSo**rDW4S}i zM9{fMPWo%4wYDG~BZ18BD+}h|GQKc-g^{++3MY>}W_uq7jGHx{mwE9fZiPCoxN$+7 zrODGGJrOkcPQUB(FD5aoS4g~7#6NR^ma7-!>mHuJfY5kTe6PpNNKC9GGRiu^L31uG z$7v`*JknQHsYB!Tm_W{a32TM099djW%5e+j0Ve_ct}IM>XLF1Ap+YvcrLV=|CKo6S zb+9Nl3_YdKP6%Cxy@6TxZ>;4&nTneadr z_ES90ydCev)LV!dN=#(*f}|ZORFdvkYBni^aLbUk>BajeWIOcmHP#8S)*2U~QKI%S zyrLmtPqb&TphJ;>yAxri#;{uyk`JJqODDw%(Z=2`1uc}br^V%>j!gS)D*q*f_-qf8&D;W1dJgQMlaH5er zN2U<%Smb7==vE}dDI8K7cKz!vs^73o9f>2sgiTzWcwY|BMYHH5%Vn7#kiw&eItCqa zIkR2~Q}>X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m literal 0 HcmV?d00001 diff --git a/benchmark/next-devup-ui-single/src/app/layout.tsx b/benchmark/next-devup-ui-single/src/app/layout.tsx new file mode 100644 index 00000000..6b8b4518 --- /dev/null +++ b/benchmark/next-devup-ui-single/src/app/layout.tsx @@ -0,0 +1,18 @@ +import type { Metadata } from 'next' + +export const metadata: Metadata = { + title: 'Create Next App', + description: 'Generated by create next app', +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode +}>) { + return ( + + {children} + + ) +} diff --git a/benchmark/next-devup-ui-single/src/app/page.tsx b/benchmark/next-devup-ui-single/src/app/page.tsx new file mode 100644 index 00000000..ab9216cc --- /dev/null +++ b/benchmark/next-devup-ui-single/src/app/page.tsx @@ -0,0 +1,51 @@ +'use client' + +import { Box, Text } from '@devup-ui/react' +import { useState } from 'react' + +export default function HomePage() { + const [color, setColor] = useState('yellow') + const [enabled, setEnabled] = useState(false) + + return ( +
+

+ Track & field champions: +

+ + hello + hello + + text + + hello + + hello + +
+ ) +} diff --git a/benchmark/next-devup-ui-single/tsconfig.json b/benchmark/next-devup-ui-single/tsconfig.json new file mode 100644 index 00000000..426d9c2d --- /dev/null +++ b/benchmark/next-devup-ui-single/tsconfig.json @@ -0,0 +1,41 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": [ + "./src/*" + ] + } + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "df/*.d.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file From f09bf2be4c74dd4f1e73aab71abe5dc3d840f6b2 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:13:05 +0900 Subject: [PATCH 07/12] Fix lint --- bindings/devup-ui-wasm/src/lib.rs | 2 +- libs/css/src/file_map.rs | 2 +- libs/css/src/lib.rs | 17 ++++++++--------- libs/sheet/src/lib.rs | 14 +++++--------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/bindings/devup-ui-wasm/src/lib.rs b/bindings/devup-ui-wasm/src/lib.rs index 84631582..1e81040d 100644 --- a/bindings/devup-ui-wasm/src/lib.rs +++ b/bindings/devup-ui-wasm/src/lib.rs @@ -285,7 +285,7 @@ pub fn get_default_theme() -> Result, JsValue> { #[wasm_bindgen(js_name = "getCss")] pub fn get_css(file_num: Option) -> Result { let sheet = GLOBAL_STYLE_SHEET.lock().unwrap(); - Ok(sheet.create_css(file_num.map(|num| get_filename_by_file_num(num)).as_deref())) + Ok(sheet.create_css(file_num.map(get_filename_by_file_num).as_deref())) } #[wasm_bindgen(js_name = "getThemeInterface")] diff --git a/libs/css/src/file_map.rs b/libs/css/src/file_map.rs index 08721c8c..0af29426 100644 --- a/libs/css/src/file_map.rs +++ b/libs/css/src/file_map.rs @@ -25,7 +25,7 @@ pub fn get_file_num_by_filename(filename: &str) -> usize { let mut map = GLOBAL_FILE_MAP.lock().unwrap(); let len = map.len(); if !map.contains_left(filename) { - map.insert(filename.to_string(), len as usize); + map.insert(filename.to_string(), len); } *map.get_by_left(filename).unwrap() } diff --git a/libs/css/src/lib.rs b/libs/css/src/lib.rs index 5e65f47f..36f7b8c7 100644 --- a/libs/css/src/lib.rs +++ b/libs/css/src/lib.rs @@ -11,7 +11,6 @@ mod selector_separator; pub mod style_selector; pub mod utils; -use std::collections::HashMap; use std::hash::{DefaultHasher, Hash, Hasher}; use crate::class_map::GLOBAL_CLASS_MAP; @@ -75,14 +74,14 @@ pub fn keyframes_to_keyframes_name(keyframes: &str, filename: Option<&str>) -> S let filename = filename.unwrap_or_default().to_string(); let class_num = map .entry(filename.to_string()) - .or_insert_with(HashMap::new) + .or_default() .get(&key) - .map(|v| format!("{}", num_to_nm_base(*v))) + .map(|v| num_to_nm_base(*v).to_string()) .unwrap_or_else(|| { - let m = map.entry(filename.to_string()).or_insert_with(HashMap::new); + let m = map.entry(filename.to_string()).or_default(); let len = m.len(); m.insert(key, len); - format!("{}", num_to_nm_base(len)) + num_to_nm_base(len).to_string() }); if !filename.is_empty() { format!( @@ -139,11 +138,11 @@ pub fn sheet_to_classname( let filename = filename.map(|v| v.to_string()).unwrap_or_default(); let clas_num = map .entry(filename.to_string()) - .or_insert_with(HashMap::new) + .or_default() .get(&key) .map(|v| num_to_nm_base(*v)) .unwrap_or_else(|| { - let m = map.entry(filename.to_string()).or_insert_with(HashMap::new); + let m = map.entry(filename.to_string()).or_default(); let len = m.len(); m.insert(key, len); num_to_nm_base(len) @@ -184,11 +183,11 @@ pub fn sheet_to_variable_name(property: &str, level: u8, selector: Option<&str>) ); let mut map = GLOBAL_CLASS_MAP.lock().unwrap(); map.entry("".to_string()) - .or_insert_with(HashMap::new) + .or_default() .get(&key) .map(|v| format!("--{}", num_to_nm_base(*v))) .unwrap_or_else(|| { - let m = map.entry("".to_string()).or_insert_with(HashMap::new); + let m = map.entry("".to_string()).or_default(); let len = m.len(); m.insert(key, len); format!("--{}", num_to_nm_base(len)) diff --git a/libs/sheet/src/lib.rs b/libs/sheet/src/lib.rs index 14d05745..0eb41012 100644 --- a/libs/sheet/src/lib.rs +++ b/libs/sheet/src/lib.rs @@ -101,6 +101,7 @@ impl ExtractStyle for StyleSheetCss { } type PropertyMap = BTreeMap>>; +type KeyframesMap = BTreeMap>>>; fn deserialize_btree_map_u8<'de, D>( deserializer: D, @@ -135,7 +136,7 @@ pub struct StyleSheet { pub properties: BTreeMap, pub css: BTreeMap>, #[serde(default)] - pub keyframes: BTreeMap>>>, + pub keyframes: KeyframesMap, #[serde(default)] pub global_css_files: BTreeSet, #[serde(default)] @@ -147,6 +148,7 @@ pub struct StyleSheet { } impl StyleSheet { + #[allow(clippy::too_many_arguments)] pub fn add_property( &mut self, class_name: &str, @@ -341,10 +343,7 @@ impl StyleSheet { css.push_str("@import \"./devup-ui.css\";"); } - if let Some(keyframes) = self - .keyframes - .get(&filename.unwrap_or_default().to_string()) - { + if let Some(keyframes) = self.keyframes.get(filename.unwrap_or_default()) { for (name, map) in keyframes { css.push_str(&format!( "@keyframes {name}{{{}}}", @@ -363,10 +362,7 @@ impl StyleSheet { } // order - if let Some(maps) = self - .properties - .get(&filename.unwrap_or_default().to_string()) - { + if let Some(maps) = self.properties.get(filename.unwrap_or_default()) { for (_, map) in maps.iter() { for (level, props) in map.iter() { let (mut global_props, rest): (Vec<_>, Vec<_>) = From e6a3bdce6a3696836cea4460387ce5ea8afecca7 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:14:58 +0900 Subject: [PATCH 08/12] Update package --- pnpm-lock.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8947cb6..9eea54f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -307,6 +307,37 @@ importers: specifier: ^5 version: 5.9.2 + benchmark/next-devup-ui-single: + dependencies: + '@devup-ui/react': + specifier: workspace:* + version: link:../../packages/react + next: + specifier: ^15.5.2 + version: 15.5.2(@babel/core@7.28.3)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + react: + specifier: ^19.1.1 + version: 19.1.1 + react-dom: + specifier: ^19.1.1 + version: 19.1.1(react@19.1.1) + devDependencies: + '@devup-ui/next-plugin': + specifier: workspace:* + version: link:../../packages/next-plugin + '@types/node': + specifier: ^24 + version: 24.3.0 + '@types/react': + specifier: ^19 + version: 19.1.12 + '@types/react-dom': + specifier: ^19 + version: 19.1.9(@types/react@19.1.12) + typescript: + specifier: ^5 + version: 5.9.2 + benchmark/next-kuma-ui: dependencies: '@kuma-ui/core': From ce00cbdeed85b0dcd45f284ada3adc0b5211ca8d Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:20:47 +0900 Subject: [PATCH 09/12] Fix lint --- libs/css/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/css/src/lib.rs b/libs/css/src/lib.rs index 36f7b8c7..c2481f0a 100644 --- a/libs/css/src/lib.rs +++ b/libs/css/src/lib.rs @@ -613,7 +613,7 @@ mod tests { fn test_set_class_map() { let mut map = HashMap::new(); map.insert("".to_string(), HashMap::new()); - map.get_mut(&"".to_string()) + map.get_mut("") .unwrap() .insert("background-0-rgba(255,0,0,0.5)-".to_string(), 1); set_class_map(map); From f6db741f001fff751b7d14d80451dccba213df80 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:27:28 +0900 Subject: [PATCH 10/12] Rm comment --- packages/next-plugin/src/__tests__/plugin.test.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/next-plugin/src/__tests__/plugin.test.ts b/packages/next-plugin/src/__tests__/plugin.test.ts index dbad6070..c64abd12 100644 --- a/packages/next-plugin/src/__tests__/plugin.test.ts +++ b/packages/next-plugin/src/__tests__/plugin.test.ts @@ -138,10 +138,6 @@ describe('DevupUINextPlugin', () => { }, }) expect(mkdirSync).toHaveBeenCalledWith('df') - // expect(writeFileSync).toHaveBeenCalledWith( - // resolve('df', 'devup-ui', 'devup-ui.css'), - // '/* devup-ui */', - // ) expect(writeFileSync).toHaveBeenCalledWith(join('df', '.gitignore'), '*') }) }) From 9045f5759f842f24ec1468bb803e32d399b7fa08 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 01:30:52 +0900 Subject: [PATCH 11/12] Add changeset --- .changeset/neat-donuts-fix.md | 10 ++++++++++ .changeset/petite-dragons-carry.md | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 .changeset/neat-donuts-fix.md create mode 100644 .changeset/petite-dragons-carry.md diff --git a/.changeset/neat-donuts-fix.md b/.changeset/neat-donuts-fix.md new file mode 100644 index 00000000..540a24c2 --- /dev/null +++ b/.changeset/neat-donuts-fix.md @@ -0,0 +1,10 @@ +--- +"@devup-ui/rsbuild-plugin": patch +"@devup-ui/webpack-plugin": patch +"@devup-ui/wasm": patch +"@devup-ui/next-plugin": patch +"@devup-ui/vite-plugin": patch +"@devup-ui/components": patch +--- + +Feat split css diff --git a/.changeset/petite-dragons-carry.md b/.changeset/petite-dragons-carry.md new file mode 100644 index 00000000..8cea4206 --- /dev/null +++ b/.changeset/petite-dragons-carry.md @@ -0,0 +1,8 @@ +--- +"@devup-ui/rsbuild-plugin": patch +"@devup-ui/webpack-plugin": patch +"@devup-ui/next-plugin": patch +"@devup-ui/vite-plugin": patch +--- + +Update option From 6e0601315e021d8ec5b07e6d242e97f49ed2ce3f Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Sat, 30 Aug 2025 02:52:10 +0900 Subject: [PATCH 12/12] Fix vite, rsbuild --- apps/rsbuild/rsbuild.config.mjs | 10 +- apps/vite/src/App.tsx | 2 +- apps/vite/vite.config.ts | 1 + .../src/__tests__/plugin.test.ts | 121 +++++++++++++++++- packages/rsbuild-plugin/src/plugin.ts | 40 +++++- packages/rsbuild-plugin/tsconfig.json | 19 ++- .../vite-plugin/src/__tests__/plugin.test.ts | 34 ++--- packages/vite-plugin/src/plugin.ts | 61 +++++---- 8 files changed, 226 insertions(+), 62 deletions(-) diff --git a/apps/rsbuild/rsbuild.config.mjs b/apps/rsbuild/rsbuild.config.mjs index bbf18ab0..761daf4c 100644 --- a/apps/rsbuild/rsbuild.config.mjs +++ b/apps/rsbuild/rsbuild.config.mjs @@ -1,7 +1,7 @@ -import { defineConfig } from '@rsbuild/core'; -import { pluginReact } from '@rsbuild/plugin-react'; -import { DevupUIRsbuildPlugin } from '@devup-ui/rsbuild-plugin'; +import { DevupUI } from '@devup-ui/rsbuild-plugin' +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' export default defineConfig({ - plugins: [pluginReact(), DevupUIRsbuildPlugin()], -}); + plugins: [pluginReact(), DevupUI()], +}) diff --git a/apps/vite/src/App.tsx b/apps/vite/src/App.tsx index 88f55b93..cd1263fb 100644 --- a/apps/vite/src/App.tsx +++ b/apps/vite/src/App.tsx @@ -14,7 +14,7 @@ export default function App() { hello - + wf typo diff --git a/apps/vite/vite.config.ts b/apps/vite/vite.config.ts index b41e40a9..456eed06 100644 --- a/apps/vite/vite.config.ts +++ b/apps/vite/vite.config.ts @@ -8,6 +8,7 @@ export default defineConfig({ react(), DevupUI({ include: ['vite-lib-example'], + // singleCss: true, }), ], }) diff --git a/packages/rsbuild-plugin/src/__tests__/plugin.test.ts b/packages/rsbuild-plugin/src/__tests__/plugin.test.ts index fec7f4a9..539054f1 100644 --- a/packages/rsbuild-plugin/src/__tests__/plugin.test.ts +++ b/packages/rsbuild-plugin/src/__tests__/plugin.test.ts @@ -1,8 +1,13 @@ import { existsSync } from 'node:fs' import { mkdir, readFile, writeFile } from 'node:fs/promises' -import { resolve } from 'node:path' +import { join, resolve } from 'node:path' -import { codeExtract, getThemeInterface } from '@devup-ui/wasm' +import { + codeExtract, + getDefaultTheme, + getThemeInterface, + registerTheme, +} from '@devup-ui/wasm' import { vi } from 'vitest' import { DevupUI } from '../plugin' @@ -34,8 +39,10 @@ describe('DevupUIRsbuildPlugin', () => { expect(typeof plugin.setup).toBe('function') const transform = vi.fn() + const modifyRsbuildConfig = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig, } as any) expect(transform).toHaveBeenCalled() }) @@ -51,8 +58,10 @@ describe('DevupUIRsbuildPlugin', () => { expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() + const modifyRsbuildConfig = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig, } as any) }) @@ -66,8 +75,10 @@ describe('DevupUIRsbuildPlugin', () => { expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() + const modifyRsbuildConfig = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig, } as any) }) @@ -104,8 +115,10 @@ describe('DevupUIRsbuildPlugin', () => { expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() + const modifyRsbuildConfig = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig, } as any) expect(transform).toHaveBeenCalled() expect(transform).toHaveBeenCalledWith( @@ -130,8 +143,10 @@ describe('DevupUIRsbuildPlugin', () => { expect(plugin).toBeDefined() expect(plugin.setup).toBeDefined() const transform = vi.fn() + const modifyRsbuildConfig = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig, } as any) expect(transform).toHaveBeenCalled() expect(transform).toHaveBeenCalledWith( @@ -182,6 +197,7 @@ const App = () => `, const transform = vi.fn() await plugin.setup({ transform, + modifyRsbuildConfig: vi.fn(), } as any) expect(transform).toHaveBeenCalled() expect(transform).toHaveBeenCalledWith( @@ -220,4 +236,105 @@ const App = () => `, map: undefined, }) }) + it.each( + createTestMatrix({ + watch: [true, false], + existsDevupFile: [true, false], + existsDistDir: [true, false], + existsSheetFile: [true, false], + existsClassMapFile: [true, false], + existsFileMapFile: [true, false], + existsCssDir: [true, false], + getDefaultTheme: ['theme', ''], + singleCss: [true, false], + }), + )('should write data files', async (options) => { + vi.mocked(writeFile).mockResolvedValueOnce(undefined) + vi.mocked(readFile).mockResolvedValueOnce(JSON.stringify({})) + vi.mocked(getThemeInterface).mockReturnValue('interface code') + vi.mocked(getDefaultTheme).mockReturnValue(options.getDefaultTheme) + vi.mocked(existsSync).mockImplementation((path) => { + if (path === 'devup.json') return options.existsDevupFile + if (path === 'df') return options.existsDistDir + if (path === resolve('df', 'devup-ui')) return options.existsCssDir + if (path === join('df', 'sheet.json')) return options.existsSheetFile + if (path === join('df', 'classMap.json')) + return options.existsClassMapFile + if (path === join('df', 'fileMap.json')) return options.existsFileMapFile + return false + }) + const plugin = DevupUI({ singleCss: options.singleCss }) + await (plugin as any).setup({ + transform: vi.fn(), + renderChunk: vi.fn(), + generateBundle: vi.fn(), + closeBundle: vi.fn(), + resolve: vi.fn(), + load: vi.fn(), + modifyRsbuildConfig: vi.fn(), + watchChange: vi.fn(), + resolveId: vi.fn(), + } as any) + if (options.existsDevupFile) { + expect(readFile).toHaveBeenCalledWith('devup.json', 'utf-8') + expect(registerTheme).toHaveBeenCalledWith({}) + expect(getThemeInterface).toHaveBeenCalledWith( + '@devup-ui/react', + 'DevupThemeColors', + 'DevupThemeTypography', + 'DevupTheme', + ) + expect(writeFile).toHaveBeenCalledWith( + join('df', 'theme.d.ts'), + 'interface code', + 'utf-8', + ) + } else { + expect(registerTheme).toHaveBeenCalledWith({}) + } + + const modifyRsbuildConfig = vi.fn() + await (plugin as any).setup({ + transform: vi.fn(), + renderChunk: vi.fn(), + generateBundle: vi.fn(), + closeBundle: vi.fn(), + resolve: vi.fn(), + modifyRsbuildConfig, + load: vi.fn(), + watchChange: vi.fn(), + resolveId: vi.fn(), + } as any) + if (options.getDefaultTheme) { + expect(modifyRsbuildConfig).toHaveBeenCalledWith(expect.any(Function)) + const config = { + source: { + define: {}, + }, + } + modifyRsbuildConfig.mock.calls[0][0](config) + expect(config).toEqual({ + source: { + define: { + 'process.env.DEVUP_UI_DEFAULT_THEME': JSON.stringify( + options.getDefaultTheme, + ), + }, + }, + }) + } else { + expect(modifyRsbuildConfig).toHaveBeenCalledWith(expect.any(Function)) + const config = { + source: { + define: {}, + }, + } + modifyRsbuildConfig.mock.calls[0][0](config) + expect(config).toEqual({ + source: { + define: {}, + }, + }) + } + }) }) diff --git a/packages/rsbuild-plugin/src/plugin.ts b/packages/rsbuild-plugin/src/plugin.ts index 33ba33df..873985c5 100644 --- a/packages/rsbuild-plugin/src/plugin.ts +++ b/packages/rsbuild-plugin/src/plugin.ts @@ -4,6 +4,8 @@ import { basename, join, resolve } from 'node:path' import { codeExtract, + getCss, + getDefaultTheme, getThemeInterface, registerTheme, setDebug, @@ -26,7 +28,7 @@ let globalCss = '' async function writeDataFiles( options: Omit< DevupUIRsbuildPluginOptions, - 'extractCss' | 'debug' | 'include' | 'singleCss' + 'extractCss' | 'debug' | 'include' >, ) { try { @@ -44,9 +46,11 @@ async function writeDataFiles( ) if (interfaceCode) { - await writeFile(join(options.distDir, 'theme.d.ts'), interfaceCode, { - encoding: 'utf-8', - }) + await writeFile( + join(options.distDir, 'theme.d.ts'), + interfaceCode, + 'utf-8', + ) } } else { registerTheme({}) @@ -55,8 +59,14 @@ async function writeDataFiles( console.error(error) registerTheme({}) } - if (!existsSync(options.cssDir)) - await mkdir(options.cssDir, { recursive: true }) + await Promise.all([ + !existsSync(options.cssDir) + ? mkdir(options.cssDir, { recursive: true }) + : Promise.resolve(), + !options.singleCss + ? writeFile(join(options.cssDir, 'devup-ui.css'), getCss()) + : Promise.resolve(), + ]) } export const DevupUI = ({ @@ -72,11 +82,16 @@ export const DevupUI = ({ name: 'devup-ui-rsbuild-plugin', async setup(api) { setDebug(debug) + + if (!existsSync(distDir)) await mkdir(distDir, { recursive: true }) + await writeFile(join(distDir, '.gitignore'), '*', 'utf-8') + await writeDataFiles({ package: libPackage, cssDir, devupFile, distDir, + singleCss, }) if (!extractCss) return @@ -87,6 +102,19 @@ export const DevupUI = ({ () => globalCss, ) + api.modifyRsbuildConfig((config) => { + const theme = getDefaultTheme() + if (theme) { + config.source ??= {} + config.source.define = { + 'process.env.DEVUP_UI_DEFAULT_THEME': + JSON.stringify(getDefaultTheme()), + ...config.source.define, + } + } + return config + }) + api.transform( { test: /\.(tsx|ts|js|mjs|jsx)$/, diff --git a/packages/rsbuild-plugin/tsconfig.json b/packages/rsbuild-plugin/tsconfig.json index 4c6e75be..30053bb9 100644 --- a/packages/rsbuild-plugin/tsconfig.json +++ b/packages/rsbuild-plugin/tsconfig.json @@ -1,6 +1,10 @@ { "compilerOptions": { - "types": ["vite/client", "vitest/importMeta", "vitest/globals"], + "types": [ + "vite/client", + "vitest/importMeta", + "vitest/globals" + ], "strict": true, "target": "ESNext", "declaration": true, @@ -22,5 +26,14 @@ "noEmit": true, "baseUrl": ".", "jsx": "react-jsx" - } -} + }, + "include": [ + "src", + "vite.config.ts", + "../../vitest.setup.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} \ No newline at end of file diff --git a/packages/vite-plugin/src/__tests__/plugin.test.ts b/packages/vite-plugin/src/__tests__/plugin.test.ts index de5a399b..9c4371ba 100644 --- a/packages/vite-plugin/src/__tests__/plugin.test.ts +++ b/packages/vite-plugin/src/__tests__/plugin.test.ts @@ -33,7 +33,6 @@ describe('devupUIVitePlugin', () => { name: 'devup-ui', config: expect.any(Function), load: expect.any(Function), - resolveId: expect.any(Function), watchChange: expect.any(Function), enforce: 'pre', transform: expect.any(Function), @@ -73,6 +72,7 @@ describe('devupUIVitePlugin', () => { existsFileMapFile: [true, false], existsCssDir: [true, false], getDefaultTheme: ['theme', ''], + singleCss: [true, false], }), )('should write data files', async (options) => { vi.mocked(writeFile).mockResolvedValueOnce(undefined) @@ -89,7 +89,7 @@ describe('devupUIVitePlugin', () => { if (path === join('df', 'fileMap.json')) return options.existsFileMapFile return false }) - const plugin = DevupUI({}) + const plugin = DevupUI({ singleCss: options.singleCss }) await (plugin as any).configResolved() if (options.existsDevupFile) { expect(readFile).toHaveBeenCalledWith('devup.json', 'utf-8') @@ -131,7 +131,11 @@ describe('devupUIVitePlugin', () => { const plugin = DevupUI({}) await (plugin as any).configResolved() expect(registerTheme).toHaveBeenCalledWith({}) - expect(writeFile).not.toHaveBeenCalled() + expect(writeFile).toHaveBeenCalledWith( + join('df', '.gitignore'), + '*', + 'utf-8', + ) }) it('should watch change', async () => { @@ -164,27 +168,11 @@ describe('devupUIVitePlugin', () => { expect(console.error).toHaveBeenCalledWith(expect.any(Error)) }) - it.each( - createTestMatrix({ - singleCss: [true, false], - }), - )('should resolveId', (options) => { - const plugin = DevupUI(options) - expect( - (plugin as any).resolveId(resolve('df', 'devup-ui', 'devup-ui.css')), - ).toEqual(options.singleCss ? expect.any(String) : undefined) - }) - - it.each( - createTestMatrix({ - singleCss: [true, false], - }), - )('should load', (options) => { + it('should load', () => { vi.mocked(getCss).mockReturnValue('css code') - const plugin = DevupUI(options) - expect((plugin as any).load('devup-ui.css')).toEqual( - options.singleCss ? expect.any(String) : undefined, - ) + const plugin = DevupUI({}) + expect((plugin as any).load('devup-ui.css')).toEqual(expect.any(String)) + expect((plugin as any).load('devup-ui-10.css')).toEqual(expect.any(String)) }) it.each( diff --git a/packages/vite-plugin/src/plugin.ts b/packages/vite-plugin/src/plugin.ts index 4da40297..e7da96e2 100644 --- a/packages/vite-plugin/src/plugin.ts +++ b/packages/vite-plugin/src/plugin.ts @@ -1,6 +1,6 @@ import { existsSync } from 'node:fs' import { mkdir, readFile, writeFile } from 'node:fs/promises' -import { basename, join, resolve } from 'node:path' +import { basename, dirname, join, relative, resolve } from 'node:path' import { codeExtract, @@ -10,7 +10,7 @@ import { registerTheme, setDebug, } from '@devup-ui/wasm' -import { normalizePath, type PluginOption, type UserConfig } from 'vite' +import { type PluginOption, type UserConfig } from 'vite' export interface DevupUIPluginOptions { package: string @@ -23,11 +23,13 @@ export interface DevupUIPluginOptions { singleCss: boolean } +function getFileNumByFilename(filename: string) { + if (filename.endsWith('devup-ui.css')) return null + return parseInt(filename.split('devup-ui-')[1].split('.')[0]) +} + async function writeDataFiles( - options: Omit< - DevupUIPluginOptions, - 'extractCss' | 'debug' | 'include' | 'singleCss' - >, + options: Omit, ) { try { const content = existsSync(options.devupFile) @@ -57,11 +59,17 @@ async function writeDataFiles( console.error(error) registerTheme({}) } - if (!existsSync(options.cssDir)) - await mkdir(options.cssDir, { recursive: true }) + await Promise.all([ + !existsSync(options.cssDir) + ? mkdir(options.cssDir, { recursive: true }) + : Promise.resolve(), + !options.singleCss + ? writeFile(join(options.cssDir, 'devup-ui.css'), getCss()) + : Promise.resolve(), + ]) } -let globalCss = '' +const cssMap: Map = new Map() export function DevupUI({ package: libPackage = '@devup-ui/react', @@ -77,11 +85,14 @@ export function DevupUI({ return { name: 'devup-ui', async configResolved() { + if (!existsSync(distDir)) await mkdir(distDir, { recursive: true }) + await writeFile(join(distDir, '.gitignore'), '*', 'utf-8') await writeDataFiles({ package: libPackage, cssDir, devupFile, distDir, + singleCss, }) }, config() { @@ -129,23 +140,21 @@ export function DevupUI({ cssDir, devupFile, distDir, + singleCss, }) } catch (error) { console.error(error) } } }, - resolveId(id) { - if ( - singleCss && - normalizePath(id) === normalizePath(join(cssDir, 'devup-ui.css')) - ) - return `devup-ui.css?t=${Date.now().toString() + globalCss.length}` - }, load(id) { - if (singleCss && id.split('?')[0] === 'devup-ui.css') - // for no share env like storybook - return (globalCss = getCss()) + const fileName = basename(id).split('?')[0] + if (fileName.startsWith('devup-ui') && fileName.endsWith('.css')) { + const fileNum = getFileNumByFilename(id) + const css = getCss(fileNum) + cssMap.set(fileNum, css) + return css + } }, enforce: 'pre', async transform(code, id) { @@ -163,21 +172,27 @@ export function DevupUI({ return } + let rel = relative(dirname(id), cssDir).replaceAll('\\', '/') + if (!rel.startsWith('./')) rel = `./${rel}` + const { code: retCode, css, map, css_file, - } = codeExtract(fileName, code, libPackage, cssDir, singleCss) + } = codeExtract(fileName, code, libPackage, rel, singleCss) if (css) { - if (globalCss.length < css.length) globalCss = css + const fileNum = getFileNumByFilename(css_file) + const prevCss = cssMap.get(fileNum) + if (prevCss && prevCss.length < css.length) cssMap.set(fileNum, css) await writeFile( join(cssDir, basename(css_file)), `/* ${id} ${Date.now()} */`, 'utf-8', ) } + // console.log('transform', retCode) return { code: retCode, map, @@ -190,7 +205,9 @@ export function DevupUI({ (file) => file.includes('devup-ui') && file.endsWith('.css'), ) if (cssFile && 'source' in bundle[cssFile]) { - bundle[cssFile].source = globalCss + const fileNum = getFileNumByFilename(cssFile) + const css = cssMap.get(fileNum) + if (css) bundle[cssFile].source = css } }, }