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.6.1 to 3.6.2

5

lib/module-type/index.d.ts

@@ -15,4 +15,9 @@ import { NodeAPI } from '../node-api';

getSupportedNapiVersions(): Promise<number[] | undefined>;
/**
* Search dependencies for package using either `packageName` or
* `@namespace/packageName` in the case of forks.
*/
findPackageInDependencies(packageName: string, packageProperty?: string): Promise<string | null>;
}
export declare function locateBinary(basePath: string, suffix: string): Promise<string | null>;
export {};

@@ -40,2 +40,17 @@ "use strict";

}
/**
* Search dependencies for package using either `packageName` or
* `@namespace/packageName` in the case of forks.
*/
async findPackageInDependencies(packageName, packageProperty = 'dependencies') {
const dependencies = await this.packageJSONFieldWithDefault(packageProperty, {});
if (typeof dependencies !== 'object')
return null;
// Look for direct dependency match
// eslint-disable-next-line no-prototype-builtins
if (dependencies.hasOwnProperty(packageName))
return packageName;
const forkedPackage = Object.keys(dependencies).find(dependency => dependency.startsWith('@') && dependency.endsWith(`/${packageName}`));
return forkedPackage || null;
}
}

@@ -42,0 +57,0 @@ exports.NativeModule = NativeModule;

10

lib/module-type/node-pre-gyp.js

@@ -14,8 +14,10 @@ "use strict";

async usesTool() {
const dependencies = await this.packageJSONFieldWithDefault('dependencies', {});
// eslint-disable-next-line no-prototype-builtins
return dependencies.hasOwnProperty('@mapbox/node-pre-gyp');
const packageName = await this.findPackageInDependencies('node-pre-gyp');
return !!packageName;
}
async locateBinary() {
return (0, _1.locateBinary)(this.modulePath, 'node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp');
const packageName = await this.findPackageInDependencies('node-pre-gyp');
if (!packageName)
return null;
return (0, _1.locateBinary)(this.modulePath, `node_modules/${packageName}/bin/node-pre-gyp`);
}

@@ -22,0 +24,0 @@ async run(nodePreGypPath) {

@@ -15,8 +15,10 @@ "use strict";

async usesTool() {
const dependencies = await this.packageJSONFieldWithDefault('dependencies', {});
// eslint-disable-next-line no-prototype-builtins
return dependencies.hasOwnProperty('prebuild-install');
const packageName = await this.findPackageInDependencies('prebuild-install');
return !!packageName;
}
async locateBinary() {
return (0, _1.locateBinary)(this.modulePath, 'node_modules/prebuild-install/bin.js');
const packageName = await this.findPackageInDependencies('prebuild-install');
if (!packageName)
return null;
return (0, _1.locateBinary)(this.modulePath, `node_modules/${packageName}/bin.js`);
}

@@ -23,0 +25,0 @@ async run(prebuildInstallPath) {

7

lib/module-type/prebuildify.js

@@ -36,8 +36,6 @@ "use strict";

async usesTool() {
const devDependencies = await this.packageJSONFieldWithDefault('devDependencies', {});
// eslint-disable-next-line no-prototype-builtins
return devDependencies.hasOwnProperty('prebuildify');
const packageName = await this.findPackageInDependencies('prebuildify', 'devDependencies');
return !!packageName;
}
async findPrebuiltModule() {
const nodeArch = (0, arch_1.getNodeArch)(this.rebuilder.arch, process.config.variables);
d(`Checking for prebuilds for "${this.moduleName}"`);

@@ -49,2 +47,3 @@ const prebuildsDir = path_1.default.join(this.modulePath, 'prebuilds');

}
const nodeArch = (0, arch_1.getNodeArch)(this.rebuilder.arch, process.config.variables);
const prebuiltModuleDir = path_1.default.join(prebuildsDir, `${this.rebuilder.platform}-${determineNativePrebuildArch(nodeArch)}`);

@@ -51,0 +50,0 @@ const nativeExt = determineNativePrebuildExtension(nodeArch);

{
"name": "@electron/rebuild",
"version": "3.6.1",
"version": "3.6.2",
"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

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