build: 清理代码并且升级依赖。

This commit is contained in:
Ivan Li 2023-02-12 15:03:40 +08:00
parent 5422cca393
commit 070100cdbc
6 changed files with 264 additions and 281 deletions

View File

@ -12,11 +12,11 @@
"dependencies": { "dependencies": {
"@emotion/react": "^11.10.5", "@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-regular-svg-icons": "^6.2.1", "@fortawesome/free-regular-svg-icons": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@mui/material": "^5.11.4", "@mui/material": "^5.11.8",
"@tauri-apps/api": "^1.2.0", "@tauri-apps/api": "^1.2.0",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"debug": "^4.3.4", "debug": "^4.3.4",
@ -27,28 +27,28 @@
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/plugin-transform-react-jsx": "^7.20.7", "@babel/plugin-transform-react-jsx": "^7.20.13",
"@emotion/babel-plugin-jsx-pragmatic": "^0.2.0", "@emotion/babel-plugin-jsx-pragmatic": "^0.2.0",
"@emotion/serialize": "^1.1.1", "@emotion/serialize": "^1.1.1",
"@tauri-apps/cli": "^1.2.2", "@tauri-apps/cli": "^1.2.3",
"@types/debug": "^4.1.7", "@types/debug": "^4.1.7",
"@types/node": "^18.11.18", "@types/node": "^18.13.0",
"@types/ramda": "^0.28.20", "@types/ramda": "^0.28.23",
"@types/react": "^18.0.26", "@types/react": "^18.0.28",
"@types/react-dom": "^18.0.10", "@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^2.2.0", "@vitejs/plugin-react": "^2.2.0",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"babel-plugin-macros": "^3.1.0", "babel-plugin-macros": "^3.1.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.4", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^8.0.0", "eslint-plugin-simple-import-sort": "^8.0.0",
"postcss": "^8.4.21", "postcss": "^8.4.21",
"prettier": "^2.8.3", "prettier": "^2.8.4",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.2.6",
"twin.macro": "^3.1.0", "twin.macro": "^3.1.0",
"typescript": "^4.9.4", "typescript": "^4.9.5",
"vite": "^3.2.5" "vite": "^3.2.5"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -140,7 +140,6 @@ impl CoreManager {
tokio::spawn(async move { tokio::spawn(async move {
let mut global_sub_pixels = HashMap::new(); let mut global_sub_pixels = HashMap::new();
while let Some(screenshot) = rx.recv().await { while let Some(screenshot) = rx.recv().await {
let start_at = Instant::now();
let colors = screenshot.get_colors(); let colors = screenshot.get_colors();
let config = screenshot.get_config(); let config = screenshot.get_config();
for (colors, config) in vec![ for (colors, config) in vec![

View File

@ -115,7 +115,6 @@ mod tests {
async fn write_config_to_disk_should_be_successful() { async fn write_config_to_disk_should_be_successful() {
let temp = TestDir::temp().create("config_dir", test_dir::FileType::Dir); let temp = TestDir::temp().create("config_dir", test_dir::FileType::Dir);
let config_file_path = temp.path("config_dir").join("picker.config.json"); let config_file_path = temp.path("config_dir").join("picker.config.json");
let manager = crate::picker::config::manger::Manager::default();
crate::picker::config::manger::Manager::write_config_to_disk( crate::picker::config::manger::Manager::write_config_to_disk(
config_file_path.clone(), config_file_path.clone(),
&Configuration::default(), &Configuration::default(),

View File

@ -9,10 +9,6 @@ pub struct DisplayPicker {
} }
impl DisplayPicker { impl DisplayPicker {
pub fn new(screen: Screen, config: DisplayConfig) -> Self {
Self { screen, config }
}
pub fn from_config(config: DisplayConfig) -> anyhow::Result<Self> { pub fn from_config(config: DisplayConfig) -> anyhow::Result<Self> {
let displays = Display::all() let displays = Display::all()
.map_err(|error| anyhow::anyhow!("Can not get all of displays. {}", error))?; .map_err(|error| anyhow::anyhow!("Can not get all of displays. {}", error))?;

View File

@ -3,7 +3,6 @@ use std::{io::ErrorKind::WouldBlock, time::Duration, thread};
pub struct Screen { pub struct Screen {
capturer: Option<Capturer>, capturer: Option<Capturer>,
init_error: Option<anyhow::Error>,
pub width: usize, pub width: usize,
pub height: usize, pub height: usize,
} }
@ -12,16 +11,6 @@ impl Screen {
pub fn new(capturer: Capturer, width: usize, height: usize) -> Self { pub fn new(capturer: Capturer, width: usize, height: usize) -> Self {
Self { Self {
capturer: Some(capturer), capturer: Some(capturer),
init_error: None,
width,
height,
}
}
pub fn new_failed(init_error: anyhow::Error, width: usize, height: usize) -> Self {
Self {
capturer: None,
init_error: Some(init_error),
width, width,
height, height,
} }