Fix bug in extract codebase that artificially limited to 30 files (#32)
This commit is contained in:
@@ -619,31 +619,6 @@ export function registerAppHandlers() {
|
||||
}
|
||||
);
|
||||
|
||||
// Extract codebase information
|
||||
ipcMain.handle(
|
||||
"extract-codebase",
|
||||
async (_, { appId, maxFiles }: { appId: number; maxFiles?: number }) => {
|
||||
const app = await db.query.apps.findFirst({
|
||||
where: eq(apps.id, appId),
|
||||
});
|
||||
|
||||
if (!app) {
|
||||
throw new Error("App not found");
|
||||
}
|
||||
|
||||
const appPath = getDyadAppPath(app.path);
|
||||
|
||||
try {
|
||||
return await extractCodebase(appPath, maxFiles);
|
||||
} catch (error) {
|
||||
logger.error(`Error extracting codebase for app ${appId}:`, error);
|
||||
throw new Error(
|
||||
`Failed to extract codebase: ${(error as any).message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.handle(
|
||||
"edit-app-file",
|
||||
async (
|
||||
|
||||
@@ -431,20 +431,6 @@ export class IpcClient {
|
||||
}
|
||||
}
|
||||
|
||||
// Extract codebase information for a given app
|
||||
public async extractCodebase(appId: number, maxFiles = 30): Promise<string> {
|
||||
try {
|
||||
const codebaseInfo = await this.ipcRenderer.invoke("extract-codebase", {
|
||||
appId,
|
||||
maxFiles,
|
||||
});
|
||||
return codebaseInfo as string;
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete an app and all its files
|
||||
public async deleteApp(appId: number): Promise<{ success: boolean }> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user