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>
pull/470/head
renovate[bot] 2 years ago committed by GitHub
parent 92233ea64a
commit 0d0ed7b907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,7 +48,7 @@ https.get(url, options, (response) => {
console.log(versions.length ? versions[0].num : "0.0.0"); console.log(versions.length ? versions[0].num : "0.0.0");
} else if (kind === "npm") { } else if (kind === "npm") {
const versions = Object.keys(data.versions).filter((v) => const versions = Object.keys(data.versions).filter((v) =>
v.startsWith(target) v.startsWith(target),
); );
console.log(versions[versions.length - 1] || "0.0.0"); console.log(versions[versions.length - 1] || "0.0.0");
} }

@ -22,10 +22,13 @@
"eslint-plugin-n": "^16.0.0", "eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1", "eslint-plugin-promise": "^6.1.1",
"eslint-plugin-security": "^1.7.1", "eslint-plugin-security": "^1.7.1",
"prettier": "^2.8.7", "prettier": "^3.0.0",
"rollup": "^3.20.4", "rollup": "^3.20.4",
"typescript": "^5.0.4" "typescript": "^5.0.4"
}, },
"resolutions": {
"semver": ">=7.5.2"
},
"engines": { "engines": {
"pnpm": ">=7.33.0" "pnpm": ">=7.33.0"
} }

