Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions desktop-app/src/main/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import path from 'path';
import fs from 'fs';
import { session, app } from 'electron';

export const loadVueDevTools = async (): Promise<void> => {
const extensionPath = path.resolve(app.getAppPath(), '..', 'extensions', 'vue-devtools');

Check failure on line 6 in desktop-app/src/main/extensions/index.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Replace `app.getAppPath(),·'..',·'extensions',·'vue-devtools'` with `⏎····app.getAppPath(),⏎····'..',⏎····'extensions',⏎····'vue-devtools'⏎··`
if (!fs.existsSync(extensionPath)) {
console.warn(`[extensions] Vue DevTools not found at ${extensionPath}`);
return;
}
try {
await session.defaultSession.loadExtension(extensionPath, { allowFileAccess: true });

Check failure on line 12 in desktop-app/src/main/extensions/index.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Replace `·allowFileAccess:·true` with `⏎······allowFileAccess:·true,⏎···`
console.log(`[extensions] Vue DevTools loaded from ${extensionPath}`);
} catch (err) {
console.error(`[extensions] Failed to load Vue DevTools from ${extensionPath}`, err);

Check failure on line 15 in desktop-app/src/main/extensions/index.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest)

Replace ``[extensions]·Failed·to·load·Vue·DevTools·from·${extensionPath}`,·err` with `⏎······`[extensions]·Failed·to·load·Vue·DevTools·from·${extensionPath}`,⏎······err⏎····`
}
};
3 changes: 2 additions & 1 deletion desktop-app/src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { initHttpBasicAuthHandlers } from './http-basic-auth';
import { initAppMetaHandlers } from './app-meta';
import { openUrl } from './protocol-handler';
import { AppUpdater } from './app-updater';
import { loadVueDevTools } from './extensions';

let windowShownOnOpen = false;

Expand Down Expand Up @@ -83,7 +84,7 @@ const installExtensions = async () => {
'MOBX_DEVTOOLS',
'APOLLO_DEVELOPER_TOOLS',
];

await loadVueDevTools();
return installer
.default(
extensions.map((name) => installer[name]),
Expand Down
Loading