fix: use @electron-forge/cli hint for project resolution#3023
Merged
VerteDinde merged 1 commit intomainfrom Oct 31, 2022
Merged
fix: use @electron-forge/cli hint for project resolution#3023VerteDinde merged 1 commit intomainfrom
VerteDinde merged 1 commit intomainfrom
Conversation
We were falling back to the "best guess" behavior for the forge.config.js scenario, we can do better than best guess and infer a forge project based on a forge dependency
VerteDinde
approved these changes
Oct 30, 2022
1j01
added a commit
to 1j01/tracky-mouse
that referenced
this pull request
Apr 19, 2024
Removing `config.forge` from `package.json` made it give an error:
An unhandled rejection has occurred inside Forge:
Error: packageJSON.main must be set to a valid entry point for your Electron app
The error did not say what `package.json` file it was looking it, but
the issue was that it was finding the wrong `package.json` due to
guessing logic in `resolve-dir.ts` that only looked for the
`config.forge` keys in `package.json` when determining what
`package.json` to use, ignoring `forge.config.js`, and defaulting to
the outermost `package.json`, not the innermost one.
Update Electron Forge to v6.0.0-beta.71 which includes a change
which remedies the problem: electron/forge#3023
Now Electron Forge checks also for a dependency on `@electron-forge/cli`
and so finds the correct `package.json` again.
Now Electron Forge can actually use `forge.config.js`, and this fixes
the executable name, the icons in some cases, and other metadata,
as well as the `@electron-forge/publisher-github` plugin, presumably.
1j01
added a commit
to 1j01/tracky-mouse
that referenced
this pull request
Apr 20, 2024
Removing `config.forge` from `package.json` first made it give an error:
An unhandled rejection has occurred inside Forge:
Error: packageJSON.main must be set to a valid entry point for your Electron app
The error did not say what `package.json` file it was looking at, but
the issue was that it was finding the wrong `package.json` due to
guessing logic in `resolve-dir.ts` that only looked for the
`config.forge` keys in `package.json` when determining what
`package.json` to use, ignoring `forge.config.js`, and defaulting to
the outermost `package.json`, not the innermost one.
Update Electron Forge to v6.0.0-beta.71 which includes a change
which remedies the problem: electron/forge#3023
Now Electron Forge checks also for a dependency on `@electron-forge/cli`
and so finds the correct `package.json` again.
Now Electron Forge can actually use `forge.config.js`, and this fixes
the executable name, the icons in some cases, and other metadata,
as well as the `@electron-forge/publisher-github` plugin, presumably.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We were falling back to the "best guess" behavior for the forge.config.js scenario, we can do better than best guess and infer a forge project based on a forge dependency