Git Product home page Git Product logo

electron-boilerplate's People

Contributors

alexdevero avatar antoinepairet avatar anubhavsahoo avatar black-snow avatar brandonhamilton avatar carlosperate avatar coskuntekin avatar crucialfelix avatar danschultzer avatar eisenkolb avatar high5 avatar idleberg avatar ingro avatar jonatasfreitasv avatar lazamar avatar misteral avatar mkostas avatar orthographic-pedant avatar pkunze avatar plrthink avatar rodrigok avatar romannekhor avatar schultzer avatar simonsarris avatar szwacz avatar thom-x avatar tkdave avatar turadg avatar tyv avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

electron-boilerplate's Issues

plans of having a livereload feature?

first off, thank you for making this amazing boilerplate! really big help for starters like me on electron.
anyway, my question is, do you have plans on putting livereload feature in this boilerplate?

I was trying to integrate electron-connect (https://github.com/Quramy/electron-connect), but as a newbie, i am having a hard time putting it all together.

Thanks!

Fail to release package distribution on Windows 7

After checking out the project and had installded the NSIS of version 3.0b2 , I got the error when npm run release

Error: Can't change target charset after data already got compressed or header already changed!
Error in script "C:\workspace\git\electron-boilerplate\tmp\installer.nsi" on line 39 -- aborting creation process

Generate new files

Hi! I have created an app that replicates a database's tables to json files. I want to release this app as an executable. The problem is that after the script is compiled, I can't create the files. All the app files are inside the "app" folder. What should I do?

Cluster Terminates on Production Release Only

I have an application that creates a cluster [fork] and sends a message to it. The app works fine for development build on Windows and Ubuntu. I then create a release (npm run release) and things change. If I run the application from the Windows start menu or doubl-click the file in Explorer the program runs but the cluster terminates immediately after going online with an exit code of 1. If I run the same application again but from the command line it works without a problem--the cluster does not terminate. The same thing happens in Ubuntu--fails from dash, works from the terminal.

I wasn't sure if you may have seen this or it is a symptom of the release process. If not I can post something to the electron github. As always, thanks for your time and any support.

Configuration file

I have this config.js file:

var config = {};

config.twitter = {};
config.redis = {};
config.web = {};

config.default_stuff =  ['red','green','blue','apple','yellow','orange','politics'];
config.twitter.user_name = process.env.TWITTER_USER || 'username';
config.twitter.password=  process.env.TWITTER_PASSWORD || 'password';
config.redis.uri = process.env.DUOSTACK_DB_REDIS;
config.redis.host = 'hostname';
config.redis.port = 6379;
config.web.port = process.env.WEB_PORT || 9980;

module.exports = config;

The file is located inside the app folder. I am trying to include it like this inside my app.js file:

var config = require('./config');

But I keep getting this error:
Uncaught Error: Cannot find module './config'

What am I doing wrong?

Using requirejs and Babel in main process

I'm a Electron and web tech beginner, and found this project very helpful as a starter kit. The app I'm developing can save and load a config file from disk. This has to be done from the main process, so I set up an IPC system.

Only the render process has access to requirejs as far as I can tell. If the main process would have access as well, it could be transpiled through Babel and use new ES6 features. It would also allow sharing code between the processes easier.

I currently have all main process code separated into app/main/, which is excluded from transpilation.

  • Why isn't ES6 enabled for the main process?
  • Should it be enabled?

Related to #22

exposing modules to the global namespace

I'm trying to expose a module imported in app.js:

import * as asInterface from './fontend/lib/asInterface';

in my app.html i have:

requirejs(['app'], function(app) {
window.app = app;
});

however app here is undefined, i imagine because app.js doesn't have a return value.

How do I modify the gulp task or project so that I can export an es6 module i've written to the global namespace?

Transpiling not compatible with the preload option on BrowserWindow

The preload option is not working due to the build script:

mainWindow = new BrowserWindow({
    // ... other options
    preload: path.join(__dirname, '/myPreloadedScript.js')

The built version (found under /build folder) is wrapped inside define(['exports'], function (exports) { leading to the following error:

ReferenceError: define is not defined
    at Object.<anonymous> (C:\electronApp\build\myPreloadedScript.js:1:63)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\electronApp\node_modules\electron-prebuilt\dist\resources\atom.asar\renderer\lib\init.js:94:7)
    at Object.<anonymous> (C:\electronApp\electronApp\node_modules\electron-prebuilt\dist\resources\atom.asar\renderer\lib\init.js:106:4)
    at Module._compile (module.js:430:26)(anonymous function) @ C:\electronApp\electronApp\node_modules\electron-prebuilt\dist\resources\atom.asar\renderer\lib\init.js:101

Preloaded js file should not be transpiled.
One PR will follow

TypeError: app.getPath is not a function

I followed your quick start instructions and I'm hitting an error after I run npm start on OSX

I'm running node v0.12.4.

$ npm start

> @ start /Users/vinny/Projects/Personal/electron-boilerplate
> node ./tasks/start

[21:05:53] Using gulpfile ~/Projects/Personal/electron-boilerplate/gulpfile.js
[21:05:53] Starting 'clean'...
[21:05:53] Finished 'clean' after 3.66 ms
[21:05:53] Starting 'transpile'...
[21:05:53] Starting 'less'...
[21:05:53] Starting 'copy'...
[21:05:53] Starting 'finalize'...
[21:05:53] Finished 'finalize' after 2.72 ms
[21:05:53] Finished 'less' after 87 ms
[21:05:53] Finished 'transpile' after 122 ms
[21:05:53] Finished 'copy' after 239 ms
[21:05:53] Starting 'build'...
[21:05:53] Finished 'build' after 11 μs
/Users/vinny/Projects/Personal/electron-boilerplate/app/vendor/electron_boilerplate/window_state.js:12
    var userDataDir = jetpack.cwd(app.getPath('userData'));
                                      ^
TypeError: app.getPath is not a function
    at module.exports (/Users/vinny/Projects/Personal/electron-boilerplate/app/vendor/electron_boilerplate/window_state.js:12:39)
    at Object.<anonymous> (/Users/vinny/Projects/Personal/electron-boilerplate/app/main.js:12:23)
    at Module._compile (module.js:418:26)
    at Object.Module._extensions..js (module.js:436:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:298:12)
    at Module.require (module.js:353:17)
    at require (module.js:372:17)
    at Object.<anonymous> (/Users/vinny/Projects/Personal/electron-boilerplate/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/api/lib/dialog.js:11:9)
    at Object.<anonymous> (/Users/vinny/Projects/Personal/electron-boilerplate/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/api/lib/dialog.js:153:4)
[21:05:54] Using gulpfile ~/Projects/Personal/electron-boilerplate/gulpfile.js
[21:05:54] Starting 'watch'...
[21:05:54] Finished 'watch' after 114 ms

Here's the output from the npm install:

$ npm install
npm WARN package.json @ No repository field.
npm WARN package.json @ No license field.
npm WARN peerDependencies The peer dependency stream-browserify@* included from bl will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
\
> [email protected] install /Users/vinny/Projects/Personal/electron-boilerplate/node_modules/appdmg/node_modules/fs-xattr
> node-gyp rebuild

  CXX(target) Release/obj.target/xattr/src/xattr.o
  SOLINK_MODULE(target) Release/xattr.node

> [email protected] postinstall /Users/vinny/Projects/Personal/electron-boilerplate/node_modules/electron-prebuilt
> node install.js

|
> [email protected] install /Users/vinny/Projects/Personal/electron-boilerplate/node_modules/appdmg/node_modules/ds-store/node_modules/macos-alias
> node-gyp rebuild

  CXX(target) Release/obj.target/volume/src/volume.o
  SOLINK_MODULE(target) Release/volume.node

> @ postinstall /Users/vinny/Projects/Personal/electron-boilerplate
> node ./tasks/app_npm_install

npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No license field.
[email protected] node_modules/fs-jetpack
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])
[email protected] node_modules/rcedit

[email protected] node_modules/q

[email protected] node_modules/yargs

[email protected] node_modules/asar
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected])

