sindresorhus / electron-boilerplate Goto Github PK
View Code? Open in Web Editor NEWBoilerplate to kickstart creating an app with Electron
License: MIT License
Boilerplate to kickstart creating an app with Electron
License: MIT License
Hi,
thanks for putting this together, I found it quite helpful.
Any chance of adding a very minimal test-environment for the generated app? I know, it requires some opinionated choice, but I believe it'd be good to have a working testing environment to start with (e.g. Grunt/Glue/Npm test task, example tests for both the renderer and the main process, etc..).
Thanks.
Depends on electron/packager#12
Using this boilerplate, if I attempt to generate a package for Windows, the process fails since the executable cannot access the app id in package.json.
https://github.com/sindresorhus/electron-boilerplate/blob/master/index.js#L17
I got stuck loading in Pushing Tags. I has been wait for around 15minutes but it's never ends.
Here is my package.json
{
"name": "com.aalfiann.electron_dev",
"productName": "Electron Dev",
"version": "1.1.3",
"description": "This is my personal project to research the feature of electron.js framework ",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/aalfiann/electron-dev.git"
},
"author": {
"name": "M ABD AZIZ ALFIAN",
"email": "[email protected]",
"url": "https://xxx.com"
},
"scripts": {
"postinstall": "electron-builder install-app-deps",
"lint": "xo",
"test": "npm run lint",
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder --macos --linux --windows",
"release": "np"
},
"dependencies": {
"electron-context-menu": "^0.12.1",
"electron-debug": "^3.0.0",
"electron-store": "^3.3.0",
"electron-unhandled": "^2.2.0",
"electron-updater": "^4.0.6",
"electron-util": "^0.12.0"
},
"devDependencies": {
"electron": "^5.0.4",
"electron-builder": "^20.43.0",
"np": "^5.0.3",
"xo": "^0.24.0"
},
"xo": {
"envs": [
"node",
"browser"
]
},
"np": {
"publish": true,
"releaseDraft": false
},
"build": {
"appId": "com.aalfiann.electron_dev",
"mac": {
"category": "public.app-category.social-networking",
"darkModeSupport": true
},
"dmg": {
"iconSize": 160,
"contents": [
{
"x": 180,
"y": 170
},
{
"x": 480,
"y": 170,
"type": "link",
"path": "/Applications"
}
]
},
"linux": {
"target": [
"AppImage",
"deb"
],
"category": "Network;Chat"
}
}
}
Some dependencies are out-of-date.
$ npm outdated --depth=0
Package Current Wanted Latest Location
electron 5.0.10 5.0.10 6.0.7 app-name
electron-builder 20.44.4 20.44.4 21.2.0 app-name
electron-context-menu 0.12.1 0.12.1 0.15.0 app-name
electron-store 3.3.0 3.3.0 4.0.0 app-name
electron-unhandled 2.2.0 2.2.0 3.0.0 app-name
electron-boilerplate
needs to be tested after a dependency upgrade?Builds the app for macOS, Linux, and Windows, using electron-packager.
Extra comma after Linux
in https://github.com/sindresorhus/electron-boilerplate/blob/master/boilerplate/readme.
Should this be fixed ?
Hi
I am beginner and don't know how to log out and log in again
Hi,
I run your app on Mac OS X 10.11.6 (15G1004) and this error was showed:
App threw an error during load
Error: Cannot find module 'electron-debug'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (/usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.
(/hello_electron_boilerplate/index.js:7:1)
at Object.
(/hello_electron_boilerplate/index.js:46:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
Kindest regards.
I think this is really harmless but when I first copied the template, it welcomed me with a red x sign because it did not pass the linter. Interestingly, even though it has the same files and configurations, linter does not say anything on this repository. I cannot wrap my head around why the test passes in this repository but not when I fork it or use the template.
Adding a rule to the xo
's config easily solves this issue but it might be better if this is solved in the template.
Here is the output of the test where it fails and the link to the build:
> [email protected] lint /Users/runner/work/electron/electron
> xoError: /Users/runner/work/electron/electron/menu.js: line 12, col 24, Error - Missing file extension for "./config" (import/extensions)
Error: /Users/runner/work/electron/electron/index.js: line 9, col 24, Error - Missing file extension for "./config" (import/extensions)
Error: /Users/runner/work/electron/electron/index.js: line 10, col 22, Error - Missing file extension for "./menu" (import/extensions)
Follow up from https://mobile.twitter.com/sindresorhus/status/1141380150593871877.
Hi! What do you typically do for native integration of your Electron apps. I know about handling light and dark themes, but what else? Do you also look at user/OS settings for font family/size, prefers-reduced-motion, system colors (e.g. to choose focus color), etc.?
Thank you and have a nice day :)
I am finding that my [dirt-simple] app will whitescreen after 30 seconds
It doesn't matter if I'm dev or packaged mode
My app just waits for iOT messages and prints them -- it's not really doing anything...
It will print the messages for 30 seconds (which keep arriving whether the app is open or not) and then whitescreens
I've tried using a setInterval script to keep it alive -- no luck
What am I missing?
Submitted issue to npm: npm/npm#9818
The markdown used in license section from https://github.com/sindresorhus/electron-boilerplate/blob/master/boilerplate/readme.md needs update which currently is not displayed correctly.
Should I fix it ?
PR => #4
Gonna wait until electron-packager
resolves some of its issues:
It seems like bad practice to have other functions within the menu.js file. A menu item should be set up to run a function from main.js or a different functions.js file.
Been banging my head on this one. What should be simple either isn't documented or isn't straight forward.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.