From 752c923002ba7752c89f2892dbcff95bdca02334 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:51:28 +0800 Subject: [PATCH] chore: fix some typos (#14334) --- .scripts/ci/check-change-tags.js | 2 +- .scripts/ci/check-license-header.js | 2 +- Cargo.lock | 1 - crates/tauri-build/src/acl.rs | 6 +++--- crates/tauri-build/src/lib.rs | 2 +- crates/tauri-cli/config.schema.json | 4 ++-- .../src/migrate/migrations/v1/config.rs | 4 ++-- crates/tauri-runtime-wry/src/lib.rs | 2 +- crates/tauri-runtime-wry/src/window/mod.rs | 2 +- .../schemas/config.schema.json | 4 ++-- crates/tauri-utils/src/acl/mod.rs | 2 +- crates/tauri-utils/src/acl/schema.rs | 18 +++++++++--------- crates/tauri-utils/src/lib.rs | 6 +++--- crates/tauri-utils/src/platform.rs | 2 +- crates/tauri-utils/src/resources.rs | 2 +- crates/tauri/Cargo.toml | 1 - crates/tauri/src/app.rs | 6 +++--- crates/tauri/src/ipc/mod.rs | 2 +- crates/tauri/src/lib.rs | 2 +- crates/tauri/src/manager/mod.rs | 4 ++-- crates/tauri/src/plugin.rs | 2 +- crates/tauri/src/tray/mod.rs | 4 ++-- crates/tauri/src/webview/mod.rs | 2 +- crates/tauri/src/webview/webview_window.rs | 4 ++-- crates/tauri/src/window/mod.rs | 4 ++-- crates/tauri/src/window/scripts/drag.js | 4 ++-- examples/api/unocss.config.js | 4 ++-- .../file-associations/src-tauri/src/main.rs | 2 +- packages/api/src/core.ts | 2 +- packages/api/src/dpi.ts | 2 +- packages/api/src/webviewWindow.ts | 2 +- packages/api/src/window.ts | 2 +- 32 files changed, 53 insertions(+), 55 deletions(-) diff --git a/.scripts/ci/check-change-tags.js b/.scripts/ci/check-change-tags.js index 1cd7de3d9..cf6463439 100644 --- a/.scripts/ci/check-change-tags.js +++ b/.scripts/ci/check-change-tags.js @@ -57,7 +57,7 @@ function checkChangeFiles(changeFiles) { for (const [file, packages] of unknownTagsEntries) { for (const { package, tag } of packages) { console.error( - `Package \`${package}\` has an uknown change tag ${tag} in ${file} ` + `Package \`${package}\` has an unknown change tag ${tag} in ${file} ` ) } } diff --git a/.scripts/ci/check-license-header.js b/.scripts/ci/check-license-header.js index 03ad824e4..4dd48fa46 100644 --- a/.scripts/ci/check-license-header.js +++ b/.scripts/ci/check-license-header.js @@ -29,7 +29,7 @@ const ignore = [ async function checkFile(file) { if ( extensions.some((e) => file.endsWith(e)) - && !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) == i) + && !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) === i) ) { const fileStream = fs.createReadStream(file) const rl = readline.createInterface({ diff --git a/Cargo.lock b/Cargo.lock index b2528bb9c..15b6fe5b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8536,7 +8536,6 @@ dependencies = [ "tracing", "tray-icon", "url", - "urlpattern", "uuid", "webkit2gtk", "webview2-com", diff --git a/crates/tauri-build/src/acl.rs b/crates/tauri-build/src/acl.rs index 474c63006..16f529d6a 100644 --- a/crates/tauri-build/src/acl.rs +++ b/crates/tauri-build/src/acl.rs @@ -157,7 +157,7 @@ fn read_plugins_manifests() -> Result> { Ok(manifests) } -struct InlinedPuginsAcl { +struct InlinedPluginsAcl { manifests: BTreeMap, permission_files: BTreeMap>, } @@ -165,7 +165,7 @@ struct InlinedPuginsAcl { fn inline_plugins( out_dir: &Path, inlined_plugins: HashMap<&'static str, InlinedPlugin>, -) -> Result { +) -> Result { let mut acl_manifests = BTreeMap::new(); let mut permission_files_map = BTreeMap::new(); @@ -250,7 +250,7 @@ permissions = [{default_permissions}] acl_manifests.insert(name.into(), manifest); } - Ok(InlinedPuginsAcl { + Ok(InlinedPluginsAcl { manifests: acl_manifests, permission_files: permission_files_map, }) diff --git a/crates/tauri-build/src/lib.rs b/crates/tauri-build/src/lib.rs index 1cd9c7b78..cd9724252 100644 --- a/crates/tauri-build/src/lib.rs +++ b/crates/tauri-build/src/lib.rs @@ -263,7 +263,7 @@ impl WindowsAttributes { } } - /// Creates the default attriute set wihtou the default app manifest. + /// Creates the default attribute set without the default app manifest. #[must_use] pub fn new_without_app_manifest() -> Self { Self { diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 323da1041..672ace507 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -921,7 +921,7 @@ ] }, { - "description": "Mica effect that matches the system dark perefence **Windows 11 Only**", + "description": "Mica effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "mica" @@ -942,7 +942,7 @@ ] }, { - "description": "Tabbed effect that matches the system dark perefence **Windows 11 Only**", + "description": "Tabbed effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "tabbed" diff --git a/crates/tauri-cli/src/migrate/migrations/v1/config.rs b/crates/tauri-cli/src/migrate/migrations/v1/config.rs index 2d7d1be4b..3de72747d 100644 --- a/crates/tauri-cli/src/migrate/migrations/v1/config.rs +++ b/crates/tauri-cli/src/migrate/migrations/v1/config.rs @@ -104,7 +104,7 @@ fn migrate_config(config: &mut Value) -> Result { } // dangerousUseHttpScheme/useHttpsScheme - let dangerouse_use_http = tauri_config + let dangerous_use_http = tauri_config .get("security") .and_then(|w| w.as_object()) .and_then(|w| { @@ -120,7 +120,7 @@ fn migrate_config(config: &mut Value) -> Result { { for window in windows { if let Some(window) = window.as_object_mut() { - window.insert("useHttpsScheme".to_string(), (!dangerouse_use_http).into()); + window.insert("useHttpsScheme".to_string(), (!dangerous_use_http).into()); } } } diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index 1aac9f1aa..6b919e746 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -812,7 +812,7 @@ impl WindowBuilder for WindowBuilderWrapper { { // TODO: find a proper way to prevent webview being pushed out of the window. // Workround for issue: https://github.com/tauri-apps/tauri/issues/10225 - // The window requies `NSFullSizeContentViewWindowMask` flag to prevent devtools + // The window requires `NSFullSizeContentViewWindowMask` flag to prevent devtools // pushing the content view out of the window. // By setting the default style to `TitleBarStyle::Visible` should fix the issue for most of the users. builder = builder.title_bar_style(TitleBarStyle::Visible); diff --git a/crates/tauri-runtime-wry/src/window/mod.rs b/crates/tauri-runtime-wry/src/window/mod.rs index 02af23661..6fb2dbe17 100644 --- a/crates/tauri-runtime-wry/src/window/mod.rs +++ b/crates/tauri-runtime-wry/src/window/mod.rs @@ -39,7 +39,7 @@ pub trait WindowExt { /// - **Android / iOS**: Unsupported. fn center(&self) {} - /// Clears the window sufrace. i.e make it it transparent. + /// Clears the window surface. i.e make it it transparent. #[cfg(windows)] fn draw_surface( &self, diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 323da1041..672ace507 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -921,7 +921,7 @@ ] }, { - "description": "Mica effect that matches the system dark perefence **Windows 11 Only**", + "description": "Mica effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "mica" @@ -942,7 +942,7 @@ ] }, { - "description": "Tabbed effect that matches the system dark perefence **Windows 11 Only**", + "description": "Tabbed effect that matches the system dark preference **Windows 11 Only**", "type": "string", "enum": [ "tabbed" diff --git a/crates/tauri-utils/src/acl/mod.rs b/crates/tauri-utils/src/acl/mod.rs index 4d2322c39..03c33d4fd 100644 --- a/crates/tauri-utils/src/acl/mod.rs +++ b/crates/tauri-utils/src/acl/mod.rs @@ -50,7 +50,7 @@ pub const PERMISSION_SCHEMA_FILE_NAME: &str = "schema.json"; pub const APP_ACL_KEY: &str = "__app-acl__"; /// Known acl manifests file pub const ACL_MANIFESTS_FILE_NAME: &str = "acl-manifests.json"; -/// Known capabilityies file +/// Known capabilities file pub const CAPABILITIES_FILE_NAME: &str = "capabilities.json"; /// Allowed commands file name pub const ALLOWED_COMMANDS_FILE_NAME: &str = "allowed-commands.json"; diff --git a/crates/tauri-utils/src/acl/schema.rs b/crates/tauri-utils/src/acl/schema.rs index 56b50a5f6..c1a793fc7 100644 --- a/crates/tauri-utils/src/acl/schema.rs +++ b/crates/tauri-utils/src/acl/schema.rs @@ -194,7 +194,7 @@ impl<'a> PermissionSchemaGenerator<'a, Iter<'a, PermissionSet>, Iter<'a, Permiss } } -/// Collect and include all possible identifiers in `Identifier` defintion in the schema +/// Collect and include all possible identifiers in `Identifier` definition in the schema fn extend_identifier_schema(schema: &mut RootSchema, acl: &BTreeMap) { if let Some(Schema::Object(identifier_schema)) = schema.definitions.get_mut("Identifier") { let permission_schemas = acl @@ -214,9 +214,9 @@ fn extend_identifier_schema(schema: &mut RootSchema, acl: &BTreeMap>( #[no_mangle] #[cfg_attr(not(target_vendor = "apple"), link_section = ".taubndl")] #[cfg_attr(target_vendor = "apple", link_section = "__DATA,taubndl")] -// Marked as `mut` becuase it could get optimized away without it, +// Marked as `mut` because it could get optimized away without it, // see https://github.com/tauri-apps/tauri/pull/13812 static mut __TAURI_BUNDLE_TYPE: &str = "UNK"; diff --git a/crates/tauri-utils/src/resources.rs b/crates/tauri-utils/src/resources.rs index 414815e2b..58a07d265 100644 --- a/crates/tauri-utils/src/resources.rs +++ b/crates/tauri-utils/src/resources.rs @@ -206,7 +206,7 @@ impl ResourcePathsIter<'_> { fn next_current_path(&mut self) -> Option> { // should be safe to unwrap since every call to `self.next_current_path()` - // is preceeded with assignemt to `self.current_path` + // is preceded with assignment to `self.current_path` let path = self.current_path.take().unwrap(); let is_dir = path.is_dir(); diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index e3d312b45..33eef1799 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -69,7 +69,6 @@ dirs = "6" percent-encoding = "2" raw-window-handle = { version = "0.6", features = ["std"] } glob = "0.3" -urlpattern = "0.3" mime = "0.3" data-url = { version = "0.3", optional = true } serialize-to-javascript = "0.1.2" diff --git a/crates/tauri/src/app.rs b/crates/tauri/src/app.rs index 06a3abe44..b950895bc 100644 --- a/crates/tauri/src/app.rs +++ b/crates/tauri/src/app.rs @@ -386,7 +386,7 @@ impl AppHandle { #[cfg(target_vendor = "apple")] impl AppHandle { - /// Fetches all Data Store Indentifiers by this app + /// Fetches all Data Store Identifiers by this app /// /// Needs to be called from Main Thread pub async fn fetch_data_store_identifiers(&self) -> crate::Result> { @@ -513,7 +513,7 @@ impl AppHandle { /// } /// /// let plugin = init_plugin(); - /// // `.name()` requires the `PLugin` trait import + /// // `.name()` requires the `Plugin` trait import /// let plugin_name = plugin.name(); /// tauri::Builder::default() /// .plugin(plugin) @@ -1577,7 +1577,7 @@ impl Builder { /// Append a custom initialization script. /// - /// Allow to append custom initialization script instend of replacing entire invoke system. + /// Allow to append custom initialization script instead of replacing entire invoke system. /// /// # Examples /// diff --git a/crates/tauri/src/ipc/mod.rs b/crates/tauri/src/ipc/mod.rs index 3b1d8cd1f..aff4d4891 100644 --- a/crates/tauri/src/ipc/mod.rs +++ b/crates/tauri/src/ipc/mod.rs @@ -345,7 +345,7 @@ impl InvokeResolver { F: Future> + Send + 'static, { // Dynamic dispatch the call in dev for a faster compile time - // TODO: Revisit this and see if we can do this for the release build as well if the performace hit is not a problem + // TODO: Revisit this and see if we can do this for the release build as well if the performance hit is not a problem #[cfg(debug_assertions)] { self.respond_async_serialized_dyn(Box::pin(task)) diff --git a/crates/tauri/src/lib.rs b/crates/tauri/src/lib.rs index 68a58edcc..6f326cf1f 100644 --- a/crates/tauri/src/lib.rs +++ b/crates/tauri/src/lib.rs @@ -296,7 +296,7 @@ pub enum EventLoopMessage { /// The webview runtime interface. A wrapper around [`runtime::Runtime`] with the proper user event type associated. pub trait Runtime: runtime::Runtime {} -/// The webview runtime handle. A wrapper arond [`runtime::RuntimeHandle`] with the proper user event type associated. +/// The webview runtime handle. A wrapper around [`runtime::RuntimeHandle`] with the proper user event type associated. pub trait RuntimeHandle: runtime::RuntimeHandle {} impl> Runtime for W {} diff --git a/crates/tauri/src/manager/mod.rs b/crates/tauri/src/manager/mod.rs index b97d9fbec..2126dd895 100644 --- a/crates/tauri/src/manager/mod.rs +++ b/crates/tauri/src/manager/mod.rs @@ -265,7 +265,7 @@ impl AppManager { crate::app::GlobalTrayIconEventListener>, >, window_event_listeners: Vec>, - webiew_event_listeners: Vec>, + webview_event_listeners: Vec>, #[cfg(desktop)] window_menu_event_listeners: HashMap< String, crate::app::GlobalMenuEventListener>, @@ -292,7 +292,7 @@ impl AppManager { invoke_handler, on_page_load, uri_scheme_protocols: Mutex::new(uri_scheme_protocols), - event_listeners: Arc::new(webiew_event_listeners), + event_listeners: Arc::new(webview_event_listeners), invoke_initialization_script, invoke_key: invoke_key.clone(), }, diff --git a/crates/tauri/src/plugin.rs b/crates/tauri/src/plugin.rs index e1624377c..9c7f9a1ab 100644 --- a/crates/tauri/src/plugin.rs +++ b/crates/tauri/src/plugin.rs @@ -90,7 +90,7 @@ pub trait Plugin: Send { #[allow(unused_variables)] fn webview_created(&mut self, webview: Webview) {} - /// Callback invoked when webview tries to navigate to the given Url. Returning falses cancels navigation. + /// Callback invoked when webview tries to navigate to the given Url. Returning false cancels navigation. #[allow(unused_variables)] fn on_navigation(&mut self, webview: &Webview, url: &Url) -> bool { true diff --git a/crates/tauri/src/tray/mod.rs b/crates/tauri/src/tray/mod.rs index 5980844c9..3f487b010 100644 --- a/crates/tauri/src/tray/mod.rs +++ b/crates/tauri/src/tray/mod.rs @@ -73,7 +73,7 @@ impl From for MouseButton { /// /// ## Platform-specific: /// -/// - **Linux**: Unsupported. The event is not emmited even though the icon is shown +/// - **Linux**: Unsupported. The event is not emitted even though the icon is shown /// and will still show a context menu on right click. #[derive(Debug, Clone, Serialize)] #[serde(tag = "type")] @@ -314,7 +314,7 @@ impl TrayIconBuilder { /// - **Linux:** Unsupported. #[deprecated( since = "2.2.0", - note = "Use `TrayIconBuiler::show_menu_on_left_click` instead." + note = "Use `TrayIconBuilder::show_menu_on_left_click` instead." )] pub fn menu_on_left_click(mut self, enable: bool) -> Self { self.inner = self.inner.with_menu_on_left_click(enable); diff --git a/crates/tauri/src/webview/mod.rs b/crates/tauri/src/webview/mod.rs index c185e7c62..9c4a6e0ea 100644 --- a/crates/tauri/src/webview/mod.rs +++ b/crates/tauri/src/webview/mod.rs @@ -2068,7 +2068,7 @@ tauri::Builder::default() /// Specify the webview background color. /// - /// ## Platfrom-specific: + /// ## Platform-specific: /// /// - **macOS / iOS**: Not implemented. /// - **Windows**: diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index f4a48c168..24232993a 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -2042,9 +2042,9 @@ impl WebviewWindow { /// Sets this window's minimum inner width. pub fn set_size_constraints( &self, - constriants: tauri_runtime::window::WindowSizeConstraints, + constraints: tauri_runtime::window::WindowSizeConstraints, ) -> crate::Result<()> { - self.window.set_size_constraints(constriants) + self.window.set_size_constraints(constraints) } /// Sets this window's position. diff --git a/crates/tauri/src/window/mod.rs b/crates/tauri/src/window/mod.rs index 92a515237..9e74e694b 100644 --- a/crates/tauri/src/window/mod.rs +++ b/crates/tauri/src/window/mod.rs @@ -1941,12 +1941,12 @@ tauri::Builder::default() /// Sets this window's minimum inner width. pub fn set_size_constraints( &self, - constriants: tauri_runtime::window::WindowSizeConstraints, + constraints: tauri_runtime::window::WindowSizeConstraints, ) -> crate::Result<()> { self .window .dispatcher - .set_size_constraints(constriants) + .set_size_constraints(constraints) .map_err(Into::into) } diff --git a/crates/tauri/src/window/scripts/drag.js b/crates/tauri/src/window/scripts/drag.js index 21aa05697..1c9461b63 100644 --- a/crates/tauri/src/window/scripts/drag.js +++ b/crates/tauri/src/window/scripts/drag.js @@ -30,7 +30,7 @@ ) { // macOS maximization happens on `mouseup`, // so we save needed state and early return - if (osName === 'macos' && e.detail == 2) { + if (osName === 'macos' && e.detail === 2) { initialX = e.clientX initialY = e.clientY return @@ -48,7 +48,7 @@ window.__TAURI_INTERNALS__.invoke('plugin:window|' + cmd) } }) - // on macOS we maximze on mouseup instead, to match the system behavior where maximization can be canceled + // on macOS we maximize on mouseup instead, to match the system behavior where maximization can be canceled // if the mouse moves outside the data-tauri-drag-region if (osName === 'macos') { document.addEventListener('mouseup', (e) => { diff --git a/examples/api/unocss.config.js b/examples/api/unocss.config.js index 6e379c5a1..c1665d25a 100644 --- a/examples/api/unocss.config.js +++ b/examples/api/unocss.config.js @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { defineConfig, presetIcons, presetUno, presetWebFonts } from 'unocss' +import { defineConfig, presetIcons, presetWind3, presetWebFonts } from 'unocss' import extractorSvelte from '@unocss/extractor-svelte' export default defineConfig({ @@ -88,7 +88,7 @@ export default defineConfig({ checkbox: 'accent-accent' }, presets: [ - presetUno(), + presetWind3(), presetIcons(), presetWebFonts({ fonts: { diff --git a/examples/file-associations/src-tauri/src/main.rs b/examples/file-associations/src-tauri/src/main.rs index caf6affeb..c2c631e24 100644 --- a/examples/file-associations/src-tauri/src/main.rs +++ b/examples/file-associations/src-tauri/src/main.rs @@ -56,7 +56,7 @@ fn main() { // NOTICE: `args` may include URL protocol (`your-app-protocol://`) // or arguments (`--`) if your app supports them. - // files may aslo be passed as `file://path/to/file` + // files may also be passed as `file://path/to/file` for maybe_file in std::env::args().skip(1) { // skip flags like -f or --flag if maybe_file.starts_with('-') { diff --git a/packages/api/src/core.ts b/packages/api/src/core.ts index d3a91edb4..30665d796 100644 --- a/packages/api/src/core.ts +++ b/packages/api/src/core.ts @@ -294,7 +294,7 @@ function convertFileSrc(filePath: string, protocol = 'asset'): string { * A rust-backed resource stored through `tauri::Manager::resources_table` API. * * The resource lives in the main process and does not exist - * in the Javascript world, and thus will not be cleaned up automatiacally + * in the Javascript world, and thus will not be cleaned up automatically * except on application exit. If you want to clean it up early, call {@linkcode Resource.close} * * @example diff --git a/packages/api/src/dpi.ts b/packages/api/src/dpi.ts index 88409726b..0a40d67d0 100644 --- a/packages/api/src/dpi.ts +++ b/packages/api/src/dpi.ts @@ -78,7 +78,7 @@ class LogicalSize { * * Physical pixels represent actual screen pixels, and are DPI-independent. * For high-DPI windows, this means that any point in the window on the screen - * will have a different position in logical pixels (@linkcode LogicalSize). + * will have a different position in logical pixels {@linkcode LogicalSize}. * * For physical-pixel-based position, see {@linkcode PhysicalPosition}. * diff --git a/packages/api/src/webviewWindow.ts b/packages/api/src/webviewWindow.ts index f73d5cab5..289902b95 100644 --- a/packages/api/src/webviewWindow.ts +++ b/packages/api/src/webviewWindow.ts @@ -134,7 +134,7 @@ class WebviewWindow { } /** - * Listen to an emitted event on this webivew window. + * Listen to an emitted event on this webview window. * * @example * ```typescript diff --git a/packages/api/src/window.ts b/packages/api/src/window.ts index e89a8ae6c..090108337 100644 --- a/packages/api/src/window.ts +++ b/packages/api/src/window.ts @@ -2229,7 +2229,7 @@ enum Effect { */ Acrylic = 'acrylic', /** - * Tabbed effect that matches the system dark perefence **Windows 11 Only** + * Tabbed effect that matches the system dark preference **Windows 11 Only** */ Tabbed = 'tabbed', /**