ibdknox / cljs-watch Goto Github PK
View Code? Open in Web Editor NEWA clojurescript compilation watcher
A clojurescript compilation watcher
If I have a file that looks like:
(ns test.a
(:use [test.b :only [bar]]))
(defn foo [a b]
(bar a b))
(defn baz [c d]
(* c d))
And a file that looks like this:
(ns test.b)
(defn bar [a b]
(- a b))
I get the following error:
27 Aug 30, 2011 7:57:19 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
28 WARNING: 1 error(s), 0 warning(s)
29 ERROR: JSC_DUPLICATE_INPUT. Duplicate input: .../test/resources/cljs/test/b.js at (unknown source) line (unknown line) : (unknown column)
30 [done]
Hi, i know that is not a priority cause the majority of users are in nix but it would be possible add windows support, taking as example my own fork if neccesary (although i dont know if it is correct).
Thanks
After installing the cljs-watch I ran it in my webnoirbased project. I did at first however get the following error message:
$cljs-watch
17:59:50 :: watcher :: Building ClojureScript files in :: src/java.io.FileNotFoundException: resources/public/cljs/bootstrap.js (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:194)
at clojure.java.io$fn__7884.invoke(io.clj:224)
at clojure.java.io$fn__7808$G__7784__7815.invoke(io.clj:63)
at clojure.java.io$fn__7896.invoke(io.clj:257)
at clojure.java.io$fn__7808$G__7784__7815.invoke(io.clj:63)
at clojure.java.io$fn__7858.invoke(io.clj:160)
at clojure.java.io$fn__7834$G__7788__7841.invoke(io.clj:63)
at clojure.java.io$writer.doInvoke(io.clj:113)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$spit.doInvoke(core.clj:6037)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at cljs.closure$output_one_file.invoke(closure.clj:695)
at cljs.closure$build.invoke(closure.clj:795)
at user$compile_cljs$fn__1602.invoke(NO_SOURCE_FILE:55)
at user$compile_cljs.invoke(NO_SOURCE_FILE:54)
at user$eval1613.invoke(NO_SOURCE_FILE:89)
at clojure.lang.Compiler.eval(Compiler.java:6424)
at clojure.lang.Compiler.eval(Compiler.java:6414)
at clojure.lang.Compiler.eval(Compiler.java:6390)
at clojure.core$eval.invoke(core.clj:2795)
at clojure.main$eval_opt.invoke(main.clj:296)
at clojure.main$initialize.invoke(main.clj:315)
at clojure.main$null_opt.invoke(main.clj:348)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:405)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
[done]
17:59:55 :: watcher :: Waiting for changes
The problem was that no resources/public/cljs folder was availiable. It was not entirely clear to me that that was the error, maybe a shout that "the directory resources/public/cljs did not exist" would be of help to someone.
I also wonder what the log message "17:59:55 :: watcher :: Waiting for changes" would mean if it actually found changes and compiled them.
After creating the directory everything seems to work just fine:
$ /opt/local/bin/cljswatch/cljs-watch
18:00:40 :: watcher :: Building ClojureScript files in :: src/ [done]
18:00:45 :: watcher :: Waiting for changes
Maybe a corner case, but if you think it's a useful error to catch, I'll dig into it and send you a patch or something.
Hi,
I get errors every other compile because EMACS stores .#bla.cljs files aside of the normal ones - Aside of that I think ignoring . files would make sense in general.
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.