update electron to v43

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -0,0 +1,31 @@
import fs from 'node:fs';
import path from 'node:path';
import { searchForModule } from './search-module.js';
import { fileURLToPath } from 'node:url';
const electronModuleNames = ['electron', 'electron-prebuilt-compile'];
async function locateModuleByImport() {
for (const moduleName of electronModuleNames) {
try {
const modulePath = path.resolve(fileURLToPath(import.meta.resolve(`${moduleName}/package.json`)), '..');
if (fs.existsSync(path.join(modulePath, 'package.json'))) {
return modulePath;
}
}
catch {
// eslint-disable-line no-empty
}
}
return null;
}
export async function locateElectronModule(projectRootPath, startDir) {
startDir ??= process.cwd();
for (const moduleName of electronModuleNames) {
const electronPaths = await searchForModule(startDir, moduleName, projectRootPath);
const electronPath = electronPaths.find((ePath) => fs.existsSync(path.join(ePath, 'package.json')));
if (electronPath) {
return electronPath;
}
}
return locateModuleByImport();
}
//# sourceMappingURL=electron-locator.js.map