A Leiningen template for Web based desktop application with Electron(atom-shell) and others. (now Electron(atom-shell) based only. will build nw.js based later...)
Website : descjop.org/
- leiningen 2.6.x +
- node v6.x +
- grunt v0.1.13 +
important : not support leiningen 2.5.x
$ npm install -g grunt-cli
You can display help how to use descjop.
$ lein new descjop help
and you can use alias in project directory.
$ lein descjop-help
You can display latest version.
$ lein new descjop version
$ lein new descjop YOUR_APP_NAME
$ cd YOUR_APP_NAME
Om based project
$ lein new descjop YOUR_APP_NAME +om
$ cd YOUR_APP_NAME
reagent based project
$ lein new descjop YOUR_APP_NAME +reagent
$ cd YOUR_APP_NAME
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
| +-- NAMESPACE
| +-- core.cljs // ClojureScript for Electron in here
+-- src_front
| +--NAMESPACE_front
| +-- core.cljs // Frontend clojureScript in here
+-- src_front_profile
+--NAMESPACE_front
+-- dev
| +-- conf.cljs
| +-- init.cljs
+-- prod
+-- conf.cljs
+-- init.cljs
run descjop-init
(windows user should use descjop-init-win
) alias below.
$ lein descjop-init
...
Running "download-electron" task
Done, without errors.
$ lein descjop-init-win
...
Running "download-electron" task
Done, without errors.
you have to change src/PROJECT_NAME/core.cljs
about :companyName
and submitURL
.
(defn -main []
(.start crash-reporter (clj->js {:companyName "Your Company Name"
:submitURL "http://example.com/"}))
...
and run extern alias descjop-externs
,
$ lein descjop-externs
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.
You can run Desktop application.
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
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
$ npm install -g electron-packager
$ lein descjop-uberapp-osx
$ descjop-uberapp-app-store
$ descjop-uberapp-win32
$ descjop-uberapp-win64
$ descjop-uberapp-linux
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
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
- descjop cli command
- add CSS
- test suite
- update electron ->
1.6.6
- fix package build alias
- update Readme.txt for Upgrading Electron version.
- update electron ->
1.6.0
- update clojurescript 1.7.228 -> 1.9.473
- some :dependencies update
- add electron packager command
- descjop-uberapp-osx
- descjop-uberapp-app-store
- descjop-uberapp-linux
- descjop-uberapp-win64
- descjop-uberapp-win32
- update electron ->
1.3.3
- add descjop command version alias
lein descjop-version
- update electron ->
1.2.7
- update electron ->
1.2.5
- fixed namespace problem.
Changes:
- update clojurescript 1.7.122 -> 1.7.228
- update electron ->
0.37.5
- add descjop command help alias
lein descjop-help
- add descjop command init alias
lein descjop-init
- add descjop command externs alias
lein descjop-externs
lein descjop-externs-dev
lein descjop-externs-prod
- add descjop command compile alias
lein descjop-once
lein descjop-once-dev
lein descjop-once-prod
- add descjop command figwheel alias
lein descjop-figwheel
- support development and production mode.
- re-design directories.
- some bug fix
Changes:
- update document
- update electron ->
0.36.1
- update lein-cljsbuild ->
1.1.2
- update lein-externs ->
0.1.5
Changes:
- update electron ->
0.36.1
- change deprecated method
.loadUrl()
to.loadURL()
- add
downloadDir
Gruntfile settings. if you want to download electron on current project directory. - delete
atom-shell
inapp__index.html
- change
.gitignore
excludeelectron/*
- change
crash-reporter.start()
inresources/leiningen/new/descjop/src__core.cljs
that requirecompanyName
andsubmitURL
Changes:
- update electron -> 0.35.0
Changes:
- update electron -> 0.34.0
- update clojurescript -> 1.7.145
Changes:
Changes:
Changes:
- add help command
- update electron -> 0.33.0
Changes:
- update electron -> 0.32.2
Changes:
- add +om option. Om based template support.
Changes:
- update clojurescript -> 1.7.48
- update electron -> 0.31.2
- update grunt-download-electron -> 2.1.2
Changes:
- support :optimization :none
- update clojure -> 1.7.0
- update clojurescript -> 1.7.28
- update electron -> 0.30.2
Changes:
- update Electron version 0.28.1 to 0.28.2
Changes:
- update Electron version 0.27.3 to 0.28.1
Changes:
- update Electron version 0.26.1 to 0.27.3
Changes:
- update Electron version 0.26.0 to 0.26.1
Changes:
- update Electron version 0.25.3 to 0.26.0
Changes:
- update Electron version 0.24.0 to 0.25.3
- update grunt-download-electron to 2.1.1
Bugfixes:
- change calling how to index.html path (#2, @karad)
Bugfixes:
- change grunt task from atom-shell to electron (#1, @karad)
Copyright © Kazuhiro Hara (Greative LLC http://greative.jp/) {:mail [email protected] :twitter https://twitter.com/kara_d}
Distributed under the MIT License http://opensource.org/licenses/MIT .