From ff4bd844abd5e6fddc56db706011d62d2a3c3efc Mon Sep 17 00:00:00 2001 From: George Xu Date: Tue, 8 Aug 2023 11:54:33 -0700 Subject: [PATCH] rename 'skipPreloads' to 'buildFromSource' --- src/cli.ts | 2 +- src/module-rebuilder.ts | 2 +- src/rebuild.ts | 6 +++--- src/types.ts | 2 +- test/rebuild-napibuildversion.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index c042f80c..caf8ea75 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -128,7 +128,7 @@ process.on('unhandledRejection', handler); useElectronClang: !!argv.useElectronClang, disablePreGypCopy: !!argv.disablePreGypCopy, projectRootPath, - skipPrebuilds: !!argv.skipPrebuilds, + buildFromSource: !!argv.buildFromSource, }); const lifecycle = rebuilder.lifecycle; diff --git a/src/module-rebuilder.ts b/src/module-rebuilder.ts index 9886e8a5..368ca249 100644 --- a/src/module-rebuilder.ts +++ b/src/module-rebuilder.ts @@ -143,7 +143,7 @@ export class ModuleRebuilder { async rebuild(cacheKey: string): Promise { if ( - !this.rebuilder.skipPrebuilds && ( + !this.rebuilder.buildFromSource && ( (await this.findPrebuildifyModule(cacheKey)) || (await this.findPrebuildInstallModule(cacheKey)) || (await this.findNodePreGypInstallModule(cacheKey))) diff --git a/src/rebuild.ts b/src/rebuild.ts index 8507c173..4d0dc179 100644 --- a/src/rebuild.ts +++ b/src/rebuild.ts @@ -28,7 +28,7 @@ export interface RebuildOptions { projectRootPath?: string; forceABI?: number; disablePreGypCopy?: boolean; - skipPrebuilds?: boolean; + buildFromSource?: boolean; } export interface RebuilderOptions extends RebuildOptions { @@ -61,7 +61,7 @@ export class Rebuilder implements IRebuilder { public msvsVersion?: string; public useElectronClang: boolean; public disablePreGypCopy: boolean; - public skipPrebuilds: boolean; + public buildFromSource: boolean; constructor(options: RebuilderOptions) { this.lifecycle = options.lifecycle; @@ -78,7 +78,7 @@ export class Rebuilder implements IRebuilder { this.prebuildTagPrefix = options.prebuildTagPrefix || 'v'; this.msvsVersion = process.env.GYP_MSVS_VERSION; this.disablePreGypCopy = options.disablePreGypCopy || false; - this.skipPrebuilds = options.skipPrebuilds || false; + this.buildFromSource = options.buildFromSource || false; if (this.useCache && this.force) { console.warn('[WARNING]: Electron Rebuild has force enabled and cache enabled, force take precedence and the cache will not be used.'); diff --git a/src/types.ts b/src/types.ts index 059b6661..393fee3d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,7 +23,7 @@ export interface IRebuilder { msvsVersion?: string; platform: string; prebuildTagPrefix: string; - skipPrebuilds: boolean; + buildFromSource: boolean; useCache: boolean; useElectronClang: boolean; } diff --git a/test/rebuild-napibuildversion.ts b/test/rebuild-napibuildversion.ts index 9e7dcb14..1873f9b0 100644 --- a/test/rebuild-napibuildversion.ts +++ b/test/rebuild-napibuildversion.ts @@ -39,7 +39,7 @@ describe('rebuild with napi_build_versions in binary config', async function () buildPath: testModulePath, electronVersion: testElectronVersion, arch, - skipPrebuilds: true, // need to skip node-pre-gyp prebuilt binary + buildFromSource: true, // need to skip node-pre-gyp prebuilt binary }); await expectNativeModuleToBeRebuilt(testModulePath, 'sqlite3');