update electron to v43
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s

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,40 @@
const url = require("url")
const fs = require("fs")
const path = require("path")
// Resolve a module specifier to a file:// URL using CJS resolution, which
// adds .js extensions automatically and follows pnpm's symlinked node_modules.
// Returns null for Node built-ins (require.resolve returns a bare string, not
// an absolute path) and for any specifier that cannot be resolved, so callers
// fall back to importing the raw specifier and get the normal error.
function resolveToFileUrl(modulePath) {
try {
const resolved = require.resolve(modulePath)
// Built-in modules (e.g. "fs", "path") resolve to their bare name, not a
// filesystem path. Passing a bare name to pathToFileURL produces a bogus URL.
return path.isAbsolute(resolved) ? url.pathToFileURL(resolved).href : null
} catch {
return null
}
}
exports.dynamicImport = async function dynamicImport(modulePath) {
if (fs.existsSync(modulePath)) {
return import(url.pathToFileURL(modulePath).href)
}
const fileUrl = resolveToFileUrl(modulePath)
return import(fileUrl !== null ? fileUrl : modulePath)
}
exports.dynamicImportMaybe = async function dynamicImportMaybe(modulePath) {
try {
return require(modulePath)
} catch (e1) {
try {
return await exports.dynamicImport(modulePath)
} catch (e2) {
e1.message = "\n1. " + e1.message + "\n2. " + e2.message
throw e1
}
}
}