GithubHelp home page GithubHelp logo

bpasero / gulp-atom-electron Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joaomoreno/gulp-atom-electron

0.0 1.0 0.0 1.04 MB

Gulp plugin for packaging Electron applications

JavaScript 100.00%

gulp-atom-electron's Introduction

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
    • 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
    • extensions - the CFBundleTypeExtensions value, a string array of file extensions
    • iconFile - the CFBundleTypeIconFile value
  • Linux

    • linuxExecutableName - overwrite the name of the executable in Linux

gulp-atom-electron's People

Contributors

joaomoreno avatar bpasero avatar weinand avatar christopherbock avatar jpalumickas avatar nasum avatar mathphreak avatar yshrsmz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.