-
Notifications
You must be signed in to change notification settings - Fork 48
Notes on Electron
Vadim Dyachenko edited this page Mar 6, 2021
·
1 revision
If you are building GMEdit from source code and choosing to use Electron binaries rather than the ones that come from GMEdit's itch/GH releases, the following may prove useful:
Grab the pre-built binaries from GitHub.
Commonly you'll want:
- electron-v#-win32-ia32.zip (Windows 32-bit, for compatibility)
- electron-v#-darwin-x64 (Mac x64)
- electron-v#-linux-x64 (Linux x64)
- Rename
/electron.exe
to/Editor.exe
(todo: pick a time to break people's shortcuts by renaming it to GMEdit.exe instead) - Use Resource Hacker to replace Icon Group 1 by resources/app/favicon.ico
- Use Resource Hacker to edit Version Info 1 to have GMEdit data, like
BLOCK "040904B0" { VALUE "CompanyName", "YellowAfterlife" VALUE "FileDescription", "GMEdit" VALUE "FileVersion", "<keep Electron version>" VALUE "InternalName", "Editor.exe" VALUE "LegalCopyright", "(c) YellowAfterlife" VALUE "OriginalFilename", "Editor.exe" VALUE "ProductName", "GMEdit" VALUE "ProductVersion", "<keep Electron version>" VALUE "SquirrelAwareVersion", "1" }
- Rename
/electron
to/GMEdit
. - Add an empty file called
GMEdit is an executable!
because people get confused.
- Rename
/Electron.app
to/GMEdit.app
- Replace
/GMEdit.app/Contents/Resources/electron.icns
by the one from/art/icon/electron.icns
All of the commands are to be executed in bin/
after doing the preceding steps;
7zip a Editor-App-Only.zip resources
Rename the win32 zip to be Editor-Win.zip;
7zip a Editor-Win.zip resources
Rename the Linux zip to be Editor-Linux.zip;
7zip a Editor-Linux.zip resources
Rename the Mac zip to be Editor-Mac.zip;
First-time setup (note: requires elevated command prompt):
mkdir GMEdit.app\Contents\Resources
mklink /D GMEdit.app\Contents\Resources\app resources\app
Subsequent packaging:
7zip a Editor-Mac.zip GMEdit.app
Not very useful unless you're me or doing a full-on fork, if we're being honest.
set /p ver=<buildnumber.txt
set /p date=<builddate.txt
gh release create "%ver%" Editor-Win.zip Editor-Linux.zip Editor-Mac.zip Editor-App-Only.zip -t "%date%"
itchio-butler push Editor-Win.zip yourname/gmedit:Editor --userversion-file builddate.txt
itchio-butler push Editor-Linux.zip yourname/gmedit:Editor-Linux --userversion-file builddate.txt
itchio-butler push Editor-Mac.zip yourname/gmedit:Editor-Mac --userversion-file builddate.txt
itchio-butler push Editor-App-Only.zip yourname/gmedit:Editor-App-Only --userversion-file builddate.txt
- Smart auto-completion
- Types
- JSDoc tags (incl. additional ones)
- @hint tag (mostly 2.3)
- `vals: $v1 $v2` (template strings)
- #args (pre-2.3 named arguments)
- ??= (for pre-GM2022 optional arguments)
- ?? ?. ?[ (pre-GM2022 null-conditional operators)
- #lambda (pre-2.3 function literals)
- => (2.3+ function shorthands)
- #import (namespaces and aliases)
- v:Type (local variable types)
- #mfunc (macros with arguments)
- #gmcr (coroutines)