@electron/rebuild
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -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; |
@@ -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
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
151808
2004