paulbutcher / electron-app Goto Github PK
View Code? Open in Web Editor NEWElectron app with deps.edn, figwheel.main, reagent, and test integration
License: Eclipse Public License 1.0
Electron app with deps.edn, figwheel.main, reagent, and test integration
License: Eclipse Public License 1.0
myapp clojure -A:dev
2019-12-07 20:08:59.995:INFO::main: Logging initialized @23659ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build dev to "bin/main.js"
[Figwheel] Successfully compiled build dev to "bin/main.js" in 8.808 seconds.
[Figwheel] Outputting main file: bin/renderer.js
[Figwheel] Outputting main file: bin/tests.js
[Figwheel] Watching paths: ("src/config/dev" "src/main" "src/renderer" "src/test") to compile build - dev
[Figwheel] Starting Server at http://localhost:9500
[Figwheel] Starting REPL
Prompt will show when REPL connects to evaluation environment (i.e. Node)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
[Rebel readline] Type :repl/help for online help info
Launching Javascript environment with script: ["npm" "start"]
Environment output being logged to: cljs-temp/js-environment.log
And the cljs-temp/js-environment.log
:
/home/stardiviner/myapp/node_modules/electron/index.js:14
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (/home/stardiviner/myapp/node_modules/electron/index.js:14:11)
at Object.<anonymous> (/home/stardiviner/myapp/node_modules/electron/index.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object.<anonymous> (/home/stardiviner/myapp/node_modules/electron/cli.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:816:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/stardiviner/.npm/_logs/2019-12-07T12_09_46_011Z-debug.log
And /home/stardiviner/.npm/_logs/2019-12-07T12_09_46_011Z-debug.log
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `electron .`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/stardiviner/.nvm/versions/node/v11.14.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:193:13)
13 verbose stack at ChildProcess.<anonymous> (/home/stardiviner/.nvm/versions/node/v11.14.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:193:13)
13 verbose stack at maybeClose (internal/child_process.js:999:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/stardiviner/myapp
16 verbose Linux 5.4.2-arch1-1
17 verbose argv "/home/stardiviner/.nvm/versions/node/v11.14.0/bin/node" "/home/stardiviner/.nvm/versions/node/v11.14.0/bin/npm" "start"
18 verbose node v11.14.0
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `electron .`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
This may be unrelated to the project, but perhaps you have solved this problem and can give some guidance.
First, thank you for putting this together :)
Second, I am having trouble getting this template to play nice with CIDER (emacs) and Calva (VS Code).
I think I may be ignorant with how to connect to figwheel-main repls from editors. If I start developing with clj -A:dev
, how can I have an editor connect to the figwheel-main repl?
I have grown fond of herb for styling, and the current content security policy for the index html files does not allow it.
Is there a reason for this?
I was able to get this working by adding
; style-src 'unsafe-inline'
to the meta tag for Content-Security-Policy
.
Would this be welcome as a PR? Or does that violate the spirit of a template? Just curious.
Very grateful for this sane starting point for electron apps in ClojureScript ๐
I am on Ubuntu 19.04.
When running a release build of the example app (built as per README) I get the following error and a blank window:
โ myapp-linux-x64 ./myapp
[16495:1203/100546.725691:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[16495:1203/100546.737550:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
After clj -A:dev
I got error:
2019-12-08 11:21:50.745:INFO::main: Logging initialized @21779ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build dev to "bin/main.js"
[Figwheel] Successfully compiled build dev to "bin/main.js" in 2.424 seconds.
[Figwheel] Outputting main file: bin/renderer.js
[Figwheel] Outputting main file: bin/tests.js
[Figwheel] Watching paths: ("src/config/dev" "src/main" "src/renderer" "src/test") to compile build - dev
[Figwheel] Starting Server at http://localhost:9500
[Figwheel] Starting REPL
Prompt will show when REPL connects to evaluation environment (i.e. Node)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
[Rebel readline] Type :repl/help for online help info
Launching Javascript environment with script: ["npm" "start"]
Environment output being logged to: cljs-temp/js-environment.log
Compile Exception: No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file file:/home/stardiviner/.m2/repository/reagent/reagent/0.9.0-rc3/reagent-0.9.0-rc3.jar!/reagent/core.cljs
ClojureScript 1.10.597
cljs.user=>
I checked out file cljs-temp/js-environment.log
.
[282758:1208/112222.978941:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[282758:1208/112223.038066:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
ld=dev&fwsid=639d3694-2205-402e-a892-719d7ebebe63
[Figwheel REPL] Session ID: 639d3694-2205-402e-a892-719d7ebebe63
[Figwheel REPL] Session Name: Monroe
I checked out the error source file reagent/core.cljs
. I found react
dependency in POM file. Then I try to install it manually.
I try to install react
with command clj -Sdeps '{:deps {cljsjs/react {:mvn/version "16.9.0-0"}}}'
successfully.
Then I restart clj -A:dev
. Still raise up this error.
I'm a bit confused.
Running the following command doesn't work:
clojure -A:new electron-app myname/myapp
It gives a warning that :new isn't defined, then it fails because it can't find electron_app.
I had to change the deps.edn before it would actually do what I think is intended. I removed clj-new from the deps, then added it as a new alias:
:aliases {:new {:extra-deps {seancorfield/clj-new {:mvn/version "1.0.199"}} :main-opts ["-m" "clj-new.create"]}}
After that I could run the command and it created the myapp folder with full template.
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.