:electron: A complete tool for building and publishing Electron applications
Перейти к файлу
Samuel Attard 026141c0c2
docs(README): fix license badge url
2016-12-03 23:57:53 +11:00
src Test both npm and yarn 2016-12-03 22:07:40 +11:00
test Test both npm and yarn 2016-12-03 22:07:40 +11:00
tmpl Implement initial make functionality. The 'zip' maker on all platforms 2016-12-03 20:05:08 +11:00
.cz.js feat(build): add git-cz for semantic versioned commits 2016-12-03 23:50:40 +11:00
.eslintignore Add tests 2016-10-06 01:50:40 +11:00
.eslintrc Fix linting 2016-12-03 16:23:06 +11:00
.gitignore Add tests 2016-10-06 01:50:40 +11:00
.npmignore Ignore src folder on NPM 2016-10-06 01:52:49 +11:00
.travis.yml Test both npm and yarn 2016-12-03 22:07:40 +11:00
LICENSE docs(LICENSE): add a license file 2016-12-03 23:55:46 +11:00
README.md docs(README): fix license badge url 2016-12-03 23:57:53 +11:00
gulpfile.babel.js Initial Commit 2016-10-06 01:42:02 +11:00
package.json feat(build): add git-cz for semantic versioned commits 2016-12-03 23:50:40 +11:00

README.md

Electron Forge

Build Status Commitizen friendly npm version npm license status

The simple way to get started with Electron

Let's do it!

npm install -g electron-forge
electron-forge init my-new-app
cd my-new-app
electron-forge start

Urgh, really... Another build tool

Funnily enough, no :D. This is not another build tool, electron-forge simply unifies the existing (and well maintained) build tools for Electron development into one, simple, easy to use package so that anyone can just jump right in to Electron development.

So what's the point

This project has a few main goals.

  1. Starting with Electron should be as simple as a single command
  2. Developers shouldn't have to worry about babel, browserify, webpack or any of that nonsense. Everything should just work for them out of the box.
  3. Everything from creating the project to packaging the project for release should be handled by one dependency in a standard way while still offering users maximum choice and freedom.

With these goals in mind, under the hood this project uses electron-compile. A tool that lets you use modern and futuristic langauges inside Electron without worrying about transpiling or build tooling.

So go on then... How do I use the thing :)

Glad you asked, it's beyond easy to get started with electron-forge.

npm install -g electron-forge
electron-forge init my-new-project

This command will generate you a brand new project folder and install all your NPM dependencies so you will be all set to go.

When you want to start your app it's as simple as

electron-forge start

Any args after "start" will be passed through to your application when it is launched.

And when you get round to packaging your application, all you have to do is:

electron-forge package

But I want to set [insert property here] to electron-packager

Good news, the package command also passes through any arguments you give it directly to electron-packager. So if you want the all the power, you have it.

CLI Usage

electron-forge --help

Running --help will give you a lot of the syntax that electron-forge expects.

Basically there are 4 top level commands to provide electron-forge.

  • init - Similar to git init and npm init. It creates a new project from scratch and sets everything up for you
  • lint - Run basic JS style linting across your application. Good for sanity checking your code.
  • package - Packages your application into a platform specific format. Windows will get .exe, macOS will get .app and so on.
  • start - Immediately launches your application