FOLDER FORGE MAC MANUAL CODE
When you run command npm run make the Forge would read config from package.json ’s config → forge → packageConfig, the osxNotarize is for the Apple notarization, and oxsSign is for Apple code signing, there are other setting items available, actually forge would use these settings to invoke the underlying lib like electron-notarize electron-osx-sign electron-packager so you can find all those available settings from their repositories, respectively. The above command will modify your package.json automatically, some of them aren’t what you want, it would override the command npm start to execute forge instant of React, change it back, the final form of the script section in package.json will look like: "scripts": Īdd a file named ist, under the project root folder with content below: .allow-jit .allow-unsigned-executable-memory .debugger This command will add electron core, electron-forge into the project.
FOLDER FORGE MAC MANUAL INSTALL
So we need to import Electron and the package tool Forge into an existing React app.įirst, let's assume the React app has been created, (check React website for How-to), now install Electron-Forge: npm install -save-dev npx electron-forge import
In this real case, I created a React app first, now I consider wrap it with Electron, and release it to a self-website or App Store. I can only cover the macOS part, cuz I still have no experience of building apps on Windows, I will write that part when I managed on it.įirst, this is my real app running on macOS, Midinote, a note-taking app:Īnd to keep things simple, I also created an example repo for demonstration, the code is here: Add Electron to an existing project I also will explain some basic concepts or structures along the way, to let you know how it works.
FOLDER FORGE MAC MANUAL HOW TO
So I decided to write this article, it will cover the whole workflow from developing an app with Electron to how to release it, and all those troubles I have run into. Things shouldn’t be like this, it’s JUST A TOOL, it should be as simple as possible for people, we need to use our limited energy to deal with real hard work in programming, right?Īnd another reason that building an app with Electron is hard is that it concerns some concepts of the app specification and the workflow of releasing app on different platforms like macOS, Windows, App Store, and some basic understanding of the structure of the app.
I read almost all those official docs, but it is still hard to do things right, the official document seems not well organized, especially for some sub-modules that it’s using underlying, like the Forge - the library to package and release the Electron app - it seems like you are doing a puzzle game. But when I try to build my own product: the Midinote which is written by React and wrapped by the Electron. I am not a fan of reading and writing tutorials for libraries, I prefer to read the official document, and I think this is the best way to learn stuff rather than read some secondary source of tutorial. A real example of building Electron app: from scratch to release, and all those gotchas