"CRATE is based on a simple idea: You shouldn't have to build a box to put your code into a box. I looked for a boilerplate that did what I wanted for what felt like aeons (but it was actually only a few weeks), and eventually gave up and made one in the name of being more lazy later.
CRATE supports all the features I wanted (you might call it extremely opinionated, verging on bitchy) in a development environment and buildchain. My boilerplate had to be open source from top to bottom, support cross-platform building of distributable applications, allow hot-reloading in the Electron app during development, be written in as close to pure Typescript as was practical (there is literally one line of vanilla JavaScript in preload.js
, and I will get rid of it soon), include all the conveinece management functions as npm scripts that I would ever use regularly, and require the minimum number of keystrokes while still outputting easily readable useful information at the terminal, tell me when it was done building so I could walk away from the build command, have a development environment as similar as possible to the output app experience, have a universal user experience across all 3 desktop OSes, gitignore all the stuff I didn't want to track or think about that was specific to that application, work on all 3 desktop OSes, use bleeding-edge versions of my dependencies, auto-update the application, use the bare minimum number of dependencies, contain the minimum number of files, and just generally be complete enough that all I had to do was clone the repo and start adding my code.
Alright, I realize now looking at my list of requirements that CRATE is both highly opinionated and bitchy (but I'm okay with that, because it does all of those things). CRATE is the best way to build applications I've ever had the pleasure of working with, and I hope you find it useful in your projects." - VirtualEstatePlanner
To start your project, you should find and replace the following symbols project-wide in VS Code by hitting crtl-shift-f
(or command-shift-f
on macOS):
YOUR_GITHUB_USER
=> your github usernameYOUR_GITHUB_REPO
=> your application's github repository nameyour-package-name
=> your application's npm package nameYOUR_APP_SHORT_NAME
=> your application's shortened nameYOUR_PRODUCT_NAME
=> your application's human-readable product nameYOUR_APPLICATION_DESCRIPTON
=> your application's human-readable short descriptionYOUR_NAME
=> your human nameYOUR_EMAIL_ADDRESS
=> your email address
Then if you don't just want to stare at a spinning box icon on all 3 platforms you should probably develop your project:
- Run
npm i -g yarn
to install yarn globally - Install the
Debugger for Chrome
extension in VSCode. - Run
yarn
to install dependencies and configure the environment - Run
yarn develop
to start - (Optional, but highly recommended) Click and then click this green triangle:
- (Optional, but officially recommended by people who aren't me becuase I like to live dangerously and I am a rolling distro kind of guy) Replace all instances of
latest
with actual version numbers in all 3package.json
files, unless you like to live dangerously (or are a rolling-distro kind of guy, gal, or android death machine)
If you are developing on macOS and building executables for Windows (ugh, I know, but you should), install Docker for Mac.
If you are developing on linux and building executables for Windows (ugh, I know, but you still probably should), run curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
to install docker-ce on most distros.
If you are developing for deployment on the Mac App Store (because you don't want to be open source about life), find the field in package.json
located at "build": { "mac": { "identity": }}
on line 83 and replace the null
value with your Apple Developer ID.
Run yarn dist:linux
, yarn dist:linux-intel64
, or dist:linux-arm64
to make executables for linux in the binaries
directory (works on any platform)
Run yarn dist:mac
, yarn dist:mac-intel64
, or yarn dist:mac-arm64
to make executables for mac in the binaries
directory (only works on macOS)
Run yarn dist:win
, yarn dist:win-intel64
, or yarn dist:win-arm64
to make executables for windows in the binaries
directory (only works on windows)
Run yarn dist:win-docker
, yarn dist:win-docker-intel64
, or yarn dist:win-docker-arm64
, to make executable fors windows in the binaries
directory (works on macOS or linux)
(only works on macOS)
- Own an intel macOS computer (or maybe a Hackintosh)
- Be very lazy
- Make sure your docker daemon is running
- Run
yarn dist:all-working
to make executables for all platforms and architectures in thebinaries
directory - Your mac will tell you when it's done