Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
80a4ba3
updating all engines to node 22
mmaietta Dec 9, 2025
5a5d2b7
tmp save for .js extension migration
mmaietta Dec 9, 2025
d26567f
tmp save
mmaietta Dec 9, 2025
c92b222
tmp save for .js extension migration
mmaietta Dec 10, 2025
c951258
tmp save
mmaietta Dec 10, 2025
850646b
move the manual node module traversal to the root abstract class. Add…
mmaietta Dec 10, 2025
5ad186e
Merge branch 'master' into chore/esm-migration
mmaietta Dec 10, 2025
e6dfaba
Merge commit '850646b29a49be6dd834957c05565f4cd1c4a797' into chore/es…
mmaietta Dec 10, 2025
1235446
tmp save
mmaietta Dec 10, 2025
fa1ceb2
got it all compiling
mmaietta Dec 10, 2025
fb7cff6
esm complete on tests as well?
mmaietta Dec 10, 2025
c978ab4
tests run
mmaietta Dec 10, 2025
c8d975b
Merge branch 'master' into chore/esm-migration
mmaietta Jan 28, 2026
f315958
it builds
mmaietta Jan 28, 2026
87d5cf7
cleanup
mmaietta Jan 28, 2026
37c7b37
tmp save
mmaietta Jan 28, 2026
0640b3c
tmp save
mmaietta Jan 28, 2026
ee370b1
tmp save
mmaietta Jan 28, 2026
0abd6fa
compiles
mmaietta Jan 28, 2026
dd5618d
regenerating schema using updated/fixed schema generator script
mmaietta Jan 28, 2026
05cfdd9
Merge commit 'ec9e2dbbd864f0858cf0d3b719ad75a84c59f29c' into chore/es…
mmaietta Jan 29, 2026
d77a294
pre-release cut
mmaietta Feb 14, 2026
515fe9d
Merge commit '9418d2c0fb3608d7b348d18ab2a6b6393374fe75' into chore/re…
mmaietta Feb 18, 2026
4a95a0d
chore: adding release/v27 release branch to github actions workflows
mmaietta Feb 18, 2026
a27e2f0
update branch naming system
mmaietta Feb 18, 2026
896ddd4
Merge branch 'master' into release-cut-setup
mmaietta Feb 18, 2026
4bc739c
Merge branch 'release-cut-setup' into chore/release-cut-v27
mmaietta Feb 18, 2026
f4c2963
Merge branch 'chore/release-cut-v27' into chore/esm-migration
mmaietta Feb 18, 2026
094886f
tmp save
mmaietta Feb 19, 2026
94441f1
Merge commit '0ea48ac284ec8f64e1a0e7d10481257460fe1919' into chore/es…
mmaietta Apr 8, 2026
a99f561
tmp save, catching up to master
mmaietta Apr 8, 2026
df7f6e9
tmp save
mmaietta Apr 8, 2026
9269332
tmp save
mmaietta Apr 8, 2026
d4cb889
it compiles
mmaietta Apr 8, 2026
3e3969b
fix runner
mmaietta Apr 8, 2026
8a2e4e9
tmp save. migrating fs-extra to namespace import
mmaietta Apr 8, 2026
b73e1a4
LFG
mmaietta Apr 8, 2026
7b9cdd6
tmp save
mmaietta Apr 8, 2026
d23239e
tmp save?
mmaietta Apr 8, 2026
190222e
tmp save, more extension changes
mmaietta Apr 10, 2026
14b4925
fix somethings
mmaietta Apr 28, 2026
c06801f
Merge commit 'a4f2d98a64087a0fc822e574d033b7770697b09e' into chore/es…
mmaietta Apr 28, 2026
eac8662
everything but tests compile
mmaietta Apr 28, 2026
07858ca
attempt 1
mmaietta Apr 29, 2026
2770f2d
claude helped
mmaietta Apr 30, 2026
9c3b692
claude got tests running
mmaietta Apr 30, 2026
dfe80f8
tests run
mmaietta Apr 30, 2026
93efaa1
add ignore
mmaietta Apr 30, 2026
9a40713
adjust all imports to esm
mmaietta Apr 30, 2026
6025002
use esm Proxy instead of eager initialization
mmaietta May 1, 2026
140c734
got it working?
mmaietta May 1, 2026
c2ef699
fix imports
mmaietta May 1, 2026
44e4009
fix ts-ignore's
mmaietta May 1, 2026
19f52b9
NICE
mmaietta May 1, 2026
5641a26
add retry to blackbox update test due to flakiness of e2e system inte…
mmaietta May 1, 2026
6f2b0b7
add fuses to blackbox update test
mmaietta May 1, 2026
3b38b0e
revert hoisted snapshot changes to see if we can reduce PR diff size
mmaietta May 2, 2026
01b91f6
initial migration/creation of `/internal` package export for minimizi…
mmaietta May 2, 2026
1b4dbdc
yesssss
mmaietta May 2, 2026
18fdf69
Merge commit '99676722552714a97c2285b170230ef941d411c0' into chore/es…
mmaietta May 2, 2026
e27a88a
optimize dependencies/devDependencies list
mmaietta May 3, 2026
76a42c1
fix all circular references
mmaietta May 3, 2026
e9f6762
fix import
mmaietta May 3, 2026
634b1e4
Merge branch 'master' into chore/esm-migration
mmaietta May 5, 2026
b47b8bc
address imports
mmaietta May 5, 2026
3ba131a
prettier
mmaietta May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .changeset/config.release-v27.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": ["changesets-changelog-clean", { "repo": "electron-userland/electron-builder" }],
"commit": false,
"linked": [[
"app-builder-lib",
"builder-util",
"dmg-builder",
"electron-builder",
"electron-builder-squirrel-windows",
"electron-publish"
]],
"access": "public",
"baseBranch": "release/v27",
"updateInternalDependencies": "patch",
"ignore": [
"electron-forge-maker-appimage",
"electron-forge-maker-nsis",
"electron-forge-maker-nsis-web",
"electron-forge-maker-snap",
"@electron-builder/test"
]
}
20 changes: 20 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"app-builder-lib": "26.8.0",
"builder-util": "26.8.0",
"builder-util-runtime": "9.5.1",
"dmg-builder": "26.8.0",
"electron-builder": "26.8.0",
"electron-builder-squirrel-windows": "26.8.0",
"electron-forge-maker-appimage": "26.8.0",
"electron-forge-maker-nsis": "26.8.0",
"electron-forge-maker-nsis-web": "26.8.0",
"electron-forge-maker-snap": "26.8.0",
"electron-publish": "26.8.0",
"electron-updater": "6.8.3",
"@electron-builder/test": "0.0.0"
},
"changesets": []
}
12 changes: 12 additions & 0 deletions .changeset/small-times-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"electron-builder-squirrel-windows": major
"builder-util-runtime": major
"electron-builder": major
"electron-publish": major
"electron-updater": major
"app-builder-lib": major
"builder-util": major
"dmg-builder": major
---

chore(node): migrating to ESM and updating all engines to node 22 to support latest versions of `electron/*` packages
3 changes: 2 additions & 1 deletion .github/workflows/pr-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- master
- release/v*
- release/v27

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"///": "Please see https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#run-test-using-cli how to run particular test instead full (and very slow) run",
"test-all": "pnpm compile && pnpm pretest && pnpm ci:test",
"test-linux": "docker run --rm -e CI=${CI:-false} -e DEBUG=${DEBUG:-} -e VITEST_SHARD_INDEX=${VITEST_SHARD_INDEX:-} -e VITEST_SHARD_COUNT=${VITEST_SHARD_COUNT:-} -e UPDATE_SNAPSHOT=\"${UPDATE_SNAPSHOT:-false}\" -e TEST_FILES=\"${TEST_FILES:-}\" -w /project -v $(pwd):/project -v $(pwd)-node-modules:/project/node_modules -v $HOME/Library/Caches/electron:/root/.cache/electron -v $HOME/Library/Caches/electron-builder:/root/.cache/electron-builder ${ADDITIONAL_DOCKER_ARGS} ${TEST_RUNNER_IMAGE_TAG:-electronuserland/builder:22-wine-mono} /bin/bash -c \"bash ./docker/test-in-docker.sh\"",
"ci:test": "ts-node test/vitest-scripts/run-vitest.ts",
"ci:test:count": "ts-node test/vitest-scripts/smart-shard-count.ts",
"ci:test": "tsx test/vitest-scripts/run-vitest.ts",
"ci:test:count": "tsx test/vitest-scripts/smart-shard-count.ts",
"ci:validate": "pnpm compile && pnpm pretest && pnpm generate-all",
"ci:version": "pnpm i && pnpm changelog && changeset version && node scripts/update-package-version-export.js && pnpm compile && pnpm generate-all && git add .",
"ci:publish": "pnpm i && pnpm compile && pnpm publish -r --tag ${NPM_DIST_TAG:-next} && changeset tag",
"docker-images": "docker/build.sh",
"docker-push": "docker/push.sh",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"generate-changeset": "pnpm changeset",
"generate-schema": "typescript-json-schema packages/app-builder-lib/tsconfig-scheme.json Configuration --out packages/app-builder-lib/scheme.json --noExtraProps --useTypeOfKeyword --strictNullChecks --required && node ./scripts/fix-schema.js",
"generate-schema": "tsx scripts/generate-schema.ts",
"generate-all": "pnpm generate-schema && pnpm prettier",
"docs:prebuild": "docker build -t mkdocs-dockerfile -f mkdocs-dockerfile . ",
"docs:build": "pnpm compile && ts-node scripts/renderer/src/typedoc2html.ts",
"docs:build": "pnpm compile && tsx scripts/renderer/src/typedoc2html.ts",
"docs:mkdocs": "docker run --rm -v ${PWD}:/docs -v ${PWD}/site:/site mkdocs-dockerfile build",
"docs:preview": "open ./site/index.html",
"docs:all": "pnpm docs:prebuild && pnpm docs:build && pnpm docs:mkdocs"
Expand All @@ -40,6 +40,7 @@
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.37.0",
"@stylistic/eslint-plugin": "^2.8.0",
"@tsconfig/node22": "^22.0.5",
"@types/node": "^22.7.4",
"@typescript-eslint/eslint-plugin": "8.17.0",
"@typescript-eslint/parser": "8.17.0",
Expand All @@ -51,18 +52,18 @@
"eslint": "9.39.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"fs-extra": "10.1.0",
"fs-extra": "^11.3.4",
"is-ci": "^4.1.0",
"prettier": "3.7.4",
"ts-node": "^10.9.2",
"tsx": "^4.21.0",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "4.2.8",
"typescript": "^5.6.2",
"typescript-json-schema": "0.64.0",
"vitest": "^3.2.2"
},
"engines": {
"node": ">=14.14",
"node": ">=22.12.0",
"pnpm": ">=10"
},
"packageManager": "pnpm@10.18.0+sha512.e804f889f1cecc40d572db084eec3e4881739f8dec69c0ff10d2d1beff9a4e309383ba27b5b750059d7f4c149535b6cd0d2cb1ed3aeb739239a4284a68f40cfa",
Expand Down
23 changes: 23 additions & 0 deletions packages/app-builder-lib/helpers/dynamic-import.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const url = require("url")
const fs = require("fs")

exports.dynamicImport = async function dynamicImport(path) {
try {
return await import(fs.existsSync(path) ? url.pathToFileURL(path).href : path)
} catch (error) {
return Promise.reject(error)
}
}

exports.dynamicImportMaybe = async function dynamicImportMaybe(path) {
try {
return require(path)
} catch (e1) {
try {
return await exports.dynamicImport(path)
} catch (e2) {
e1.message = "\n1. " + e1.message + "\n2. " + e2.message
throw e1
}
}
}
16 changes: 10 additions & 6 deletions packages/app-builder-lib/helpers/dynamic-import.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
const url = require("url")
const fs = require("fs")
import { createRequire } from "node:module"
import { pathToFileURL } from "node:url"
import { existsSync } from "node:fs"

exports.dynamicImport = async function dynamicImport(path) {
const require = createRequire(import.meta.url)

export async function dynamicImport(path) {
try {
return await import(fs.existsSync(path) ? url.pathToFileURL(path).href : path)
return await import(existsSync(path) ? pathToFileURL(path).href : path)
} catch (error) {
return Promise.reject(error)
}
}

exports.dynamicImportMaybe = async function dynamicImportMaybe(path) {
/** Like {@link dynamicImport()}, except it tries out {@link require()} first. */
export async function dynamicImportMaybe(path) {
try {
return require(path)
} catch (e1) {
try {
return await exports.dynamicImport(path)
return await dynamicImport(path)
} catch (e2) {
e1.message = "\n1. " + e1.message + "\n2. " + e2.message
throw e1
Expand Down
36 changes: 36 additions & 0 deletions packages/app-builder-lib/helpers/remote-rebuild.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
if (!process.send) {
console.error("The remote rebuilder expects to be spawned with an IPC channel")
process.exit(1)
}

const rebuilder = rebuilder => {
rebuilder.lifecycle.on("module-found", moduleName => process.send?.({ msg: "module-found", moduleName }))
rebuilder.lifecycle.on("module-done", moduleName => process.send?.({ msg: "module-done", moduleName }))
rebuilder.lifecycle.on("module-skip", moduleName => process.send?.({ msg: "module-skip", moduleName }))

return rebuilder
.then(() => {
process.send?.({ msg: "rebuild-done" })
return process.exit(0)
})
.catch(err => {
process.send?.({
msg: "rebuild-error",
err: {
message: err.message,
stack: err.stack,
},
})
process.exit(0)
})
}

const main = async () => {
const options = JSON.parse(process.argv[2])
return import("@electron/rebuild").then(module => {
const { rebuild } = module
return rebuilder(rebuild(options))
})
}

main()
6 changes: 2 additions & 4 deletions packages/app-builder-lib/helpers/remote-rebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ const rebuilder = rebuilder => {
})
}

const main = () => {
const main = async () => {
const options = JSON.parse(process.argv[2])

const dynamicImport = require("./dynamic-import").dynamicImportMaybe
return dynamicImport("@electron/rebuild").then(module => {
return import("@electron/rebuild").then(module => {
const { rebuild } = module
return rebuilder(rebuild(options))
})
Expand Down
14 changes: 9 additions & 5 deletions packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"name": "app-builder-lib",
"description": "electron-builder lib",
"version": "26.9.0",
"main": "out/index.js",
"version": "26.8.2",
"type": "module",
"exports": {
".": "./out/index.js",
"./internal": "./out/indexInternal.js"
},
"files": [
"out",
"templates",
Expand Down Expand Up @@ -56,7 +60,6 @@
"@electron/rebuild": "^4.0.3",
"@electron/universal": "2.0.3",
"@malept/flatpak-bundler": "^0.4.0",
"@types/fs-extra": "9.0.13",
"async-exit-hook": "^2.0.1",
"builder-util": "workspace:*",
"builder-util-runtime": "workspace:*",
Expand All @@ -67,7 +70,7 @@
"dotenv-expand": "^11.0.6",
"ejs": "^3.1.8",
"electron-publish": "workspace:*",
"fs-extra": "^10.1.0",
"fs-extra": "^11.3.4",
"hosted-git-info": "^4.1.0",
"isbinaryfile": "^5.0.0",
"jiti": "^2.4.2",
Expand Down Expand Up @@ -106,6 +109,7 @@
"@babel/preset-env": "7.24.8",
"@babel/preset-react": "7.24.7",
"@types/debug": "4.1.7",
"@types/fs-extra": "9.0.13",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably bump it to v11 In all package.jsons

"@types/ejs": "3.1.0",
"@types/hosted-git-info": "3.0.2",
"@types/js-yaml": "4.0.3",
Expand All @@ -123,5 +127,5 @@
"electron-builder-squirrel-windows": "workspace:*"
},
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
"typings": "./out/index.d.ts"
"types": "./out/index.d.ts"
}
7 changes: 5 additions & 2 deletions packages/app-builder-lib/src/Framework.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { FileTransformer } from "builder-util"
import { AsarIntegrity } from "./asar/integrity"
import { AfterPackContext, ElectronPlatformName, Platform, PlatformPackager } from "./index"
import { AsarIntegrity } from "./asar/integrity.js"
import { AfterPackContext } from "./configuration.js"
import { Platform } from "./core.js"
import { ElectronPlatformName } from "./electron/ElectronFramework.js"
import type { PlatformPackager } from "./platformPackager.js"

export interface Framework {
readonly name: string
Expand Down
11 changes: 7 additions & 4 deletions packages/app-builder-lib/src/ProtonFramework.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { createRequire } from "node:module"
import { FileTransformer, log } from "builder-util"

const require = createRequire(import.meta.url)
import { safeStringifyJson } from "builder-util-runtime"
import { Platform } from "./core"
import { NODE_MODULES_PATTERN } from "./fileTransformer"
import { LibUiFramework } from "./frameworks/LibUiFramework"
import { getTemplatePath } from "./util/pathManager"
import { Platform } from "./core.js"
import { NODE_MODULES_PATTERN } from "./fileTransformer.js"
import { LibUiFramework } from "./frameworks/LibUiFramework.js"
import { getTemplatePath } from "./util/pathManager.js"

export class ProtonFramework extends LibUiFramework {
readonly name = "proton"
Expand Down
11 changes: 6 additions & 5 deletions packages/app-builder-lib/src/appInfo.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { isEmptyOrSpaces, log } from "builder-util"
import { sanitizeFileName } from "builder-util/internal"
import { Nullish } from "builder-util-runtime"
import { sanitizeFileName } from "builder-util/out/filename"
import { prerelease } from "semver"
import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions"
import { Packager } from "./packager"
import { expandMacro } from "./util/macroExpander"
import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions.js"
import { Packager } from "./packager.js"
import { expandMacro } from "./util/macroExpander.js"

// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote
// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/
Expand All @@ -21,7 +21,7 @@ export function smarten(s: string): string {
}

export class AppInfo {
readonly description = smarten(this.info.metadata.description || "")
readonly description: string
readonly version: string
readonly type: string | undefined
readonly shortVersion: string | undefined
Expand All @@ -40,6 +40,7 @@ export class AppInfo {
private readonly platformSpecificOptions: PlatformSpecificBuildOptions | null = null,
normalizeNfd = false
) {
this.description = smarten(this.info.metadata.description || "")
this.version = info.metadata.version!
this.type = info.metadata.type

Expand Down
Loading
Loading