@ -76,7 +76,7 @@ const r2 = await auth.verifyRegistration(
challenge, challenge,
app, app,
registerResult.registerData, registerResult.registerData,
registerResult.clientData registerResult.clientData,
); );
const j2 = JSON.parse(r2); const j2 = JSON.parse(r2);
@ -91,7 +91,7 @@ const counter = await auth.verifySignature(
signData.signData, signData.signData,
clientData, clientData,
keyHandle, keyHandle,
pubkey pubkey,
); );
if (counter && counter > 0) { if (counter && counter > 0) {

@ -17,7 +17,7 @@ export class Authenticator {
challenge: string, challenge: string,
application: string, application: string,
registerData: string, registerData: string,
clientData: string clientData: string,
): Promise<string> { ): Promise<string> {
return await invoke("plugin:authenticator|verify_registration", { return await invoke("plugin:authenticator|verify_registration", {
challenge, challenge,
@ -30,7 +30,7 @@ export class Authenticator {
async sign( async sign(
challenge: string, challenge: string,
application: string, application: string,
keyHandle: string keyHandle: string,
): Promise<string> { ): Promise<string> {
return await invoke("plugin:authenticator|sign", { return await invoke("plugin:authenticator|sign", {
timeout: 10000, timeout: 10000,
@ -46,7 +46,7 @@ export class Authenticator {
signData: string, signData: string,
clientData: string, clientData: string,
keyHandle: string, keyHandle: string,
pubkey: string pubkey: string,
): Promise<number> { ): Promise<number> {
return await invoke("plugin:authenticator|verify_signature", { return await invoke("plugin:authenticator|verify_signature", {
challenge, challenge,

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -59,7 +59,7 @@ const stopWatching = await watch(
(event) => { (event) => {
const { kind, path } = event; const { kind, path } = event;
}, },
{ recursive: true } { recursive: true },
); );
const stopRawWatcher = await watchImmediate( const stopRawWatcher = await watchImmediate(
@ -67,7 +67,7 @@ const stopRawWatcher = await watchImmediate(
(event) => { (event) => {
const { type, paths, attrs } = event; const { type, paths, attrs } = event;
}, },
{} {},
); );
``` ```

@ -45,7 +45,7 @@ async function unwatch(id: number): Promise<void> {
export async function watch( export async function watch(
paths: string | string[], paths: string | string[],
cb: (event: DebouncedEvent) => void, cb: (event: DebouncedEvent) => void,
options: DebouncedWatchOptions = {} options: DebouncedWatchOptions = {},
): Promise<UnlistenFn> { ): Promise<UnlistenFn> {
const opts = { const opts = {
recursive: false, recursive: false,
@ -71,7 +71,7 @@ export async function watch(
`watcher://debounced-event/${id}`, `watcher://debounced-event/${id}`,
(event) => { (event) => {
cb(event.payload); cb(event.payload);
} },
); );
return () => { return () => {
@ -83,7 +83,7 @@ export async function watch(
export async function watchImmediate( export async function watchImmediate(
paths: string | string[], paths: string | string[],
cb: (event: RawEvent) => void, cb: (event: RawEvent) => void,
options: WatchOptions = {} options: WatchOptions = {},
): Promise<UnlistenFn> { ): Promise<UnlistenFn> {
const opts = { const opts = {
recursive: false, recursive: false,
@ -109,7 +109,7 @@ export async function watchImmediate(
`watcher://raw-event/${id}`, `watcher://raw-event/${id}`,
(event) => { (event) => {
cb(event.payload); cb(event.payload);
} },
); );
return () => { return () => {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -43,7 +43,7 @@ enum LogLevel {
async function log( async function log(
level: LogLevel, level: LogLevel,
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
const traces = new Error().stack?.split("\n").map((line) => line.split("@")); const traces = new Error().stack?.split("\n").map((line) => line.split("@"));
@ -86,7 +86,7 @@ async function log(
*/ */
export async function error( export async function error(
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
await log(LogLevel.Error, message, options); await log(LogLevel.Error, message, options);
} }
@ -108,7 +108,7 @@ export async function error(
*/ */
export async function warn( export async function warn(
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
await log(LogLevel.Warn, message, options); await log(LogLevel.Warn, message, options);
} }
@ -130,7 +130,7 @@ export async function warn(
*/ */
export async function info( export async function info(
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
await log(LogLevel.Info, message, options); await log(LogLevel.Info, message, options);
} }
@ -152,7 +152,7 @@ export async function info(
*/ */
export async function debug( export async function debug(
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
await log(LogLevel.Debug, message, options); await log(LogLevel.Debug, message, options);
} }
@ -174,7 +174,7 @@ export async function debug(
*/ */
export async function trace( export async function trace(
message: string, message: string,
options?: LogOptions options?: LogOptions,
): Promise<void> { ): Promise<void> {
await log(LogLevel.Trace, message, options); await log(LogLevel.Trace, message, options);
} }
@ -193,7 +193,7 @@ export async function attachConsole(): Promise<UnlistenFn> {
// TODO: Investigate security/detect-unsafe-regex // TODO: Investigate security/detect-unsafe-regex
// eslint-disable-next-line no-control-regex, 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, /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
"" "",
); );
switch (payload.level) { switch (payload.level) {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -89,7 +89,7 @@ export default class Database {
db: this.path, db: this.path,
query, query,
values: bindValues ?? [], values: bindValues ?? [],
} },
); );
return { return {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -177,7 +177,7 @@ export class Store {
*/ */
async onKeyChange<T>( async onKeyChange<T>(
key: string, key: string,
cb: (value: T | null) => void cb: (value: T | null) => void,
): Promise<UnlistenFn> { ): Promise<UnlistenFn> {
return await listen<ChangePayload<T>>("store://change", (event) => { return await listen<ChangePayload<T>>("store://change", (event) => {
if (event.payload.path === this.path && event.payload.key === key) { 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. * @returns A promise resolving to a function to unlisten to the event.
*/ */
async onChange<T>( async onChange<T>(
cb: (key: string, value: T | null) => void cb: (key: string, value: T | null) => void,
): Promise<UnlistenFn> { ): Promise<UnlistenFn> {
return await listen<ChangePayload<T>>("store://change", (event) => { return await listen<ChangePayload<T>>("store://change", (event) => {
if (event.payload.path === this.path) { if (event.payload.path === this.path) {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -23,7 +23,7 @@ export type StoreKey =
| ArrayBuffer; | ArrayBuffer;
function toBytesDto( function toBytesDto(
v: ClientPath | VaultPath | RecordPath | StoreKey v: ClientPath | VaultPath | RecordPath | StoreKey,
): string | number[] { ): string | number[] {
if (typeof v === "string") { if (typeof v === "string") {
return v; return v;
@ -125,7 +125,7 @@ class ProcedureExecutor {
*/ */
async generateSLIP10Seed( async generateSLIP10Seed(
outputLocation: Location, outputLocation: Location,
sizeBytes?: number sizeBytes?: number,
): Promise<Uint8Array> { ): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", { return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs, ...this.procedureArgs,
@ -152,7 +152,7 @@ class ProcedureExecutor {
chain: number[], chain: number[],
source: "Seed" | "Key", source: "Seed" | "Key",
sourceLocation: Location, sourceLocation: Location,
outputLocation: Location outputLocation: Location,
): Promise<Uint8Array> { ): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", { return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs, ...this.procedureArgs,
@ -181,7 +181,7 @@ class ProcedureExecutor {
async recoverBIP39( async recoverBIP39(
mnemonic: string, mnemonic: string,
outputLocation: Location, outputLocation: Location,
passphrase?: string passphrase?: string,
): Promise<Uint8Array> { ): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", { return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs, ...this.procedureArgs,
@ -205,7 +205,7 @@ class ProcedureExecutor {
*/ */
async generateBIP39( async generateBIP39(
outputLocation: Location, outputLocation: Location,
passphrase?: string passphrase?: string,
): Promise<Uint8Array> { ): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", { return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs, ...this.procedureArgs,
@ -245,7 +245,7 @@ class ProcedureExecutor {
*/ */
async signEd25519( async signEd25519(
privateKeyLocation: Location, privateKeyLocation: Location,
msg: string msg: string,
): Promise<Uint8Array> { ): Promise<Uint8Array> {
return await invoke<number[]>("plugin:stronghold|execute_procedure", { return await invoke<number[]>("plugin:stronghold|execute_procedure", {
...this.procedureArgs, ...this.procedureArgs,
@ -310,7 +310,7 @@ export class Store {
async insert( async insert(
key: StoreKey, key: StoreKey,
value: number[], value: number[],
lifetime?: Duration lifetime?: Duration,
): Promise<void> { ): Promise<void> {
return await invoke("plugin:stronghold|save_store_record", { return await invoke("plugin:stronghold|save_store_record", {
snapshotPath: this.path, snapshotPath: this.path,
@ -328,7 +328,7 @@ export class Store {
snapshotPath: this.path, snapshotPath: this.path,
client: this.client, client: this.client,
key: toBytesDto(key), key: toBytesDto(key),
} },
).then((v) => (v != null ? Uint8Array.from(v) : null)); ).then((v) => (v != null ? Uint8Array.from(v) : null));
} }
} }

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -58,7 +58,7 @@ upload(
"https://example.com/file-upload", "https://example.com/file-upload",
"./path/to/my/file.txt", "./path/to/my/file.txt",
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress (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", "https://example.com/file-download-link",
"./path/to/save/my/file.txt", "./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 (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, url: string,
filePath: string, filePath: string,
progressHandler?: ProgressHandler, progressHandler?: ProgressHandler,
headers?: Map<string, string> headers?: Map<string, string>,
): Promise<void> { ): Promise<void> {
const ids = new Uint32Array(1); const ids = new Uint32Array(1);
window.crypto.getRandomValues(ids); window.crypto.getRandomValues(ids);
@ -59,7 +59,7 @@ async function download(
url: string, url: string,
filePath: string, filePath: string,
progressHandler?: ProgressHandler, progressHandler?: ProgressHandler,
headers?: Map<string, string> headers?: Map<string, string>,
): Promise<void> { ): Promise<void> {
const ids = new Uint32Array(1); const ids = new Uint32Array(1);
window.crypto.getRandomValues(ids); window.crypto.getRandomValues(ids);

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -11,14 +11,14 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.1.0",
"@sveltejs/kit": "^1.15.5", "@sveltejs/kit": "^1.22.0",
"@tauri-apps/cli": "^1.2.3", "@tauri-apps/cli": "^1.4.0",
"svelte": "^4.0.0", "svelte": "^4.0.4",
"svelte-check": "^3.2.0", "svelte-check": "^3.4.4",
"tslib": "^2.5.0", "tslib": "^2.6.0",
"typescript": "^5.0.4", "typescript": "^5.1.6",
"vite": "^4.2.1" "vite": "^4.4.0"
}, },
"dependencies": { "dependencies": {
"tauri-plugin-websocket-api": "link:../../" "tauri-plugin-websocket-api": "link:../../"

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

@ -53,7 +53,7 @@ export default class WebSocket {
m = { type: "Binary", data: message }; m = { type: "Binary", data: message };
} else { } else {
throw new Error( 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", { return await invoke("plugin:websocket|send", {

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

@ -23,7 +23,7 @@ async function saveWindowState(flags: StateFlags): Promise<void> {
*/ */
async function restoreState( async function restoreState(
label: WindowLabel, label: WindowLabel,
flags: StateFlags flags: StateFlags,
): Promise<void> { ): Promise<void> {
return invoke("plugin:window-state|restore_state", { label, flags }); return invoke("plugin:window-state|restore_state", { label, flags });
} }

@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@ import { createConfig } from "../rollup.config.mjs";
export default createConfig({ export default createConfig({
input: "guest-js/index.ts", input: "guest-js/index.ts",
pkg: JSON.parse( 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/], external: [/^@tauri-apps\/api/],
}); });

Loading…
Cancel
Save