chore: fix typing issue

This commit is contained in:
Nicolas Meienberger 2026-02-09 21:52:21 +01:00
parent 74ea647e4e
commit 676bd63ee1
7 changed files with 44 additions and 38 deletions

View file

@ -1,3 +1,4 @@
// @ts-nocheck
// This file is auto-generated by @hey-api/openapi-ts // This file is auto-generated by @hey-api/openapi-ts
import { import {

View file

@ -1,3 +1,4 @@
// @ts-nocheck
// This file is auto-generated by @hey-api/openapi-ts // This file is auto-generated by @hey-api/openapi-ts
import { type ClientOptions, type Config, createClient, createConfig } from "./client"; import { type ClientOptions, type Config, createClient, createConfig } from "./client";

View file

@ -1,3 +1,4 @@
// @ts-nocheck
// This file is auto-generated by @hey-api/openapi-ts // This file is auto-generated by @hey-api/openapi-ts
export { export {

View file

@ -1,3 +1,4 @@
// @ts-nocheck
// This file is auto-generated by @hey-api/openapi-ts // This file is auto-generated by @hey-api/openapi-ts
import type { Client, Options as Options2, TDataShape } from "./client"; import type { Client, Options as Options2, TDataShape } from "./client";

View file

@ -1,3 +1,4 @@
// @ts-nocheck
// This file is auto-generated by @hey-api/openapi-ts // This file is auto-generated by @hey-api/openapi-ts
export type ClientOptions = { export type ClientOptions = {

View file

@ -1,7 +1,8 @@
import { useEffect, useRef, useState, useCallback } from "react"; import { useRef, useState, useCallback } from "react";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { Play, Loader2, Trash2, Terminal } from "lucide-react"; import { Play, Loader2, Trash2, Terminal } from "lucide-react";
import { Button } from "./ui/button"; import { Button } from "./ui/button";
import { cn } from "~/client/lib/utils";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from "./ui/sheet"; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from "./ui/sheet";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select";
import { Label } from "./ui/label"; import { Label } from "./ui/label";
@ -74,7 +75,6 @@ export function DevPanel({ open, onOpenChange }: DevPanelProps) {
abortControllerRef.current = new AbortController(); abortControllerRef.current = new AbortController();
// Parse command line: first word is command, rest are args
const trimmedLine = commandLine.trim(); const trimmedLine = commandLine.trim();
const parts = trimmedLine.split(/\s+/); const parts = trimmedLine.split(/\s+/);
const command = parts[0]; const command = parts[0];
@ -177,14 +177,14 @@ export function DevPanel({ open, onOpenChange }: DevPanelProps) {
<div className="flex gap-2"> <div className="flex gap-2">
<Button onClick={handleRun} disabled={isRunning || !selectedRepoId || !commandLine.trim()}> <Button onClick={handleRun} disabled={isRunning || !selectedRepoId || !commandLine.trim()}>
{isRunning ? <Loader2 className="h-4 w-4 animate-spin mr-2" /> : <Play className="h-4 w-4 mr-2" />} <Loader2 className={cn("h-4 w-4 animate-spin mr-2", { hidden: !isRunning })} />
{isRunning ? "Running..." : "Run"} <Play className={cn("h-4 w-4 mr-2", { hidden: isRunning })} />
<span className={cn({ hidden: !isRunning })}>Running...</span>
<span className={cn({ hidden: isRunning })}>Run</span>
</Button>
<Button variant="destructive" onClick={handleCancel} className={cn({ hidden: !isRunning })}>
Cancel
</Button> </Button>
{isRunning && (
<Button variant="destructive" onClick={handleCancel}>
Cancel
</Button>
)}
<Button variant="outline" onClick={handleClear} disabled={isRunning}> <Button variant="outline" onClick={handleClear} disabled={isRunning}>
<Trash2 className="h-4 w-4 mr-2" /> <Trash2 className="h-4 w-4 mr-2" />
Clear Clear
@ -194,35 +194,32 @@ export function DevPanel({ open, onOpenChange }: DevPanelProps) {
<div className="flex-1 min-h-0 border rounded-md bg-muted/30"> <div className="flex-1 min-h-0 border rounded-md bg-muted/30">
<div ref={outputRef} className="h-full overflow-auto p-3 font-mono text-xs"> <div ref={outputRef} className="h-full overflow-auto p-3 font-mono text-xs">
{output.length === 0 ? ( <div className={cn("text-muted-foreground", { hidden: output.length > 0 })}>
<div className="text-muted-foreground">Output will appear here...</div> Output will appear here...
) : ( </div>
<div className="space-y-0.5"> <div className={cn("space-y-0.5", { hidden: output.length === 0 })}>
{output.map((line, i) => { {output.map((line, i) => {
let displayLine = line; let displayLine = line;
let isJson = false; let isJson = false;
try { try {
const parsed = JSON.parse(line); const parsed = JSON.parse(line);
displayLine = JSON.stringify(parsed, null, 2); displayLine = JSON.stringify(parsed, null, 2);
isJson = true; isJson = true;
} catch { } catch {
// Not valid JSON, display as-is // Not valid JSON, display as-is
} }
return ( return (
<pre <pre
key={`${i}-${line.slice(0, 20)}`} key={`${i}-${line.slice(0, 20)}`}
className={ className={cn("whitespace-pre-wrap break-all text-xs", {
isJson "wrap-break-word text-[10px] leading-tight": isJson,
? "whitespace-pre wrap-break-word text-[10px] leading-tight" })}
: "whitespace-pre-wrap break-all text-xs" >
} {displayLine}
> </pre>
{displayLine} );
</pre> })}
); </div>
})}
</div>
)}
</div> </div>
</div> </div>
</div> </div>

View file

@ -5,6 +5,10 @@ export default defineConfig({
input: `http://${config.serverIp}:3000/api/v1/openapi.json`, input: `http://${config.serverIp}:3000/api/v1/openapi.json`,
output: { output: {
path: "./app/client/api-client", path: "./app/client/api-client",
header: [
"// @ts-nocheck",
"// This file is auto-generated by @hey-api/openapi-ts",
],
postProcess: ["oxfmt"], postProcess: ["oxfmt"],
}, },
plugins: [...defaultPlugins, "@tanstack/react-query", "@hey-api/client-fetch"], plugins: [...defaultPlugins, "@tanstack/react-query", "@hey-api/client-fetch"],