Giter VIP home page Giter VIP logo

electron-app's Introduction

electron-app

A clj template for for an Electron application built with deps.edn, Figwheel Main, Reagent, and test integration via cljs-test-display.

Usage

clojure -A:new electron-app myname/myapp

This will generate an Electron app with a main process (source for which is located in src/main), a single renderer process (src/renderer) and unit tests for both (src/test).

Building

Before anything else, install Node dependencies:

npm install

Development

To run a development build:

clojure -A:dev

This will compile and run your Electron app, and display two windows, one containing your renderer, the other your tests displayed via clj-test-display:

Screenshot

After the application has started, you should have a REPL running, with three Figwheel sessions connected (one for the main process, one for the renderer, and one for the tests). You can see these three sessions with (conns):

cljs.user=> (conns)
Will Eval On:  Lilliana
Session Name     Age URL
Lilliana          0m /figwheel-connect
Shelia            0m /figwheel-connect
Angila            0m /figwheel-connect

And switch between them with (focus session-name).

Go ahead and make changes to your source or via the REPL and watch the UI and/or tests update in real time.

Building a Release

The main and renderer processes need to be built separately, and then packaged into an executable with electron-packager:

clojure -A:main
clojure -A:renderer
npm run package

Running tests from command line

To run tests from the command line (useful for CI builds):

clojure -A:test

Note that tests are run within an Electron process, so you will need to create a virtual display driver to run tests on a headless CI system.

License

Copyright © 2019 Paul Butcher

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

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.