Skip to content

Commit

Permalink
fix: properly configure electron-rebuild for monorepos (#7215)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta authored Oct 26, 2022
1 parent 53327d5 commit 0d3b87f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fresh-experts-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: Using electron-rebuild for finding project root for native node addons to correctly handle monorepo setups
4 changes: 3 additions & 1 deletion packages/app-builder-lib/src/util/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { homedir } from "os"
import * as path from "path"
import { Configuration } from "../configuration"
import { NodeModuleDirInfo } from "./packageDependencies"
import * as electronRebuild from "electron-rebuild"
import { getElectronVersion } from "../electron/electronVersion"
import * as electronRebuild from "electron-rebuild"
import * as searchModule from "electron-rebuild/lib/src/search-module"

export async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {
let isDependenciesInstalled = false
Expand Down Expand Up @@ -156,6 +157,7 @@ export async function rebuild(appDir: string, buildFromSource: boolean, arch = p
arch,
force: true,
debug: log.isDebugEnabled,
projectRootPath: await searchModule.getProjectRootPath(appDir),
}
if (buildFromSource) {
options.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild"
Expand Down

0 comments on commit 0d3b87f

Please sign in to comment.