mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
chore(deps): update dependency prettier to v3 (#467)
* chore(deps): update dependency prettier to v3 * fmt * semver override * update example deps --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
@@ -48,7 +48,7 @@ https.get(url, options, (response) => {
|
||||
console.log(versions.length ? versions[0].num : "0.0.0");
|
||||
} else if (kind === "npm") {
|
||||
const versions = Object.keys(data.versions).filter((v) =>
|
||||
v.startsWith(target)
|
||||
v.startsWith(target),
|
||||
);
|
||||
console.log(versions[versions.length - 1] || "0.0.0");
|
||||
}
|
||||
|
||||
+4
-1
@@ -22,10 +22,13 @@
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-security": "^1.7.1",
|
||||
"prettier": "^2.8.7",
|
||||
"prettier": "^3.0.0",
|
||||
"rollup": "^3.20.4",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": ">=7.33.0"
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ const r2 = await auth.verifyRegistration(
|
||||
challenge,
|
||||
app,
|
||||
registerResult.registerData,
|
||||
registerResult.clientData
|
||||
registerResult.clientData,
|
||||
);
|
||||
const j2 = JSON.parse(r2);
|
||||
|
||||
@@ -91,7 +91,7 @@ const counter = await auth.verifySignature(
|
||||
signData.signData,
|
||||
clientData,
|
||||
keyHandle,
|
||||
pubkey
|
||||
pubkey,
|
||||
);
|
||||
|
||||
if (counter && counter > 0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ export class Authenticator {
|
||||
challenge: string,
|
||||
application: string,
|
||||
registerData: string,
|
||||
clientData: string
|
||||
clientData: string,
|
||||
): Promise<string> {
|
||||
return await invoke("plugin:authenticator|verify_registration", {
|
||||
challenge,
|
||||
@@ -30,7 +30,7 @@ export class Authenticator {
|
||||
async sign(
|
||||
challenge: string,
|
||||
application: string,
|
||||
keyHandle: string
|
||||
keyHandle: string,
|
||||
): Promise<string> {
|
||||
return await invoke("plugin:authenticator|sign", {
|
||||
timeout: 10000,
|
||||
@@ -46,7 +46,7 @@ export class Authenticator {
|
||||
signData: string,
|
||||
clientData: string,
|
||||
keyHandle: string,
|
||||
pubkey: string
|
||||
pubkey: string,
|
||||
): Promise<number> {
|
||||
return await invoke("plugin:authenticator|verify_signature", {
|
||||
challenge,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ const stopWatching = await watch(
|
||||
(event) => {
|
||||
const { kind, path } = event;
|
||||
},
|
||||
{ recursive: true }
|
||||
{ recursive: true },
|
||||
);
|
||||
|
||||
const stopRawWatcher = await watchImmediate(
|
||||
@@ -67,7 +67,7 @@ const stopRawWatcher = await watchImmediate(
|
||||
(event) => {
|
||||
const { type, paths, attrs } = event;
|
||||
},
|
||||
{}
|
||||
{},
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ async function unwatch(id: number): Promise<void> {
|
||||
export async function watch(
|
||||
paths: string | string[],
|
||||
cb: (event: DebouncedEvent) => void,
|
||||
options: DebouncedWatchOptions = {}
|
||||
options: DebouncedWatchOptions = {},
|
||||
): Promise<UnlistenFn> {
|
||||
const opts = {
|
||||
recursive: false,
|
||||
@@ -71,7 +71,7 @@ export async function watch(
|
||||
`watcher://debounced-event/${id}`,
|
||||
(event) => {
|
||||
cb(event.payload);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -83,7 +83,7 @@ export async function watch(
|
||||
export async function watchImmediate(
|
||||
paths: string | string[],
|
||||
cb: (event: RawEvent) => void,
|
||||
options: WatchOptions = {}
|
||||
options: WatchOptions = {},
|
||||
): Promise<UnlistenFn> {
|
||||
const opts = {
|
||||
recursive: false,
|
||||
@@ -109,7 +109,7 @@ export async function watchImmediate(
|
||||
`watcher://raw-event/${id}`,
|
||||
(event) => {
|
||||
cb(event.payload);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ enum LogLevel {
|
||||
async function log(
|
||||
level: LogLevel,
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
const traces = new Error().stack?.split("\n").map((line) => line.split("@"));
|
||||
|
||||
@@ -86,7 +86,7 @@ async function log(
|
||||
*/
|
||||
export async function error(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Error, message, options);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ export async function error(
|
||||
*/
|
||||
export async function warn(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Warn, message, options);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ export async function warn(
|
||||
*/
|
||||
export async function info(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Info, message, options);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ export async function info(
|
||||
*/
|
||||
export async function debug(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Debug, message, options);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ export async function debug(
|
||||
*/
|
||||
export async function trace(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Trace, message, options);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export async function attachConsole(): Promise<UnlistenFn> {
|
||||
// TODO: Investigate security/detect-unsafe-regex
|
||||
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
|
||||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
||||
""
|
||||
"",
|
||||
);
|
||||
|
||||
switch (payload.level) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class Database {
|
||||
db: this.path,
|
||||
query,
|
||||
values: bindValues ?? [],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -177,7 +177,7 @@ export class Store {
|
||||
*/
|
||||
async onKeyChange<T>(
|
||||
key: string,
|
||||
cb: (value: T | null) => void
|
||||
cb: (value: T | null) => void,
|
||||
): Promise<UnlistenFn> {
|
||||
return await listen<ChangePayload<T>>("store://change", (event) => {
|
||||
if (event.payload.path === this.path && event.payload.key === key) {
|
||||
@@ -192,7 +192,7 @@ export class Store {
|
||||
* @returns A promise resolving to a function to unlisten to the event.
|
||||
*/
|
||||
async onChange<T>(
|
||||
cb: (key: string, value: T | null) => void
|
||||
cb: (key: string, value: T | null) => void,
|
||||
): Promise<UnlistenFn> {
|
||||
return await listen<ChangePayload<T>>("store://change", (event) => {
|
||||
if (event.payload.path === this.path) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ export type StoreKey =
|
||||
| ArrayBuffer;
|
||||
|
||||
function toBytesDto(
|
||||
v: ClientPath | VaultPath | RecordPath | StoreKey
|
||||
v: ClientPath | VaultPath | RecordPath | StoreKey,
|
||||
): string | number[] {
|
||||
if (typeof v === "string") {
|
||||
return v;
|
||||
@@ -125,7 +125,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async generateSLIP10Seed(
|
||||
outputLocation: Location,
|
||||
sizeBytes?: number
|
||||
sizeBytes?: number,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -152,7 +152,7 @@ class ProcedureExecutor {
|
||||
chain: number[],
|
||||
source: "Seed" | "Key",
|
||||
sourceLocation: Location,
|
||||
outputLocation: Location
|
||||
outputLocation: Location,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -181,7 +181,7 @@ class ProcedureExecutor {
|
||||
async recoverBIP39(
|
||||
mnemonic: string,
|
||||
outputLocation: Location,
|
||||
passphrase?: string
|
||||
passphrase?: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -205,7 +205,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async generateBIP39(
|
||||
outputLocation: Location,
|
||||
passphrase?: string
|
||||
passphrase?: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -245,7 +245,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async signEd25519(
|
||||
privateKeyLocation: Location,
|
||||
msg: string
|
||||
msg: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -310,7 +310,7 @@ export class Store {
|
||||
async insert(
|
||||
key: StoreKey,
|
||||
value: number[],
|
||||
lifetime?: Duration
|
||||
lifetime?: Duration,
|
||||
): Promise<void> {
|
||||
return await invoke("plugin:stronghold|save_store_record", {
|
||||
snapshotPath: this.path,
|
||||
@@ -328,7 +328,7 @@ export class Store {
|
||||
snapshotPath: this.path,
|
||||
client: this.client,
|
||||
key: toBytesDto(key),
|
||||
}
|
||||
},
|
||||
).then((v) => (v != null ? Uint8Array.from(v) : null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ upload(
|
||||
"https://example.com/file-upload",
|
||||
"./path/to/my/file.txt",
|
||||
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress
|
||||
{ "Content-Type": "text/plain" } // optional headers to send with the request
|
||||
{ "Content-Type": "text/plain" }, // optional headers to send with the request
|
||||
);
|
||||
```
|
||||
|
||||
@@ -69,7 +69,7 @@ download(
|
||||
"https://example.com/file-download-link",
|
||||
"./path/to/save/my/file.txt",
|
||||
(progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress
|
||||
{ "Content-Type": "text/plain" } // optional headers to send with the request
|
||||
{ "Content-Type": "text/plain" }, // optional headers to send with the request
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ async function upload(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
headers?: Map<string, string>
|
||||
headers?: Map<string, string>,
|
||||
): Promise<void> {
|
||||
const ids = new Uint32Array(1);
|
||||
window.crypto.getRandomValues(ids);
|
||||
@@ -59,7 +59,7 @@ async function download(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
headers?: Map<string, string>
|
||||
headers?: Map<string, string>,
|
||||
): Promise<void> {
|
||||
const ids = new Uint32Array(1);
|
||||
window.crypto.getRandomValues(ids);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^2.0.0",
|
||||
"@sveltejs/kit": "^1.15.5",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"svelte": "^4.0.0",
|
||||
"svelte-check": "^3.2.0",
|
||||
"tslib": "^2.5.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.2.1"
|
||||
"@sveltejs/adapter-auto": "^2.1.0",
|
||||
"@sveltejs/kit": "^1.22.0",
|
||||
"@tauri-apps/cli": "^1.4.0",
|
||||
"svelte": "^4.0.4",
|
||||
"svelte-check": "^3.4.4",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.1.6",
|
||||
"vite": "^4.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tauri-plugin-websocket-api": "link:../../"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class WebSocket {
|
||||
m = { type: "Binary", data: message };
|
||||
} else {
|
||||
throw new Error(
|
||||
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array"
|
||||
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array",
|
||||
);
|
||||
}
|
||||
return await invoke("plugin:websocket|send", {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ async function saveWindowState(flags: StateFlags): Promise<void> {
|
||||
*/
|
||||
async function restoreState(
|
||||
label: WindowLabel,
|
||||
flags: StateFlags
|
||||
flags: StateFlags,
|
||||
): Promise<void> {
|
||||
return invoke("plugin:window-state|restore_state", { label, flags });
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
Generated
+323
-193
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ import { createConfig } from "../rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user