chore: fix some typos (#14334)

This commit is contained in:
Tony
2025-10-20 22:51:28 +08:00
committed by GitHub
parent cb28f4368c
commit 752c923002
32 changed files with 53 additions and 55 deletions

View File

@@ -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} `
)
}
}

View File

@@ -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({

1
Cargo.lock generated
View File

@@ -8536,7 +8536,6 @@ dependencies = [
"tracing",
"tray-icon",
"url",
"urlpattern",
"uuid",
"webkit2gtk",
"webview2-com",

View File

@@ -157,7 +157,7 @@ fn read_plugins_manifests() -> Result<BTreeMap<String, Manifest>> {
Ok(manifests)
}
struct InlinedPuginsAcl {
struct InlinedPluginsAcl {
manifests: BTreeMap<String, Manifest>,
permission_files: BTreeMap<String, Vec<PermissionFile>>,
}
@@ -165,7 +165,7 @@ struct InlinedPuginsAcl {
fn inline_plugins(
out_dir: &Path,
inlined_plugins: HashMap<&'static str, InlinedPlugin>,
) -> Result<InlinedPuginsAcl> {
) -> Result<InlinedPluginsAcl> {
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,
})

View File

@@ -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 {

View File

@@ -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"

View File

@@ -104,7 +104,7 @@ fn migrate_config(config: &mut Value) -> Result<MigratedConfig> {
}
// 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<MigratedConfig> {
{
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());
}
}
}

View File

@@ -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);

View File

@@ -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,

View File

@@ -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"

View File

@@ -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";

View File

@@ -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<String, Manifest>) {
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<String, Mani
}
}
/// Collect permission schemas and its associated scope schema and schema definitons from plugins
/// Collect permission schemas and its associated scope schema and schema definitions from plugins
/// and replace `PermissionEntry` extend object syntax with a new schema that does conditional
/// checks to serve the relavent scope schema for the right permissions schema, in a nutshell, it
/// checks to serve the relevant scope schema for the right permissions schema, in a nutshell, it
/// will look something like this:
/// ```text
/// PermissionEntry {
@@ -250,16 +250,16 @@ fn extend_permission_entry_schema(root_schema: &mut RootSchema, acl: &BTreeMap<S
if let Some(Schema::Object(obj)) = root_schema.definitions.get_mut("PermissionEntry") {
let any_of = obj.subschemas().any_of.as_mut().unwrap();
let Schema::Object(extened_permission_entry) = any_of.last_mut().unwrap() else {
let Schema::Object(extend_permission_entry) = any_of.last_mut().unwrap() else {
unreachable!("PermissionsEntry should be an object not a boolean");
};
// remove default properties and save it to be added later as a fallback
let obj = extened_permission_entry.object.as_mut().unwrap();
let obj = extend_permission_entry.object.as_mut().unwrap();
let default_properties = std::mem::take(&mut obj.properties);
let defaut_identifier = default_properties.get(IDENTIFIER).cloned().unwrap();
let default_identifier = (IDENTIFIER.to_string(), defaut_identifier);
let default_identifier = default_properties.get(IDENTIFIER).cloned().unwrap();
let default_identifier = (IDENTIFIER.to_string(), default_identifier);
let mut all_of = vec![];
@@ -299,7 +299,7 @@ fn extend_permission_entry_schema(root_schema: &mut RootSchema, acl: &BTreeMap<S
all_of.push(Schema::Object(default_obj));
// replace extended PermissionEntry with the new schema
extened_permission_entry.subschemas().all_of = Some(all_of);
extend_permission_entry.subschemas().all_of = Some(all_of);
}
// extend root schema with definitions collected from plugins
@@ -352,7 +352,7 @@ fn extend_permission_file_schema(schema: &mut RootSchema, permissions: &[Permiss
let permissions_obj = obj.object().properties.get_mut("permissions");
if let Some(Schema::Object(permissions_obj)) = permissions_obj {
// replace the permissions property schema object
// from a mere string to a referecnce to `PermissionKind`
// from a mere string to a reference to `PermissionKind`
permissions_obj.array().items.replace(
Schema::Object(SchemaObject {
reference: Some("#/definitions/PermissionKind".into()),

View File

@@ -112,13 +112,13 @@ mod window_effects {
UnderWindowBackground,
/// **macOS 10.14+**
UnderPageBackground,
/// Mica effect that matches the system dark perefence **Windows 11 Only**
/// Mica effect that matches the system dark preference **Windows 11 Only**
Mica,
/// Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
MicaDark,
/// Mica effect with light mode **Windows 11 Only**
MicaLight,
/// Tabbed effect that matches the system dark perefence **Windows 11 Only**
/// Tabbed effect that matches the system dark preference **Windows 11 Only**
Tabbed,
/// Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**
TabbedDark,
@@ -372,7 +372,7 @@ pub enum Error {
#[cfg(feature = "resources")]
#[error("could not walk directory `{0}`, try changing `allow_walk` to true on the `ResourcePaths` constructor.")]
NotAllowedToWalkDir(std::path::PathBuf),
/// Resourece path doesn't exist
/// Resource path doesn't exist
#[cfg(feature = "resources")]
#[error("resource path `{0}` doesn't exist")]
ResourcePathNotFound(std::path::PathBuf),

View File

@@ -351,7 +351,7 @@ fn resource_dir_from<P: AsRef<std::path::Path>>(
#[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";

View File

@@ -206,7 +206,7 @@ impl ResourcePathsIter<'_> {
fn next_current_path(&mut self) -> Option<crate::Result<Resource>> {
// 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();

View File

@@ -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"

View File

@@ -386,7 +386,7 @@ impl AppHandle<crate::Wry> {
#[cfg(target_vendor = "apple")]
impl<R: Runtime> AppHandle<R> {
/// 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<Vec<[u8; 16]>> {
@@ -513,7 +513,7 @@ impl<R: Runtime> AppHandle<R> {
/// }
///
/// 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<R: Runtime> Builder<R> {
/// 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
///

View File

@@ -345,7 +345,7 @@ impl<R: Runtime> InvokeResolver<R> {
F: Future<Output = Result<InvokeResponseBody, InvokeError>> + 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))

View File

@@ -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<EventLoopMessage> {}
/// 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<EventLoopMessage> {}
impl<W: runtime::Runtime<EventLoopMessage>> Runtime for W {}

View File

@@ -265,7 +265,7 @@ impl<R: Runtime> AppManager<R> {
crate::app::GlobalTrayIconEventListener<AppHandle<R>>,
>,
window_event_listeners: Vec<GlobalWindowEventListener<R>>,
webiew_event_listeners: Vec<GlobalWebviewEventListener<R>>,
webview_event_listeners: Vec<GlobalWebviewEventListener<R>>,
#[cfg(desktop)] window_menu_event_listeners: HashMap<
String,
crate::app::GlobalMenuEventListener<Window<R>>,
@@ -292,7 +292,7 @@ impl<R: Runtime> AppManager<R> {
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(),
},

View File

@@ -90,7 +90,7 @@ pub trait Plugin<R: Runtime>: Send {
#[allow(unused_variables)]
fn webview_created(&mut self, webview: Webview<R>) {}
/// 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<R>, url: &Url) -> bool {
true

View File

@@ -73,7 +73,7 @@ impl From<tray_icon::MouseButton> 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<R: Runtime> TrayIconBuilder<R> {
/// - **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);

View File

@@ -2068,7 +2068,7 @@ tauri::Builder::default()
/// Specify the webview background color.
///
/// ## Platfrom-specific:
/// ## Platform-specific:
///
/// - **macOS / iOS**: Not implemented.
/// - **Windows**:

View File

@@ -2042,9 +2042,9 @@ impl<R: Runtime> WebviewWindow<R> {
/// 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.

View File

@@ -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)
}

View File

@@ -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) => {

View File

@@ -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: {

View File

@@ -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('-') {

View File

@@ -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

View File

@@ -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}.
*

View File

@@ -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

View File

@@ -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',
/**