mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
Run formatter on new plugins
This commit is contained in:
@@ -19,4 +19,4 @@
|
||||
"svelte": "^3.49.0",
|
||||
"vite": "^3.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+77
-77
@@ -1,116 +1,116 @@
|
||||
{
|
||||
"images" : [
|
||||
"images": [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-20x20@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-20x20@3x.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-29x29@2x-1.png",
|
||||
"scale" : "2x"
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-29x29@2x-1.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-29x29@3x.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-40x40@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-40x40@3x.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-60x60@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "AppIcon-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "AppIcon-60x60@3x.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-20x20@1x.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-20x20@2x-1.png",
|
||||
"scale" : "2x"
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-20x20@2x-1.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-29x29@1x.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-29x29@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-40x40@1x.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-40x40@2x-1.png",
|
||||
"scale" : "2x"
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-40x40@2x-1.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-76x76@1x.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-76x76@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "AppIcon-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "AppIcon-83.5x83.5@2x.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "AppIcon-512@2x.png",
|
||||
"scale" : "1x"
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "AppIcon-512@2x.png",
|
||||
"scale": "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ targets:
|
||||
base:
|
||||
ENABLE_BITCODE: false
|
||||
ARCHS: [arm64, arm64-sim]
|
||||
VALID_ARCHS: arm64 arm64-sim
|
||||
VALID_ARCHS: arm64 arm64-sim
|
||||
LIBRARY_SEARCH_PATHS[arch=x86_64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
|
||||
LIBRARY_SEARCH_PATHS[arch=arm64]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
|
||||
LIBRARY_SEARCH_PATHS[arch=arm64-sim]: $(inherited) $(PROJECT_DIR)/Externals/$(CONFIGURATION) $(SDKROOT)/usr/lib/swift $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
|
||||
@@ -82,4 +82,4 @@ targets:
|
||||
basedOnDependencyAnalysis: false
|
||||
outputFiles:
|
||||
- $(SRCROOT)/target/aarch64-apple-ios/${CONFIGURATION}/deps/libapp.a
|
||||
- $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libapp.a
|
||||
- $(SRCROOT)/target/x86_64-apple-ios/${CONFIGURATION}/deps/libapp.a
|
||||
|
||||
@@ -63,4 +63,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ import { internalIpV4 } from "internal-ip";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(async () => {
|
||||
const host = process.env.TAURI_PLATFORM === 'android' || process.env.TAURI_PLATFORM === 'ios' ? (await internalIpV4()) : 'localhost'
|
||||
const host =
|
||||
process.env.TAURI_PLATFORM === "android" ||
|
||||
process.env.TAURI_PLATFORM === "ios"
|
||||
? await internalIpV4()
|
||||
: "localhost";
|
||||
return {
|
||||
plugins: [svelte()],
|
||||
|
||||
@@ -13,17 +17,17 @@ export default defineConfig(async () => {
|
||||
clearScreen: false,
|
||||
// tauri expects a fixed port, fail if that port is not available
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
host: "0.0.0.0",
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
hmr: {
|
||||
protocol: 'ws',
|
||||
protocol: "ws",
|
||||
host,
|
||||
port: 5183
|
||||
port: 5183,
|
||||
},
|
||||
fs: {
|
||||
allow: ['.', '../../tooling/api/dist']
|
||||
}
|
||||
allow: [".", "../../tooling/api/dist"],
|
||||
},
|
||||
},
|
||||
// to make use of `TAURI_DEBUG` and other env variables
|
||||
// https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
|
||||
@@ -36,5 +40,5 @@ export default defineConfig(async () => {
|
||||
// produce sourcemaps for debug builds
|
||||
sourcemap: !!process.env.TAURI_DEBUG,
|
||||
},
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
import { invoke } from "@tauri-apps/api/tauri";
|
||||
|
||||
interface FileResponse {
|
||||
base64Data?: string
|
||||
duration?: number
|
||||
height?: number
|
||||
width?: number
|
||||
mimeType?: string
|
||||
modifiedAt?: number
|
||||
name?: string
|
||||
path: string
|
||||
size: number
|
||||
base64Data?: string;
|
||||
duration?: number;
|
||||
height?: number;
|
||||
width?: number;
|
||||
mimeType?: string;
|
||||
modifiedAt?: number;
|
||||
name?: string;
|
||||
path: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ interface FileResponse {
|
||||
*/
|
||||
interface DialogFilter {
|
||||
/** Filter name. */
|
||||
name: string
|
||||
name: string;
|
||||
/**
|
||||
* Extensions to filter, without a `.` prefix.
|
||||
* @example
|
||||
@@ -31,7 +31,7 @@ interface DialogFilter {
|
||||
* extensions: ['svg', 'png']
|
||||
* ```
|
||||
*/
|
||||
extensions: string[]
|
||||
extensions: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,20 +41,20 @@ interface DialogFilter {
|
||||
*/
|
||||
interface OpenDialogOptions {
|
||||
/** The title of the dialog window. */
|
||||
title?: string
|
||||
title?: string;
|
||||
/** The filters of the dialog. */
|
||||
filters?: DialogFilter[]
|
||||
filters?: DialogFilter[];
|
||||
/** Initial directory or file path. */
|
||||
defaultPath?: string
|
||||
defaultPath?: string;
|
||||
/** Whether the dialog allows multiple selection or not. */
|
||||
multiple?: boolean
|
||||
multiple?: boolean;
|
||||
/** Whether the dialog is a directory selection or not. */
|
||||
directory?: boolean
|
||||
directory?: boolean;
|
||||
/**
|
||||
* If `directory` is true, indicates that it will be read recursively later.
|
||||
* Defines whether subdirectories will be allowed on the scope or not.
|
||||
*/
|
||||
recursive?: boolean
|
||||
recursive?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,15 +64,15 @@ interface OpenDialogOptions {
|
||||
*/
|
||||
interface SaveDialogOptions {
|
||||
/** The title of the dialog window. */
|
||||
title?: string
|
||||
title?: string;
|
||||
/** The filters of the dialog. */
|
||||
filters?: DialogFilter[]
|
||||
filters?: DialogFilter[];
|
||||
/**
|
||||
* Initial directory or file path.
|
||||
* If it's a directory path, the dialog interface will change to that folder.
|
||||
* If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.
|
||||
*/
|
||||
defaultPath?: string
|
||||
defaultPath?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,36 +80,36 @@ interface SaveDialogOptions {
|
||||
*/
|
||||
interface MessageDialogOptions {
|
||||
/** The title of the dialog. Defaults to the app name. */
|
||||
title?: string
|
||||
title?: string;
|
||||
/** The type of the dialog. Defaults to `info`. */
|
||||
type?: 'info' | 'warning' | 'error'
|
||||
type?: "info" | "warning" | "error";
|
||||
/** The label of the confirm button. */
|
||||
okLabel?: string
|
||||
okLabel?: string;
|
||||
}
|
||||
|
||||
interface ConfirmDialogOptions {
|
||||
/** The title of the dialog. Defaults to the app name. */
|
||||
title?: string
|
||||
title?: string;
|
||||
/** The type of the dialog. Defaults to `info`. */
|
||||
type?: 'info' | 'warning' | 'error'
|
||||
type?: "info" | "warning" | "error";
|
||||
/** The label of the confirm button. */
|
||||
okLabel?: string
|
||||
okLabel?: string;
|
||||
/** The label of the cancel button. */
|
||||
cancelLabel?: string
|
||||
cancelLabel?: string;
|
||||
}
|
||||
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: false, directory?: false }
|
||||
): Promise<null | FileResponse>
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: false }
|
||||
): Promise<null | FileResponse>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: true, directory?: false }
|
||||
): Promise<null | FileResponse[]>
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: false }
|
||||
): Promise<null | FileResponse[]>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: false, directory?: true }
|
||||
): Promise<null | string>
|
||||
options?: OpenDialogOptions & { multiple?: false; directory?: true }
|
||||
): Promise<null | string>;
|
||||
async function open(
|
||||
options?: OpenDialogOptions & { multiple?: true, directory?: true }
|
||||
): Promise<null | string[]>
|
||||
options?: OpenDialogOptions & { multiple?: true; directory?: true }
|
||||
): Promise<null | string[]>;
|
||||
/**
|
||||
* Open a file/directory selection dialog.
|
||||
*
|
||||
@@ -165,11 +165,11 @@ async function open(
|
||||
async function open(
|
||||
options: OpenDialogOptions = {}
|
||||
): Promise<null | string | string[] | FileResponse | FileResponse[]> {
|
||||
if (typeof options === 'object') {
|
||||
Object.freeze(options)
|
||||
if (typeof options === "object") {
|
||||
Object.freeze(options);
|
||||
}
|
||||
|
||||
return invoke('plugin:dialog|open', { options })
|
||||
return invoke("plugin:dialog|open", { options });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,11 +197,11 @@ async function open(
|
||||
* @since 1.0.0
|
||||
*/
|
||||
async function save(options: SaveDialogOptions = {}): Promise<string | null> {
|
||||
if (typeof options === 'object') {
|
||||
Object.freeze(options)
|
||||
if (typeof options === "object") {
|
||||
Object.freeze(options);
|
||||
}
|
||||
|
||||
return invoke('plugin:dialog|save', { options })
|
||||
return invoke("plugin:dialog|save", { options });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,13 +225,13 @@ async function message(
|
||||
message: string,
|
||||
options?: string | MessageDialogOptions
|
||||
): Promise<void> {
|
||||
const opts = typeof options === 'string' ? { title: options } : options
|
||||
return invoke('plugin:dialog|message', {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|message", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
type_: opts?.type,
|
||||
okButtonLabel: opts?.okLabel?.toString()
|
||||
})
|
||||
okButtonLabel: opts?.okLabel?.toString(),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,14 +254,14 @@ async function ask(
|
||||
message: string,
|
||||
options?: string | ConfirmDialogOptions
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === 'string' ? { title: options } : options
|
||||
return invoke('plugin:dialog|ask', {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|ask", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
type_: opts?.type,
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? 'Yes',
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'No',
|
||||
})
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? "Yes",
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "No",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,14 +284,14 @@ async function confirm(
|
||||
message: string,
|
||||
options?: string | ConfirmDialogOptions
|
||||
): Promise<boolean> {
|
||||
const opts = typeof options === 'string' ? { title: options } : options
|
||||
return invoke('plugin:dialog|confirm', {
|
||||
const opts = typeof options === "string" ? { title: options } : options;
|
||||
return invoke("plugin:dialog|confirm", {
|
||||
message: message.toString(),
|
||||
title: opts?.title?.toString(),
|
||||
type_: opts?.type,
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? 'Ok',
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? 'Cancel',
|
||||
})
|
||||
okButtonLabel: opts?.okLabel?.toString() ?? "Ok",
|
||||
cancelButtonLabel: opts?.cancelLabel?.toString() ?? "Cancel",
|
||||
});
|
||||
}
|
||||
|
||||
export type {
|
||||
@@ -299,7 +299,7 @@ export type {
|
||||
OpenDialogOptions,
|
||||
SaveDialogOptions,
|
||||
MessageDialogOptions,
|
||||
ConfirmDialogOptions
|
||||
}
|
||||
ConfirmDialogOptions,
|
||||
};
|
||||
|
||||
export { open, save, message, ask, confirm }
|
||||
export { open, save, message, ask, confirm };
|
||||
|
||||
Reference in New Issue
Block a user