Skip to content

Commit

Permalink
fix: update autoupdate docs to describe module-based support. set `na…
Browse files Browse the repository at this point in the history
…tiveRebuilder` default value to use electron/rebuild (#8140)
  • Loading branch information
mmaietta committed Mar 18, 2024
1 parent ff8f94f commit 99a6150
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 73 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-socks-chew.md
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: update autoupdate docs to describe module-based support. set nativeRebuilder default value to use electron/rebuild
207 changes: 139 additions & 68 deletions docs/auto-update.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/configuration/configuration.md
Expand Up @@ -93,7 +93,7 @@ Env file `electron-builder.env` in the current dir ([example](https://github.com
<p><code id="Configuration-npmRebuild">npmRebuild</code> = <code>true</code> Boolean - Whether to <a href="https://docs.npmjs.com/cli/rebuild">rebuild</a> native dependencies before starting to package the app.</p>
</li>
<li>
<p><code id="Configuration-nativeRebuilder">nativeRebuilder</code> = <code>legacy</code> “legacy” | “sequential” | “parallel” | “undefined” - Use <code>legacy</code> app-builder binary for installing native dependencies, or <code>@electron/rebuild</code> in <code>sequential</code> or <code>parallel</code> compilation modes.</p>
<p><code id="Configuration-nativeRebuilder">nativeRebuilder</code> = <code>sequential</code> “legacy” | “sequential” | “parallel” | “undefined” - Use <code>legacy</code> app-builder binary for installing native dependencies, or <code>@electron/rebuild</code> in <code>sequential</code> or <code>parallel</code> compilation modes.</p>
</li>
<li>
<p><code id="Configuration-buildNumber">buildNumber</code> String | “undefined” - The build number. Maps to the <code>--iteration</code> flag for builds using FPM on Linux. If not defined, then it will fallback to <code>BUILD_NUMBER</code> or <code>TRAVIS_BUILD_NUMBER</code> or <code>APPVEYOR_BUILD_NUMBER</code> or <code>CIRCLE_BUILD_NUM</code> or <code>BUILD_BUILDNUMBER</code> or <code>CI_PIPELINE_IID</code> env.</p>
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/scheme.json
Expand Up @@ -7010,7 +7010,7 @@
"type": "null"
}
],
"default": "legacy",
"default": "sequential",
"description": "Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes."
},
"nodeGypRebuild": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/configuration.ts
Expand Up @@ -133,7 +133,7 @@ export interface Configuration extends PlatformSpecificBuildOptions {
readonly npmRebuild?: boolean
/**
* Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes.
* @default legacy
* @default sequential
*/
readonly nativeRebuilder?: "legacy" | "sequential" | "parallel" | null

Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/util/yarn.ts
Expand Up @@ -182,7 +182,7 @@ export async function rebuild(config: Configuration, appDir: string, options: Re
execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,
buildFromSource: options.buildFromSource === true,
}
if ([undefined, null, "legacy"].includes(config.nativeRebuilder)) {
if (config.nativeRebuilder === "legacy") {
const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true)
return executeAppBuilderAndWriteJson(["rebuild-node-modules"], configuration, { env, cwd: appDir })
}
Expand All @@ -205,7 +205,7 @@ export async function rebuild(config: Configuration, appDir: string, options: Re
arch,
debug: log.isDebugEnabled,
projectRootPath: await getProjectRootPath(appDir),
mode: config.nativeRebuilder as RebuildMode,
mode: (config.nativeRebuilder as RebuildMode) || "sequential",
}
if (buildFromSource) {
rebuildOptions.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild"
Expand Down

0 comments on commit 99a6150

Please sign in to comment.