install react dev tools in development (#4979)

This commit is contained in:
Jack Amadeo
2025-10-09 22:31:39 -04:00
committed by GitHub
parent 00657f82d7
commit f68c4bfc23
3 changed files with 139 additions and 0 deletions
+10
View File
@@ -52,6 +52,7 @@ import { Recipe } from './recipe';
import './utils/recipeHash';
import { decodeRecipe } from './api';
import { Client, createClient, createConfig } from './api/client';
import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
async function decodeRecipeMain(client: Client, deeplink: string): Promise<Recipe | null> {
try {
@@ -589,6 +590,15 @@ const createChat = async (
},
});
if (!app.isPackaged) {
installExtension(REACT_DEVELOPER_TOOLS, {
loadExtensionOptions: { allowFileAccess: true },
session: mainWindow.webContents.session,
})
.then(() => log.info('added react dev tools'))
.catch((err) => log.info('failed to install react dev tools:', err));
}
const goosedClient = createClient(
createConfig({
baseUrl: `http://127.0.0.1:${port}`,