app-builder-lib 26.12.0 → 26.13.0
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/out/asar/asarFileChecker.d.ts +2 -2
- package/out/asar/asarFileChecker.js +3 -2
- package/out/asar/asarFileChecker.js.map +1 -1
- package/out/asar/asarUtil.js +3 -2
- package/out/asar/asarUtil.js.map +1 -1
- package/out/binDownload.js +36 -9
- package/out/binDownload.js.map +1 -1
- package/out/codeSign/certInfo.d.ts +54 -0
- package/out/codeSign/certInfo.js +466 -0
- package/out/codeSign/certInfo.js.map +1 -0
- package/out/codeSign/macCodeSign.d.ts +1 -1
- package/out/codeSign/macCodeSign.js +10 -9
- package/out/codeSign/macCodeSign.js.map +1 -1
- package/out/codeSign/windowsSignToolManager.js +3 -9
- package/out/codeSign/windowsSignToolManager.js.map +1 -1
- package/out/configuration.d.ts +5 -0
- package/out/configuration.js.map +1 -1
- package/out/electron/ElectronFramework.js +4 -1
- package/out/electron/ElectronFramework.js.map +1 -1
- package/out/electron/electronVersion.js +9 -4
- package/out/electron/electronVersion.js.map +1 -1
- package/out/fileTransformer.js +2 -1
- package/out/fileTransformer.js.map +1 -1
- package/out/forge-maker.js +6 -2
- package/out/forge-maker.js.map +1 -1
- package/out/mac/MacTargetHelper.d.ts +24 -0
- package/out/mac/MacTargetHelper.js +269 -0
- package/out/mac/MacTargetHelper.js.map +1 -0
- package/out/macPackager.d.ts +21 -7
- package/out/macPackager.js +219 -346
- package/out/macPackager.js.map +1 -1
- package/out/node-module-collector/moduleManager.d.ts +12 -2
- package/out/node-module-collector/moduleManager.js +3 -0
- package/out/node-module-collector/moduleManager.js.map +1 -1
- package/out/options/linuxOptions.d.ts +4 -3
- package/out/options/linuxOptions.js.map +1 -1
- package/out/options/macOptions.d.ts +6 -0
- package/out/options/macOptions.js.map +1 -1
- package/out/options/metadata.d.ts +2 -0
- package/out/options/metadata.js.map +1 -1
- package/out/packager.js +4 -4
- package/out/packager.js.map +1 -1
- package/out/platformPackager.d.ts +1 -1
- package/out/platformPackager.js +27 -21
- package/out/platformPackager.js.map +1 -1
- package/out/targets/AppxTarget.js +2 -1
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/FlatpakTarget.js +2 -4
- package/out/targets/FlatpakTarget.js.map +1 -1
- package/out/targets/FpmTarget.js +30 -6
- package/out/targets/FpmTarget.js.map +1 -1
- package/out/targets/LinuxTargetHelper.d.ts +1 -1
- package/out/targets/LinuxTargetHelper.js +79 -14
- package/out/targets/LinuxTargetHelper.js.map +1 -1
- package/out/targets/MsiTarget.js +1 -1
- package/out/targets/MsiTarget.js.map +1 -1
- package/out/targets/MsiWrappedTarget.js +1 -1
- package/out/targets/MsiWrappedTarget.js.map +1 -1
- package/out/targets/appimage/AppImageTarget.d.ts +0 -2
- package/out/targets/appimage/AppImageTarget.js +27 -42
- package/out/targets/appimage/AppImageTarget.js.map +1 -1
- package/out/targets/appimage/appImageUtil.d.ts +3 -1
- package/out/targets/appimage/appImageUtil.js +33 -0
- package/out/targets/appimage/appImageUtil.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +15 -5
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/WebInstallerTarget.js +2 -2
- package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
- package/out/targets/nsis/nsisScriptGenerator.js +2 -3
- package/out/targets/nsis/nsisScriptGenerator.js.map +1 -1
- package/out/targets/pkg.js +1 -1
- package/out/targets/pkg.js.map +1 -1
- package/out/targets/snap/SnapTarget.js +2 -1
- package/out/targets/snap/SnapTarget.js.map +1 -1
- package/out/targets/snap/core24.js +5 -4
- package/out/targets/snap/core24.js.map +1 -1
- package/out/targets/snap/coreLegacy.js +5 -5
- package/out/targets/snap/coreLegacy.js.map +1 -1
- package/out/targets/snap/snapcraftBuilder.js +4 -3
- package/out/targets/snap/snapcraftBuilder.js.map +1 -1
- package/out/toolsets/linux.d.ts +3 -1
- package/out/toolsets/linux.js +49 -21
- package/out/toolsets/linux.js.map +1 -1
- package/out/toolsets/windows.js +7 -17
- package/out/toolsets/windows.js.map +1 -1
- package/out/util/bundledTool.js +2 -1
- package/out/util/bundledTool.js.map +1 -1
- package/out/util/config/config.js +4 -3
- package/out/util/config/config.js.map +1 -1
- package/out/util/dynamicImport.d.ts +1 -0
- package/out/util/dynamicImport.js +14 -0
- package/out/util/dynamicImport.js.map +1 -0
- package/out/util/electronGet.d.ts +2 -0
- package/out/util/electronGet.js +38 -2
- package/out/util/electronGet.js.map +1 -1
- package/out/util/packageMetadata.js +2 -1
- package/out/util/packageMetadata.js.map +1 -1
- package/out/util/rebuild.d.ts +1 -1
- package/out/util/rebuild.js.map +1 -1
- package/out/util/yarn.js +1 -1
- package/out/util/yarn.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +11 -8
- package/scheme.json +22 -1
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +5 -5
package/out/util/electronGet.js
CHANGED
|
@@ -12,12 +12,14 @@ const builder_util_1 = require("builder-util");
|
|
|
12
12
|
const multiProgress_1 = require("electron-publish/out/multiProgress");
|
|
13
13
|
const fs_1 = require("fs");
|
|
14
14
|
const fs = require("fs/promises");
|
|
15
|
+
const crypto = require("crypto");
|
|
15
16
|
const os = require("os");
|
|
16
17
|
const path = require("path");
|
|
17
18
|
const lockfile = require("proper-lockfile");
|
|
18
19
|
const promises_1 = require("stream/promises");
|
|
19
20
|
const tar = require("tar");
|
|
20
21
|
const unzipper = require("unzipper");
|
|
22
|
+
const builder_util_runtime_1 = require("builder-util-runtime");
|
|
21
23
|
const cacheState_1 = require("./cacheState");
|
|
22
24
|
function hashUrlSafe(input, length = 6) {
|
|
23
25
|
let hash = 5381;
|
|
@@ -121,6 +123,15 @@ async function extractArchive(file, dir) {
|
|
|
121
123
|
// rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction
|
|
122
124
|
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
123
125
|
await fs.mkdir(tmpDir, { recursive: true });
|
|
126
|
+
// Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).
|
|
127
|
+
// A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.
|
|
128
|
+
for (let i = 0; !(await (0, builder_util_1.exists)(file)); i++) {
|
|
129
|
+
if (i >= 4) {
|
|
130
|
+
throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: "ENOENT", path: file });
|
|
131
|
+
}
|
|
132
|
+
builder_util_1.log.warn({ file, attempt: i + 1 }, "source archive transiently missing, retrying");
|
|
133
|
+
await new Promise(r => setTimeout(r, 300 * (i + 1)));
|
|
134
|
+
}
|
|
124
135
|
if (file.endsWith(".tar.gz") || file.endsWith(".tgz")) {
|
|
125
136
|
await tar.extract({ file, cwd: tmpDir, strip: 1 });
|
|
126
137
|
}
|
|
@@ -130,7 +141,7 @@ async function extractArchive(file, dir) {
|
|
|
130
141
|
else if (file.endsWith(".7z")) {
|
|
131
142
|
const cmd7za = await (0, builder_util_1.getPath7za)();
|
|
132
143
|
try {
|
|
133
|
-
await (0, builder_util_1.exec)(cmd7za, ["x", "-bd", file,
|
|
144
|
+
await (0, builder_util_1.exec)(cmd7za, ["x", "-bd", file, (0, builder_util_1.to7zaOutputSwitch)((0, builder_util_1.sanitizeDirPath)(tmpDir)), "-y"]);
|
|
134
145
|
}
|
|
135
146
|
catch (e) {
|
|
136
147
|
// Check if extraction actually failed or just had benign warnings
|
|
@@ -160,6 +171,19 @@ async function extractArchive(file, dir) {
|
|
|
160
171
|
}
|
|
161
172
|
async function downloadArtifactToFile(config, label) {
|
|
162
173
|
var _a, _b, _c, _d;
|
|
174
|
+
// Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's
|
|
175
|
+
// non-atomic putFileInCache (remove + move) from racing with a concurrent reader.
|
|
176
|
+
const artifactLockKey = crypto
|
|
177
|
+
.createHash("sha256")
|
|
178
|
+
.update(JSON.stringify({ v: config.version, p: config.platform, a: config.arch, n: config.artifactName }))
|
|
179
|
+
.digest("hex")
|
|
180
|
+
.slice(0, 20);
|
|
181
|
+
const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`);
|
|
182
|
+
const releaseArtifactLock = await lockfile.lock(artifactLockPath, {
|
|
183
|
+
retries: { retries: 30, minTimeout: 500, maxTimeout: 5000 },
|
|
184
|
+
stale: 600000,
|
|
185
|
+
realpath: false,
|
|
186
|
+
});
|
|
163
187
|
let lastLoggedMilestone = -1;
|
|
164
188
|
const state = { bar: undefined };
|
|
165
189
|
const downloadOptions = {
|
|
@@ -197,7 +221,12 @@ async function downloadArtifactToFile(config, label) {
|
|
|
197
221
|
try {
|
|
198
222
|
let filePath;
|
|
199
223
|
try {
|
|
200
|
-
filePath = await get.downloadArtifact(configWithProgress)
|
|
224
|
+
filePath = await (0, builder_util_runtime_1.retry)(() => get.downloadArtifact(configWithProgress), {
|
|
225
|
+
retries: 3,
|
|
226
|
+
interval: 2000,
|
|
227
|
+
backoff: 2000,
|
|
228
|
+
shouldRetry: (e) => e instanceof builder_util_runtime_1.HttpError ? e.isServerError() : typeof (e === null || e === void 0 ? void 0 : e.code) === "string" && ["ENOTFOUND", "ETIMEDOUT", "ECONNRESET", "EPIPE", "ENOENT"].includes(e.code),
|
|
229
|
+
});
|
|
201
230
|
}
|
|
202
231
|
catch (err) {
|
|
203
232
|
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("dest already exists")) {
|
|
@@ -219,6 +248,7 @@ async function downloadArtifactToFile(config, label) {
|
|
|
219
248
|
finally {
|
|
220
249
|
(_c = state.bar) === null || _c === void 0 ? void 0 : _c.update(100);
|
|
221
250
|
(_d = state.bar) === null || _d === void 0 ? void 0 : _d.terminate();
|
|
251
|
+
await releaseArtifactLock().catch(err => builder_util_1.log.warn({ err }, "failed to release artifact download lock"));
|
|
222
252
|
}
|
|
223
253
|
}
|
|
224
254
|
/**
|
|
@@ -329,6 +359,12 @@ function buildElectronArtifactConfig(options) {
|
|
|
329
359
|
}
|
|
330
360
|
else {
|
|
331
361
|
const { mirror, customDir, cache, customFilename, isVerifyChecksum, strictSSL, platform: overridePlatform, arch: overrideArch } = electronDownload;
|
|
362
|
+
// strictSSL: false disables TLS certificate validation for all
|
|
363
|
+
// electron/tool downloads. This option exists only for air-gapped or
|
|
364
|
+
// self-signed-cert environments; ensure your build network is fully trusted.
|
|
365
|
+
if (strictSSL === false) {
|
|
366
|
+
builder_util_1.log.warn({ option: "electronDownload.strictSSL" }, "strictSSL is false — TLS certificate validation is DISABLED for Electron downloads. Only use this option in a trusted, isolated build environment.");
|
|
367
|
+
}
|
|
332
368
|
artifactConfig = {
|
|
333
369
|
...artifactConfig,
|
|
334
370
|
unsafelyDisableChecksums: isVerifyChecksum === false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":";;AAwFA,8CA2BC;AAyDD,wCA+CC;AAyID,wDA+BC;AAqDD,kEAGC;AAED,4DASC;AAMD,oDAaC;AAzdD,qCAAoC;AACpC,uCAOsB;AACtB,+CAA8G;AAC9G,sEAAkE;AAClE,2BAAwD;AACxD,kCAAiC;AACjC,yBAAwB;AACxB,6BAA4B;AAC5B,4CAA2C;AAC3C,8CAA0C;AAC1C,2BAA0B;AAC1B,qCAAoC;AAEpC,6CAAmJ;AA0DnJ,SAAS,WAAW,CAAC,KAAa,EAAE,MAAM,GAAG,CAAC;IAC5C,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACnD,CAAC;IACD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AC9E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,YAAY,KAAK,OAAO,EAAE,EAAE,UAAU,CAAC,CAAA;IAEzH,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,aAAqB;IACxD,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,IAAA,kCAAmB,EAAC,MAAM,CAAC,CAAA;QACvC,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 ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n GotDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { buildGotProxyAgent, exec, exists, getPath7za, log, PADDING, parseValidEnvVarUrl } from \"builder-util\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\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 { ElectronPlatformName } from \"../electron/ElectronFramework\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState\"\nimport type { ProgressBar } from \"electron-publish\"\n\nexport type ElectronGetOptions = 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\" // to be added below\n> & {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n electronDownload?: ElectronGetOptions | ElectronDownloadOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n strictSSL?: boolean\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction 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\nexport function getCacheDirectory(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): 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 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\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 const entries = createReadStream(file).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 (!destPath.startsWith(dir + path.sep) && 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 (!resolvedTarget.startsWith(dir + path.sep) && 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}\n\nexport async function extractArchive(file: string, dir: string) {\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n retries: { retries: 15, 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 if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\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, `-o${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, 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 fs.rename(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nasync function downloadArtifactToFile(config: Parameters<typeof get.downloadArtifact>[0], label: string): Promise<string> {\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n const downloadOptions: GotDownloaderOptions = {\n timeout: { request: 10 * 60 * 1000 }, // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n agent: config.downloadOptions?.agent ?? buildGotProxyAgent(),\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 get.downloadArtifact(configWithProgress)\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 }\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: Parameters<typeof get.downloadArtifact>[0], extractDir: string, label: string): Promise<string> {\n await fs.mkdir(extractDir, { recursive: true })\n\n // Pre-lock fast path: only short-circuit for a definitively complete and valid cache.\n // Do NOT clean up here — concurrent processes could race to delete under each other.\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 const release = await lockfile.lock(extractDir, {\n retries: { retries: 15, 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 fs.mkdir(extractDir, { recursive: true })\n\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\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 * 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 const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = overrideUrl ? `${overrideUrl}/${filenameWithExt}` : `${baseUrl}${releaseName}/${filenameWithExt}`\n const suffix = hashUrlSafe(fullUrl, 5)\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|zip|7z)$/, \"\")}-${suffix}`\n const extractDir = path.join(getCacheDirectory({ allowEnvVarOverride: true }), releaseName, folderName)\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 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(getCacheDirectory({ allowEnvVarOverride: true }), \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt)\n}\n\n// Keys present in ElectronGetOptions but absent from ElectronDownloadOptions.\n// Used to discriminate between the two config shapes at runtime.\nconst ELECTRON_GET_EXCLUSIVE_KEYS: readonly string[] = [\"mirrorOptions\", \"force\", \"unsafelyDisableChecksums\"]\n\nfunction isElectronGetOptions(dl: ElectronGetOptions | ElectronDownloadOptions): dl is ElectronGetOptions {\n return ELECTRON_GET_EXCLUSIVE_KEYS.some(k => Object.hasOwnProperty.call(dl, k))\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(options: ArtifactDownloadOptions): ElectronPlatformArtifactDetails {\n const { electronDownload, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = options\n\n let artifactConfig: ElectronPlatformArtifactDetails = { cacheRoot, platform, arch, version, artifactName }\n\n if (electronDownload != null) {\n if (isElectronGetOptions(electronDownload)) {\n const { mirrorOptions, ...rest } = electronDownload\n artifactConfig = { ...artifactConfig, ...rest, cacheRoot, mirrorOptions }\n } else {\n const { mirror, customDir, cache, customFilename, isVerifyChecksum, strictSSL, platform: overridePlatform, arch: overrideArch } = electronDownload\n artifactConfig = {\n ...artifactConfig,\n unsafelyDisableChecksums: isVerifyChecksum === false,\n cacheRoot: cache ?? cacheRoot,\n mirrorOptions: {\n mirror: mirror || undefined,\n customDir: customDir || undefined,\n customFilename: customFilename || undefined,\n },\n ...(strictSSL === false ? { downloadOptions: { https: { rejectUnauthorized: false } } } : {}),\n }\n if (overridePlatform != null) {\n artifactConfig.platform = overridePlatform\n }\n if (overrideArch != null) {\n artifactConfig.arch = overrideArch\n }\n }\n }\n\n artifactConfig.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(getCacheDirectory({ allowEnvVarOverride: true }), `${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 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)\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":";;AA4FA,8CA2BC;AAyDD,wCAyDC;AA6JD,wDA+BC;AA8DD,kEAGC;AAED,4DASC;AAMD,oDAaC;AApgBD,qCAAo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,MAAM,cAAc,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAA;IAE3D,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7D,MAAM,UAAU,GAAG,GAAG,YAAY,KAAK,OAAO,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE,CAAA;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,YAAY,KAAK,OAAO,EAAE,EAAE,UAAU,CAAC,CAAA;IAEzH,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,aAAqB;IACxD,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,IAAA,kCAAmB,EAAC,MAAM,CAAC,CAAA;QACvC,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 ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n GotDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { buildGotProxyAgent, exec, exists, getPath7za, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch } from \"builder-util\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as crypto from \"crypto\"\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 { HttpError, retry } from \"builder-util-runtime\"\nimport { ElectronPlatformName } from \"../electron/ElectronFramework\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState\"\nimport type { ProgressBar } from \"electron-publish\"\n\nexport type ElectronGetOptions = 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\" // to be added below\n> & {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n electronDownload?: ElectronGetOptions | ElectronDownloadOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport interface ElectronDownloadOptions {\n // https://github.com/electron-userland/electron-builder/issues/3077\n // must be optional\n version?: string\n\n /**\n * The [cache location](https://github.com/electron-userland/electron-download#cache-location).\n */\n cache?: string | null\n\n /**\n * The mirror.\n */\n mirror?: string | null\n\n /** @private */\n customDir?: string | null\n /** @private */\n customFilename?: string | null\n\n /** @private */\n strictSSL?: boolean\n /** @private */\n isVerifyChecksum?: boolean\n\n platform?: ElectronPlatformName\n arch?: string\n}\n\nfunction 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\nexport function getCacheDirectory(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): 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 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\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 const entries = createReadStream(file).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 (!destPath.startsWith(dir + path.sep) && 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 (!resolvedTarget.startsWith(dir + path.sep) && 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}\n\nexport async function extractArchive(file: string, dir: string) {\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n retries: { retries: 15, 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 new Promise(r => setTimeout(r, 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(\".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, 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 fs.rename(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nasync function downloadArtifactToFile(config: Parameters<typeof get.downloadArtifact>[0], 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 artifactLockKey = crypto\n .createHash(\"sha256\")\n .update(JSON.stringify({ v: config.version, p: (config as any).platform, a: (config as any).arch, n: (config as any).artifactName }))\n .digest(\"hex\")\n .slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 30, 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 const downloadOptions: GotDownloaderOptions = {\n timeout: { request: 10 * 60 * 1000 }, // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n agent: config.downloadOptions?.agent ?? buildGotProxyAgent(),\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 * 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: Parameters<typeof get.downloadArtifact>[0], extractDir: string, label: string): Promise<string> {\n await fs.mkdir(extractDir, { recursive: true })\n\n // Pre-lock fast path: only short-circuit for a definitively complete and valid cache.\n // Do NOT clean up here — concurrent processes could race to delete under each other.\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 const release = await lockfile.lock(extractDir, {\n retries: { retries: 15, 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 fs.mkdir(extractDir, { recursive: true })\n\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\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 * 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 const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = overrideUrl ? `${overrideUrl}/${filenameWithExt}` : `${baseUrl}${releaseName}/${filenameWithExt}`\n const suffix = hashUrlSafe(fullUrl, 5)\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|zip|7z)$/, \"\")}-${suffix}`\n const extractDir = path.join(getCacheDirectory({ allowEnvVarOverride: true }), releaseName, folderName)\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 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(getCacheDirectory({ allowEnvVarOverride: true }), \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt)\n}\n\n// Keys present in ElectronGetOptions but absent from ElectronDownloadOptions.\n// Used to discriminate between the two config shapes at runtime.\nconst ELECTRON_GET_EXCLUSIVE_KEYS: readonly string[] = [\"mirrorOptions\", \"force\", \"unsafelyDisableChecksums\"]\n\nfunction isElectronGetOptions(dl: ElectronGetOptions | ElectronDownloadOptions): dl is ElectronGetOptions {\n return ELECTRON_GET_EXCLUSIVE_KEYS.some(k => Object.hasOwnProperty.call(dl, k))\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(options: ArtifactDownloadOptions): ElectronPlatformArtifactDetails {\n const { electronDownload, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = options\n\n let artifactConfig: ElectronPlatformArtifactDetails = { cacheRoot, platform, arch, version, artifactName }\n\n if (electronDownload != null) {\n if (isElectronGetOptions(electronDownload)) {\n const { mirrorOptions, ...rest } = electronDownload\n artifactConfig = { ...artifactConfig, ...rest, cacheRoot, mirrorOptions }\n } else {\n const { mirror, customDir, cache, customFilename, isVerifyChecksum, strictSSL, platform: overridePlatform, arch: overrideArch } = electronDownload\n // strictSSL: false disables TLS certificate validation for all\n // electron/tool downloads. This option exists only for air-gapped or\n // self-signed-cert environments; ensure your build network is fully trusted.\n if (strictSSL === false) {\n log.warn(\n { option: \"electronDownload.strictSSL\" },\n \"strictSSL is false — TLS certificate validation is DISABLED for Electron downloads. Only use this option in a trusted, isolated build environment.\"\n )\n }\n artifactConfig = {\n ...artifactConfig,\n unsafelyDisableChecksums: isVerifyChecksum === false,\n cacheRoot: cache ?? cacheRoot,\n mirrorOptions: {\n mirror: mirror || undefined,\n customDir: customDir || undefined,\n customFilename: customFilename || undefined,\n },\n ...(strictSSL === false ? { downloadOptions: { https: { rejectUnauthorized: false } } } : {}),\n }\n if (overridePlatform != null) {\n artifactConfig.platform = overridePlatform\n }\n if (overrideArch != null) {\n artifactConfig.arch = overrideArch\n }\n }\n }\n\n artifactConfig.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(getCacheDirectory({ allowEnvVarOverride: true }), `${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 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)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
@@ -85,7 +85,8 @@ function checkDependencies(dependencies, errors) {
|
|
|
85
85
|
// Pick the version out of yarn berry patch syntax
|
|
86
86
|
// "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch"
|
|
87
87
|
if (updaterVersion.startsWith("patch:")) {
|
|
88
|
-
|
|
88
|
+
// codeql[js/polynomial-redos] - [^#]+ is a possessive character-class match; linear time, no catastrophic backtracking
|
|
89
|
+
const match = updaterVersion.match(/@npm%3A([^#]+)#/);
|
|
89
90
|
if (match) {
|
|
90
91
|
updaterVersion = match[1];
|
|
91
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":";;AASA,0CAQC;AAkBD,sCA6CC;AAhFD,+CAA8E;AAE9E,uCAA2D;AAC3D,6BAA4B;AAC5B,iCAAgC;AAEhC,iEAA6D;AAE7D,gBAAgB;AACT,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAA;IACjC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,IAAA,2CAAoB,EAAC,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,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IA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AY,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;IAED,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAA;IAClE,IAAI,OAAO,CAAC,GAAG,CAAC,+CAA+C,KAAK,MAAM,EAAE,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC/B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,IAAI,YAAY,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,0CAA0C,GAAG,wEAAwE,CAAC,CAAA;QACpJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { readFile, readJson, readJsonSync } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata\"\nimport { normalizePackageData } from \"./normalizePackageData\"\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await 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 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 if ((metadata as any).directories != null) {\n errors.push(`\"directories\" in the root is deprecated, please specify in the \"build\"`)\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 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(__dirname, normalized)\n const json = 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 const deps = [\"electron\", \"electron-prebuilt\", \"electron-rebuild\"]\n if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== \"true\") {\n deps.push(\"electron-builder\")\n }\n for (const name of deps) {\n if (name in dependencies) {\n errors.push(`Package \"${name}\" is only allowed in \"devDependencies\". ` + `Please remove it from the \"dependencies\" section in your package.json.`)\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":";;AASA,0CAQC;AAkBD,sCA6CC;AAhFD,+CAA8E;AAE9E,uCAA2D;AAC3D,6BAA4B;AAC5B,iCAAgC;AAEhC,iEAA6D;AAE7D,gBAAgB;AACT,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,IAAA,m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,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;gBACtG,MAAM,IAAI,GAAG,IAAA,uBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAA;gBACrE,cAAc,GAAG,IAAI,CAAC,OAAO,CAAA;gBAC7B,MAAK;YACP,CAAC;QACH,CAAC;QAED,MAAM,8BAA8B,GAAG,OAAO,CAAA;QAC9C,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,KAAK,8BAA8B,EAAE,CAAC,EAAE,CAAC;YAC7E,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;IAED,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAA;IAClE,IAAI,OAAO,CAAC,GAAG,CAAC,+CAA+C,KAAK,MAAM,EAAE,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC/B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,IAAI,YAAY,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,0CAA0C,GAAG,wEAAwE,CAAC,CAAA;QACpJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { readFile, readJson, readJsonSync } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata\"\nimport { normalizePackageData } from \"./normalizePackageData\"\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await 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 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 if ((metadata as any).directories != null) {\n errors.push(`\"directories\" in the root is deprecated, please specify in the \"build\"`)\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(__dirname, normalized)\n const json = 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 const deps = [\"electron\", \"electron-prebuilt\", \"electron-rebuild\"]\n if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== \"true\") {\n deps.push(\"electron-builder\")\n }\n for (const name of deps) {\n if (name in dependencies) {\n errors.push(`Package \"${name}\" is only allowed in \"devDependencies\". ` + `Please remove it from the \"dependencies\" section in your package.json.`)\n }\n }\n}\n"]}
|
package/out/util/rebuild.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RebuildOptions } from "@electron/rebuild";
|
|
1
|
+
import type { RebuildOptions } from "@electron/rebuild";
|
|
2
2
|
export declare const rebuild: (options: RebuildOptions) => Promise<void>;
|
package/out/util/rebuild.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../src/util/rebuild.ts"],"names":[],"mappings":";;;AACA,+CAAkC;AAClC,oCAAmC;AACnC,6BAA4B;AAErB,MAAM,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAiB,EAAE;;IACtE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAC3G,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAA;IAEF,IAAI,YAAmB,CAAA;IAEvB,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,IAAI,CAAC,KA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,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChC,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AArDY,QAAA,OAAO,WAqDnB","sourcesContent":["import { RebuildOptions } from \"@electron/rebuild\"\nimport { log } from \"builder-util\"\nimport * as cp from \"child_process\"\nimport * as path from \"path\"\n\nexport const rebuild = async (options: RebuildOptions): Promise<void> => {\n const { arch } = options\n log.info({ arch }, `installing native dependencies`)\n\n const child = cp.fork(path.resolve(__dirname, \"../../helpers/remote-rebuild.js\"), [JSON.stringify(options)], {\n stdio: [\"pipe\", \"pipe\", \"pipe\", \"ipc\"],\n })\n\n let pendingError: Error\n\n child.stdout?.on(\"data\", chunk => {\n log.info(chunk.toString())\n })\n child.stderr?.on(\"data\", chunk => {\n log.error(chunk.toString())\n })\n\n child.on(\"message\", (message: { msg: string; moduleName: string; err: { message: string; stack: string } }) => {\n const { moduleName, msg } = message\n switch (msg) {\n case \"module-found\": {\n log.info({ moduleName, arch }, \"preparing\")\n break\n }\n case \"module-done\": {\n log.info({ moduleName, arch }, \"finished\")\n break\n }\n case \"module-skip\": {\n log.debug?.({ moduleName, arch }, \"skipped. set ENV=electron-rebuild to determine why\")\n break\n }\n case \"rebuild-error\": {\n pendingError = new Error(message.err.message)\n pendingError.stack = message.err.stack\n break\n }\n case \"rebuild-done\": {\n log.info(\"completed installing native dependencies\")\n break\n }\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n child.on(\"exit\", code => {\n if (code === 0 && !pendingError) {\n resolve()\n } else {\n reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`))\n }\n })\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../src/util/rebuild.ts"],"names":[],"mappings":";;;AACA,+CAAkC;AAClC,oCAAmC;AACnC,6BAA4B;AAErB,MAAM,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAiB,EAAE;;IACtE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAC3G,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAA;IAEF,IAAI,YAAmB,CAAA;IAEvB,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IACF,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAqF,EAAE,EAAE;;QAC5G,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,OAAO,CAAA;QACnC,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,cAAc,CAAC,CAAC,CAAC;gBACpB,kBAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,WAAW,CAAC,CAAA;gBAC3C,MAAK;YACP,CAAC;YACD,KAAK,aAAa,CAAC,CAAC,CAAC;gBACnB,kBAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,CAAA;gBAC1C,MAAK;YACP,CAAC;YACD,KAAK,aAAa,CAAC,CAAC,CAAC;gBACnB,MAAA,kBAAG,CAAC,KAAK,mEAAG,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,oDAAoD,CAAC,CAAA;gBACvF,MAAK;YACP,CAAC;YACD,KAAK,eAAe,CAAC,CAAC,CAAC;gBACrB,YAAY,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBAC7C,YAAY,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;gBACtC,MAAK;YACP,CAAC;YACD,KAAK,cAAc,CAAC,CAAC,CAAC;gBACpB,kBAAG,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;gBACpD,MAAK;YACP,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChC,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AArDY,QAAA,OAAO,WAqDnB","sourcesContent":["import type { RebuildOptions } from \"@electron/rebuild\"\nimport { log } from \"builder-util\"\nimport * as cp from \"child_process\"\nimport * as path from \"path\"\n\nexport const rebuild = async (options: RebuildOptions): Promise<void> => {\n const { arch } = options\n log.info({ arch }, `installing native dependencies`)\n\n const child = cp.fork(path.resolve(__dirname, \"../../helpers/remote-rebuild.js\"), [JSON.stringify(options)], {\n stdio: [\"pipe\", \"pipe\", \"pipe\", \"ipc\"],\n })\n\n let pendingError: Error\n\n child.stdout?.on(\"data\", chunk => {\n log.info(chunk.toString())\n })\n child.stderr?.on(\"data\", chunk => {\n log.error(chunk.toString())\n })\n\n child.on(\"message\", (message: { msg: string; moduleName: string; err: { message: string; stack: string } }) => {\n const { moduleName, msg } = message\n switch (msg) {\n case \"module-found\": {\n log.info({ moduleName, arch }, \"preparing\")\n break\n }\n case \"module-done\": {\n log.info({ moduleName, arch }, \"finished\")\n break\n }\n case \"module-skip\": {\n log.debug?.({ moduleName, arch }, \"skipped. set ENV=electron-rebuild to determine why\")\n break\n }\n case \"rebuild-error\": {\n pendingError = new Error(message.err.message)\n pendingError.stack = message.err.stack\n break\n }\n case \"rebuild-done\": {\n log.info(\"completed installing native dependencies\")\n break\n }\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n child.on(\"exit\", code => {\n if (code === 0 && !pendingError) {\n resolve()\n } else {\n reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`))\n }\n })\n })\n}\n"]}
|
package/out/util/yarn.js
CHANGED
|
@@ -41,7 +41,7 @@ function getElectronGypCacheDir() {
|
|
|
41
41
|
function getGypEnv(frameworkInfo, platform, arch, buildFromSource) {
|
|
42
42
|
const npmConfigArch = arch === "armv7l" ? "arm" : arch;
|
|
43
43
|
const common = {
|
|
44
|
-
...process.env,
|
|
44
|
+
...(0, builder_util_1.stripSensitiveEnvVars)(process.env),
|
|
45
45
|
npm_config_arch: npmConfigArch,
|
|
46
46
|
npm_config_target_arch: npmConfigArch,
|
|
47
47
|
npm_config_platform: platform,
|
package/out/util/yarn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn.js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AA;IACrG,CAAC;IAED,MAAM,EACJ,aAAa,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAC5C,GAAG,OAAO,CAAA;IACX,MAAM,eAAe,GAAG,aAAa,IAAI,UAAU,IAAI,MAAM,CAAA;IAC7D,MAAM,OAAO,GAAG;QACd,eAAe;QACf,IAAI;QACJ,eAAe;QACf,aAAa;QACb,UAAU,EAAE,kBAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI;QAC5C,MAAM,EAAE,kBAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI;KACrC,CAAA;IACD,kBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;IAEhD,MAAM,cAAc,GAA2B;QAC7C,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,eAAe;QACf,IAAI,EAAE,MAAM,CAAC,eAAe,IAAI,YAAY;QAC5C,iBAAiB,EAAE,IAAI;KACxB,CAAA;IACD,OAAO,IAAA,iBAAa,EAAC,cAAc,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { PM, getPackageManagerCommand } from \"../node-module-collector\"\nimport { detectPackageManager } from \"../node-module-collector/packageManager\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport { rebuild as remoteRebuild } from \"./rebuild\"\nimport * as which from \"which\"\nimport { RebuildOptions as ElectronRebuildOptions } from \"@electron/rebuild\"\nimport { Nullish } from \"builder-util-runtime\"\n\nexport async function installOrRebuild(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n forceInstall = false,\n env: NodeJS.ProcessEnv\n) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n const dirsToCheck = [...new Set([projectDir, appDir, workspaceRoot].filter((d): d is string => !!d))]\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if ((await Promise.all(dirsToCheck.map(d => pathExists(path.join(d, fileOrDir))))).some(Boolean)) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, { appDir, projectDir, workspaceRoot }, effectiveOptions, env)\n } else {\n await rebuild(config, { appDir, projectDir, workspaceRoot }, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: common.npm_config_electron_mirror || \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nexport async function installDependencies(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n env: NodeJS.ProcessEnv\n): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n const searchPaths = [projectDir, appDir].concat(workspaceRoot ? [workspaceRoot] : [])\n const { pm, resolvedDirectory: _resolvedWorkspaceDir } = await detectPackageManager(searchPaths)\n\n log.info({ pm, platform, arch, projectDir, appDir, workspaceRoot: _resolvedWorkspaceDir }, \"installing dependencies\")\n\n const execArgs = [\"install\"]\n if (pm === PM.YARN) {\n execArgs.push(\"--prefer-offline\")\n } else if (pm === PM.YARN_BERRY) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n }\n\n const execPath = getPackageManagerCommand(pm)\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env: {\n ...getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n ...env,\n },\n })\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, { appDir, projectDir, workspaceRoot }, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = process.platform === \"win32\" ? which.sync(\"node-gyp\") : \"node-gyp\"\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\nexport interface DirectoryPaths {\n appDir: string\n projectDir: string\n workspaceRoot: string | Nullish\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, { appDir, projectDir, workspaceRoot }: DirectoryPaths, options: RebuildOptions) {\n const buildFromSource = options.buildFromSource === true\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n\n if (config.nativeRebuilder === \"legacy\") {\n const configuration = {\n platform,\n arch,\n buildFromSource,\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n }\n const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource)\n return executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n }\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const projectRootPath = workspaceRoot || projectDir || appDir\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n workspaceRoot,\n projectDir: log.filePath(projectDir) || \"./\",\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const rebuildOptions: ElectronRebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n platform,\n buildFromSource,\n projectRootPath,\n mode: config.nativeRebuilder || \"sequential\",\n disablePreGypCopy: true,\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;AAeA,4CA4BC;AAWD,8BAiCC;AAED,kDAyCC;AAED,wCAiBC;AAoBD,0BA4CC;AArND,+CAAyE;AACzE,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAE5B,6CAA4D;AAC5D,oEAAuE;A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G;QACd,eAAe;QACf,IAAI;QACJ,eAAe;QACf,aAAa;QACb,UAAU,EAAE,kBAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI;QAC5C,MAAM,EAAE,kBAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI;KACrC,CAAA;IACD,kBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;IAEhD,MAAM,cAAc,GAA2B;QAC7C,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,IAAI;QACJ,QAAQ;QACR,eAAe;QACf,eAAe;QACf,IAAI,EAAE,MAAM,CAAC,eAAe,IAAI,YAAY;QAC5C,iBAAiB,EAAE,IAAI;KACxB,CAAA;IACD,OAAO,IAAA,iBAAa,EAAC,cAAc,CAAC,CAAA;AACtC,CAAC","sourcesContent":["import { asArray, log, spawn, stripSensitiveEnvVars } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { PM, getPackageManagerCommand } from \"../node-module-collector\"\nimport { detectPackageManager } from \"../node-module-collector/packageManager\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport { rebuild as remoteRebuild } from \"./rebuild\"\nimport * as which from \"which\"\nimport type { RebuildOptions as ElectronRebuildOptions } from \"@electron/rebuild\"\nimport { Nullish } from \"builder-util-runtime\"\n\nexport async function installOrRebuild(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n forceInstall = false,\n env: NodeJS.ProcessEnv\n) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n const dirsToCheck = [...new Set([projectDir, appDir, workspaceRoot].filter((d): d is string => !!d))]\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if ((await Promise.all(dirsToCheck.map(d => pathExists(path.join(d, fileOrDir))))).some(Boolean)) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, { appDir, projectDir, workspaceRoot }, effectiveOptions, env)\n } else {\n await rebuild(config, { appDir, projectDir, workspaceRoot }, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...stripSensitiveEnvVars(process.env),\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: common.npm_config_electron_mirror || \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nexport async function installDependencies(\n config: Configuration,\n { appDir, projectDir, workspaceRoot }: DirectoryPaths,\n options: RebuildOptions,\n env: NodeJS.ProcessEnv\n): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n const searchPaths = [projectDir, appDir].concat(workspaceRoot ? [workspaceRoot] : [])\n const { pm, resolvedDirectory: _resolvedWorkspaceDir } = await detectPackageManager(searchPaths)\n\n log.info({ pm, platform, arch, projectDir, appDir, workspaceRoot: _resolvedWorkspaceDir }, \"installing dependencies\")\n\n const execArgs = [\"install\"]\n if (pm === PM.YARN) {\n execArgs.push(\"--prefer-offline\")\n } else if (pm === PM.YARN_BERRY) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n }\n\n const execPath = getPackageManagerCommand(pm)\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env: {\n ...getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n ...env,\n },\n })\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, { appDir, projectDir, workspaceRoot }, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = process.platform === \"win32\" ? which.sync(\"node-gyp\") : \"node-gyp\"\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\nexport interface DirectoryPaths {\n appDir: string\n projectDir: string\n workspaceRoot: string | Nullish\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, { appDir, projectDir, workspaceRoot }: DirectoryPaths, options: RebuildOptions) {\n const buildFromSource = options.buildFromSource === true\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n\n if (config.nativeRebuilder === \"legacy\") {\n const configuration = {\n platform,\n arch,\n buildFromSource,\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n }\n const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource)\n return executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n }\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const projectRootPath = workspaceRoot || projectDir || appDir\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n workspaceRoot,\n projectDir: log.filePath(projectDir) || \"./\",\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const rebuildOptions: ElectronRebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n platform,\n buildFromSource,\n projectRootPath,\n mode: config.nativeRebuilder || \"sequential\",\n disablePreGypCopy: true,\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "26.
|
|
1
|
+
export declare const PACKAGE_VERSION = "26.13.0";
|
package/out/version.js
CHANGED
package/out/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,SAAS,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"26.13.0\"\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": "26.
|
|
4
|
+
"version": "26.13.0",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out",
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
"@electron/universal": "2.0.3",
|
|
58
58
|
"@malept/flatpak-bundler": "^0.4.0",
|
|
59
59
|
"@types/fs-extra": "9.0.13",
|
|
60
|
+
"@peculiar/webcrypto": "^1.7.1",
|
|
61
|
+
"asn1js": "^3.0.10",
|
|
60
62
|
"async-exit-hook": "^2.0.1",
|
|
61
63
|
"chromium-pickle-js": "^0.2.0",
|
|
62
64
|
"ci-info": "4.3.1",
|
|
@@ -72,6 +74,7 @@
|
|
|
72
74
|
"json5": "^2.2.3",
|
|
73
75
|
"lazy-val": "^1.0.5",
|
|
74
76
|
"minimatch": "^10.2.5",
|
|
77
|
+
"pkijs": "^3.4.0",
|
|
75
78
|
"plist": "3.1.0",
|
|
76
79
|
"proper-lockfile": "^4.1.2",
|
|
77
80
|
"resedit": "^1.7.0",
|
|
@@ -81,9 +84,9 @@
|
|
|
81
84
|
"tiny-async-pool": "1.3.0",
|
|
82
85
|
"unzipper": "^0.12.3",
|
|
83
86
|
"which": "^5.0.0",
|
|
84
|
-
"builder-util": "26.
|
|
85
|
-
"builder-util-runtime": "9.6.
|
|
86
|
-
"electron-publish": "26.
|
|
87
|
+
"builder-util": "26.13.0",
|
|
88
|
+
"builder-util-runtime": "9.6.3",
|
|
89
|
+
"electron-publish": "26.13.0"
|
|
87
90
|
},
|
|
88
91
|
"///": "babel in devDependencies for proton tests",
|
|
89
92
|
"devDependencies": {
|
|
@@ -117,12 +120,12 @@
|
|
|
117
120
|
"@types/unzipper": "^0.10.11",
|
|
118
121
|
"@types/which": "^3.0.4",
|
|
119
122
|
"toml": "^3.0.0",
|
|
120
|
-
"dmg-builder": "26.
|
|
121
|
-
"electron-builder-squirrel-windows": "26.
|
|
123
|
+
"dmg-builder": "26.13.0",
|
|
124
|
+
"electron-builder-squirrel-windows": "26.13.0"
|
|
122
125
|
},
|
|
123
126
|
"peerDependencies": {
|
|
124
|
-
"dmg-builder": "26.
|
|
125
|
-
"electron-builder-squirrel-windows": "26.
|
|
127
|
+
"dmg-builder": "26.13.0",
|
|
128
|
+
"electron-builder-squirrel-windows": "26.13.0"
|
|
126
129
|
},
|
|
127
130
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
128
131
|
"typings": "./out/index.d.ts"
|
package/scheme.json
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"type": "null"
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
|
-
"description": "The compression algorithm passed to the AppImage build tool.\n\n**FUSE2 toolset (`\"0.0.0\"` or unset):** `\"xz\"`
|
|
70
|
+
"description": "The compression algorithm passed to the AppImage build tool.\n\n**FUSE2 toolset (`\"0.0.0\"` or unset):** only `\"xz\"` and `\"gzip\"` are forwarded\nto mksquashfs (`-comp <value>`); `\"xz\"` additionally passes `-Xdict-size 100% -b 1048576`.\n`\"zstd\"`, `null`, and unset fall through to the root-level `compression` option:\n- `\"maximum\"` → `\"xz\"`\n- anything else → flag omitted (mksquashfs defaults to gzip)\n\n**Static-runtime toolsets (`>= 1.0.0`):** `\"gzip\"` and `\"zstd\"` are forwarded\ndirectly. `\"xz\"` is mapped to `\"zstd\"` (nearest supported equivalent). `null`\nor unset falls through to the root-level `compression` option:\n- `\"store\"` → `\"gzip\"`\n- `\"normal\"` / `\"maximum\"` / unset → `\"zstd\"`"
|
|
71
71
|
},
|
|
72
72
|
"description": {
|
|
73
73
|
"description": "As [description](https://www.electron.build/configuration#description) from application package.json, but allows you to specify different for Linux.",
|
|
@@ -953,6 +953,22 @@
|
|
|
953
953
|
},
|
|
954
954
|
"type": "array"
|
|
955
955
|
},
|
|
956
|
+
"filesystem": {
|
|
957
|
+
"anyOf": [
|
|
958
|
+
{
|
|
959
|
+
"enum": [
|
|
960
|
+
"APFS",
|
|
961
|
+
"HFS+"
|
|
962
|
+
],
|
|
963
|
+
"type": "string"
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"type": "null"
|
|
967
|
+
}
|
|
968
|
+
],
|
|
969
|
+
"default": "HFS+",
|
|
970
|
+
"description": "The filesystem for the DMG volume (e.g. `\"APFS\"` or `\"HFS+\"`)\nThis will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions)."
|
|
971
|
+
},
|
|
956
972
|
"format": {
|
|
957
973
|
"default": "UDZO",
|
|
958
974
|
"description": "The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).",
|
|
@@ -9159,6 +9175,11 @@
|
|
|
9159
9175
|
],
|
|
9160
9176
|
"description": "Directories for build resources"
|
|
9161
9177
|
},
|
|
9178
|
+
"disableAsarIntegrity": {
|
|
9179
|
+
"default": false,
|
|
9180
|
+
"description": "Whether to skip ASAR integrity hash computation. Useful for custom electron forks with encrypted ASAR support where the header is not readable by standard tools.",
|
|
9181
|
+
"type": "boolean"
|
|
9182
|
+
},
|
|
9162
9183
|
"disableDefaultIgnoredFiles": {
|
|
9163
9184
|
"default": false,
|
|
9164
9185
|
"description": "Whether to exclude all default ignored files(https://www.electron.build/contents#files) and options. Defaults to `false`.",
|
|
@@ -31,10 +31,8 @@
|
|
|
31
31
|
|
|
32
32
|
!macro CHECK_APP_RUNNING
|
|
33
33
|
Var /GLOBAL CmdPath
|
|
34
|
-
Var /GLOBAL FindPath
|
|
35
34
|
Var /GLOBAL PowerShellPath
|
|
36
35
|
StrCpy $CmdPath "$SYSDIR\cmd.exe"
|
|
37
|
-
StrCpy $FindPath "$SYSDIR\find.exe"
|
|
38
36
|
StrCpy $PowerShellPath "$SYSDIR\WindowsPowerShell\v1.0\powershell.exe"
|
|
39
37
|
!ifmacrodef customCheckAppRunning
|
|
40
38
|
!insertmacro customCheckAppRunning
|
|
@@ -69,10 +67,12 @@
|
|
|
69
67
|
Pop ${_RETURN}
|
|
70
68
|
${else}
|
|
71
69
|
!ifdef INSTALL_MODE_PER_ALL_USERS
|
|
72
|
-
|
|
70
|
+
# exact match via findstr anchored to the start of each CSV line
|
|
71
|
+
nsExec::Exec `"$CmdPath" /C tasklist /FI "IMAGENAME eq ${_FILE}" /FO CSV /NH | "$SYSDIR\findstr.exe" /B /I /C:"\"${_FILE}\""`
|
|
72
|
+
Pop ${_RETURN}
|
|
73
73
|
!else
|
|
74
|
-
# find process owned by current user
|
|
75
|
-
nsExec::Exec `"$CmdPath" /C tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO CSV | "$
|
|
74
|
+
# find process owned by current user — anchored exact match
|
|
75
|
+
nsExec::Exec `"$CmdPath" /C tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO CSV /NH | "$SYSDIR\findstr.exe" /B /I /C:"\"${_FILE}\""`
|
|
76
76
|
Pop ${_RETURN}
|
|
77
77
|
!endif
|
|
78
78
|
${endIf}
|