Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@electron/rebuild

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@electron/rebuild - npm Package Compare versions

Comparing version 3.3.1 to 3.4.0

2

lib/rebuild.d.ts

@@ -24,2 +24,3 @@ /// <reference types="node" />

buildFromSource?: boolean;
ignoreModules?: string[];
}

@@ -50,2 +51,3 @@ export interface RebuilderOptions extends RebuildOptions {

buildFromSource: boolean;
ignoreModules: string[];
constructor(options: RebuilderOptions);

@@ -52,0 +54,0 @@ get ABI(): string;

28

lib/rebuild.js

@@ -62,2 +62,4 @@ "use strict";

this.buildFromSource = options.buildFromSource || false;
this.ignoreModules = options.ignoreModules || [];
d('ignoreModules', this.ignoreModules);
if (this.useCache && this.force) {

@@ -123,11 +125,23 @@ console.warn('[WARNING]: Electron Rebuild has force enabled and cache enabled, force take precedence and the cache will not be used.');

const moduleRebuilder = new module_rebuilder_1.ModuleRebuilder(this, modulePath);
this.lifecycle.emit('module-found', path.basename(modulePath));
let moduleName = path.basename(modulePath);
const parentName = path.basename(path.dirname(modulePath));
if (parentName !== 'node_modules') {
moduleName = `${parentName}/${moduleName}`;
}
this.lifecycle.emit('module-found', moduleName);
if (!this.force && await moduleRebuilder.alreadyBuiltByRebuild()) {
d(`skipping: ${path.basename(modulePath)} as it is already built`);
this.lifecycle.emit('module-done');
this.lifecycle.emit('module-skip');
d(`skipping: ${moduleName} as it is already built`);
this.lifecycle.emit('module-done', moduleName);
this.lifecycle.emit('module-skip', moduleName);
return;
}
d('checking', moduleName, 'against', this.ignoreModules);
if (this.ignoreModules.includes(moduleName)) {
d(`skipping: ${moduleName} as it is in the ignoreModules array`);
this.lifecycle.emit('module-done', moduleName);
this.lifecycle.emit('module-skip', moduleName);
return;
}
if (await moduleRebuilder.prebuildInstallNativeModuleExists()) {
d(`skipping: ${path.basename(modulePath)} as it was prebuilt`);
d(`skipping: ${moduleName} as it was prebuilt`);
return;

@@ -148,3 +162,3 @@ }

await applyDiffFn(modulePath);
this.lifecycle.emit('module-done');
this.lifecycle.emit('module-done', moduleName);
return;

@@ -154,3 +168,3 @@ }

if (await moduleRebuilder.rebuild(cacheKey)) {
this.lifecycle.emit('module-done');
this.lifecycle.emit('module-done', moduleName);
}

@@ -157,0 +171,0 @@ }

{
"name": "@electron/rebuild",
"version": "3.3.1",
"version": "3.4.0",
"description": "Electron supporting package to rebuild native node modules against the currently installed electron",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

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