chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)

* chore: adjust prettier config, .gitignore and use taplo to format toml files

This brings the plugins-workspace repository to the same code style of the main tauri repo

* format toml

* ignore examples gen dir

* add .vscode/extensions.json

* remove packageManager field

* fmt

* fix audit

* taplo ignore permissions autogenerated files

* remove create dummy dist

* fix prettier workflow

* install fmt in prettier workflow

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Amr Bashir
2024-09-04 14:54:23 +03:00
committed by GitHub
parent 72c2ce82c1
commit cf4d7d4e6c
227 changed files with 2534 additions and 2505 deletions
+3 -3
View File
@@ -10,11 +10,11 @@ repository = { workspace = true }
links = "tauri-plugin-os"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[build-dependencies]
tauri-plugin = { workspace = true, features = [ "build" ] }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }
+2 -2
View File
@@ -60,8 +60,8 @@ fn main() {
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```javascript
import { version } from "@tauri-apps/plugin-os";
const osVersion = await version();
import { version } from '@tauri-apps/plugin-os'
const osVersion = await version()
```
## Contributing
+1 -1
View File
@@ -20,4 +20,4 @@ We prefer to receive reports in English.
Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
+44 -44
View File
@@ -8,49 +8,49 @@
* @module
*/
import { invoke } from "@tauri-apps/api/core";
import { invoke } from '@tauri-apps/api/core'
/** @ignore */
declare global {
interface Window {
__TAURI_OS_PLUGIN_INTERNALS__: {
eol: string;
os_type: OsType;
platform: Platform;
family: Family;
version: string;
arch: Arch;
exe_extension: string;
};
eol: string
os_type: OsType
platform: Platform
family: Family
version: string
arch: Arch
exe_extension: string
}
}
}
type Platform =
| "linux"
| "macos"
| "ios"
| "freebsd"
| "dragonfly"
| "netbsd"
| "openbsd"
| "solaris"
| "android"
| "windows";
| 'linux'
| 'macos'
| 'ios'
| 'freebsd'
| 'dragonfly'
| 'netbsd'
| 'openbsd'
| 'solaris'
| 'android'
| 'windows'
type OsType = "linux" | "windows" | "macos" | "ios" | "android";
type OsType = 'linux' | 'windows' | 'macos' | 'ios' | 'android'
type Arch =
| "x86"
| "x86_64"
| "arm"
| "aarch64"
| "mips"
| "mips64"
| "powerpc"
| "powerpc64"
| "riscv64"
| "s390x"
| "sparc64";
| 'x86'
| 'x86_64'
| 'arm'
| 'aarch64'
| 'mips'
| 'mips64'
| 'powerpc'
| 'powerpc64'
| 'riscv64'
| 's390x'
| 'sparc64'
/**
* Returns the operating system-specific end-of-line marker.
@@ -60,7 +60,7 @@ type Arch =
* @since 2.0.0
* */
function eol(): string {
return window.__TAURI_OS_PLUGIN_INTERNALS__.eol;
return window.__TAURI_OS_PLUGIN_INTERNALS__.eol
}
/**
@@ -77,7 +77,7 @@ function eol(): string {
*
*/
function platform(): Platform {
return window.__TAURI_OS_PLUGIN_INTERNALS__.platform;
return window.__TAURI_OS_PLUGIN_INTERNALS__.platform
}
/**
@@ -91,10 +91,10 @@ function platform(): Platform {
* @since 2.0.0
*/
function version(): string {
return window.__TAURI_OS_PLUGIN_INTERNALS__.version;
return window.__TAURI_OS_PLUGIN_INTERNALS__.version
}
type Family = "unix" | "windows";
type Family = 'unix' | 'windows'
/**
* Returns the current operating system family. Possible values are `'unix'`, `'windows'`.
@@ -107,7 +107,7 @@ type Family = "unix" | "windows";
* @since 2.0.0
*/
function family(): Family {
return window.__TAURI_OS_PLUGIN_INTERNALS__.family;
return window.__TAURI_OS_PLUGIN_INTERNALS__.family
}
/**
@@ -121,7 +121,7 @@ function family(): Family {
* @since 2.0.0
*/
function type(): OsType {
return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type;
return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type
}
/**
@@ -136,7 +136,7 @@ function type(): OsType {
* @since 2.0.0
*/
function arch(): Arch {
return window.__TAURI_OS_PLUGIN_INTERNALS__.arch;
return window.__TAURI_OS_PLUGIN_INTERNALS__.arch
}
/**
@@ -150,7 +150,7 @@ function arch(): Arch {
* @since 2.0.0
*/
function exeExtension(): string {
return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension;
return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension
}
/**
@@ -167,7 +167,7 @@ function exeExtension(): string {
* @since 2.0.0
*/
async function locale(): Promise<string | null> {
return await invoke("plugin:os|locale");
return await invoke('plugin:os|locale')
}
/**
@@ -179,7 +179,7 @@ async function locale(): Promise<string | null> {
* ```
*/
async function hostname(): Promise<string | null> {
return await invoke("plugin:os|hostname");
return await invoke('plugin:os|hostname')
}
export {
@@ -191,6 +191,6 @@ export {
arch,
locale,
exeExtension,
hostname,
};
export type { Platform, OsType, Arch, Family };
hostname
}
export type { Platform, OsType, Arch, Family }
+8 -8
View File
@@ -13,11 +13,11 @@ All information except the host name are available.
"""
permissions = [
"allow-arch",
"allow-exe-extension",
"allow-family",
"allow-locale",
"allow-os-type",
"allow-platform",
"allow-version",
]
"allow-arch",
"allow-exe-extension",
"allow-family",
"allow-locale",
"allow-os-type",
"allow-platform",
"allow-version",
]
+2 -2
View File
@@ -2,6 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { createConfig } from "../../shared/rollup.config.js";
import { createConfig } from '../../shared/rollup.config.js'
export default createConfig();
export default createConfig()
+4 -4
View File
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: MIT
// eslint-disable-next-line
Object.defineProperty(window, "__TAURI_OS_PLUGIN_INTERNALS__", {
Object.defineProperty(window, '__TAURI_OS_PLUGIN_INTERNALS__', {
value: {
eol: __TEMPLATE_eol__,
os_type: __TEMPLATE_os_type__,
@@ -11,6 +11,6 @@ Object.defineProperty(window, "__TAURI_OS_PLUGIN_INTERNALS__", {
family: __TEMPLATE_family__,
version: __TEMPLATE_version__,
arch: __TEMPLATE_arch__,
exe_extension: __TEMPLATE_exe_extension__,
},
});
exe_extension: __TEMPLATE_exe_extension__
}
})