Socket
Socket
Sign inDemoInstall

app-builder-lib

Package Overview
Dependencies
Maintainers
2
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-builder-lib - npm Package Compare versions

Comparing version 24.6.0 to 24.6.1

12

out/electron/electronVersion.js
"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.");

3

out/packager.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc