Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: electron-userland/electron-builder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v26.0.7
Choose a base ref
...
head repository: electron-userland/electron-builder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v26.0.8
Choose a head ref
  • 6 commits
  • 54 files changed
  • 5 contributors

Commits on Feb 20, 2025

  1. chore(tests): use yarn instead of npm install to resolve unit tes…

    …t instability (#8877)
    beyondkmp authored Feb 20, 2025
    Copy the full SHA
    7dbac1b View commit details
  2. chore: refactor node module collector, extract explicit `DependencyTr…

    …ee`, update types to be generic and respective to `npm list` vs `pnpm list` dependency trees (#8872)
    
    - Moves functions around so that they're topologically ordered.
    - Updates `types` for explicit usage of what is the result `JSON.parse`
    and what is used for the production tree
    - Removes `delete array[key]` logic by refactoring to `reduce` (no more
    modifying the original `JSON.parse` tree)
    - Extracts `JSON.parse` functionality to be specific to each collector
    - Extracts `DependencyTree` with initial set
    `implicitDependenciesInjected = false` so that the boolean isn't
    optional by using DFS approach
    - Consolidates implicit dependency injection to npm-specific logic by
    extracting simplified dependency tree w/o `dependencies`
    - Converted the abstract collector class to be generic of type:
    `NodeModulesCollector<T extends Dependency<T, OptionalsType>,
    OptionalsType>`
    - This way, all abstracted and overridden methods are easily typed per
    their respective `JSON.parse` objects. Then uses a common method to
    construct the dependencies into a `DependencyTree` and then internally
    (as before) hoisting and converting to `NodeModuleInfo[]`
    - This accommodates the differences of `optionalDependencies` within
    `pnpm list` (`PnpmDependency`) and `npm list` (`string`)
    mmaietta authored Feb 20, 2025
    Copy the full SHA
    7f6c3fe View commit details

Commits on Feb 21, 2025

  1. chore(docs): fix link to encapsulated manual update via menu.js (#8879)

    BreakBB authored Feb 21, 2025
    Copy the full SHA
    aadf839 View commit details
  2. Copy the full SHA
    c006890 View commit details
  3. feat: allow usage of .cjs, .mjs, and type=module custom publish…

    …ers. Adds `AsyncEventEmitter`. (#8868)
    mmaietta authored Feb 21, 2025
    Copy the full SHA
    48c9f88 View commit details
  4. chore(deploy): Release v26.0.8 (#8878)

    github-actions[bot] authored Feb 21, 2025
    Copy the full SHA
    d26efc0 View commit details
Showing with 837 additions and 342 deletions.
  1. +1 −1 .github/workflows/test.yaml
  2. +9 −0 CHANGELOG.md
  3. +1 −0 README.md
  4. +14 −0 packages/app-builder-lib/CHANGELOG.md
  5. +1 −1 packages/app-builder-lib/package.json
  6. +8 −8 packages/app-builder-lib/src/configuration.ts
  7. +5 −2 packages/app-builder-lib/src/index.ts
  8. +1 −1 packages/app-builder-lib/src/macPackager.ts
  9. +134 −100 packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts
  10. +49 −15 packages/app-builder-lib/src/node-module-collector/npmNodeModulesCollector.ts
  11. +40 −13 packages/app-builder-lib/src/node-module-collector/pnpmNodeModulesCollector.ts
  12. +24 −20 packages/app-builder-lib/src/node-module-collector/types.ts
  13. +77 −58 packages/app-builder-lib/src/packager.ts
  14. +22 −32 packages/app-builder-lib/src/platformPackager.ts
  15. +31 −24 packages/app-builder-lib/src/publish/PublishManager.ts
  16. +2 −2 packages/app-builder-lib/src/publish/updateInfoBuilder.ts
  17. +2 −2 packages/app-builder-lib/src/targets/AppImageTarget.ts
  18. +3 −3 packages/app-builder-lib/src/targets/AppxTarget.ts
  19. +2 −2 packages/app-builder-lib/src/targets/ArchiveTarget.ts
  20. +2 −2 packages/app-builder-lib/src/targets/FlatpakTarget.ts
  21. +2 −2 packages/app-builder-lib/src/targets/FpmTarget.ts
  22. +3 −3 packages/app-builder-lib/src/targets/MsiTarget.ts
  23. +1 −1 packages/app-builder-lib/src/targets/differentialUpdateInfoBuilder.ts
  24. +2 −2 packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
  25. +1 −1 packages/app-builder-lib/src/targets/pkg.ts
  26. +2 −2 packages/app-builder-lib/src/targets/snap.ts
  27. +84 −0 packages/app-builder-lib/src/util/asyncEventEmitter.ts
  28. +1 −0 packages/app-builder-lib/src/util/resolve.ts
  29. +1 −1 packages/app-builder-lib/src/version.ts
  30. +7 −0 packages/dmg-builder/CHANGELOG.md
  31. +1 −1 packages/dmg-builder/package.json
  32. +2 −2 packages/dmg-builder/src/dmg.ts
  33. +7 −0 packages/electron-builder-squirrel-windows/CHANGELOG.md
  34. +1 −1 packages/electron-builder-squirrel-windows/package.json
  35. +6 −6 packages/electron-builder-squirrel-windows/src/SquirrelWindowsTarget.ts
  36. +8 −0 packages/electron-builder/CHANGELOG.md
  37. +1 −1 packages/electron-builder/package.json
  38. +1 −1 packages/electron-builder/src/publish.ts
  39. +7 −0 packages/electron-forge-maker-appimage/CHANGELOG.md
  40. +1 −1 packages/electron-forge-maker-appimage/package.json
  41. +7 −0 packages/electron-forge-maker-nsis-web/CHANGELOG.md
  42. +1 −1 packages/electron-forge-maker-nsis-web/package.json
  43. +7 −0 packages/electron-forge-maker-nsis/CHANGELOG.md
  44. +1 −1 packages/electron-forge-maker-nsis/package.json
  45. +7 −0 packages/electron-forge-maker-snap/CHANGELOG.md
  46. +1 −1 packages/electron-forge-maker-snap/package.json
  47. +1 −1 pages/auto-update.md
  48. +3 −0 test/fixtures/build-hook.cjs
  49. +9 −0 test/fixtures/build-hook.mjs
  50. +154 −7 test/snapshots/BuildTest.js.snap
  51. +6 −6 test/src/ArtifactPublisherTest.ts
  52. +62 −7 test/src/BuildTest.ts
  53. +10 −6 test/src/globTest.ts
  54. +1 −1 test/src/helpers/packTester.ts
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ jobs:
testFiles:
- ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configurationValidationTest,filenameUtilTest,filesTest,globTest,ignoreTest,macroExpanderTest,mainEntryTest,urlUtilTest,extraMetadataTest,linuxArchiveTest,linuxPackagerTest,HoistedNodeModuleTest,MemoLazyTest,HoistTest
- snapTest,debTest,fpmTest,protonTest
- winPackagerTest,BuildTest,winCodeSignTest,webInstallerTest
- winPackagerTest,winCodeSignTest,webInstallerTest
- oneClickInstallerTest,assistedInstallerTest
steps:
- name: Checkout code repository
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [](https://github.com/electron-userland/electron-builder/compare/v26.0.7...v) (2025-02-21)


### Features

* allow usage of `.cjs`, `.mjs`, and `type=module` custom publishers. Adds `AsyncEventEmitter`. ([#8868](https://github.com/electron-userland/electron-builder/issues/8868)) ([48c9f88](https://github.com/electron-userland/electron-builder/commit/48c9f88b185cbc4a52926e6e10791bf293ecda6f))



# [](https://github.com/electron-userland/electron-builder/compare/v26.0.6...v) (2025-02-18)


1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -179,6 +179,7 @@ builder.build({
* [Vue CLI 3 plugin for Electron](https://nklayman.github.io/vue-cli-plugin-electron-builder) A Vue CLI 3 plugin for Electron with no required configuration.
* [electron-vue-vite](https://github.com/caoxiemeihao/electron-vue-vite) A real simple Electron + Vue3 + Vite5 boilerplate.
* [vite-electron-builder](https://github.com/cawa-93/vite-electron-builder) Secure boilerplate for Electron app based on Vite. Supports multiple frameworks.
* [electronjs-with-nextjs](https://github.com/saulotarsobc/electronjs-with-nextjs) ElectronJS application with NextJS and TypeScript.

## Debug

14 changes: 14 additions & 0 deletions packages/app-builder-lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# app-builder-lib

## 26.0.8

### Patch Changes

- [#8872](https://github.com/electron-userland/electron-builder/pull/8872) [`7f6c3fea`](https://github.com/electron-userland/electron-builder/commit/7f6c3fea6fea8cffa00a43413f5335097aca94b0) Thanks [@mmaietta](https://github.com/mmaietta)! - chore: refactor node module collector, extract explicit `DependencyTree`, update types to be generic and respective to `npm list` vs `pnpm list` dependency trees

- [#8868](https://github.com/electron-userland/electron-builder/pull/8868) [`48c9f88b`](https://github.com/electron-userland/electron-builder/commit/48c9f88b185cbc4a52926e6e10791bf293ecda6f) Thanks [@mmaietta](https://github.com/mmaietta)! - fix: allow usage of .cjs, .mjs, and type=module custom/generic publishers

- [#8872](https://github.com/electron-userland/electron-builder/pull/8872) [`7f6c3fea`](https://github.com/electron-userland/electron-builder/commit/7f6c3fea6fea8cffa00a43413f5335097aca94b0) Thanks [@mmaietta](https://github.com/mmaietta)! - chore: refactor node module collector to reduce recursion, extract explicit DependencyTree, update types

- Updated dependencies []:
- dmg-builder@26.0.8
- electron-builder-squirrel-windows@26.0.8

## 26.0.7

### Patch Changes
2 changes: 1 addition & 1 deletion packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app-builder-lib",
"description": "electron-builder lib",
"version": "26.0.7",
"version": "26.0.8",
"main": "out/index.js",
"files": [
"out",
16 changes: 8 additions & 8 deletions packages/app-builder-lib/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -288,36 +288,36 @@ File `myBeforePackHook.js` in the project root directory:
}
```
*/
readonly beforePack?: Hook<BeforePackContext, any> | string | null
readonly beforePack?: Hook<BeforePackContext, void> | string | null

/**
* The function (or path to file or module id) to be [run after the prebuilt Electron binary has been extracted to the output directory](#afterextract)
* Same setup as {@link beforePack}
*/
readonly afterExtract?: Hook<AfterExtractContext, any> | string | null
readonly afterExtract?: Hook<AfterExtractContext, void> | string | null

/**
* The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).
* Same setup as {@link beforePack}
*/
readonly afterPack?: Hook<AfterPackContext, any> | string | null
readonly afterPack?: Hook<AfterPackContext, void> | string | null

/**
* The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).
* Same setup as {@link beforePack}
*/
readonly afterSign?: Hook<AfterPackContext, any> | string | null
readonly afterSign?: Hook<AfterPackContext, void> | string | null

/**
* The function (or path to file or module id) to be run on artifact build start.
* Same setup as {@link beforePack}
*/
readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, any> | string | null
readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null
/**
* The function (or path to file or module id) to be run on artifact build completed.
* Same setup as {@link beforePack}
*/
readonly artifactBuildCompleted?: Hook<ArtifactCreated, any> | string | null
readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null
/**
* The function (or path to file or module id) to be run after all artifacts are built.
@@ -339,11 +339,11 @@ Configuration in the same way as `afterPack` (see above).
/**
* The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.
*/
readonly msiProjectCreated?: Hook<string, any> | string | null
readonly msiProjectCreated?: Hook<string, void> | string | null
/**
* The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.
*/
readonly appxManifestCreated?: Hook<string, any> | string | null
readonly appxManifestCreated?: Hook<string, void> | string | null
/**
* The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic
*/
7 changes: 5 additions & 2 deletions packages/app-builder-lib/src/index.ts
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ export function build(options: PackagerOptions & PublishOptions, packager: Packa
}
buildResult.artifactPaths.push(newArtifact)
for (const publishConfiguration of publishConfigurations) {
publishManager.scheduleUpload(
await publishManager.scheduleUpload(
publishConfiguration,
{
file: newArtifact,
@@ -132,6 +132,9 @@ export function build(options: PackagerOptions & PublishOptions, packager: Packa
promise = publishManager.awaitTasks()
}

return promise.then(() => process.removeListener("SIGINT", sigIntHandler))
return promise.then(() => {
packager.clearPackagerEventListeners()
process.removeListener("SIGINT", sigIntHandler)
})
})
}
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/macPackager.ts
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ export class MacPackager extends PlatformPackager<MacConfiguration> {
packager: this,
electronPlatformName: platformName,
}
await this.info.afterPack(packContext)
await this.info.emitAfterPack(packContext)

if (this.info.cancellationToken.cancelled) {
return
Loading