Skip to content

v6.0.0

Compare
Choose a tag to compare
@georgexu99 georgexu99 released this 02 Nov 18:36
· 276 commits to main since this release

What's Changed

Breaking changes

Forge has spent a considerable time in beta development; this is a list of breaking changes made in recent betas (>= 6.0.0-beta.65), so that users who have been using the later beta versions in their apps can more easily transition to the stable release.

A complete list of changes and commits can be found below.

Config: Changed plugins syntax (#2963)

The plugins array now takes objects containing an object with properties name and config, rather than tuples containing the plugin name and config.

This aligns the syntax for this configuration with the publishers and makers arrays.

{
  plugins: [
-      [
-        '@electron-forge/plugin-webpack',
-        { /* ... */ }
-      ]
+
+      {
+        name: '@electron-forge/plugin-webpack',
+        config: { /* ... */ }
+      }
 ]
}

Config: Prefer forge.config.js for new Forge projects (#2991) (#2995)

We have changed the electron-forge init and electron-forge import commands to create a JavaScript config file rather than a section in package.json. This is to better
support dynamic build logic that isn't possible with the JSON format. Forge now has better support for alternate configuration syntaxes via rechoir.

This is a breaking change for any existing third-party templates and plugins:

  • The internal signature of Plugin.getHook(name) has changed to Plugin.getHooks().name.
  • Templates that mutated the Forge config within package.json will need to instantiate their own forge.config.js or forge.config.ts

Config: Renamed Electron Rebuild config (#2963)

For consistency with the packagerConfig option for electron-packager, the field to configure @electron/rebuild has now been shortened to rebuildConfig.

{
-  electronRebuildConfig: { /* ... */ }
+  rebuildConfig: { /* ... */ }
}

Config: Renamed ElectronRebuildConfig (#2963)

Removed @electron-forge/template-typescript template (#2948)

This has been removed in favor of the [Webpack + TypeScript Template].

Maker: Upgraded Maker Wix dependency to electron-wix-msi@5.0.0 (3008))

This upgrade includes a rename from appIconPath to icon in the config (#153). This aligns WiX MSI's icon config with the other makers.

Build: Upgraded required Node.js to 14 LTS (#2921)

Package: Upgraded package dependency to electron-packager@17 (#2978)

The upgrade to Electron Packager 17 introduces the shiny new @electron/osx-sign package for macOS code signing. It's a rewrite of the old electron-osx-sign tool with more sensible defaults.

To migrate, we recommend seeing if the default packagerConfig.osxSign options work for you and tweaking the default entitlements to your needs. Otherwise, see the @electron/osx-sign MIGRATION.md doc for a 1:1 conversion from the old config options to the new ones.

Command: Removed lint command (#2964)

Command: Removed install command (#2958)


Changelog

Breaking Changes

Features

  • feat(plugin-webpack): improve native asset relocation without forking Vercel loader by @timfish in #2320
  • feat(plugin-webpack): add nodeIntegration config for renderers by @malept in #2330
  • feat(plugin-webpack): add devContentSecurityPolicy config option by @malept in #2332
  • feat(webpack-plugin): upgrade to Webpack 5 by @YvanGuidoin in #2225
  • feat: add support for forge.config.ts et. al by @MarshallOfSound in #2993
  • feat(core): allow mutating packageJSON on load by @MarshallOfSound in #513
  • feat(core): add basic support for non-exact Electron versions by @malept in #680
  • V6 API by @MarshallOfSound in #433
  • feat: move create-electron-app into forge by @VerteDinde in #2988
  • feat(publisher-s3): add keyResolver option to allow users to make their own S3 key path by @MarshallOfSound in #482
  • Typescript :) by @MarshallOfSound in #495
  • feat(plugin-local-electron): add plugin-local-electron by @MarshallOfSound in #501
  • feat(generic): add source-map-support for better stacktraces by @malept in #488
  • feat: use forge.config.ts in the webpack typescript template by @MarshallOfSound in #3012
  • feat(publisher-s3): Add sessionToken and change default fallback by @bboure in #2984
  • feat(core): resolve forge.config.js by default if it exists by @MarshallOfSound in #569
  • feat(core): allow no config to be present, default to an empty object by @MarshallOfSound in #543
  • feat(core): use git config to determine author before username by @pd4d10 in #920
  • feat(core): add "init --force" to allow overwriting an existing dir by @malept in #1020
  • feat: add typescript-webpack template by @codebytere in #1344
  • feat: add template for typescript by @codebytere in #1319
  • feat(plugin-webpack): add an option to export webpack compilation stats by @sirgallifrey in #639
  • feat(core): add platform and arch to generateAssets hook parameters by @timfish in #2327
    #2344
  • feat(plugin-webpack): allow most webpack-dev-server options to be configurable by @malept in #2444
  • feat(plugin-webpack): allow specifing a seperate webpack config for your preload by @kyruzic in #2679
  • feat: Make autoUpdate and autoLaunch features configurable in MakerWixConfig by @pthompson-asana in #2620
  • feat(template): add a default preload script by @malept in #2722
  • feat: Various improvements for electron/template by @felixrieseberg in #950
  • feat(cli): add --inspect-brk-electron option by @MOZGIII in #1328
  • feat(publisher-ers): support flavor config by @erickzhao in #2766
  • feat: 🎸 Add packageSourceMaps option to WebpackPluginConfig by @zac-jacobson in #2581
  • feat: allow disabling maker in config by @erickzhao in #2754
  • feat: 🎸 allow specifying alternative tag prefix by @tylerbrandt in #2605
  • feat(plugin-webpack): Allow each entrypoint to specify nodeIntegration by @chetbox in #2867
  • feat: remove preload.js from TypeScript templates by @itsananderson in #2938
  • feat(plugin-webpack): support standalone preload entry points by @erickzhao in #2950
  • feat(webpack-plugin): webpack 5 configuration factory by @erickzhao in #2776
  • feat(publisher-github): add retry support by @malept in #2550
  • feat(publisher-github): add debug support for Octokit by @malept in #2499
  • feat(publisher-bitbucket): initial publish publisher-bitbucket by @lukebatchelor in #571
  • feat: adds a hook before MSICreator.create() is called by @mako-taco in #623

Fixes

  • fix(packager): "packaging application" log never stops when building for multiple architectures by @macdja38 in #3006
  • fix: do not proxify class instances in forge config by @MarshallOfSound in #3039
  • fix(core): install @electron-forge/cli to new projects by @malept in #486
  • fix: ensure webpack typescript template runs by @MarshallOfSound in #3038
  • fix(publish): ignore unnecessary files when publishing to npm by @erikian in #3024
  • fix(publisher-github): remove deprecated option from @octokit/rest params (6.x) by @malept in #505
  • fix: restore isProd in the webpack plugin by @MarshallOfSound in #3021
  • fix: use @electron-forge/cli hint for project resolution by @MarshallOfSound in #3023
  • fix(template-base): use minimum instead of exact version when replacing ELECTRON_FORGE/VERSION in templates by @erikian in #3030
  • fix(template-typescript-webpack): clean up forge config code by @erickzhao in #3009
  • fix(template-typescript-webpack): webpack entrypoint extensions by @erickzhao in #3014
  • fix(template-typescript-webpack): properly load forge.config.ts by @erickzhao in #3016
  • fix(plugin-webpack): keep devDependencies, dependencies, optionalDependencies and peerDependencies in the distributed package.json by @erikian in #3007
  • fix(publisher-github): don't reexport Octokit type by @malept in #1962
  • fix(core): init should install the latest caret version of Forge by @malept in #1963
  • fix(maker-deb): return the correct outPath with a prerelease version by @malept in #584
  • fix(core): show the package manager stderr when installing deps fails by @malept in #618
  • fix(core): rename maker fixtures so they will get compiled by babel/typescript by @malept in #630
  • fix(maker-wix): correct path to distributable by @liudonghua123 in #609
  • fix(maker-dmg): return correct path from dmg maker by @MarshallOfSound in #631
  • fix(plugin-webpack): fix incorrect PRELOAD_WEBPACK_ENTRY. by @tgds in #635
  • Upgrade to Electron Packager 13 by @malept in #642
  • Add simple Importer from Forge 5.x to 6.x by @malept in #653
  • fix(plugin-webpack): make the PRELOAD_ENTRY variable map to undefined when there is no preload by @MarshallOfSound in #687
  • fix(template-typescript): add eslint-plugin-import/typescript rules by @unasuke in #2048
  • fix(plugin-webpack): correctly define the asset relocator base dir by @tjquillan in #2022
  • fix(template/typescript-webpack): add ts/tsx to known eslint-plugin-import extensions by @malept in #2139
  • fix(template/typescript-webpack): magic constant is a string & describe it by @malept in #2166
  • fix(core): better error detection for electron-prebuilt-compile by @malept in #2268
  • fix(plugin-local-electron): bind methods correctly by @malept in #2280
  • fix(webpack-plugin): add web as a target for the renderer process by @malept in #2285
  • fix(maker-squirrel): use executableName for exe when available by @malept in #2365
  • refactor(plugin-webpack): cleanup by @malept in #2368
  • fix(plugin-webpack): throw error if something bad happened in preload compilation by @vhashimotoo in #2334
  • fix(plugin-electronegativity): add parserPlugins option by @vhashimotoo in #2323
  • fix(core): add support for finding electron for npm 7 workspaces by @malept in #2446
  • fix(template-webpack): only use node-loader if the .node files are in native_modules/ by @malept in #2449
  • fix(plugin-webpack): fix deprecation warnings for dev-server@4.0.0 by @malept in #2457
    #2458
  • fix(core): better errors when maker names are invalid by @malept in #2467
  • fix(core): stops breaking regexps in the config parser by @MarshallOfSound in #566
  • fix(core): resolve publisher config correctly when given a publisher name by @MarshallOfSound in #568
  • fix(core): keep track of application restarts and close stdin pipe correctly by @MarshallOfSound in #567
  • fix: abstract base classes should implement shared type interfaces by @malept in #684
  • fix: use git to check that you're in a Git repository by @shiftkey in #689
  • fix(core): be more descriptive when a plugin/maker/publisher module isn't found by @malept in #694
  • fix(plugin-webpack): throw an error if webpack generates compilation errors when packaging by @malept in #695
  • fix(plugin-webpack): allow port to be configurable by @malept in #693
  • Fix Windows CI by @MarshallOfSound in #715
  • fix(core): use loadFile instead of loadURL in the default template by @malept in #1341
  • fix(plugin-webpack): handle package.json files without config keys by @malept in #1342
  • fix(template-webpack): use css-loader instead of file-loader by @shimaore in #1036
  • build: use Node 12 for the docs stage on Travis CI by @malept in #1057
  • fix(maker): allow Linux makers to run on non-Linux hosts if possible by @malept in #1082
  • fix: ensure that makers do not overwrite existing un-similar outputs by @MarshallOfSound in #1086
  • fix(plugin-webpack): add missing debug level for webpack-dev-middleware by @thateverdmitriy in #1131
  • fix(cli): warn on unknown commands by @malept in #1304
  • fix(maker-base): throw a better error when external binaries are missing by @malept in #1306
  • refactor(publisher-s3): replace the s3 package with just aws-sdk by @malept in #1318
  • fix(maker-windows): handle versions with prerelease information by @malept in #1320
  • fix(web-multi-logger): xterm 4 compatibility by @malept in #1387
  • fix(template-typescript-webpack): adjust ts-loader module rule syntax by @malept in #1388
  • fix(core): find electron when app is in a yarn workspace by @malept in #1450
  • fix(template): stop holding a reference to mainWindow by @malept in https://github.com/electron/forge/pull/1468\
  • fix(plugin-webpack): lazily load config generator so isProd is set correctly by @malept in https://github.com/electron/forge/pull/1480\
  • fix(typescript-webpack): remove async=false option from ts-checker to avoid preload compile hang by @malept in #1497
  • fix(core): throw an error when no make targets for the given platform are found by @malept in #1515
  • fix(plugin-webpack): change preload target from electron-renderer to electron-preload by @malept in #1521
  • fix(template-base): update Travis CI config to best practices by @malept in #1539
  • fix(publisher-electron-release-server): throw an exception for 4xx/5xx HTTP status codes by @pierrickouw in #1538
  • fix(core): search for electron in a node_modules folder with electron in it by @vhashimotoo in #2326
  • fix(plugin-webpack): don't specify resolve.modules by default by @kamontat in #2149
  • fix(maker-dmg): add the arch to the default dmg name by @malept in #2431
  • fix(webpack-plugin): Ensure asset relocator injected code works with nodeIntegration disabled by @timfish in #2396
  • fix(template): add plugin:import/electron to TypeScript ESLint config by @malept in #2399
  • fix(template-typescript-webpack): lint tsx files by default by @malept in #2403
  • fix(plugin-webpack): don't show the error message if packagerConfig.ignore is a function by @malept in #2424
  • fix(plugin-webpack): rebuild native modules before packaging by @malept in #2584
  • fix: replace colors with chalk by @malept in #2666
  • fix(cli): re-add shebang to electron-forge binary by @malept in #2671
  • fix(publisher-electron-release-server): omit RELEASES file when uploading assets by @monsterkrampe in #2089
  • fix(plugin-webpack): validate that the correct entry point is used by @malept in #2522
  • fix: unpin electron-notarize by @malept in #2515
  • fix(publisher-electron-release-server): set knownLength option for asset upload by @monsterkrampe in #2706
  • fix(plugin-webpack): better webpack-dev-server types by @erickzhao in #2952
  • fix: keep stdin unpaused after ora completes by @clavin in #2904
  • fix: add missing exports from packages by @clavin in #2920
  • fix: escape file names for make step by @erickzhao in #2752
  • fix(core): disable the packagerConfig.all option by @malept in #510
  • fix(cli): use scoped package path in vscode debugger scripts by @jrobeson in #524
  • fix: search for the top-level node_modules folder when using yarn workspaces by @malept in #902
  • fix(core): restart app in development via CLI multiple times by @miaowing in #904
  • refactor: convert from electron-download to @electron/get by @malept in #921
  • fix(core): update CI templates to Node 8 and other updates by @malept in #975
  • Move template CSS into a separate file by @malept in #1010
  • fix(plugin-webpack): check that stats is not empty before sending to multi-logger by @malept in #1018
  • fix(plugin-webpack): properly reference index.js in production by @shimaore in #1021
  • fix(plugin-webpack): adjust publicPath in renderer only by @shimaore in #1035
  • fix: pin gh-actions to SHAs, update to remove deprecation warning by @VerteDinde in #2966
  • fix(docs): only publish API docs on v6 tags by @erickzhao in #2976
  • fix(docs): avoid generating Typescript utility types by @erickzhao in #2980
  • fix(docs): only load modules if package has entry point by @erickzhao in #2981
  • fix: generate custom docs sidebar by @VerteDinde in #2974
  • fix(template-typescript-webpack): use new plugin syntax by @georgexu99 in #2989
  • fix(template-webpack): use new plugin syntax by @georgexu99 in #2990
  • fix(template-typescript-webpack): preload file to webpack config by @fredrikj31 in #2936

Other Changes

Full Changelog: v5.1.1...v6.0.0