@@ -11,7 +11,7 @@ import { PM, detect, getPackageManagerVersion } from "../node-module-collector"
11
11
import { NodeModuleDirInfo } from "./packageDependencies"
12
12
import { rebuild as remoteRebuild } from "./rebuild/rebuild"
13
13
14
- export async function installOrRebuild ( config : Configuration , appDir : string , projectDir : string , options : RebuildOptions , forceInstall = false ) {
14
+ export async function installOrRebuild ( config : Configuration , { appDir , projectDir } : DirectoryPaths , options : RebuildOptions , forceInstall = false ) {
15
15
const effectiveOptions : RebuildOptions = {
16
16
buildFromSource : config . buildDependenciesFromSource === true ,
17
17
additionalArgs : asArray ( config . npmArgs ) ,
@@ -28,9 +28,9 @@ export async function installOrRebuild(config: Configuration, appDir: string, pr
28
28
}
29
29
30
30
if ( forceInstall || ! isDependenciesInstalled ) {
31
- await installDependencies ( config , appDir , projectDir , effectiveOptions )
31
+ await installDependencies ( config , { appDir, projectDir } , effectiveOptions )
32
32
} else {
33
- await rebuild ( config , appDir , projectDir , effectiveOptions )
33
+ await rebuild ( config , { appDir, projectDir } , effectiveOptions )
34
34
}
35
35
}
36
36
@@ -90,7 +90,7 @@ async function checkYarnBerry(pm: PM) {
90
90
return version . split ( "." ) [ 0 ] >= "2"
91
91
}
92
92
93
- async function installDependencies ( config : Configuration , appDir : string , projectDir : string , options : RebuildOptions ) : Promise < any > {
93
+ async function installDependencies ( config : Configuration , { appDir , projectDir } : DirectoryPaths , options : RebuildOptions ) : Promise < any > {
94
94
const platform = options . platform || process . platform
95
95
const arch = options . arch || process . arch
96
96
const additionalArgs = options . additionalArgs
@@ -121,7 +121,7 @@ async function installDependencies(config: Configuration, appDir: string, projec
121
121
122
122
// Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)
123
123
// https://github.com/electron-userland/electron-builder/issues/8024
124
- return rebuild ( config , appDir , projectDir , options )
124
+ return rebuild ( config , { appDir, projectDir } , options )
125
125
}
126
126
127
127
export async function nodeGypRebuild ( platform : NodeJS . Platform , arch : string , frameworkInfo : DesktopFrameworkInfo ) {
@@ -168,8 +168,13 @@ export interface RebuildOptions {
168
168
additionalArgs ?: Array < string > | null
169
169
}
170
170
171
+ export interface DirectoryPaths {
172
+ appDir : string
173
+ projectDir : string
174
+ }
175
+
171
176
/** @internal */
172
- export async function rebuild ( config : Configuration , appDir : string , projectDir : string , options : RebuildOptions ) {
177
+ export async function rebuild ( config : Configuration , { appDir , projectDir } : DirectoryPaths , options : RebuildOptions ) {
173
178
const configuration = {
174
179
dependencies : await options . productionDeps . value ,
175
180
nodeExecPath : process . execPath ,
0 commit comments