Consider shadow-build as build tool
thheller opened this issue · 3 comments
https://github.com/thheller/markright/tree/shadow-build
I was curious how your build config would look using shadow-build
but sort of rewrote several parts of your app in the process. I always needed an excuse to play with electron, sorry I went a little OCD on your code.
Re-organized the code a bit and threw some stuff out. Code now lives in src/cljs
. Most of this probably wasn't required but your old structure had multiple versions of markright.core
which was very confusing to me.
You can test things by doing
lein run m build/main-dev
and lein run -m build/ui-dev
Then open electron via electron node
(I moved everything "package" related into the node
directory, what was app
before is now in node/ui
).
The main-dev
process recompiles files whenever something changes but does not attempt to reload anything (so requires an electron
restart). The ui-dev
process is sort of figwheel-ish with auto-compile/reload and a REPL for the UI.
Anyways, the new build code now is here:
https://github.com/thheller/markright/blob/shadow-build/src/dev/build.clj
If you are interested I can walk you through some stuff.
Hey Thomas,
thanks for the feedback. I didn't have time to look through the entire code yet but it looks very promising!
Re-organized the code a bit and threw some stuff out. Code now lives in src/cljs. Most of this probably wasn't required but your old structure had multiple versions of markright.core which was very confusing to me.
That was probably a mistake due to inexperience. I wanted multiple cljsbuild targets that compile into different files: One for actions to be required by electron, one for the backend and one for the frontend. Since all targets run independently and will never import each other, I decided to go with markright.core
for them.
If you like to see your changes back in the editor, please feel free to open a pr 😄 Would love to merge your changes back in!
(Did you test packaging by chance? That was possible with npm run build
and npm run package
which will spit out packages for mac / windows )
I did not touch the packaging stuff, didn't want to come to close to npm
. ;)
Just realised that the ipc
stuff I added could probably be used via the om.next
remote stuff if you treat the main
stuff as the server
.