3

I was wondering, how can I start to write an Electron app using the Hyper.js sources?

I am new to both Electron and Hyper, and watched a few videos on building an Electron app. But I can't quite figure out how to start the Hyper app. For instance, which is the "main" file in the sources?

halfer
  • 19,824
  • 17
  • 99
  • 186
Adrian
  • 744
  • 7
  • 17
  • Start off by looking at the scripts section of the package.json file in the root directory, you can see to initialise the app you run `electron app`? In the app directory the index.js file contains most of the code relative to the apps execution via electron? – Craig van Tonder Mar 30 '18 at 12:20
  • Thanks Craig, the [package.json](https://github.com/zeit/hyper/blob/canary/app/package.json) file was the first to have looked in, but there is no "scripts" section in that file (which I was surprised not to see, but since I am a beginner I guess there is something I don't yet understand). And I tried `node index.js` but it complains with an error about notify.js, that it cannot read a property 'on' of undefined, in the line: `app.on('ready', () => {`. – Adrian Mar 30 '18 at 21:21
  • 1
    (I've edited this to make it less about requesting a guide, as that would be off-topic. It's a bit brief, but it may yet pass, given that it has upvotes). – halfer Mar 30 '18 at 21:54

1 Answers1

0

Alright, after more reading and getting familiar with Node.js and Electron apps, the following procedure works: git clone https://github.com/zeit/hyper cd hyper npm install

A lot of packages will be installed in a subdirectory called node_modules, then: yarn run dev

And (in a separate terminal window): yarn rup app

This will open an Electron app similar to the original one built by Hyper.

Adrian
  • 744
  • 7
  • 17