app-builder-lib 27.0.0-alpha.6 → 27.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +23 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +71 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/configuration.d.ts +42 -5
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/fileMatcher.d.ts +15 -0
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +41 -2
- package/dist/fileMatcher.js.map +1 -1
- package/dist/indexInternal.d.ts +2 -1
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +2 -1
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +2 -3
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +11 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +28 -5
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +3 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +8 -4
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +17 -7
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +5 -4
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.js +1 -1
- package/dist/packager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +3 -1
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +4 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +9 -0
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +3 -3
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +27 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +92 -57
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +12 -2
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +20 -11
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/win/MsiTarget.js +2 -2
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/toolsets/custom.js +4 -2
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +4 -1
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +63 -2
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/electronGet.d.ts +5 -0
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +107 -7
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/packageMetadata.js +46 -21
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +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AAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!isSafeExtractPath(resolvedTarget, dir)) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n signal: AbortSignal.timeout(10 * 60 * 1000), // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const configWithProgress = { ...config, downloadOptions }\n try {\n let filePath: string\n try {\n filePath = await retry(() => get.downloadArtifact(configWithProgress), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: (e: any) =>\n e instanceof HttpError ? e.isServerError() : typeof e?.code === \"string\" && [\"ENOTFOUND\", \"ETIMEDOUT\", \"ECONNRESET\", \"EPIPE\", \"ENOENT\"].includes(e.code),\n })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(configWithProgress)\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the SHA-256 checksum when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expectedSha256: string | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expectedSha256) {\n const hash = await new Promise<string>((resolve, reject) => {\n const h = crypto.createHash(\"sha256\")\n const s = createReadStream(archiveCachePath)\n s.on(\"error\", reject)\n s.on(\"data\", (chunk: Buffer | string) => h.update(chunk))\n s.on(\"end\", () => resolve(h.digest(\"hex\")))\n })\n if (hash !== expectedSha256) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(config: ElectronArtifactDetails, extractDir: string, label: string, archiveCachePath?: string): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, (config as any).checksums?.[label])\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n return `${overrideUrl}/${filenameWithExt}`\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath)\n}\n\n/**\n * Downloads and extracts an electron platform artifact (e.g. ffmpeg) using @electron/get.\n * Deduplicates concurrent calls for the same artifact within the same process.\n */\nfunction buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): ElectronPlatformArtifactDetails {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified.txt; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAA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M,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,6BAA6B,CAAC,KAAK,EAAE,GAAG,YAAY,KAAK,OAAO,EAAE,EAAE,UAAU,CAAC,CAAA;IAElH,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!isSafeExtractPath(resolvedTarget, dir)) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n signal: AbortSignal.timeout(10 * 60 * 1000), // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const configWithProgress = { ...config, downloadOptions }\n try {\n let filePath: string\n try {\n filePath = await retry(() => get.downloadArtifact(configWithProgress), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: (e: any) =>\n e instanceof HttpError ? e.isServerError() : typeof e?.code === \"string\" && [\"ENOTFOUND\", \"ETIMEDOUT\", \"ECONNRESET\", \"EPIPE\", \"ENOENT\"].includes(e.code),\n })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(configWithProgress)\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the SHA-256 checksum when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n *\n * Air-gapped seeding contract: placing the archive at\n * `<cacheDir>/<releaseName>/<archive>` (e.g. `$ELECTRON_BUILDER_CACHE/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz`)\n * is sufficient for a fully offline toolset resolution — the checksum here is computed locally\n * against the value hardcoded in the toolset module, and extraction happens locally too. No\n * `.state` file needs to be seeded. See https://www.electron.build/tutorials/offline-air-gapped-builds.\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expectedSha256: string | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expectedSha256) {\n const hash = await new Promise<string>((resolve, reject) => {\n const h = crypto.createHash(\"sha256\")\n const s = createReadStream(archiveCachePath)\n s.on(\"error\", reject)\n s.on(\"data\", (chunk: Buffer | string) => h.update(chunk))\n s.on(\"end\", () => resolve(h.digest(\"hex\")))\n })\n if (hash !== expectedSha256) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(config: ElectronArtifactDetails, extractDir: string, label: string, archiveCachePath?: string): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, (config as any).checksums?.[label])\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n return `${overrideUrl}/${filenameWithExt}`\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath)\n}\n\n/**\n * Mirrors @electron/get's default cache root (`env-paths(\"electron\", { suffix: \"\" }).cache`).\n * @electron/get does not export it and its package `exports` map blocks deep imports, so the\n * (deliberately tiny) platform switch is replicated here. Must stay in sync with the\n * `cacheRoot` default documented in @electron/get's `ElectronDownloadRequestOptions`.\n * @internal exported for unit testing\n */\nexport function defaultElectronGetCacheRoot(): string {\n const name = \"electron\"\n const homeDir = os.homedir()\n switch (os.platform()) {\n case \"darwin\":\n return path.join(homeDir, \"Library\", \"Caches\", name)\n case \"win32\":\n return path.join(process.env.LOCALAPPDATA || path.join(homeDir, \"AppData\", \"Local\"), name, \"Cache\")\n default:\n return path.join(process.env.XDG_CACHE_HOME || path.join(homeDir, \".cache\"), name)\n }\n}\n\n/**\n * Parses the upstream `SHASUMS256.txt` format into the `Record<filename, sha256-hex>` shape that\n * @electron/get accepts as inline `checksums`. Each line is `<sha256-hex> *<filename>` (binary\n * mode) or `<sha256-hex> <filename>` (text mode); malformed lines are ignored.\n * @internal exported for unit testing\n */\nexport function parseChecksumFile(content: string): Record<string, string> {\n const checksums: Record<string, string> = {}\n for (const rawLine of content.split(\"\\n\")) {\n const match = /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/.exec(rawLine.trim())\n if (match != null) {\n checksums[match[2]] = match[1].toLowerCase()\n }\n }\n return checksums\n}\n\n/**\n * Looks for a locally seeded SHASUMS256 file at the root of the @electron/get cache and returns\n * its contents as inline `checksums`, or null when nothing usable is seeded.\n *\n * Why: without inline `checksums`, @electron/get re-downloads `SHASUMS256.txt` with a hardcoded\n * `cacheMode: Bypass` on EVERY build — even when the artifact itself is a cache hit — so a fully\n * seeded cache still requires network access and air-gapped builds fail (#10039). Cache-seeding\n * tools (e.g. flatpak-node-generator) already place `SHASUMS256.txt-<version>` flat at the cache\n * root; feeding it back as inline `checksums` keeps checksum validation enabled while making it\n * fully offline. A plain `SHASUMS256.txt` at the cache root is accepted as a manual-seeding\n * fallback. A candidate file is only used when it actually contains an entry for the requested\n * artifact, so a stale file for another version can never break an online build.\n * See https://www.electron.build/tutorials/offline-air-gapped-builds for the seeding contract.\n * @internal exported for unit testing\n */\nexport async function resolveSeededChecksums(cacheRoot: string, version: string, artifactFileName: string): Promise<Record<string, string> | null> {\n const candidates = [path.join(cacheRoot, `SHASUMS256.txt-${version}`), path.join(cacheRoot, \"SHASUMS256.txt\")]\n for (const candidate of candidates) {\n if (!(await exists(candidate))) {\n continue\n }\n let content: string\n try {\n content = await fs.readFile(candidate, \"utf-8\")\n } catch (err: any) {\n log.warn({ file: log.filePath(candidate), err: err.message }, \"failed to read seeded SHASUMS file — ignoring it\")\n continue\n }\n const checksums = parseChecksumFile(content)\n if (checksums[artifactFileName] == null) {\n log.warn({ file: log.filePath(candidate), artifactFileName }, \"seeded SHASUMS file has no entry for the requested artifact — ignoring it\")\n continue\n }\n log.debug({ file: log.filePath(candidate), artifactFileName }, \"using locally seeded SHASUMS256 checksums — checksum validation can run offline\")\n return checksums\n }\n return null\n}\n\n/**\n * Assembles the `@electron/get` artifact config (`ElectronPlatformArtifactDetails`) from\n * `ArtifactDownloadOptions`: spreads the caller's options and pins `cacheRoot`/`platform`/`arch`/\n * `version`/`artifactName` and the resolved cache mode, warning when checksum verification is\n * disabled. When the caller provides no `checksums` (user-provided `electronGet.checksums` always\n * wins) and verification is not disabled, a locally seeded `SHASUMS256.txt-<version>` at the cache\n * root is picked up as inline `checksums` so validation works offline (see resolveSeededChecksums).\n * Callers pass the result to `downloadArtifactToFile` / `downloadAndExtract`.\n * @internal exported for unit testing\n */\nexport async function buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): Promise<ElectronPlatformArtifactDetails> {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n if (artifactConfig.checksums == null && !artifactConfig.unsafelyDisableChecksums) {\n // Matches @electron/get's getArtifactFileName for non-generic artifacts; `artifactSuffix` and\n // `customFilename` cannot diverge here — both are excluded from ElectronGetOptions.\n const artifactFileName = `${artifactName}-v${version}-${platform}-${arch}.zip`\n const seededChecksums = await resolveSeededChecksums(cacheRoot ?? defaultElectronGetCacheRoot(), version, artifactFileName)\n if (seededChecksums != null) {\n artifactConfig.checksums = seededChecksums\n }\n }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport async function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = await buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\n/**\n * Downloads an electron platform artifact (e.g. ffmpeg) via `@electron/get` and extracts it into a\n * content-addressed cache directory (keyed on a hash of the resolved artifact config), returning the\n * extraction path.\n */\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = await buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { InvalidConfigurationError, isEmptyOrSpaces, log } from "builder-util";
|
|
2
2
|
import fsExtra from "fs-extra";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import * as path from "path";
|
|
4
5
|
import * as semver from "semver";
|
|
5
6
|
import { normalizePackageData } from "./normalizePackageData.js";
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
6
8
|
/** @internal */
|
|
7
9
|
export async function readPackageJson(file) {
|
|
8
10
|
const data = await fsExtra.readJson(file);
|
|
@@ -27,7 +29,7 @@ async function authors(file, data) {
|
|
|
27
29
|
data.contributors = authorData.split(/\r?\n/g).map(it => it.replace(/^\s*#.*$/, "").trim());
|
|
28
30
|
}
|
|
29
31
|
/** @internal */
|
|
30
|
-
export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile) {
|
|
32
|
+
export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile, projectDir) {
|
|
31
33
|
const errors = [];
|
|
32
34
|
const reportError = (missedFieldName) => {
|
|
33
35
|
errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`);
|
|
@@ -45,7 +47,7 @@ export function checkMetadata(metadata, devMetadata, appPackageFile, devAppPacka
|
|
|
45
47
|
log.warn({ appPackageFile }, `author is missed in the package.json`);
|
|
46
48
|
}
|
|
47
49
|
checkNotEmpty("version", metadata.version);
|
|
48
|
-
checkDependencies(metadata.dependencies, errors);
|
|
50
|
+
checkDependencies(metadata.dependencies, errors, projectDir);
|
|
49
51
|
if (metadata !== devMetadata) {
|
|
50
52
|
if (metadata.build != null) {
|
|
51
53
|
errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`);
|
|
@@ -69,34 +71,57 @@ function versionSatisfies(version, range, loose) {
|
|
|
69
71
|
}
|
|
70
72
|
return semver.satisfies(coerced, range, loose);
|
|
71
73
|
}
|
|
72
|
-
function checkDependencies(dependencies, errors) {
|
|
74
|
+
function checkDependencies(dependencies, errors, projectDir) {
|
|
73
75
|
if (dependencies == null) {
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
78
|
let updaterVersion = dependencies["electron-updater"];
|
|
77
79
|
if (updaterVersion != null) {
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
let skipValidation = false;
|
|
81
|
+
// prefer the version of the actually-installed electron-updater over the declared specifier,
|
|
82
|
+
// so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version
|
|
83
|
+
let resolvedPackageJson = null;
|
|
84
|
+
try {
|
|
85
|
+
resolvedPackageJson = require.resolve("electron-updater/package.json", { paths: [projectDir] });
|
|
86
|
+
}
|
|
87
|
+
catch (_ignored) {
|
|
88
|
+
// electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map
|
|
89
|
+
// does not expose "./package.json" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below
|
|
86
90
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
if (resolvedPackageJson != null) {
|
|
92
|
+
updaterVersion = fsExtra.readJsonSync(resolvedPackageJson).version;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// Pick the version out of yarn berry patch syntax
|
|
96
|
+
// "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch"
|
|
97
|
+
if (updaterVersion.startsWith("patch:")) {
|
|
98
|
+
const npmMarker = "@npm%3A";
|
|
99
|
+
const markerIndex = updaterVersion.indexOf(npmMarker);
|
|
100
|
+
if (markerIndex !== -1) {
|
|
101
|
+
const versionStart = markerIndex + npmMarker.length;
|
|
102
|
+
const hashIndex = updaterVersion.indexOf("#", versionStart);
|
|
103
|
+
if (hashIndex > versionStart) {
|
|
104
|
+
updaterVersion = updaterVersion.slice(versionStart, hashIndex);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// for testing auto-update using workspace electron-updater
|
|
109
|
+
const prefixes = ["link:", "file:"];
|
|
110
|
+
for (const prefix of prefixes) {
|
|
111
|
+
if (updaterVersion.startsWith(prefix)) {
|
|
112
|
+
const normalized = path.normalize(updaterVersion.substring(prefix.length));
|
|
113
|
+
const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized);
|
|
114
|
+
const json = fsExtra.readJsonSync(path.join(packageJsonPath, "package.json"));
|
|
115
|
+
updaterVersion = json.version;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
96
118
|
}
|
|
119
|
+
// pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation
|
|
120
|
+
const unresolvableProtocols = ["catalog:", "workspace:"];
|
|
121
|
+
skipValidation = unresolvableProtocols.some(protocol => updaterVersion.startsWith(protocol));
|
|
97
122
|
}
|
|
98
123
|
const requiredElectronUpdaterVersion = "4.0.0";
|
|
99
|
-
if (!versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
|
|
124
|
+
if (!skipValidation && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
|
|
100
125
|
errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}". Received "${updaterVersion}"`);
|
|
101
126
|
}
|
|
102
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAE9E,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACb,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAS;IAC5C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAM;IACR,CAAC;IAED,IAAI,UAAU,CAAA;IACd,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAA;IAC1F,CA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AC,gKAAgK,CAAC,CAAA;IAC/K,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport fsExtra from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata.js\"\nimport { normalizePackageData } from \"./normalizePackageData.js\"\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await fsExtra.readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await fsExtra.readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (_ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | Nullish) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkDependencies(metadata.dependencies, errors)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: Record<string, string> | Nullish, errors: Array<string>) {\n if (dependencies == null) {\n return\n }\n\n let updaterVersion = dependencies[\"electron-updater\"]\n if (updaterVersion != null) {\n // Pick the version out of yarn berry patch syntax\n // \"patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch\"\n if (updaterVersion.startsWith(\"patch:\")) {\n // codeql[js/polynomial-redos] - [^#]+ is a possessive character-class match; linear time, no catastrophic backtracking\n const match = updaterVersion.match(/@npm%3A([^#]+)#/)\n if (match) {\n updaterVersion = match[1]\n }\n }\n\n // for testing auto-update using workspace electron-updater\n const prefixes = [\"link:\", \"file:\"]\n for (const prefix of prefixes) {\n if (updaterVersion.startsWith(prefix)) {\n const normalized = path.normalize(updaterVersion.substring(prefix.length))\n const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized)\n const json = fsExtra.readJsonSync(path.join(packageJsonPath, \"package.json\"))\n updaterVersion = json.version\n break\n }\n }\n\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (!versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\". Received \"${updaterVersion}\"`\n )\n }\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAE9E,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEhE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACb,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAS;IAC5C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAM;IACR,CAAC;IAED,IAAI,UAAU,CAAA;IACd,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,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S,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;oBAC1E,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAA;oBAC1G,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAA;oBAC7E,cAAc,GAAG,IAAI,CAAC,OAAO,CAAA;oBAC7B,MAAK;gBACP,CAAC;YACH,CAAC;YAED,uIAAuI;YACvI,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;YACxD,cAAc,GAAG,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAA;QAC9F,CAAC;QAED,MAAM,8BAA8B,GAAG,OAAO,CAAA;QAC9C,IAAI,CAAC,cAAc,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK,8BAA8B,EAAE,CAAC,EAAE,CAAC;YAChG,MAAM,CAAC,IAAI,CACT,6BAA6B,8BAA8B,iGAAiG,8BAA8B,gBAAgB,cAAc,GAAG,CAC5N,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACnE,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,gKAAgK,CAAC,CAAA;IAC/K,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport fsExtra from \"fs-extra\"\nimport { createRequire } from \"node:module\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata.js\"\nimport { normalizePackageData } from \"./normalizePackageData.js\"\n\nconst require = createRequire(import.meta.url)\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await fsExtra.readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await fsExtra.readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (_ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string, projectDir: string): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | Nullish) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkDependencies(metadata.dependencies, errors, projectDir)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: Record<string, string> | Nullish, errors: Array<string>, projectDir: string) {\n if (dependencies == null) {\n return\n }\n\n let updaterVersion = dependencies[\"electron-updater\"]\n if (updaterVersion != null) {\n let skipValidation = false\n\n // prefer the version of the actually-installed electron-updater over the declared specifier,\n // so that specifiers like pnpm `catalog:`/`workspace:` are validated against the real version\n let resolvedPackageJson: string | null = null\n try {\n resolvedPackageJson = require.resolve(\"electron-updater/package.json\", { paths: [projectDir] })\n } catch (_ignored) {\n // electron-updater is not installed (MODULE_NOT_FOUND), or the installed version's `exports` map\n // does not expose \"./package.json\" (ERR_PACKAGE_PATH_NOT_EXPORTED) — fall back to the declared specifier below\n }\n\n if (resolvedPackageJson != null) {\n updaterVersion = fsExtra.readJsonSync(resolvedPackageJson).version\n } else {\n // Pick the version out of yarn berry patch syntax\n // \"patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch\"\n if (updaterVersion.startsWith(\"patch:\")) {\n const npmMarker = \"@npm%3A\"\n const markerIndex = updaterVersion.indexOf(npmMarker)\n if (markerIndex !== -1) {\n const versionStart = markerIndex + npmMarker.length\n const hashIndex = updaterVersion.indexOf(\"#\", versionStart)\n if (hashIndex > versionStart) {\n updaterVersion = updaterVersion.slice(versionStart, hashIndex)\n }\n }\n }\n\n // for testing auto-update using workspace electron-updater\n const prefixes = [\"link:\", \"file:\"]\n for (const prefix of prefixes) {\n if (updaterVersion.startsWith(prefix)) {\n const normalized = path.normalize(updaterVersion.substring(prefix.length))\n const packageJsonPath = path.isAbsolute(normalized) ? normalized : path.resolve(process.cwd(), normalized)\n const json = fsExtra.readJsonSync(path.join(packageJsonPath, \"package.json\"))\n updaterVersion = json.version\n break\n }\n }\n\n // pnpm `catalog:` and `workspace:` specifiers cannot be resolved to a concrete version from the package.json alone, so skip validation\n const unresolvableProtocols = [\"catalog:\", \"workspace:\"]\n skipValidation = unresolvableProtocols.some(protocol => updaterVersion.startsWith(protocol))\n }\n\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (!skipValidation && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\". Received \"${updaterVersion}\"`\n )\n }\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n}\n"]}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "27.0.0-alpha.
|
|
1
|
+
export declare const PACKAGE_VERSION = "27.0.0-alpha.7";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = "27.0.0-alpha.
|
|
1
|
+
export const PACKAGE_VERSION = "27.0.0-alpha.7";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"27.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"27.0.0-alpha.7\"\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-builder-lib",
|
|
3
3
|
"description": "electron-builder lib",
|
|
4
|
-
"version": "27.0.0-alpha.
|
|
4
|
+
"version": "27.0.0-alpha.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
"undici": "^7.27.1",
|
|
99
99
|
"unzipper": "^0.12.3",
|
|
100
100
|
"which": "^5.0.0",
|
|
101
|
-
"builder-util": "27.0.0-alpha.
|
|
102
|
-
"
|
|
103
|
-
"
|
|
101
|
+
"builder-util": "27.0.0-alpha.7",
|
|
102
|
+
"builder-util-runtime": "10.0.0-alpha.6",
|
|
103
|
+
"electron-publish": "27.0.0-alpha.7"
|
|
104
104
|
},
|
|
105
105
|
"///": "babel in devDependencies for proton tests",
|
|
106
106
|
"devDependencies": {
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"@types/unzipper": "^0.10.11",
|
|
116
116
|
"@types/which": "^3.0.4",
|
|
117
117
|
"toml": "^3.0.0",
|
|
118
|
-
"dmg-builder": "27.0.0-alpha.
|
|
119
|
-
"electron-builder-squirrel-windows": "27.0.0-alpha.
|
|
118
|
+
"dmg-builder": "27.0.0-alpha.7",
|
|
119
|
+
"electron-builder-squirrel-windows": "27.0.0-alpha.7"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"dmg-builder": "27.0.0-alpha.
|
|
123
|
-
"electron-builder-squirrel-windows": "27.0.0-alpha.
|
|
122
|
+
"dmg-builder": "27.0.0-alpha.7",
|
|
123
|
+
"electron-builder-squirrel-windows": "27.0.0-alpha.7"
|
|
124
124
|
},
|
|
125
125
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
126
126
|
"types": "./dist/index.d.ts",
|