[email protected] node_modules/gulp-util
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/fs-jetpack
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])

[email protected] node_modules/vinyl-map
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected])

[email protected] node_modules/gulp
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/esperanto
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])

[email protected] node_modules/gulp-less
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/electron-prebuilt
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/appdmg
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])

failed in app_npm_install task

Hi, I am trying to build a windows app using this boilerplate, but I get some trouble in installing dependencies. Errors shows below:

plrth_000@PLRTHINK-PC ~/Desktop/electron-boilerplate (master)
$ npm install
npm WARN package.json @ No repository field.
npm WARN optional dep failed, continuing [email protected]
/
> [email protected] postinstall c:\Users\plrth_000\Desktop\electron-boile
rplate\node_modules\electron-prebuilt
> node install.js

/
> @ postinstall c:\Users\plrth_000\Desktop\electron-boilerplate
> node ./tasks/app_npm_install


events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)

npm ERR! @ postinstall: `node ./tasks/app_npm_install`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the @ postinstall script.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./tasks/app_npm_install
npm ERR! You can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd c:\Users\plrth_000\Desktop\electron-boilerplate
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\Users\plrth_000\Desktop\electron-boilerplate\npm-debug.log
npm ERR! not ok code 0

I am running nodev0.10.36 on windows8.1.

