• This repository has been archived on 20/Apr/2023
  • Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    JavaScript
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gulp plugin for packaging Electron applications

Deprecated

Please use the official way of requiring Electron: https://electronjs.org/docs/tutorial/first-app

--

gulp-atom-electron

Build Status

Installation

npm install --save-dev gulp-atom-electron

Usage

You can use this module in two distinct ways: to package your application and/or to download a version of Electron to disk.

How to Package Your Application

You should source your app's files using gulp.src and pipe them through gulp-atom-electron. The following task will create your application in the app folder, ready for launch.

var gulp = require("gulp");
var symdest = require("gulp-symdest");
var electron = require("gulp-atom-electron");

gulp.task("default", function () {
  return gulp
    .src("src/**")
    .pipe(electron({ version: "0.34.1", platform: "darwin" }))
    .pipe(symdest("app"));
});

Note: It is important to use gulp-symdest only because of the OS X platform. An application bundle has symlinks within and if you use gulp.dest to pipe the built app to disk, those will be missing. symdest will make sure symlinks are taken into account.

Finally, you can always pipe it to a zip archive for easy distribution. joaomoreno/gulp-vinyl-zip is recommended:

var gulp = require("gulp");
var zip = require("gulp-vinyl-zip");
var electron = require("gulp-atom-electron");

gulp.task("default", function () {
  return gulp
    .src("src/**")
    .pipe(electron({ version: "0.34.1", platform: "darwin" }))
    .pipe(zip.dest("app-darwin.zip"));
});

How to Download Electron

There's also a very handy export electron.dest() function that makes sure you always have the exact version of Electron in a directory:

var gulp = require("gulp");
var electron = require("gulp-atom-electron");

gulp.task("default", function () {
  return electron.dest("electron-build", {
    version: "0.34.1",
    platform: "darwin",
  });
});

This will place a vanilla Electron build into the electron-build directory. If you run it consecutively and it detects that the version in the destination directory is the intended one, it will end up in a no-op. Else it will download the provided version and replace it.

Options

You must provide the following options:

  • version - the Electron version to use
  • platform - kind of OS (darwin, linux, win32)

The following options are optional:

  • quiet - suppress a progress bar when downloading

  • token - GitHub access token(to avoid request limit. You can grab it here)

  • arch - the processor architecture (ia32, x64)

  • Windows

    • winIcon - path to an .ico file
    • companyName - company name
    • copyright - copyright statement
  • Darwin

    • darwinIcon - path to an .icns file
    • darwinHelpBookFolder - the CFBundleHelpBookFolder value
    • darwinHelpBookName - the CFBundleHelpBookName value
    • darwinBundleDocumentTypes - (reference) array of dictionaries, each containing the following structure:
      • name - the CFBundleTypeName value
      • role - the CFBundleTypeRole value
      • ostypes - the CFBundleTypeOSTypes value, a string array
      • utis - the LSItemContentTypes value, a string array
      • extensions - the CFBundleTypeExtensions value, a string array of file extensions
      • iconFile - the CFBundleTypeIconFile value
    • darwinForceDarkModeSupport - Forces Mojave dark mode support to be enabled for older Electron versions
  • Linux

    • linuxExecutableName - overwrite the name of the executable in Linux

More Repositories

1

gifcap

Capture your screen to a GIF in your browser
TypeScript
1,363
star
2

thyme

The task timer for OS X.
Objective-C
577
star
3

deemon

Run a process in the background and attach to it
TypeScript
58
star
4

gulp-vinyl-zip

Streaming vinyl adapter for zip archives
JavaScript
22
star
5

vscode-javascript-notebooks

JavaScript & TypeScript Notebooks for VS Code
TypeScript
20
star
6

Green-Apples

Repository for small applications / plugins for Mac OS X
Python
15
star
7

gulp-azure-storage

Gulp plugin to download and upload files to/from the Azure blob storage
JavaScript
11
star
8

facilis

Send files through HTTP without hassle.
Python
9
star
9

resume

CSS
8
star
10

proxy-containers

Misc Docker containers running proxy servers
Shell
5
star
11

recipes

Recipes
5
star
12

gulp-symdest

Like gulp.dest, but handles symlinks
JavaScript
3
star
13

dotfiles

My dotfiles
Shell
3
star
14

safe-dependencies-action

JavaScript
2
star
15

advent-of-code-2017

Advent of Code 2017
JavaScript
2
star
16

ray-tracing-in-one-weekend

Rust
2
star
17

lsp-talk

Jupyter Notebook
2
star
18

test-pr-templates

Test repository for PR templates
2
star
19

vscode-settings

Settings for VS Code
Shell
2
star
20

encodings

Encoding samples
2
star
21

proxy-tests

Electron proxy tests
JavaScript
1
star
22

arduino-rgb-lamp

Arduino RGB Lamp
1
star
23

advent-of-code-2018

JavaScript
1
star
24

aoc2022

Jupyter Notebook
1
star
25

test-pr-actions

1
star
26

aoc2021

Advent of Code 2021
Jupyter Notebook
1
star
27

vscode-github-stats

JavaScript
1
star
28

node-mirror

Mirror for Node.JS builds
1
star
29

aoc2020

Advent of Code 2020
JavaScript
1
star
30

baerlis

JavaScript
1
star
31

vsobuild-test

Shell
1
star
32

vscode-user-config

1
star
33

code-update

Automatically update VS Code in Linux
JavaScript
1
star
34

logperf

JavaScript
1
star
35

cosmosdb-concurrency-tests

TypeScript
1
star
36

why-is-vscode-broken

JavaScript
1
star
37

speakup

The next-gen Standup app
TypeScript
1
star
38

EmptyWebApplication

A basic ASP .Net vNext web application
C#
1
star
39

vscode-theme-abyss

Abyss theme for Visual Studio Code
1
star
40

lox

TypeScript
1
star
41

node-libarchive

NodeJS bindings to libarchive
C++
1
star
42

Ideas

1
star
43

aoc-2023

Jupyter Notebook
1
star
44

homebridge-sonos-gds

Specific Homebridge plugin to play GDS.FM across all Sonos devices
TypeScript
1
star
45

libtag

Audio tag library for node.js.
CoffeeScript
1
star
46

Windows

Windows Setup
PowerShell
1
star
47

playground

1
star