This commit is contained in:
George Xu 2022-10-24 15:00:01 -07:00
Родитель f0c47d2153
Коммит fc894c6fac
Не найден ключ, соответствующий данной подписи
1 изменённых файлов: 73 добавлений и 9 удалений

Просмотреть файл

@ -29,9 +29,11 @@ A stable release means that we are done making major breaking changes, and that
If your app already uses an existing build tooling solution that provides packaging and publishing capabilities, the benefits associated with adopting Electron Forge can still outweigh the initial switching cost.
Electron Forge will receive features from the latest Electron tooling updates as soon as they come out. This means that alongside the implicit features and plugins that Forge provides, users won't need to wire in new tooling support themselves, or wait for that support to be eventually implemented by other packages before upgrading. This reduction in the burden of maintenance for Forge applications has already been observed when Electron released `@electron/universal` [support](https://github.com/electron/universal) as well as [ASAR Integrity checking](https://www.electronjs.org/docs/latest/tutorial/asar-integrity), which were features that Forge supported out of the box.
We believe there are two main advantages to using Forge:
In addition, Forge was built with the intention of supporting custom plugins, makers and publishers. Forge's extensible API design means that you can write your own additional build logic for any advanced use cases that you may require. For more details, see the [Extending Electron Forge] section of the docs.
1. *Forge receives new features for application building as soon as they are supported in Electron*. This means that alongside the implicit features and plugins that Forge provides, users won't need to wire in new tooling support themselves, or wait for that support to be eventually implemented by other packages before upgrading. This reduction in the burden of maintenance for Forge applications has already been observed when Electron released `@electron/universal` [support](https://github.com/electron/universal) as well as [ASAR Integrity checking](https://www.electronjs.org/docs/latest/tutorial/asar-integrity), which were features that Forge supported out of the box.
2. *Forge's multi-package architecture makes it easier to understand and extend.* Forge was built with the intention of supporting custom plugins, makers and publishers. Since Forge is made up of so many smaller packages with clear responsibilities, it is easier to follow code flow. In addition, Forge's extensible API design means that you can write your own additional build logic separate from the provided configuration options for advanced use cases. For more details on extensibility, see the [Extending Electron Forge] section of the docs, or visit the ["Why Electron Forge"](https://www.electronforge.io/core-concepts/why-electron-forge) section of our docs to learn more about the benefits that Forge offers.
## Introducing the webpack plugin
@ -78,18 +80,80 @@ Forge will try to migrate from Electron Forge v5 automatically as much as possib
Manual migration details can be found in the Forge [import documentation]. Further help can be offered in our [Discord](https://discord.gg/f4cH9BzaDw).
## Breaking changes since beta:
## Breaking changes:
Forge has spent a considerable time in beta development; this is a list of breaking changes made in recent betas, 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 [here](https://github.com/electron-userland/electron-forge/blob/main/CHANGELOG.md)_.
- removed `@electron-forge/template-typescript` template ([#2948](https://github.com/electron-userland/electron-forge/commit/fc9421d513300b98c987af41ae71cb5d7e696fd1))
- removed `install` command ([#2958](https://github.com/electron-userland/electron-forge/commit/6b215b0c1d91c998bb2ab953b502e87868527ed9))
- renamed the default repository branch from `master` to `main` ([#2946](https://github.com/electron-userland/electron-forge/commit/d28974e35b5e64aa94e6cc53dce36c8e53f5b5bf))
- renamed `electronRebuildConfig` to `rebuildConfig` ([placeholdercommitmsg](https://github.com/electron-userland/electron-forge/pull/2963))
- renamed `identity-validation` to`identityValidation` ([#2959](https://github.com/electron-userland/electron-forge/commit/dba9359026b6b72479bff8133ec0c2c2e05d5595))
#### Changed plugin configuration syntax ([#2963](https://github.com/electron-userland/electron-forge/pull/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.
```diff
{
plugins: [
- [
- '@electron-forge/plugin-webpack',
- { /* ... */ }
- ]
+
+ {
+ name: '@electron-forge/plugin-webpack',
+ config: { /* ... */ }
+ }
]
}
```
#### Prefer forge.config.ts over package.json config ([#2991](https://github.com/electron-userland/electron-forge/commit/777197e5))
- This change affects the init and import commands. It changes these commands to create a forge.config.js rather than creating config.forge in your package.json.
- The internal signature of `Plugin.getHook(name)` has been changed to `Plugin.getHooks(name)` [#2995](https://github.com/electron/forge/pull/2995) as part of these changes.
- This is considered a breaking change for any third-party templates because the base template no longer sets up a config.forge object, and any template-specific mutations to the Forge config should instead be performed on the forge.config.js file.
- templates that mutated the Forge config within `package.json` will need to instantiate their own `forge.config.js` or `forge.config.ts`
#### Upgraded Maker Wix dependency to `electron-wix-msi@5.0.0` ([3008](https://github.com/electron/forge/pull/3008)))
- This upgrade includes a rename from `appIconPath` to `icon` in the config ([#153](https://github.com/electron-userland/electron-wix-msi/pull/153)).
#### Upgraded Node.js to 14 LTS ([#2921](https://github.com/electron/forge/pull/2921))
#### Upgraded Package dependency to `electron-packager@17` ([#2978](https://github.com/electron-userland/electron-forge/pull/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](https://github.com/electron/osx-sign/blob/main/MIGRATION.md) doc for a 1:1 conversion from the old config options to the new ones.
#### Renamed Electron Rebuild config ([#2963](https://github.com/electron-userland/electron-forge/pull/2963))
For consistency with the `packagerConfig` option for `electron-packager`, the field to configure `electron-rebuild` has now been shortened to `rebuildConfig`.
```diff
{
- electronRebuildConfig: { /* ... */ }
+ rebuildConfig: { /* ... */ }
}
```
#### Renamed `identity-validation` to`identityValidation` ([#2959](https://github.com/electron-userland/electron-forge/pull/2959))
The field to configure `identity-validation` has now been shortened to `identityValidation`.
```diff
{
- identity-validation: ""
+ identityValidation: ""
}
```
#### removed `@electron-forge/template-typescript` template ([#2948](https://github.com/electron-userland/electron-forge/commit/fc9421d513300b98c987af41ae71cb5d7e696fd1))
#### Removed `install` command ([#2958](https://github.com/electron-userland/electron-forge/commit/6b215b0c1d91c998bb2ab953b502e87868527ed9))
## A call to action:
Tell us what you need! The Electron Forge Team is always looking to build the project to better suit its users. You can help us improve Electron Forge by submitting feature requests, posting issues, or just letting us know your feedback!
Tell us what you need! The Electron Forge Team is always looking to build the project to better suit its users. You can help us improve Electron Forge by submitting feature requests, posting [issues](https://github.com/electron/forge/issues), or just letting us know your feedback!
<!-- links -->