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:
Gregory Schier
2026-03-13 10:15:49 -07:00
parent 45262edfbd
commit b4a1c418bb
664 changed files with 13638 additions and 13492 deletions

View File

@@ -3,28 +3,28 @@ import {
enableEncryption,
revealWorkspaceKey,
setWorkspaceKey,
} from '@yaakapp-internal/crypto';
import type { WorkspaceMeta } from '@yaakapp-internal/models';
import classNames from 'classnames';
import { useAtomValue } from 'jotai';
import { useEffect, useState } from 'react';
import { activeWorkspaceAtom, activeWorkspaceMetaAtom } from '../hooks/useActiveWorkspace';
import { createFastMutation } from '../hooks/useFastMutation';
import { useStateWithDeps } from '../hooks/useStateWithDeps';
import { showConfirm } from '../lib/confirm';
import { CopyIconButton } from './CopyIconButton';
import { Banner } from './core/Banner';
import type { ButtonProps } from './core/Button';
import { Button } from './core/Button';
import { IconButton } from './core/IconButton';
import { IconTooltip } from './core/IconTooltip';
import { Label } from './core/Label';
import { PlainInput } from './core/PlainInput';
import { HStack, VStack } from './core/Stacks';
import { EncryptionHelp } from './EncryptionHelp';
} from "@yaakapp-internal/crypto";
import type { WorkspaceMeta } from "@yaakapp-internal/models";
import classNames from "classnames";
import { useAtomValue } from "jotai";
import { useEffect, useState } from "react";
import { activeWorkspaceAtom, activeWorkspaceMetaAtom } from "../hooks/useActiveWorkspace";
import { createFastMutation } from "../hooks/useFastMutation";
import { useStateWithDeps } from "../hooks/useStateWithDeps";
import { showConfirm } from "../lib/confirm";
import { CopyIconButton } from "./CopyIconButton";
import { Banner } from "./core/Banner";
import type { ButtonProps } from "./core/Button";
import { Button } from "./core/Button";
import { IconButton } from "./core/IconButton";
import { IconTooltip } from "./core/IconTooltip";
import { Label } from "./core/Label";
import { PlainInput } from "./core/PlainInput";
import { HStack, VStack } from "./core/Stacks";
import { EncryptionHelp } from "./EncryptionHelp";
interface Props {
size?: ButtonProps['size'];
size?: ButtonProps["size"];
expanded?: boolean;
onDone?: () => void;
onEnabledEncryption?: () => void;
@@ -119,7 +119,7 @@ export function WorkspaceEncryptionSetting({ size, expanded, onDone, onEnabledEn
<div className="mb-auto flex flex-col-reverse">
<Button
className="mt-3"
color={expanded ? 'info' : 'secondary'}
color={expanded ? "info" : "secondary"}
size={size}
onClick={async () => {
setError(null);
@@ -127,7 +127,9 @@ export function WorkspaceEncryptionSetting({ size, expanded, onDone, onEnabledEn
await enableEncryption(workspaceMeta.workspaceId);
setJustEnabledEncryption(true);
} catch (err) {
setError(`Failed to enable encryption: ${err instanceof Error ? err.message : String(err)}`);
setError(
`Failed to enable encryption: ${err instanceof Error ? err.message : String(err)}`,
);
}
}}
>
@@ -152,7 +154,7 @@ export function WorkspaceEncryptionSetting({ size, expanded, onDone, onEnabledEn
}
const setWorkspaceKeyMut = createFastMutation({
mutationKey: ['set-workspace-key'],
mutationKey: ["set-workspace-key"],
mutationFn: setWorkspaceKey,
});
@@ -167,14 +169,14 @@ function EnterWorkspaceKey({
onDisabled?: () => void;
error?: string | null;
}) {
const [key, setKey] = useState<string>('');
const [key, setKey] = useState<string>("");
const handleForgotKey = async () => {
const confirmed = await showConfirm({
id: 'disable-encryption',
title: 'Disable Encryption',
color: 'danger',
confirmText: 'Disable Encryption',
id: "disable-encryption",
title: "Disable Encryption",
color: "danger",
confirmText: "Disable Encryption",
description: (
<>
This will disable encryption for this workspace. Any previously encrypted values will fail
@@ -253,14 +255,14 @@ function KeyRevealer({
return (
<div
className={classNames(
'w-full border border-border rounded-md pl-3 py-2 p-1',
'grid gap-1 grid-cols-[minmax(0,1fr)_auto] items-center',
"w-full border border-border rounded-md pl-3 py-2 p-1",
"grid gap-1 grid-cols-[minmax(0,1fr)_auto] items-center",
)}
>
<VStack space={0.5}>
{!disableLabel && (
<span className="text-sm text-primary flex items-center gap-1">
Workspace encryption key{' '}
Workspace encryption key{" "}
<IconTooltip iconSize="sm" size="lg" content={helpAfterEncryption} />
</span>
)}
@@ -269,8 +271,8 @@ function KeyRevealer({
<HStack>
{encryptionKey && <CopyIconButton text={encryptionKey} title="Copy workspace key" />}
<IconButton
title={show ? 'Hide' : 'Reveal' + 'workspace key'}
icon={show ? 'eye_closed' : 'eye'}
title={show ? "Hide" : "Reveal" + "workspace key"}
icon={show ? "eye_closed" : "eye"}
onClick={() => setShow((v) => !v)}
/>
</HStack>
@@ -282,14 +284,14 @@ function HighlightedKey({ keyText, show }: { keyText: string; show: boolean }) {
return (
<span className="text-xs font-mono [&_*]:cursor-auto [&_*]:select-text">
{show ? (
keyText.split('').map((c, i) => {
keyText.split("").map((c, i) => {
return (
<span
// oxlint-disable-next-line react/no-array-index-key
key={i}
className={classNames(
c.match(/[0-9]/) && 'text-info',
c === '-' && 'text-text-subtle',
c.match(/[0-9]/) && "text-info",
c === "-" && "text-text-subtle",
)}
>
{c}