"define is not defined"

I have a separate js file to control the menu of my app. Inside the app folder, the file is fine, but when I run npm start, the file in the build folder has a random "define(function () {" added to it, which causes an error and for the file to be ignored. Is this a bug, or am I doing something wrong?

Another alternative to setting npm_config_arch=ia32 on 64-bit Windows

Another alternative to setting the environment variable npm_config_arch to ia32 on 64-bit Windows is to have 32-bit Node.js (and npm) installed.

This is what I do since it's easy to switch between versions of Node.js and different architectures using nvm-windows.

(Related but off-topic note: If you use nvm-windows, I recommend running npm cache clear before switching to a different version/arch of Node.js)

After adding a couple libraries, gulp is extremely slow

I installed jquery and semantic-ui to my project by adding the following dependencies into app/package.json:

"jquery": "1.11.3",
"semantic-ui": "2.1"

When I do npm start, I see the following:

[22:43:53] Using gulpfile ~/Documents/analyzerii/gulpfile.js
[22:43:54] Starting 'clean'...
[22:43:54] Finished 'clean' after 4.43 ms
[22:43:54] Starting 'bundle'...
[22:43:54] Starting 'less'...
[22:43:54] Starting 'copy'...
[22:43:54] Starting 'finalize'...
[22:43:54] Finished 'finalize' after 11 ms
[22:43:54] Finished 'bundle' after 105 ms
[22:43:54] Finished 'less' after 136 ms
[22:44:39] Finished 'copy' after 45 s
[22:44:39] Starting 'build'...
[22:44:39] Finished 'build' after 14 μs

Why is "copy" taking 45s? Also, assuming this is just copying some files, why does it take so much of my cpu time and spin up my fans?

SyntaxError: Bad character escape sequence

I'm just trying run this project on Windows 10 - 64bits, Node 5.0.0.
The npm install command is OK, but when I run npm start, I'm getting this error:

[20:20:38] Using gulpfile ~\Documents\electron-boilerplate\gulpfile.js
[20:20:38] Starting 'clean'...
[20:20:38] Finished 'clean' after 4.74 ms
[20:20:38] Starting 'bundle'...
[20:20:38] Starting 'less'...
[20:20:38] Starting 'copy'...
[20:20:38] Starting 'finalize'...
[20:20:38] Finished 'finalize' after 2.03 ms
{ [SyntaxError: Bad character escape sequence (1:42) in C:\Users\user\Documents\electron-boilerplate\app\background.js]
  pos: 42,
  loc: Position { line: 1, column: 42 },
  raisedAt: 42,
  code: 'PARSE_ERROR',
  file: 'C:\\Users\\user\\Documents\\electron-boilerplate\\app\\background.js' }
{ [SyntaxError: Bad character escape sequence (1:42) in C:\Users\user\Documents\electron-boilerplate\app\app.js]
  pos: 42,
  loc: Position { line: 1, column: 42 },
  raisedAt: 42,
  code: 'PARSE_ERROR',
  file: 'C:\\Users\\user\\Documents\\electron-boilerplate\\app\\app.js' }
[20:20:38] Finished 'less' after 92 ms
[20:20:39] Finished 'copy' after 377 ms
[20:20:40] Using gulpfile ~\Documents\electron-boilerplate\gulpfile.js
[20:20:40] Starting 'watch'...
[20:20:40] Finished 'watch' after 430 ms

npm start error

Im getting the below error while running npm start:

C:\Users\arun\Documents\GitHub\electron-boilerplate>npm start

> @ start C:\Users\arun\Documents\GitHub\electron-boilerplate
> node ./tasks/start

fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'C:\Users\arun\Documents\GitHub\electron-boilerplate\node_modules\electron-prebuilt\path.txt'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at Object.<anonymous> (C:\Users\arun\Documents\GitHub\electron-boilerplate\node_modules\electron-prebuilt\index.js:4:21)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\arun\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.1.1
npm ERR! npm  v2.11.0
npm ERR! code ELIFECYCLE
npm ERR! @ start: `node ./tasks/start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script 'node ./tasks/start'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./tasks/start
npm ERR! You can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\arun\Documents\GitHub\electron-boilerplate\npm-debug.log

The `watch` tasks seems to be running in the background even after the app is closed

Try these steps to reproduce this issue:

  1. Clone the repo
  2. Run npm install at the root of the repo
  3. Run npm start to start the electron app
  4. Close the app - the terminal window will also show the prompt (giving the indication that all the background tasks are terminated)
  5. Make a trivial whitespace change to /app/hello_world/hello_universe.js and save
  6. Notice that the terminal window will start the transpile-watch task
$ [12:37:26] Starting 'transpile-watch'...
[12:37:26] Finished 'transpile-watch' after 47 ms

Testing this with the latest commit as of now on a Mac, with node and npm versions as below:

$ node -v
v0.12.4

$ npm -v
2.11.3

Built-in sample code for Notifications

It would be great if a sample built-in code for Windows Notifications is provided.
Also I have a doubt. Does electron support Windows 7 notification ?

32 bit builds?

Is there anything special I need to know in order to create 32-bit builds using this project?

requirejs related question

First, thanks so much for the great bolilerplate, it has been great for a newbie of web programming to begin creating a cross platfore app with Electron.

I am working to add AngularJS and jQuery EasyUI support to the boilerplate. For easyui support I was able to add without any special requirejs problems or dependencies--later I need to refactor that to also use requirejs. However, I am adding AngularJS has brought about some questions with requirejs and I was hoping you could offer some suggestions.

I am now adding a requirejs.config statement to the boilerplate in the hopes of defining the correct requirejs layout/configuration for my app. Where would you envision this going? I have changed the boilerplate a bit in an attempt to getting just the requirejs dependencies working but I find some files get parsed but the define/function is not executed.

  • I have no changes to ./app/main.js
  • I have modified the ./app/app.html to be:
<!doctype html>
<html>
<head>
    <title>Electron Boilerplate</title>
</head>
<body >
    <h1>Hello World!</h1>
    <script data-main="require_config" src="vendor/require.js"></script>
</body>
</html>
  • My new file, ./app/require_config.js looks like:
console.log("REQUIRE_CONFIG.JS-------------"+requirejs.version);
requirejs.config({
    paths: {
    'myapp': './js/myapp'
  },
  // kick start application
  deps: ['./bootstrap']
});
  • My new file, boostrap.js is meant to manually bootstrap AngularJS, etc.
 console.log("BOOTSTRAP.JS1-------------");
 define( ['myapp'], function (myapp) {
      'use strict';
     console.log("BOOTSTRAP.JS2+++++++++++++");
 });
  • For an example, I have the bootstrap now have a dependency on a new file, myapp.js. This file would create the AngularJS application file.
console.log("MYAPP.JS-------------");
define([], function () {
  'use strict';
  console.log("MYAPP.JS+++++++++++++");
});

NOTE: My modified code doesn't use your original app.js. I am only trying to test/target requirejs.

After running this example I find:

[1262:0917/172739:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[1291:0917/172739:INFO:renderer_main.cc(200)] Renderer process started
[1295:0917/172739:INFO:renderer_main.cc(200)] Renderer process started
[1262:0917/172740:INFO:CONSOLE(4)] "REQUIRE_CONFIG.JS-------------2.1.20", source: file:///home/swdev/projects/build/require_config.js (4)
[1262:0917/172740:INFO:CONSOLE(4)] "BOOTSTRAP.JS1-------------", source: file:///home/swdev/projects/build/bootstrap.js (4)

The require_config.js and bootstrap.js are processed but the define/function is not executed. Furthermore, the app,js is not parsed at all. I have also removed the myapp dependency within bootloader.js to be define( [], function () { but this didn't work either.

Could the problem here be related to requirejs or something other interaction with node.js/babel/etc? Any ideas or suggestions on what the problem might be and/or how you envision extending the requirejs infrastructure here would be much appreciated. Thanks in advanced for the time.

Use of requirejs() vs <script> tags

I've been trying to build on your repo to develop my own understanding of TDD when making an Electron App (your repo is the best integrated solution I've found)

I'm wondering if you could explain how you picture the requirejs() function working in the index.html. I was under the impression that requirejs helped managed loading all javascripts, however app.html still includes <script src= ...> tags. Also app.js (which is loaded by require) also includes module loading therein.

Is the intention for app.js to act as a central javascript file where all modules (either ES6 module pattern or commonJS pattern) are loaded that will be used by the webpage. It would be helpful to understand the javascript module loading pattern intended

ipc error when closing app on Windows

I'm consistently seeing ERROR:ipc_channel_win.cc(138)] pipe error: 109 when I close the app on Windows.

Running Node v0.12.5 on Windows 8.1.

C:\Projects\ebp [master]> npm start

> @ start C:\Projects\ebp
> node ./tasks/start

[22:16:44] Using gulpfile C:\Projects\ebp\gulpfile.js
[22:16:44] Starting 'clean'...
[22:16:44] Finished 'clean' after 51 ms
[22:16:44] Starting 'transpile'...
[22:16:44] Starting 'less'...
[22:16:44] Starting 'copy'...
[22:16:44] Starting 'finalize'...
[22:16:44] Finished 'finalize' after 5.53 ms
[22:16:45] Finished 'less' after 102 ms
[22:16:45] Finished 'transpile' after 154 ms
[22:16:45] Finished 'copy' after 547 ms
[22:16:45] Starting 'build'...
[22:16:45] Finished 'build' after 16 μs
[11080:0628/221646:INFO:renderer_main.cc(200)] Renderer process started
[7468:0628/221646:INFO:renderer_main.cc(200)] Renderer process started
[22:16:46] Using gulpfile C:\Projects\ebp\gulpfile.js
[22:16:46] Starting 'watch'...
[22:16:47] Finished 'watch' after 487 ms
[[11080:0628/221705:ERROR:ipc_channel_win.cc(138)] pipe error: 109
7468:0628/221705:ERROR:ipc_channel_win.cc(138)] pipe error: 109

C:\Projects\ebp [master]>

NSIS, Windows and UTF-8

Currently the NSIS doesn't do well with Hungarian characters. Even after creating the script file for the NSIS the character encoding is great, but in the installer and later in the path the characters are messed up.
For example:
TerĂĽlet számolás should be Terület számolás

I've found this little NSIS addon: http://nsis.sourceforge.net/Utf8Converter but I haven't got the faintest on how start using it... any help would be welcome 😄

Babel Support

Any chance you could add Babel support for those of us who want to use ES6 within the Application?

few questions

Hi Jakub,

Thanks for this project, as I have been struggling with somewhat official electron-starter. This boilerplate worked so great and set up was a breeze. I have couple of questions.

  1. How do you compare with electron-starter. I think they build the electron itself to customize the menu icons,... Any tradeoff I need to be aware of.
  2. Is there a way not to distribute the application in source format. electron doc mentions they have asar for that. Can you incorporate that in your release pipeline? or atleast minify the source files.
  3. What is the best way to get rid of all the chrome menus. In the release version, I see a file default_app.js with these menus configured but not sure a way to specify in my app.

Thanks again for your effort. I was a lifesaver :-)

Cheers.
bsr

Why two package.json?

Hi, thanks for the awesome template for me to kickstart electron development!
I have a question that why do you use two package.json, one for development, one for distribution, as package.json already has devDependencies for us to declare development dependencies?

Thanks :)

`npm run release` failed on windows

When I run npm run release on my Windows, I got the following error message.

E:\code\nodejs\electron-boilerplate>npm run release

> @ release E:\code\nodejs\electron-boilerplate
> gulp release --env=production

[10:49:29] Using gulpfile E:\code\nodejs\electron-boilerplate\gulpfile.js
[10:49:29] Starting 'clean'...
[10:49:30] Finished 'clean' after 141 ms
[10:49:30] Starting 'transpile'...
[10:49:30] Starting 'less'...
[10:49:30] Starting 'copy'...
[10:49:30] Starting 'finalize'...
[10:49:30] Finished 'finalize' after 23 ms
[10:49:30] Finished 'less' after 186 ms
[10:49:30] Finished 'transpile' after 299 ms
[10:49:31] Finished 'copy' after 1.24 s
[10:49:31] Starting 'build'...
[10:49:31] Finished 'build' after 14 µs
[10:49:31] Starting 'release'...
[10:49:37] Building installer with NSIS...
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn makensis ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "release"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! @ release: `gulp release --env=production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ release script 'gulp release --env=production'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp release --env=production
npm ERR! You can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\code\nodejs\electron-boilerplate\npm-debug.log

