Fork me on GitHub
#lumo
<
2017-09-11
>
dotemacs06:09:27

Do you need to go for two step classpath specification:

$ lein classpath > cp.cljs
$ lumo -c `cat cp.txt` myscript.cljs
You can do it as one via:
$ lumo -c `lein classpath` myscript.cljs

anmonteiro15:09:02

@dotemacs sure can but you're then paying the lein startup cost

anmonteiro15:09:30

Kinda defeats the purpose of having a fast starting REPL

richiardiandrea17:09:51

The huckleberry project does that for you in non-JVM way. It is an alternative. @stbgz and I where talking about transpiring Aether but nobody has had the time so far

dominicm17:09:32

If I knew someone who could use intellij, I'd get them to figure out where the actual code was

anmonteiro18:09:12

I have IntelliJ installed

anmonteiro18:09:19

but I never opened it

metametadata18:09:51

Hi. Is there any way to require namespace dynamically? It looks like Lumo doesn't like (require ...) not at the top of the file. I want to require all the namespaces from the specified path somehow (it's something like a folder of migration files written in CLJS).

anmonteiro18:09:24

@metametadata can you give me a concrete example of what you’re trying to achieve?

metametadata18:09:17

@anmonteiro Yes. Assuming there's a folder migrations/: a.cljs, b.cljs, .... I want a function or a macro: (get-migrations "migrations/") which would return me, say, the next vector: [migrations.a/up migrations.b/up ...]. Here up functions are assumed to be defined in every migration ns

anmonteiro18:09:58

@metametadata you may be able to do what you want with lumo.core/eval

anmonteiro18:09:13

e.g.

(def my-ns 'clojure.set)
(lumo.core/eval `(require '~my-ns))

metametadata18:09:40

awesome, thanks!

metametadata18:09:28

plus I saw some functions to list files in lumo's bundled/ folder. Hopefully these can be combined

anmonteiro18:09:55

there’s a file-seq somewhere

anmonteiro18:09:10

just require that namespace if you know what you’re doing

anmonteiro18:09:17

they’re bundled with Lumo but not in the snapshot

anmonteiro18:09:25

@metametadata curious to hear what you’re using Lumo for

anmonteiro18:09:34

I’ve had a couple cool testimonials at ClojuTRE

metametadata18:09:21

at the moment it's about automating Kubernetes deployments from Jenkins

metametadata18:09:17

yeah, it's much better than bash 🙂

metametadata18:09:18

also I used it here as a simplistic alternative to pyinvoke/makefile: https://github.com/metametadata/clj-fakes/blob/master/tasks.cljs

anmonteiro18:09:18

I love hearing about these, keep me updated

john19:09:04

I whipped up a lumo script to automatically append pivotal IDs to git commit messages. Works like a charm 🙂

anmonteiro18:09:23

@metametadata also, I’ve been quite busy recently, but I know those __filename and SIGINT issues are annoying

anmonteiro18:09:27

I’ll have a look at them soon

metametadata18:09:38

thanks! they're not blocking for me but would be nice to have

Paco20:09:36

Hola! Great work on lumo! I made a toy script to try it out and works great!

Paco20:09:56

I would love to run the tests for the script I wrote also

Paco20:09:10

is there a way to run tests directly with lumo?

richiardiandrea20:09:37

@kidpollo lumo can run clojure.test directly

richiardiandrea20:09:48

standard clojure api (`run-tests`)

Paco20:09:26

ahhh not but not cljs.test/run-tests ?

Paco20:09:29

cljs.user=> cljs.test/run-tests
            :arrow_up:
WARNING: No such namespace: cljs.test, could not locate cljs/test.cljs, cljs/test.cljc, or JavaScript source providing "cljs.test" at line

Paco20:09:42

(clojure.test/run-tests) isnt there either

richiardiandrea20:09:20

@kidpollo it is odd, did you require it with :require-macros?

richiardiandrea20:09:53

Lumo 1.7.0
ClojureScript 1.9.924
Node.js v8.4.0
 Docs: (doc function-name-here)
       (find-doc "part-of-name-here")
 Source: (source function-name-here)
 Exit: Control+D or :cljs/quit or exit

cljs.user=> (require '[cljs.test :as t])
nil
cljs.user=> (t/run-tests)

Testing cljs.user

Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
nil
cljs.user=> 

Paco20:09:35

yeah I am doing something weird

richiardiandrea20:09:08

also, if it is still not working maybe some fix is coming up, Antonio has been fixing things like crazy and some work might be either in progress or coming to master

anmonteiro20:09:12

^ this should work at the REPL currently

Paco20:09:08

yeah I had a couple typos

Paco20:09:18

it works just fine nvm 😄

Paco20:09:53

this is a game changer! thanks so much @anmonteiro

anmonteiro21:09:59

glad you enjoy it

anmonteiro21:09:07

@kidpollo how did you come to know about Lumo?

Paco21:09:54

Heard about it first from @kenny since I was already experimenting with cljs node and boot apps.

Paco21:09:20

also saw the clojure tre talk

Paco21:09:59

ended up using Lumo repo as inspiration for the test runner lumo -c test:src scripts/test.cljs

Paco21:09:20

works fine

Paco21:09:12

Hey @anmonteiro does lumo provide a way to compile scripts into binaries much like itself?

Paco21:09:52

Is it a feature worth exploring? I think it is 😛

anmonteiro21:09:56

there might be a way of achieving that in the future

anmonteiro21:09:17

just don’t expect it anytime soon

anmonteiro21:09:22

unless someone works on it