mirror of
https://github.com/aleksey-hoffman/sigma-file-manager.git
synced 2026-10-18 17:20:21 -05:00
Dev: bump deps; code clean up
This commit is contained in:
1 parent
31c665c6f8
commit
1d5a1c55a4
24 files changed
+2655
-3145
No files matched your search
Generated
+330
-268
File diff suppressed because it is too large.
Load diff
@@ -8,11 +8,15 @@
|
||||
"test": "wdio run wdio.conf.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wdio/cli": "^9.19.0",
|
||||
"@wdio/globals": "^9.19.0",
|
||||
"@wdio/local-runner": "^9.19.0",
|
||||
"@wdio/mocha-framework": "^9.19.0",
|
||||
"@wdio/spec-reporter": "^9.19.0",
|
||||
"@wdio/cli": "^9.29.1",
|
||||
"@wdio/globals": "^9.29.1",
|
||||
"@wdio/local-runner": "^9.29.1",
|
||||
"@wdio/mocha-framework": "^9.29.1",
|
||||
"@wdio/spec-reporter": "^9.29.1",
|
||||
"edgedriver": "^6.3.0"
|
||||
},
|
||||
"overrides": {
|
||||
"esbuild": "0.28.1",
|
||||
"serialize-javascript": "7.0.7"
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,10 @@ export default defineConfigWithVueTs(
|
||||
{
|
||||
...pluginVitest.configs.recommended,
|
||||
files: ['src/**/__tests__/*'],
|
||||
rules: {
|
||||
...pluginVitest.configs.recommended.rules,
|
||||
'vitest/valid-expect': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
|
||||
Generated
+1225
-1297
File diff suppressed because it is too large.
Load diff
+43
-43
@@ -18,8 +18,8 @@
|
||||
"test:e2e:webdriver": "npm run test --prefix e2e-webdriver",
|
||||
"test:e2e:webdriver:skip-build": "cross-env SFM_SKIP_TAURI_BUILD_FOR_WEBDRIVER=1 npm run test --prefix e2e-webdriver",
|
||||
"test:e2e:webdriver:install-edge-driver": "npm run install-edge-driver --prefix e2e-webdriver",
|
||||
"test:unit": "vitest",
|
||||
"test:unit:run": "vitest run",
|
||||
"test:unit": "node ./scripts/vitest-run.mjs",
|
||||
"test:unit:run": "node ./scripts/vitest-run.mjs run",
|
||||
"build-only": "vite build",
|
||||
"check": "run-p ts lint:check test:unit:run",
|
||||
"check:win": "run-p ts lint:check test:unit:run test:e2e:webdriver",
|
||||
@@ -47,76 +47,76 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@crabnebula/tauri-plugin-drag": "^2.1.0",
|
||||
"@lucide/vue": "^1.0.0",
|
||||
"@tauri-apps/api": "^2.10.1",
|
||||
"@lucide/vue": "^1.23.0",
|
||||
"@tauri-apps/api": "^2.11.1",
|
||||
"@tauri-apps/plugin-autostart": "^2.5.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.3.2",
|
||||
"@tauri-apps/plugin-dialog": "^2.6.0",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.3.1",
|
||||
"@tauri-apps/plugin-opener": "^2.5.3",
|
||||
"@tauri-apps/plugin-dialog": "^2.7.1",
|
||||
"@tauri-apps/plugin-global-shortcut": "^2.3.2",
|
||||
"@tauri-apps/plugin-opener": "^2.5.4",
|
||||
"@tauri-apps/plugin-os": "^2.3.2",
|
||||
"@tauri-apps/plugin-store": "^2.4.2",
|
||||
"@vueuse/core": "^14.2.1",
|
||||
"@tauri-apps/plugin-store": "^2.4.3",
|
||||
"@vueuse/core": "^14.3.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"dayjs": "^1.11.20",
|
||||
"dompurify": "^3.3.3",
|
||||
"dayjs": "^1.11.21",
|
||||
"dompurify": "^3.4.11",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"marked": "^17.0.5",
|
||||
"minimatch": "^10.2.4",
|
||||
"marked": "^18.0.5",
|
||||
"minimatch": "^10.2.5",
|
||||
"pinia": "^3.0.4",
|
||||
"qrcode": "^1.5.4",
|
||||
"reka-ui": "^2.9.2",
|
||||
"semver": "^7.7.4",
|
||||
"reka-ui": "^2.10.1",
|
||||
"semver": "^7.8.5",
|
||||
"tauri-plugin-system-fonts-api": "^2.0.2",
|
||||
"v-wave": "^3.0.4",
|
||||
"v-wave": "^3.1.1",
|
||||
"vaul-vue": "^0.4.1",
|
||||
"vue": "^3.5.31",
|
||||
"vue-i18n": "^11.3.0",
|
||||
"vue-router": "^5.0.4",
|
||||
"vue": "^3.5.39",
|
||||
"vue-i18n": "^11.4.6",
|
||||
"vue-router": "^5.1.0",
|
||||
"vue-sonner": "^2.0.9",
|
||||
"vue3-smooth-dnd": "^0.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@choochmeque/tauri-windows-bundle": "^0.1.20",
|
||||
"@intlify/eslint-plugin-vue-i18n": "^4.3.0",
|
||||
"@choochmeque/tauri-windows-bundle": "^0.1.28",
|
||||
"@intlify/eslint-plugin-vue-i18n": "^4.5.1",
|
||||
"@stylistic/eslint-plugin": "^5.10.0",
|
||||
"@tauri-apps/cli": "^2.10.1",
|
||||
"@tauri-apps/cli": "^2.11.4",
|
||||
"@tsconfig/node22": "^22.0.5",
|
||||
"@types/jsdom": "^28.0.1",
|
||||
"@types/jsdom": "^28.0.3",
|
||||
"@types/lodash.clonedeep": "^4.5.9",
|
||||
"@types/node": "^25.5.0",
|
||||
"@types/node": "^26.1.1",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@vitejs/plugin-vue": "^6.0.5",
|
||||
"@vitest/eslint-plugin": "^1.6.13",
|
||||
"@vue/eslint-config-typescript": "^14.7.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vitejs/plugin-vue": "^6.0.7",
|
||||
"@vitest/eslint-plugin": "^1.6.21",
|
||||
"@vue/eslint-config-typescript": "^14.9.0",
|
||||
"@vue/test-utils": "^2.4.11",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"esbuild": "^0.28.1",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint-plugin-check-file": "^3.3.1",
|
||||
"eslint-plugin-vue": "~10.8.0",
|
||||
"jsdom": "^29.0.1",
|
||||
"npm-run-all2": "^8.0.4",
|
||||
"eslint-plugin-vue": "~10.9.2",
|
||||
"jsdom": "^29.1.1",
|
||||
"npm-run-all2": "^9.0.2",
|
||||
"readdirp": "^5.0.0",
|
||||
"stylelint": "^17.6.0",
|
||||
"stylelint": "^17.14.0",
|
||||
"stylelint-config-css-modules": "^4.6.0",
|
||||
"stylelint-config-idiomatic-order": "^10.0.0",
|
||||
"stylelint-config-recommended-vue": "^1.6.1",
|
||||
"stylelint-config-standard": "^40.0.0",
|
||||
"stylelint-selector-bem-pattern": "^4.0.1",
|
||||
"typescript": "~5.9.3",
|
||||
"vite": "npm:rolldown-vite@latest",
|
||||
"vite-plugin-run": "^0.6.1",
|
||||
"vite-plugin-vue-devtools": "^8.1.1",
|
||||
"vitest": "^4.1.2",
|
||||
"vue-eslint-parser": "^10.4.0",
|
||||
"vue-tsc": "^3.2.6"
|
||||
"stylelint-selector-bem-pattern": "^5.0.0",
|
||||
"typescript": "~6.0.3",
|
||||
"vite": "^8.1.3",
|
||||
"vite-plugin-run": "^0.9.1",
|
||||
"vite-plugin-vue-devtools": "^8.1.5",
|
||||
"vitest": "^4.1.10",
|
||||
"vue-eslint-parser": "^10.4.1",
|
||||
"vue-tsc": "^3.3.7"
|
||||
},
|
||||
"overrides": {
|
||||
"@typescript-eslint/eslint-plugin": "8.57.2",
|
||||
"@typescript-eslint/parser": "8.57.2",
|
||||
"@typescript-eslint/eslint-plugin": "8.63.0",
|
||||
"@typescript-eslint/parser": "8.63.0",
|
||||
"stylelint-order": "^8.1.1",
|
||||
"stylelint-selector-bem-pattern": {
|
||||
"stylelint": "$stylelint"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
function normalizeWindowsPath(directoryPath) {
|
||||
if (process.platform !== 'win32') {
|
||||
return directoryPath;
|
||||
}
|
||||
|
||||
return directoryPath.replace(/^([a-z]):/, (_match, driveLetter) => `${driveLetter.toUpperCase()}:`);
|
||||
}
|
||||
|
||||
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
|
||||
const projectRoot = normalizeWindowsPath(path.resolve(scriptDirectory, '..'));
|
||||
const vitestExecutable = path.join(projectRoot, 'node_modules', 'vitest', 'vitest.mjs');
|
||||
const vitestArguments = process.argv.slice(2);
|
||||
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[vitestExecutable, ...vitestArguments],
|
||||
{
|
||||
cwd: projectRoot,
|
||||
stdio: 'inherit',
|
||||
env: process.env,
|
||||
},
|
||||
);
|
||||
|
||||
if (result.error) {
|
||||
console.error(result.error);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
Generated
+923
-1449
File diff suppressed because it is too large.
Load diff
+13
-13
@@ -22,32 +22,32 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
devtools = []
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2.5", features = [] }
|
||||
tauri-build = { version = "2.6", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
log = "0.4"
|
||||
tauri = { version = "2.10", features = [ "protocol-asset", "tray-icon", "image-png", "devtools"] }
|
||||
tauri = { version = "2.11", features = [ "protocol-asset", "tray-icon", "image-png", "devtools"] }
|
||||
tauri-plugin-log = "2"
|
||||
tauri-plugin-store = "2"
|
||||
tauri-plugin-opener = "2.5.3"
|
||||
tauri-plugin-opener = "2.5.4"
|
||||
tauri-plugin-os = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-global-shortcut = "2"
|
||||
tauri-plugin-system-fonts = "2"
|
||||
sysinfo = { version = "0.38", features = ["linux-netdevs"] }
|
||||
trash = "5.2.5"
|
||||
trash = "5.2.6"
|
||||
base64 = "0.22"
|
||||
png = "0.18"
|
||||
file_icon_provider = "1.0.0"
|
||||
file_icon_provider = "1.0.1"
|
||||
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "bmp", "webp", "tiff", "ico"] }
|
||||
lru = "0.16"
|
||||
lru = "0.18"
|
||||
once_cell = "1.21"
|
||||
dirs = "5"
|
||||
tantivy = "0.25"
|
||||
dirs = "6"
|
||||
tantivy = "0.26"
|
||||
walkdir = "2.5"
|
||||
rayon = "1.11"
|
||||
rayon = "1.12"
|
||||
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync"] }
|
||||
notify = "8"
|
||||
tauri-plugin-drag = "2"
|
||||
@@ -56,7 +56,7 @@ tauri-plugin-single-instance = "2"
|
||||
reqwest = { version = "0.13", default-features = false, features = ["rustls", "stream"] }
|
||||
httpdate = "1.0"
|
||||
futures-util = "0.3"
|
||||
zip = "8.4"
|
||||
zip = "8.6"
|
||||
tar = "0.4"
|
||||
xz2 = "0.1"
|
||||
flate2 = "1.1"
|
||||
@@ -65,7 +65,7 @@ tauri-plugin-clipboard-manager = "2.3.2"
|
||||
tauri-plugin-autostart = "2"
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
mime_guess = "2"
|
||||
mdns-sd = { version = "0.18", features = ["async"] }
|
||||
mdns-sd = { version = "0.20", features = ["async"] }
|
||||
tokio-util = { version = "0.7", features = ["io"] }
|
||||
urlencoding = "2"
|
||||
local-ip-address = "0.6"
|
||||
@@ -90,8 +90,8 @@ tokio = { version = "1", features = ["macros", "test-util"] }
|
||||
libc = "0.2"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winreg = "0.55"
|
||||
roxmltree = "0.20"
|
||||
winreg = "0.56"
|
||||
roxmltree = "0.21"
|
||||
webview-com-bindings-core = { package = "windows-core", version = "0.61.2" }
|
||||
webview2-com = "0.38.2"
|
||||
windows-core = "0.58"
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
// License: GNU GPLv3 or later. See the license file in the project root for more information.
|
||||
// Copyright © 2021 - present Aleksey Hoffman. All rights reserved.
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::path::{Path, PathBuf};
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
[package]
|
||||
edition = "2021"
|
||||
name = "drag"
|
||||
version = "2.1.0"
|
||||
version = "2.1.1"
|
||||
authors = ["CrabNebula Ltd."]
|
||||
build = false
|
||||
autolib = false
|
||||
|
||||
@@ -65,6 +65,7 @@ fn get_recent_cached_clipboard_source_context() -> Option<ClipboardSourceContext
|
||||
Some(cached.context.clone())
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn normalize_optional_string(value: String) -> Option<String> {
|
||||
let trimmed = value.trim();
|
||||
|
||||
@@ -75,6 +76,7 @@ fn normalize_optional_string(value: String) -> Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn executable_base_name(path: &str) -> Option<String> {
|
||||
let base = path
|
||||
.rsplit(['\\', '/'])
|
||||
@@ -196,9 +198,11 @@ fn get_clipboard_source_context_sync() -> ClipboardSourceContext {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[cfg(windows)]
|
||||
use super::{executable_base_name, normalize_optional_string};
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn normalize_optional_string_trims_and_rejects_empty_values() {
|
||||
assert_eq!(
|
||||
normalize_optional_string(" Sigma ".to_string()),
|
||||
@@ -208,6 +212,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn executable_base_name_returns_file_name_only() {
|
||||
assert_eq!(
|
||||
executable_base_name(r"C:\Apps\Cursor\Cursor.exe"),
|
||||
|
||||
@@ -270,7 +270,7 @@ fn snapshot_value(name: String, value: RegValue) -> RegistryValueSnapshot {
|
||||
RegistryValueSnapshot {
|
||||
name,
|
||||
value_type: value_type_name(&value),
|
||||
bytes: value.bytes,
|
||||
bytes: value.bytes.into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ fn restore_existing_key(snapshot: &RegistryKeyTreeSnapshot) -> Result<(), String
|
||||
|
||||
for value_snapshot in &snapshot.values {
|
||||
let value = RegValue {
|
||||
bytes: value_snapshot.bytes.clone(),
|
||||
bytes: value_snapshot.bytes.clone().into(),
|
||||
vtype: value_type_from_name(&value_snapshot.value_type)?,
|
||||
};
|
||||
|
||||
@@ -562,11 +562,6 @@ pub fn is_current_default_file_manager() -> Result<bool, String> {
|
||||
current_registry_is_owned_by_sfm()
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn is_current_default_file_manager() -> Result<bool, String> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn enable_default_file_manager(app_handle: &tauri::AppHandle) -> Result<bool, String> {
|
||||
let existing_snapshot = match read_snapshot(app_handle) {
|
||||
@@ -711,7 +706,7 @@ mod tests {
|
||||
|
||||
for (name, original_value) in originals {
|
||||
let original_type = value_type_name(&original_value);
|
||||
let original_bytes = original_value.bytes.clone();
|
||||
let original_bytes = original_value.bytes.clone().into_owned();
|
||||
|
||||
let snapshot = snapshot_value(name.to_string(), original_value);
|
||||
let serialized = serde_json::to_string(&snapshot).unwrap();
|
||||
@@ -721,7 +716,7 @@ mod tests {
|
||||
assert_eq!(deserialized.bytes, original_bytes);
|
||||
|
||||
let restored = RegValue {
|
||||
bytes: deserialized.bytes,
|
||||
bytes: deserialized.bytes.into(),
|
||||
vtype: value_type_from_name(&deserialized.value_type).unwrap(),
|
||||
};
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ fn global_search_query_blocking(
|
||||
|
||||
let query_boxed = build_query(&fields, &query, &options);
|
||||
let top_docs = searcher
|
||||
.search(&query_boxed, &TopDocs::with_limit(100_000))
|
||||
.search(&query_boxed, &TopDocs::with_limit(100_000).order_by_score())
|
||||
.map_err(|error| error.to_string())?;
|
||||
|
||||
let internal_ignored: Vec<String> = builtin_ignored_paths()
|
||||
@@ -475,7 +475,9 @@ mod tests {
|
||||
let reader = index.reader().unwrap();
|
||||
let searcher = reader.searcher();
|
||||
let query = build_query(&fields, query_text, &create_options(exact_match));
|
||||
let top_docs = searcher.search(&query, &TopDocs::with_limit(10)).unwrap();
|
||||
let top_docs = searcher
|
||||
.search(&query, &TopDocs::with_limit(10).order_by_score())
|
||||
.unwrap();
|
||||
|
||||
top_docs
|
||||
.into_iter()
|
||||
|
||||
@@ -26,16 +26,19 @@ pub fn canonicalize_path(path: &Path) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn path_for_selection(file_path: &str) -> String {
|
||||
file_path.replace('/', "\\")
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn parent_directory_for_selection(file_path: &str) -> Option<std::path::PathBuf> {
|
||||
Path::new(&path_for_selection(file_path))
|
||||
.parent()
|
||||
.map(std::path::Path::to_path_buf)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn normalize_selection_path_for_comparison(file_path: &str) -> String {
|
||||
let mut normalized_path = path_for_selection(file_path).replace('\\', "/");
|
||||
|
||||
@@ -46,6 +49,7 @@ pub fn normalize_selection_path_for_comparison(file_path: &str) -> String {
|
||||
normalized_path
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn common_parent_directory_for_selections(
|
||||
file_paths: &[String],
|
||||
) -> Result<std::path::PathBuf, String> {
|
||||
@@ -74,6 +78,7 @@ pub fn common_parent_directory_for_selections(
|
||||
Ok(expected_parent.clone())
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn strip_extended_path_prefix(path: &str) -> String {
|
||||
if let Some(rest) = path.strip_prefix(r"\\?\UNC\") {
|
||||
format!(r"\\{rest}")
|
||||
@@ -84,35 +89,18 @@ pub fn strip_extended_path_prefix(path: &str) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn prepare_shell_path(file_path: &str) -> String {
|
||||
#[cfg(windows)]
|
||||
let native_path = path_for_selection(file_path);
|
||||
#[cfg(not(windows))]
|
||||
let native_path = file_path.to_string();
|
||||
|
||||
let path = Path::new(&native_path);
|
||||
#[cfg(windows)]
|
||||
let resolved = dunce::canonicalize(path).unwrap_or_else(|_| path.to_path_buf());
|
||||
#[cfg(not(windows))]
|
||||
let resolved = path.canonicalize().unwrap_or_else(|_| path.to_path_buf());
|
||||
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let resolved_path = strip_extended_path_prefix(&resolved.to_string_lossy());
|
||||
resolved_path.replace('/', "\\")
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
resolved.to_string_lossy().into_owned()
|
||||
}
|
||||
let resolved_path = strip_extended_path_prefix(&resolved.to_string_lossy());
|
||||
resolved_path.replace('/', "\\")
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn shell_path_candidates(file_path: &str) -> Vec<String> {
|
||||
#[cfg(windows)]
|
||||
let native_path = path_for_selection(file_path);
|
||||
#[cfg(not(windows))]
|
||||
let native_path = file_path.to_string();
|
||||
|
||||
let path = Path::new(&native_path);
|
||||
let mut candidates: Vec<String> = Vec::new();
|
||||
|
||||
@@ -150,7 +138,7 @@ pub fn load_png_as_base64(path: &std::path::Path) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, windows))]
|
||||
mod shell_path_tests {
|
||||
use super::{path_for_selection, prepare_shell_path, strip_extended_path_prefix};
|
||||
|
||||
@@ -182,7 +170,6 @@ mod shell_path_tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn path_for_selection_converts_unc_paths_to_backslashes() {
|
||||
assert_eq!(
|
||||
@@ -191,7 +178,6 @@ mod shell_path_tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn prepare_shell_path_converts_unc_paths_to_backslashes() {
|
||||
assert_eq!(
|
||||
@@ -200,7 +186,6 @@ mod shell_path_tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn prepare_shell_path_converts_local_windows_paths_to_backslashes() {
|
||||
assert_eq!(
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
// License: GNU GPLv3 or later. See the license file in the project root for more information.
|
||||
// Copyright © 2021 - present Aleksey Hoffman. All rights reserved.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::iter::once;
|
||||
use std::path::{Path, PathBuf};
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::path::Path;
|
||||
|
||||
use super::types::SystemClipboardFiles;
|
||||
|
||||
@@ -12,7 +16,7 @@ use super::windows::{set_windows_clipboard_bytes, windows_open_clipboard, with_w
|
||||
|
||||
pub(crate) fn set_system_clipboard_files_sync(
|
||||
paths: &[String],
|
||||
operation: &str,
|
||||
#[cfg_attr(not(target_os = "windows"), allow(unused_variables))] operation: &str,
|
||||
) -> Result<(), String> {
|
||||
if paths.is_empty() {
|
||||
return Ok(());
|
||||
|
||||
@@ -145,6 +145,7 @@ fn normalize_shell_icon_path(path: &Path) -> PathBuf {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub(crate) fn strip_shell_icon_index(path: &str) -> String {
|
||||
if let Some(comma_index) = path.rfind(',') {
|
||||
let suffix = path[comma_index + 1..].trim();
|
||||
@@ -160,6 +161,7 @@ pub(crate) fn strip_shell_icon_index(path: &str) -> String {
|
||||
path.to_string()
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub(crate) fn has_shell_executable_icon_extension(path: &Path) -> bool {
|
||||
path.extension()
|
||||
.and_then(|extension| extension.to_str())
|
||||
@@ -450,6 +452,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn strip_shell_icon_index_removes_numeric_suffix() {
|
||||
assert_eq!(
|
||||
strip_shell_icon_index(r"C:\Windows\System32\cmd.exe,0"),
|
||||
|
||||
@@ -14,6 +14,7 @@ pub const DEFAULT_FILE_MANAGER_LAUNCH_TARGET_FILE_NAME: &str = "launch-target.tx
|
||||
#[cfg(windows)]
|
||||
pub const APP_EXECUTION_ALIAS_FILE_NAME: &str = "sigma-file-manager.exe";
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn executable_path_indicates_windows_store_install(executable_path: &str) -> bool {
|
||||
let lower = executable_path.to_lowercase();
|
||||
lower.contains("\\windowsapps\\") || lower.contains("\\program files\\windowsapps\\")
|
||||
@@ -30,11 +31,6 @@ pub fn is_running_in_windows_msix_package() -> bool {
|
||||
result == ERROR_INSUFFICIENT_BUFFER || result == ERROR_SUCCESS
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn is_running_in_windows_msix_package() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn is_windows_store_installation() -> bool {
|
||||
if is_running_in_windows_msix_package() {
|
||||
|
||||
@@ -64,8 +64,8 @@ const props = defineProps<ToasterProps>();
|
||||
background-color: hsl(var(--background) / 0%);
|
||||
}
|
||||
|
||||
[data-sonner-toast][data-mounted='false'] :deep(.sigma-ui-toast-static),
|
||||
[data-sonner-toast][data-mounted='false'] :deep(.sigma-ui-toast-progress) {
|
||||
[data-sonner-toast][data-mounted='false'] .sigma-ui-toast-static,
|
||||
[data-sonner-toast][data-mounted='false'] .sigma-ui-toast-progress {
|
||||
backdrop-filter: blur(0);
|
||||
background-color: hsl(var(--background) / 0%);
|
||||
}
|
||||
|
||||
@@ -604,7 +604,7 @@ function renderMarkdown(text: string): string {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.changelog-dialog__release-summary :deep(strong) {
|
||||
.changelog-dialog__release-summary strong {
|
||||
color: hsl(var(--foreground));
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ function handleOpenChange(open: boolean) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.entry-card-tags :deep(.tag-selector__trigger) {
|
||||
.entry-card-tags .tag-selector__trigger {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
@@ -151,24 +151,24 @@ function handleOpenChange(open: boolean) {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.entry-card-tags :deep(.tag-selector__trigger--full-width) {
|
||||
.entry-card-tags .tag-selector__trigger--full-width {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.entry-card-tags :deep(.tag-selector__trigger-icon-plus) {
|
||||
.entry-card-tags .tag-selector__trigger-icon-plus {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.entry-card-tags :deep(.tag-selector__label) {
|
||||
.entry-card-tags .tag-selector__label {
|
||||
overflow: hidden;
|
||||
max-width: 8rem;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.entry-card-tags :deep(.tag-selector__selected-tags) {
|
||||
.entry-card-tags .tag-selector__selected-tags {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
@@ -235,31 +235,31 @@ function handleOpenChange(open: boolean) {
|
||||
transform: translateX(-10px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-active :deep(.tag-selector__trigger-icon-plus),
|
||||
.entry-card-tags-editor-enter-active :deep(.tag-selector__label),
|
||||
.entry-card-tags-editor-enter-active :deep(.tag-selector__badge),
|
||||
.entry-card-tags-editor-leave-active :deep(.tag-selector__trigger-icon-plus),
|
||||
.entry-card-tags-editor-leave-active :deep(.tag-selector__label),
|
||||
.entry-card-tags-editor-leave-active :deep(.tag-selector__badge) {
|
||||
.entry-card-tags-editor-enter-active .tag-selector__trigger-icon-plus,
|
||||
.entry-card-tags-editor-enter-active .tag-selector__label,
|
||||
.entry-card-tags-editor-enter-active .tag-selector__badge,
|
||||
.entry-card-tags-editor-leave-active .tag-selector__trigger-icon-plus,
|
||||
.entry-card-tags-editor-leave-active .tag-selector__label,
|
||||
.entry-card-tags-editor-leave-active .tag-selector__badge {
|
||||
transition:
|
||||
opacity 200ms ease,
|
||||
transform 200ms ease,
|
||||
max-width 200ms ease;
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-active :deep(.tag-selector__label) {
|
||||
.entry-card-tags-editor-enter-active .tag-selector__label {
|
||||
transition-delay: 40ms;
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-active :deep(.tag-selector__badge) {
|
||||
.entry-card-tags-editor-enter-active .tag-selector__badge {
|
||||
transition-delay: 20ms;
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-leave-active :deep(.tag-selector__label) {
|
||||
.entry-card-tags-editor-leave-active .tag-selector__label {
|
||||
transition-delay: 0ms;
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-leave-active :deep(.tag-selector__badge) {
|
||||
.entry-card-tags-editor-leave-active .tag-selector__badge {
|
||||
transition-delay: 30ms;
|
||||
}
|
||||
|
||||
@@ -268,18 +268,18 @@ function handleOpenChange(open: boolean) {
|
||||
transform: translateX(-12px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-from :deep(.tag-selector__trigger-icon-plus) {
|
||||
.entry-card-tags-editor-enter-from .tag-selector__trigger-icon-plus {
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-from :deep(.tag-selector__label) {
|
||||
.entry-card-tags-editor-enter-from .tag-selector__label {
|
||||
max-width: 0;
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-enter-from :deep(.tag-selector__badge) {
|
||||
.entry-card-tags-editor-enter-from .tag-selector__badge {
|
||||
opacity: 0;
|
||||
transform: translateX(10px);
|
||||
}
|
||||
@@ -289,18 +289,18 @@ function handleOpenChange(open: boolean) {
|
||||
transform: translateX(-12px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-leave-to :deep(.tag-selector__trigger-icon-plus) {
|
||||
.entry-card-tags-editor-leave-to .tag-selector__trigger-icon-plus {
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-leave-to :deep(.tag-selector__label) {
|
||||
.entry-card-tags-editor-leave-to .tag-selector__label {
|
||||
max-width: 0;
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
}
|
||||
|
||||
.entry-card-tags-editor-leave-to :deep(.tag-selector__badge) {
|
||||
.entry-card-tags-editor-leave-to .tag-selector__badge {
|
||||
opacity: 0;
|
||||
transform: translateX(10px);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ const showMarketplaceUnavailable = computed(() => {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
.extensions-marketplace__unavailable :deep(.empty-state) {
|
||||
.extensions-marketplace__unavailable .empty-state {
|
||||
padding: 48px 24px;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ function handleViewportScroll(event: Event) {
|
||||
padding-inline-end: var(--file-browser-scrollbar-gutter);
|
||||
}
|
||||
|
||||
:deep(.file-browser-list-view) :global(.sigma-ui-scroll-area-scrollbar) {
|
||||
:deep(.file-browser-list-view .sigma-ui-scroll-area-scrollbar) {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// License: GNU GPLv3 or later. See the license file in the project root for more information.
|
||||
// Copyright © 2021 - present Aleksey Hoffman. All rights reserved.
|
||||
|
||||
import { vi } from 'vitest';
|
||||
|
||||
if (!('getEntriesByType' in performance)) {
|
||||
Object.defineProperty(performance, 'getEntriesByType', {
|
||||
configurable: true,
|
||||
value: vi.fn(() => []),
|
||||
});
|
||||
}
|
||||
@@ -9,6 +9,7 @@ export default mergeConfig(
|
||||
environment: 'jsdom',
|
||||
exclude: [...configDefaults.exclude, 'e2e/**'],
|
||||
root: fileURLToPath(new URL('./', import.meta.url)),
|
||||
setupFiles: [fileURLToPath(new URL('./src/test-support/vitest-setup.ts', import.meta.url))],
|
||||
},
|
||||
}),
|
||||
);
|
||||
Reference in new issue
Block a user