E:\code\nodejs\electron-boilerplate>

The content of E:\code\nodejs\electron-boilerplate\npm-debug.log is belows

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prerelease', 'release', 'postrelease' ]
5 info prerelease @
6 info release @
7 verbose unsafe-perm in lifecycle true
8 info @ Failed to exec release script
9 verbose stack Error: @ release: `gulp release --env=production`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid @
11 verbose cwd E:\code\nodejs\electron-boilerplate
12 error Windows_NT 6.3.9600
13 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "release"
14 error node v0.12.4
15 error npm  v2.10.1
16 error code ELIFECYCLE
17 error @ release: `gulp release --env=production`
17 error Exit status 1
18 error Failed at the @ release script 'gulp release --env=production'.
18 error This is most likely a problem with the  package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     gulp release --env=production
18 error You can get their info via:
18 error     npm owner ls
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

My OS is Win8.1 x64, and node/npm version is

E:\code\nodejs\electron-boilerplate>node -v
v0.12.4

E:\code\nodejs\electron-boilerplate>npm -v
2.10.1

E:\code\nodejs\electron-boilerplate>

use of 'app' twice

The first time for the electron API app object (render-side), the second time for the requirejs module (browser-side).
I didn't understand the difference at first, but after reading the excellent Electron api docs this became clear. I would suggest renaming the app.js file to something like: mymodule.js or something?

