[OUTDATED NOT SUPPORTED] Status Electron (React Native Web and Electron)
Go to file
Andrey Shovkoplyas 38608fb7af fixed wrong requirements 2017-11-14 13:33:01 +03:00
app main 2017-11-10 15:01:28 -05:00
src/status_desktop sources 2017-11-10 14:36:21 -05:00
src_front fixed wrong requirements 2017-11-14 13:33:01 +03:00
src_front_profile/status_desktop_front sources 2017-11-10 14:36:21 -05:00
src_tools sources 2017-11-10 14:36:21 -05:00
.gitignore sources 2017-11-10 14:36:21 -05:00
Gruntfile.js init 2017-11-10 11:36:23 -05:00
README.md optimization 2017-11-10 15:35:40 -05:00
package-lock.json init 2017-11-10 11:36:23 -05:00
package.json init 2017-11-10 11:36:23 -05:00
project.clj fixed wrong requirements 2017-11-14 13:33:01 +03:00
status.icns init 2017-11-10 11:36:23 -05:00

README.md

status-desktop

This project build by descjop v0.7.0

Status Desktop (React Native Web and Electron)

You should have status-react and status-electron in the same directory

+-- status-dev-folder
|   +-- status-react // status-react repo
|   +-- status-electron // this repo

Make simlink to resources folder

ln -s /Users/*/status-dev-folder/status-react/resources /Users/*/status-dev-folder/status-electron/resources

Requirements

  • leiningen 2.6.x +
  • node v0.12.x +
  • grunt v0.1.13 +

(if you don't install grunt yet.)

$ npm install -g grunt-cli

Project Directory

see your app dir. looks like

.
+-- Gruntfile.js
+-- README.md
+-- app
|   +-- dev // deveropment mode dir
|   |   +-- index.html // entry html file
|   |   +-- js
|   |   |   +-- externs_front.js
|   |   |   +-- externs.js
|   |   |   +-- main.js
|   |   +-- package.json // for Desktop app
|   +-- prod // production mode dir
|       +-- index.html // entry html file
|       +-- js
|       |   +-- externs_front.js
|       |   +-- externs.js
|       |   +-- main.js
|       +-- package.json // for Desktop app
+-- package.json // for Compile
+-- project.clj // compile settings desktop app
+-- resources
+-- src
|   +-- status_desktop
|       +-- core.cljs // ClojureScript for Electron in here
+-- src_front
|   +--status_desktop_front
|      +-- core.cljs //  Status ClojureScript enter point in here
+-- src_front_profile
    +--status_desktop_front
       +-- dev
       |   +-- conf.cljs
       |   +-- init.cljs
       +-- prod
           +-- conf.cljs
           +-- init.cljs

Usage

step 1

run descjop-init (windows user should use descjop-init-win) alias below.

OSX/Linux user

$ lein descjop-init
 ...
 
Running "download-electron" task
 
Done, without errors.

Windows user

$ lein descjop-init-win
 ...
 
Running "download-electron" task
 
Done, without errors.

step 2

run cljsbuild lein descjop-once.

$ lein descjop-once

Compiling ClojureScript.
Compiling "app/js/cljsbuild-main.js" from ["src"]...
Successfully compiled "app/js/cljsbuild-main.js" in 10.812 seconds.
...
Successfully compiled "app/dev/js/front.js" in 10.588 seconds.
...
Successfully compiled "app/prod/js/cljsbuild-main.js" in 19.333 seconds.
...
Successfully compiled "app/prod/js/front.js" in 29.94 seconds.

Ignore WARNINGS during front.js compilation

step 3

You can run Desktop application.

development mode

development mode use figwheel. run alias descjop-figwheel. before run application. Open other terminal window.

$ lein descjop-figwheel

and you can run Electron(Atom-Shell) app.

On Windows:

$ .\electron\electron.exe app/dev

On Linux:

$ ./electron/electron app/dev

On OS X:

$ ./electron/Electron.app/Contents/MacOS/Electron app/dev

production mode

you can run Electron(Atom-Shell) app.

On Windows:

$ .\electron\electron.exe app/prod

On Linux:

$ ./electron/electron app/prod

On OS X:

$ ./electron/Electron.app/Contents/MacOS/Electron app/prod

Package App

(If not already installed Electron-packager.)

$ npm install -g electron-packager

run command

for OSX

$ lein descjop-uberapp-osx

for OSX app store

$ descjop-uberapp-app-store

for windows 32bit app

$ descjop-uberapp-win32

for windows 64bit app

$ descjop-uberapp-win64

for linux

$ descjop-uberapp-linux

How to Upgrade to new Electron version

You can change Electron version in Gruntfile.js.

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        "download-electron": {
            version: "1.3.2", // change Electron version 1.3.2 -> 1.3.3
            outputDir: "./electron", 
            rebuild: true
        }
    });

    grunt.loadNpmTasks('grunt-download-electron');

};

and re-run

for linux / mac

$ lein descjop-init

for windows

$ lein descjop-init-win

Aliases

you can use aliases in project directory.

$ lein descjop-version       # descjop version
$ lein descjop-help          # descjop help
$ lein descjop-init          # init project
$ lein descjop-init-win      # init project for windows user
$ lein descjop-externs       # output externs for develop and production
$ lein descjop-externs-dev   # output externs for develop
$ lein descjop-externs-prod  # output externs for production
$ lein descjop-figwheel      # start figwheel
$ lein descjop-once          # build JavaScript for develop and production
$ lein descjop-once-dev      # build JavaScript for develop
$ lein descjop-once-prod     # build JavaScript for production

License

Copyright © FIXME

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