mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 09:48:28 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,16 @@ r2d2 = "0.8.10"
|
||||
r2d2_sqlite = "0.25.0"
|
||||
mime_guess = "2.0.5"
|
||||
rand = "0.9.0"
|
||||
reqwest = { workspace = true, features = ["multipart", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider", "socks", "http2"] }
|
||||
reqwest = { workspace = true, features = [
|
||||
"multipart",
|
||||
"gzip",
|
||||
"brotli",
|
||||
"deflate",
|
||||
"json",
|
||||
"rustls-tls-manual-roots-no-provider",
|
||||
"socks",
|
||||
"http2",
|
||||
] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true, features = ["raw_value"] }
|
||||
tauri = { workspace = true, features = ["devtools", "protocol-asset"] }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"identifier": "default",
|
||||
"description": "Default capabilities for all build variants",
|
||||
"windows": [
|
||||
"*"
|
||||
],
|
||||
"windows": ["*"],
|
||||
"permissions": [
|
||||
"core:app:allow-identifier",
|
||||
"core:event:allow-emit",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp-internal/tauri",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "bindings/index.ts"
|
||||
}
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
"assetProtocol": {
|
||||
"enable": true,
|
||||
"scope": {
|
||||
"allow": [
|
||||
"$APPDATA/responses/*",
|
||||
"$RESOURCE/static/*"
|
||||
]
|
||||
"allow": ["$APPDATA/responses/*", "$RESOURCE/static/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,9 +22,7 @@
|
||||
"plugins": {
|
||||
"deep-link": {
|
||||
"desktop": {
|
||||
"schemes": [
|
||||
"yaak"
|
||||
]
|
||||
"schemes": ["yaak"]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"updater": {
|
||||
"endpoints": [
|
||||
"https://update.yaak.app/check/{{target}}/{{arch}}/{{current_version}}"
|
||||
],
|
||||
"endpoints": ["https://update.yaak.app/check/{{target}}/{{arch}}/{{current_version}}"],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVGRkFGMjQxRUNEOTQ3MzAKUldRd1I5bnNRZkw2NzRtMnRlWTN3R24xYUR3aGRsUjJzWGwvdHdEcGljb3ZJMUNlMjFsaHlqVU4K"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { Fonts } from './bindings/gen_fonts';
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { Fonts } from "./bindings/gen_fonts";
|
||||
|
||||
export async function listFonts() {
|
||||
return invoke<Fonts>('plugin:yaak-fonts|list', {});
|
||||
return invoke<Fonts>("plugin:yaak-fonts|list", {});
|
||||
}
|
||||
|
||||
export function useFonts() {
|
||||
return useQuery({
|
||||
queryKey: ['list_fonts'],
|
||||
queryKey: ["list_fonts"],
|
||||
queryFn: () => listFonts(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp-internal/fonts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts"
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { listen } from '@tauri-apps/api/event';
|
||||
import { appInfo } from '@yaakapp/app/lib/appInfo';
|
||||
import { useEffect } from 'react';
|
||||
import { LicenseCheckStatus } from './bindings/license';
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import { appInfo } from "@yaakapp/app/lib/appInfo";
|
||||
import { useEffect } from "react";
|
||||
import { LicenseCheckStatus } from "./bindings/license";
|
||||
|
||||
export * from './bindings/license';
|
||||
export * from "./bindings/license";
|
||||
|
||||
const CHECK_QUERY_KEY = ['license.check'];
|
||||
const CHECK_QUERY_KEY = ["license.check"];
|
||||
|
||||
export function useLicense() {
|
||||
const queryClient = useQueryClient();
|
||||
const activate = useMutation<void, string, { licenseKey: string }>({
|
||||
mutationKey: ['license.activate'],
|
||||
mutationFn: (payload) => invoke('plugin:yaak-license|activate', payload),
|
||||
mutationKey: ["license.activate"],
|
||||
mutationFn: (payload) => invoke("plugin:yaak-license|activate", payload),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
|
||||
});
|
||||
|
||||
const deactivate = useMutation<void, string, void>({
|
||||
mutationKey: ['license.deactivate'],
|
||||
mutationFn: () => invoke('plugin:yaak-license|deactivate'),
|
||||
mutationKey: ["license.deactivate"],
|
||||
mutationFn: () => invoke("plugin:yaak-license|deactivate"),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
|
||||
});
|
||||
|
||||
// Check the license again after a license is activated
|
||||
useEffect(() => {
|
||||
const unlisten = listen('license-activated', async () => {
|
||||
const unlisten = listen("license-activated", async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY });
|
||||
});
|
||||
return () => {
|
||||
@@ -41,7 +41,7 @@ export function useLicense() {
|
||||
if (!appInfo.featureLicense) {
|
||||
return null;
|
||||
}
|
||||
return invoke<LicenseCheckStatus>('plugin:yaak-license|check');
|
||||
return invoke<LicenseCheckStatus>("plugin:yaak-license|check");
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp-internal/license",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts"
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export function setWindowTitle(title: string) {
|
||||
invoke('plugin:yaak-mac-window|set_title', { title }).catch(console.error);
|
||||
invoke("plugin:yaak-mac-window|set_title", { title }).catch(console.error);
|
||||
}
|
||||
|
||||
export function setWindowTheme(bgColor: string) {
|
||||
invoke('plugin:yaak-mac-window|set_theme', { bgColor }).catch(console.error);
|
||||
invoke("plugin:yaak-mac-window|set_theme", { bgColor }).catch(console.error);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp-internal/mac-window",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
[default]
|
||||
description = "Default permissions for the plugin"
|
||||
permissions = [
|
||||
"allow-set-title",
|
||||
"allow-set-theme",
|
||||
]
|
||||
permissions = ["allow-set-title", "allow-set-theme"]
|
||||
|
||||
Reference in New Issue
Block a user