chore: lint fix

ran pnpm lint fix and fixed warnings
This commit is contained in:
Dustin Loring 2025-01-18 08:12:01 -05:00 committed by GitHub
commit adf0cbc502
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 24 additions and 37 deletions

View File

@ -1,10 +1,10 @@
import type { Message } from 'ai';
import ignore from 'ignore';
import { useState } from 'react';
import { GitCloneDialog } from '~/components/git/GitCloneDialog';
import WithTooltip from '~/components/ui/Tooltip';
import { IGNORE_PATTERNS } from '~/constants/ignorePatterns';
import { useGit } from '~/lib/hooks/useGit';
import { useState } from 'react';
import { GitCloneDialog } from '~/components/git/GitCloneDialog';
const ig = ignore().add(IGNORE_PATTERNS);
const generateId = () => Math.random().toString(36).substring(2, 15);
@ -74,11 +74,7 @@ ${textDecoder.decode(content)}
</button>
</WithTooltip>
<GitCloneDialog
isOpen={showDialog}
onClose={() => setShowDialog(false)}
onClone={handleClone}
/>
<GitCloneDialog isOpen={showDialog} onClose={() => setShowDialog(false)} onClone={handleClone} />
</>
);
}

View File

@ -1,7 +1,6 @@
import { useState } from 'react';
import { Dialog, DialogButton, DialogDescription, DialogRoot, DialogTitle } from '~/components/ui/Dialog';
import { useGit } from '~/lib/hooks/useGit';
import { toast } from 'react-toastify';
import { Dialog, DialogButton, DialogDescription, DialogRoot, DialogTitle } from '~/components/ui/Dialog';
interface GitCloneDialogProps {
isOpen: boolean;
@ -19,15 +18,15 @@ export function GitCloneDialog({ isOpen, onClose, onClone }: GitCloneDialogProps
e.preventDefault();
setIsLoading(true);
try {
// If it's a private repo, construct the URL with the token
const cloneUrl = isPrivate
? repoUrl.replace('https://', `https://${token}@`)
: repoUrl;
// if it's a private repo, construct the URL with the token
const cloneUrl = isPrivate ? repoUrl.replace('https://', `https://${token}@`) : repoUrl;
if (onClone) {
await onClone(cloneUrl);
}
toast.success('Repository cloned successfully!');
onClose();
} catch (error) {
@ -45,21 +44,11 @@ export function GitCloneDialog({ isOpen, onClose, onClone }: GitCloneDialogProps
<form onSubmit={handleSubmit} className="space-y-4">
<div className="flex items-center gap-4 mb-4">
<label className="flex items-center gap-2">
<input
type="radio"
checked={!isPrivate}
onChange={() => setIsPrivate(false)}
className="form-radio"
/>
<input type="radio" checked={!isPrivate} onChange={() => setIsPrivate(false)} className="form-radio" />
<span>Public Repository</span>
</label>
<label className="flex items-center gap-2">
<input
type="radio"
checked={isPrivate}
onChange={() => setIsPrivate(true)}
className="form-radio"
/>
<input type="radio" checked={isPrivate} onChange={() => setIsPrivate(true)} className="form-radio" />
<span>Private Repository</span>
</label>
</div>

View File

@ -1,5 +1,5 @@
import React from 'react';
import type { ReactElement } from 'react';
import React from 'react';
import { memo } from 'react';
import { classNames } from '~/utils/classNames';

View File

@ -1,5 +1,5 @@
import React from 'react';
import type { ReactElement } from 'react';
import React from 'react';
import { memo } from 'react';
import { classNames } from '~/utils/classNames';

View File

@ -1,10 +1,10 @@
import React from 'react';
import { motion } from 'framer-motion';
import React from 'react';
import { memo } from 'react';
import type { ReactElement } from 'react';
import { classNames } from '~/utils/classNames';
import { cubicEasingFn } from '~/utils/easings';
import { genericMemo } from '~/utils/react';
import type { ReactElement } from 'react';
interface SliderOption<T> {
value: T;

View File

@ -2,10 +2,10 @@ import * as nodePath from 'node:path';
import { WebContainer } from '@webcontainer/api';
import { map, type MapStore } from 'nanostores';
import type { ActionCallbackData } from './message-parser';
import { workbenchStore } from '~/lib/stores/workbench';
import type { BoltAction } from '~/types/actions';
import { createScopedLogger } from '~/utils/logger';
import { unreachable } from '~/utils/unreachable';
import { workbenchStore } from '~/lib/stores/workbench';
const logger = createScopedLogger('ActionRunner');
@ -129,7 +129,7 @@ export class ActionRunner {
const webcontainer = await this.#webcontainer;
// Write the command to the Bolt terminal
// write the command to the Bolt terminal
workbenchStore.writeToBoltTerminal(`\x1b[1;34m$ ${action.content}\x1b[0m\n`);
const process = await webcontainer.spawn('jsh', ['-c', action.content], {
@ -153,7 +153,9 @@ export class ActionRunner {
const exitCode = await process.exit;
logger.debug(`Process terminated with code ${exitCode}`);
workbenchStore.writeToBoltTerminal(`\x1b[1;${exitCode === 0 ? '32' : '31'}mProcess exited with code ${exitCode}\x1b[0m\n\n`);
workbenchStore.writeToBoltTerminal(
`\x1b[1;${exitCode === 0 ? '32' : '31'}mProcess exited with code ${exitCode}\x1b[0m\n\n`,
);
}
async #runFileAction(action: ActionState) {
@ -168,7 +170,7 @@ export class ActionRunner {
// remove trailing slashes
folder = folder.replace(/\/+$/g, '');
// Write file creation to Bolt terminal
// write file creation to Bolt terminal
workbenchStore.writeToBoltTerminal(`\x1b[1;34mCreating file: ${action.filePath}\x1b[0m\n`);
if (folder !== '.') {

View File

@ -1,9 +1,9 @@
import { atom, map, type MapStore, type ReadableAtom, type WritableAtom } from 'nanostores';
import { BoltTerminalStore } from './bolt-terminal';
import { EditorStore } from './editor';
import { FilesStore, type FileMap } from './files';
import { PreviewsStore } from './previews';
import { TerminalStore } from './terminal';
import { BoltTerminalStore } from './bolt-terminal';
import type { EditorDocument, ScrollPosition } from '~/components/editor/codemirror/CodeMirrorEditor';
import { ActionRunner } from '~/lib/runtime/action-runner';
import type { ActionCallbackData, ArtifactCallbackData } from '~/lib/runtime/message-parser';

View File

@ -1,4 +1,4 @@
import type { ComponentProps, ComponentType, JSXElementConstructor } from 'react';
import type { ComponentProps, ComponentType } from 'react';
import { memo } from 'react';
export const genericMemo: <T extends ComponentType<any>>(