app-builder-lib
Advanced tools
Comparing version 24.6.0 to 24.6.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.computeElectronVersion = exports.getElectronPackage = exports.getElectronVersionFromInstalled = exports.getElectronVersion = void 0; | ||
const search_module_1 = require("@electron/rebuild/lib/search-module"); | ||
const builder_util_1 = require("builder-util"); | ||
@@ -58,11 +57,4 @@ const builder_util_runtime_1 = require("builder-util-runtime"); | ||
} | ||
const potentialRootDirs = [projectDir, await (0, search_module_1.getProjectRootPath)(projectDir)]; | ||
let dependency = null; | ||
for await (const dir of potentialRootDirs) { | ||
const metadata = await (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(dir, "package.json"))); | ||
dependency = metadata ? findFromPackageMetadata(metadata) : null; | ||
if (dependency) { | ||
break; | ||
} | ||
} | ||
const metadata = await (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json"))); | ||
const dependency = metadata ? findFromPackageMetadata(metadata) : null; | ||
if ((dependency === null || dependency === void 0 ? void 0 : dependency.name) === "electron-nightly") { | ||
@@ -69,0 +61,0 @@ builder_util_1.log.info("You are using a nightly version of electron, be warned that those builds are highly unstable."); |
@@ -406,3 +406,3 @@ "use strict"; | ||
if (config.nodeGypRebuild === true) { | ||
await (0, yarn_1.nodeGypRebuild)(frameworkInfo, arch, platform); | ||
await (0, yarn_1.nodeGypRebuild)(platform.nodeName, builder_util_1.Arch[arch], frameworkInfo); | ||
} | ||
@@ -435,2 +435,3 @@ if (config.npmRebuild === false) { | ||
arch: builder_util_1.Arch[arch], | ||
productionDeps: this.getNodeDependencyInfo(null), | ||
}); | ||
@@ -437,0 +438,0 @@ } |
@@ -62,4 +62,4 @@ "use strict"; | ||
const devDependencies = metadata.devDependencies; | ||
if (devDependencies != null && "@electron/rebuild" in devDependencies) { | ||
builder_util_1.log.info('@electron/rebuild is already incorporated into 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`'); | ||
if (devDependencies != null && ("electron-rebuild" in devDependencies || "@electron/rebuild" in devDependencies)) { | ||
builder_util_1.log.info('@electron/rebuild not required if you use 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`'); | ||
} | ||
@@ -94,3 +94,3 @@ if (errors.length > 0) { | ||
} | ||
const deps = ["electron", "electron-prebuilt", "@electron/rebuild"]; | ||
const deps = ["electron", "electron-prebuilt", "electron-rebuild"]; | ||
if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== "true") { | ||
@@ -97,0 +97,0 @@ deps.push("electron-builder"); |
/// <reference types="node" /> | ||
import { Arch } from "builder-util"; | ||
import { Lazy } from "lazy-val"; | ||
import { Configuration } from "../configuration"; | ||
import { Platform } from "../core"; | ||
import { NodeModuleDirInfo } from "./packageDependencies"; | ||
export declare function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall?: boolean): Promise<void>; | ||
@@ -11,5 +11,6 @@ export interface DesktopFrameworkInfo { | ||
export declare function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean): any; | ||
export declare function nodeGypRebuild(frameworkInfo: DesktopFrameworkInfo, arch: Arch, platform: Platform): Promise<void>; | ||
export declare function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo): Promise<void>; | ||
export interface RebuildOptions { | ||
frameworkInfo: DesktopFrameworkInfo; | ||
productionDeps?: Lazy<Array<NodeModuleDirInfo>>; | ||
platform?: NodeJS.Platform; | ||
@@ -16,0 +17,0 @@ arch?: string; |
@@ -8,7 +8,9 @@ "use strict"; | ||
const path = require("path"); | ||
const electronRebuild = require("@electron/rebuild/lib/rebuild"); | ||
const searchModule = require("@electron/rebuild/lib/search-module"); | ||
const events_1 = require("events"); | ||
const core_1 = require("../core"); | ||
const appBuilder_1 = require("./appBuilder"); | ||
async function installOrRebuild(config, appDir, options, forceInstall = false) { | ||
const effectiveOptions = { | ||
buildFromSource: config.buildDependenciesFromSource === true, | ||
additionalArgs: (0, builder_util_1.asArray)(config.npmArgs), | ||
...options, | ||
}; | ||
let isDependenciesInstalled = false; | ||
@@ -22,13 +24,6 @@ for (const fileOrDir of ["node_modules", ".pnp.js"]) { | ||
if (forceInstall || !isDependenciesInstalled) { | ||
const effectiveOptions = { | ||
buildFromSource: config.buildDependenciesFromSource === true, | ||
additionalArgs: (0, builder_util_1.asArray)(config.npmArgs), | ||
...options, | ||
}; | ||
await installDependencies(appDir, effectiveOptions); | ||
} | ||
else { | ||
const arch = (0, builder_util_1.archFromString)(options.arch || process.arch); | ||
const platform = core_1.Platform.fromString(options.platform || process.platform); | ||
await rebuild(appDir, config.buildDependenciesFromSource === true, options.frameworkInfo, arch, platform); | ||
await rebuild(appDir, effectiveOptions); | ||
} | ||
@@ -112,4 +107,19 @@ } | ||
} | ||
async function nodeGypRebuild(frameworkInfo, arch, platform) { | ||
return rebuild(process.cwd(), false, frameworkInfo, arch, platform); | ||
async function nodeGypRebuild(platform, arch, frameworkInfo) { | ||
builder_util_1.log.info({ platform, arch }, "executing node-gyp rebuild"); | ||
// this script must be used only for electron | ||
const nodeGyp = `node-gyp${process.platform === "win32" ? ".cmd" : ""}`; | ||
const args = ["rebuild"]; | ||
// headers of old Electron versions do not have a valid config.gypi file | ||
// and --force-process-config must be passed to node-gyp >= 8.4.0 to | ||
// correctly build modules for them. | ||
// see also https://github.com/nodejs/node-gyp/pull/2497 | ||
const [major, minor] = frameworkInfo.version | ||
.split(".") | ||
.slice(0, 2) | ||
.map(n => parseInt(n, 10)); | ||
if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) { | ||
args.push("--force-process-config"); | ||
} | ||
await (0, builder_util_1.spawn)(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) }); | ||
} | ||
@@ -130,21 +140,16 @@ exports.nodeGypRebuild = nodeGypRebuild; | ||
/** @internal */ | ||
async function rebuild(appDir, buildFromSource, frameworkInfo, arch, platform) { | ||
builder_util_1.log.info({ arch: builder_util_1.Arch[arch], platform: platform.name, version: frameworkInfo.version, appDir }, "executing @electron/rebuild"); | ||
const rootPath = await searchModule.getProjectRootPath(appDir); | ||
const rebuilderOptions = { | ||
buildPath: appDir, | ||
electronVersion: frameworkInfo.version, | ||
arch: builder_util_1.Arch[arch], | ||
projectRootPath: rootPath, | ||
disablePreGypCopy: true, | ||
lifecycle: new events_1.EventEmitter(), | ||
async function rebuild(appDir, options) { | ||
const configuration = { | ||
dependencies: await options.productionDeps.value, | ||
nodeExecPath: process.execPath, | ||
platform: options.platform || process.platform, | ||
arch: options.arch || process.arch, | ||
additionalArgs: options.additionalArgs, | ||
execPath: process.env.npm_execpath || process.env.NPM_CLI_JS, | ||
buildFromSource: options.buildFromSource === true, | ||
}; | ||
if (buildFromSource) { | ||
rebuilderOptions.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild"; | ||
} | ||
const rebuilder = new electronRebuild.Rebuilder(rebuilderOptions); | ||
rebuilder.platform = platform.nodeName; | ||
return rebuilder.rebuild(); | ||
const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true); | ||
await (0, appBuilder_1.executeAppBuilderAndWriteJson)(["rebuild-node-modules"], configuration, { env, cwd: appDir }); | ||
} | ||
exports.rebuild = rebuild; | ||
//# sourceMappingURL=yarn.js.map |
@@ -1,1 +0,1 @@ | ||
export declare const PACKAGE_VERSION = "24.6.0"; | ||
export declare const PACKAGE_VERSION = "24.6.1"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PACKAGE_VERSION = void 0; | ||
exports.PACKAGE_VERSION = "24.6.0"; | ||
exports.PACKAGE_VERSION = "24.6.1"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "app-builder-lib", | ||
"description": "electron-builder lib", | ||
"version": "24.6.0", | ||
"version": "24.6.1", | ||
"main": "out/index.js", | ||
@@ -53,3 +53,2 @@ "files": [ | ||
"@electron/osx-sign": "^1.0.4", | ||
"@electron/rebuild": "3.2.13", | ||
"@electron/universal": "1.3.4", | ||
@@ -108,4 +107,4 @@ "@malept/flatpak-bundler": "^0.4.0", | ||
"@types/tar": "^6.1.3", | ||
"dmg-builder": "24.6.0", | ||
"electron-builder-squirrel-windows": "24.6.0" | ||
"dmg-builder": "24.6.1", | ||
"electron-builder-squirrel-windows": "24.6.1" | ||
}, | ||
@@ -112,0 +111,0 @@ "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2914230
28
22695
144
- Removed@electron/rebuild@3.2.13
- Removed@electron/rebuild@3.2.13(transitive)
- Removed@gar/promisify@1.1.3(transitive)
- Removed@malept/cross-spawn-promise@2.0.0(transitive)
- Removed@npmcli/fs@2.1.2(transitive)
- Removed@npmcli/move-file@2.0.1(transitive)
- Removed@sindresorhus/is@4.6.0(transitive)
- Removed@szmarczak/http-timer@4.0.6(transitive)
- Removed@types/cacheable-request@6.0.3(transitive)
- Removed@types/http-cache-semantics@4.0.4(transitive)
- Removed@types/keyv@3.1.4(transitive)
- Removed@types/responselike@1.0.3(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedagentkeepalive@4.5.0(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedaproba@2.0.0(transitive)
- Removedare-we-there-yet@3.0.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcacache@16.1.3(transitive)
- Removedcacheable-lookup@5.0.4(transitive)
- Removedcacheable-request@7.0.4(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcli-cursor@3.1.0(transitive)
- Removedcli-spinners@2.9.2(transitive)
- Removedcliui@8.0.1(transitive)
- Removedclone@1.0.4(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddefaults@1.0.4(transitive)
- Removeddefer-to-connect@2.0.1(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddetect-libc@2.0.3(transitive)
- Removedencoding@0.1.13(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedenv-paths@2.2.1(transitive)
- Removederr-code@2.0.3(transitive)
- Removedescalade@3.2.0(transitive)
- Removedexponential-backoff@3.1.1(transitive)
- Removedgauge@4.0.4(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedglob@8.1.0(transitive)
- Removedgot@11.8.6(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedhttp2-wrapper@1.0.3(transitive)
- Removedhumanize-ms@1.2.1(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedieee754@1.2.1(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedinfer-owner@1.0.4(transitive)
- Removedip-address@9.0.5(transitive)
- Removedis-interactive@1.0.0(transitive)
- Removedis-lambda@1.0.1(transitive)
- Removedis-unicode-supported@0.1.0(transitive)
- Removedjsbn@1.1.0(transitive)
- Removedjson-buffer@3.0.1(transitive)
- Removedkeyv@4.5.4(transitive)
- Removedlog-symbols@4.1.0(transitive)
- Removedlowercase-keys@2.0.0(transitive)
- Removedlru-cache@7.18.3(transitive)
- Removedmake-fetch-happen@10.2.1(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removedmimic-response@1.0.13.1.0(transitive)
- Removedminipass-collect@1.0.2(transitive)
- Removedminipass-fetch@2.1.2(transitive)
- Removedminipass-flush@1.0.5(transitive)
- Removedminipass-pipeline@1.2.4(transitive)
- Removedminipass-sized@1.0.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removednode-abi@3.68.0(transitive)
- Removednode-api-version@0.1.4(transitive)
- Removednode-gyp@9.4.1(transitive)
- Removednopt@6.0.0(transitive)
- Removednormalize-url@6.1.0(transitive)
- Removednpmlog@6.0.2(transitive)
- Removedonetime@5.1.2(transitive)
- Removedora@5.4.1(transitive)
- Removedp-cancelable@2.1.1(transitive)
- Removedp-map@4.0.0(transitive)
- Removedpromise-inflight@1.0.1(transitive)
- Removedpromise-retry@2.0.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedquick-lru@5.1.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedresolve-alpn@1.2.1(transitive)
- Removedresponselike@2.0.1(transitive)
- Removedrestore-cursor@3.1.0(transitive)
- Removedretry@0.12.0(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsocks-proxy-agent@7.0.0(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedssri@9.0.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedunique-filename@2.0.1(transitive)
- Removedunique-slug@3.0.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedy18n@5.0.8(transitive)
- Removedyargs@17.7.2(transitive)
- Removedyargs-parser@21.1.1(transitive)