add .bowerrc file?

would be nice to add a .bowerrc file, setting the working dir to app:

{
  "cwd" : "app"
}

Problem Launching from Ubuntu Unity

I had a situation where I could properly run the application from the terminal and double click the app in the nautilus window. However, launching from the Ubuntu Unity would give me a failure. After some looking it seems the app.desktop needs the following:

Path=/opt/{{name}}/

If you'd prefer I could fork and use a pull request. Seemed like a simple change so I didn't do the fork, etc.

Error when making a release

On Windows 7, when I make for distribution installer with command: npm run release, I got error.
Failed at the @ release script 'gulp release --env=production

Here the contain of npm-debug.log file

0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Applications\\nodejs\\\\node.exe',
1 verbose cli   'D:\\Applications\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prerelease', 'release', 'postrelease' ]
5 info prerelease @
6 info release @
7 verbose unsafe-perm in lifecycle true
8 info @ Failed to exec release script
9 verbose stack Error: @ release: `gulp release --env=production`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (D:\Applications\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (D:\Applications\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid @
11 verbose cwd C:\Users\lemoussel\SkyDrive\Electron\electron-boilerplate
12 error Windows_NT 6.1.7601
13 error argv "D:\\Applications\\nodejs\\\\node.exe" "D:\\Applications\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "release"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error @ release: `gulp release --env=production`
17 error Exit status 1
18 error Failed at the @ release script 'gulp release --env=production'.
18 error This is most likely a problem with the  package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     gulp release --env=production
18 error You can get their info via:
18 error     npm owner ls
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

how am I supposed to put my javascript files into folders?

I want to create a file electron-boilerplate/app/anyfolder/constants.js with content

module.exports = {
  a = 1,
  b = 2
}

Then use this file in main.js as follows:

var constants = require('./anyfolder/constants');

However I get

Uncaught Exception:
ReferenceError: define is not defined

error because in build directory constant.js's content is changed and starts with

define(['exports'], function (exports) {

What am I missing? Can't I use folders for javascripts to be used from main.js?

Required module not found in release app (Windows)

Hi there,

Thanks so much for this very helpful boilerplate.

I have got my project set up, and it works just fine when I using "npm start".

When I create a windows install file via "npm run release", my app builds but when I open it, I get an error that my kinect2 module can not be found.

I am trying to require the kinect2 module, which has native bindings. I tried to run npm run app-install -- kinect2 but got a node-gyp error on compilation. The kinect2 lib has it's own install script, which I ran inside the boilerplate directory, and it runs fine in test mode.

Hopefully, I'm just missing something silly and it's not being copied over.

Thanks!

Gulp Watch Errors Preventing App from Opening in Windows

I have a situation where I have added a directory (./app/sdk/...). Under this sdk directory I have Linux shared objects and Windows DLL's. I also have added "./sdk/**" to the ./tasks/build.js paths.copyFromAppDir. When I run under Linux I have no problems: files are copied and the app opens fine. However, if I change to Windows I get gulp errors and files do not copy:

[13:44:28] 'watch' errored after 649 ms
[13:44:28] Error: EPERM: operation not permitted, scandir 'Z:\work\tmp\hmi\app\sdk\linux\libanlzr.so.orig'
    at Error (native)
    at Object.fs.readdirSync (fs.js:813:18)
    at Glob._readdir (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:577:20)
    at Glob._process (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:379:15)
    at Glob.<anonymous> (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:403:14)
    at Array.forEach (native)
    at Glob.<anonymous> (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:402:9)
    at Glob._readdir (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:554:32)
    at Glob._process (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:379:15)
    at Glob.<anonymous> (Z:\work\tmp\hmi\node_modules\gulp\node_modules\vinyl-fs\node_modules\glob-watcher\node_modules\gaze\node_modules\globule\node_modules\glob\glob.js:403:14)

It seems the copy process fails to copy most of the files even though I don't see any other errors reported.

Also, just prior to the error being displayed I get a dialog box:

Error Opening App
"The app provided is not a valid...."

Error: Cannot find module: './vendor/electron_boilerplate/env_config'

If I remove the sdk directory all together, the problem goes away. Also, if I only remove the sdk/linux directory so no Linux shared libraries are found, the problem goes away.

Is there something else I need to configure so these offending files are not watched or copied? How can I get Windows to ignore the Linux directory? (or any directory for that matter). Thanks for the time and any suggestions.

Same project for Mac and Windows

Do I need separate project for Mac and Windows?

I am running virtual windows on Mac. I did following on MAC:

git clone https://github.com/szwacz/electron-boilerplate.git
cd electron-boilerplate
npm install
npm start

everything is fine. Can run, release.

The same application is not running from windows (i am using same project that i used to run from mac). Then I prepare another project for windows and it is running fine.

So, now i have 2 separate projects. one for MAC and another for Windows. Is it really required? Isn't it possible to release both platform build (Mac and Windows) from single project (that i am executing from MAC).

Windows 10: Error when trying to run blank boilerplate

I installed Node 4.2.1 and NSIS on Windows 10.

After npm install went through without errors, npm start produces the following output:

Z:\>npm start

> @ start Z:\
> node ./tasks/start

[13:10:54] Using gulpfile Z:\gulpfile.js
module.js:339
    throw err;
    ^

Error: Cannot find module 'Z:node_modules\gulp\index.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Liftoff.handleArguments (Z:\node_modules\gulp\bin\gulp.js:119:18)
    at Liftoff.<anonymous> (Z:\node_modules\gulp\node_modules\liftoff\index.js:192:16)
    at module.exports (Z:\node_modules\gulp\node_modules\liftoff\node_modules\flagged-respawn\index.js:17:3)
    at Liftoff.<anonymous> (Z:\node_modules\gulp\node_modules\liftoff\index.js:185:9)
    at Z:\node_modules\gulp\node_modules\liftoff\index.js:159:9
    at Z:\node_modules\gulp\node_modules\v8flags\index.js:99:14
[13:10:58] Using gulpfile Z:\gulpfile.js
module.js:339
    throw err;
    ^

Error: Cannot find module 'Z:node_modules\gulp\index.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Liftoff.handleArguments (Z:\node_modules\gulp\bin\gulp.js:119:18)
    at Liftoff.<anonymous> (Z:\node_modules\gulp\node_modules\liftoff\index.js:192:16)
    at module.exports (Z:\node_modules\gulp\node_modules\liftoff\node_modules\flagged-respawn\index.js:17:3)
    at Liftoff.<anonymous> (Z:\node_modules\gulp\node_modules\liftoff\index.js:185:9)
    at Z:\node_modules\gulp\node_modules\liftoff\index.js:159:9
    at Z:\node_modules\gulp\node_modules\v8flags\index.js:99:14

Special precautions for Windows

First, thank you for the great boilerplate. It makes it easy to get the right start with electron.

I wonder wich Path I have to set for a Windows Release. I installed NSIS and seted the System Environment like that

setx PATH "%PATH%;C:/Program Files (x86)/NSIS"

but like that I get the following error:

[13:06:28] Building installer with NSIS...

C:\Users\robert\Desktop\electron-boilerplate\tasks\release_windows.js:101
                + " added to PATH environment variable?";
                ^
Can't find NSIS. Are you sure you've installed it and added to PATH environment
variable?

npm ERR! Windows_NT 6.1.7601

Maybe you got a hint how the set the System Environment Variable correctly?

Thank you very much.

Used Jasmine version

Hi again :).

Could send the link of which has been downloaded the Jasmine version used ?

No version I tested, installed via bower or downloaded from Github worked.

ipc.send is not a function

in both files:

var ipc = require('ipc');

in main.js:

ipc.on('foo-foo', function () {
    console.log("Foo!");
});

in dev_helper.js:

label: 'File',
accelerator: 'CmdOrCtrl+N',
click: function () {
    ipc.send('foo-foo');
}

I get this error:
ipc.send is not a function..

Am I missing something?

Slow rendering

I have created an electron boilerplate app and I'm loading the CSS inside the page itself using

link rel="stylesheet" type="text/css" href="assets/css/style.css"

But it takes 1-2 seconds for the CSS to load. Can I preload the CSS somehow? Or create a preloader, I don't know... but the white flash looks really bad.

Where to put JS and CSS files to be included?

Hi! I am trying to add my own custom CSS and JS files. I know I can edit main.less and app.js, but I want to keep them as separate files. How can I do that?
I have tried to add new folders or even add new files to existing folders, but nothing works.
I have read the documentation, but I can't find the information which refers to that. Or I did not understand, because I'm not an English native. I don't know. So, please help!

Later edit: Please close or delete this issue. I've found the answer at #62

Understanding how to get React to work

Hey first of all this is a great boilerplate, I really appreciate the work you put into the different release processes, this makes everything much much simpler.

My current problem is I am not sure what is the best way to work React into this boilerplate. It seems that no matter what I do that it will error on any JSX code despite whether or not I load require("babel-core/register"); in any file. Is there an easy way to add this to your gulp file or is there some other way I can get this working.

Ideally I would be able to do import { HelloWorldComponent } from './hello_world/hello_world.js' where hello_world is a React component. Any thoughts on how to make this happen?

Distribute Cordova project Desktop App prepared using electron

Hello;

I'm new to electron and boilerplate. Earlier i was using nw.js to prepare desktop app of cordova based project. I am using browser platform as source to prepare desktop app.

I downloaded electron-boilerplate project and run it successfully on my mac. Now everytime I build / change my project files, i have to copy this files to electron-boilerplate directory and then have to run it. Is there any shortcut to do so? What is the best way to prepare build of my project? please note that my source directory is different then electron-boilerplate directory. I am using electron-boilerplate to prepare desktop apps build only.

app won't start

i installed everything as per the documentation on OSX 10.8 and get up to the npm start point, which exits after starting watch:

.../electron-boilerplate ► npm start

> @ start .../electron-boilerplate
> node ./tasks/start

[17:18:49] Using gulpfile .../electron-boilerplate/gulpfile.js
[17:18:49] Starting 'clean'...
[17:18:49] Finished 'clean' after 43 ms
[17:18:49] Starting 'transpile'...
[17:18:49] Starting 'less'...
[17:18:49] Starting 'copy'...
[17:18:49] Starting 'finalize'...
[17:18:49] Finished 'finalize' after 3.17 ms
[17:18:50] Finished 'less' after 143 ms
[17:18:50] Finished 'transpile' after 217 ms
[17:18:50] Finished 'copy' after 412 ms
[17:18:50] Starting 'build'...
[17:18:50] Finished 'build' after 12 μs
[17:18:51] Using gulpfile .../electron-boilerplate/gulpfile.js
[17:18:51] Starting 'watch'...
.../electron-boilerplate ► 

No application window is opened, and no error message is shown.

npm peer dependencies

On a fresh install of the electron-boilerplate using npm 2.10.1, apart from the expected warnings I get the following:

npm WARN peerDependencies The peer dependency stream-browserify@* included from bl will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

Might be worth adding explicit dependencies sooner rather than later?

Upgrade to rollup 0.21.0 to get much improved build error reporting

I just had one of those "something deep down in there is broken" errors.

All I was seeing was:

TypeError: _this10.module.locals.lookup(...).mark is not a function

but I don't know in what context that is.

tasks/build.js could be more helpful here:

}).catch(function(err) {
console.error('build: Error during rollup', err.stack);
});

That tells us where to look for what went wrong.

Then after I updated rollup I got a much nicer report:

Error during rollup [Error: Module /Users/crucial/code/idmx/models-of-self-organization/app/segregation/app.js does not export run (imported by /Users/crucial/code/idmx/models-of-self-organization/app/app.js)] Error: Module /Users/crucial/code/idmx/models-of-self-organization/app/segregation/app.js does not export run (imported by /Users/crucial/code/idmx/models-of-self-organization/app/app.js)
    at Module.trace (/Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:6711:28)
    at /Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:6358:81
    at Array.forEach (native)
    at /Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:6357:25
    at Array.forEach (native)
    at Module.bindReferences (/Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:6350:19)
    at /Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:7468:19
    at Array.forEach (native)
    at /Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:7467:19
    at tryCatch (/Users/crucial/code/idmx/models-of-self-organization/node_modules/rollup/dist/rollup.js:337:12)

and I know exactly what I screwed up.

Thanks for the boilerplate !

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.