Code Monkey home page Code Monkey logo

mies's Introduction

mies

A minimal ClojureScript template.

Usage

To create a new project:

lein new mies hello-world
cd hello-world

Most of the following scripts require rlwrap (on OS X installable via brew).

To compile a developer build version:

scripts/build

To continuously monitor source files and build when changed:

scripts/watch

To compile a release version:

scripts/release

License

Copyright © 2013-2016 David Nolen

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

mies's People

Contributors

bcardiff avatar benmoss avatar bensu avatar brandonbloom avatar graue avatar hughfdjackson avatar idibidiart avatar jdeisenberg avatar mneise avatar newsomc avatar priyatam avatar pstephens avatar pwojnowski avatar swannodette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mies's Issues

rlwrap: command not found

$ scripts/watch

scripts/watch: line 2: rlwrap: command not found

OS X 10.11.2
Fixed for my setup by running brew install rlwrap.

Old source being pulled in from target/classes

I was stumped by an old version of code from a second repo running, even after lein clean and confirming the clojars version of the second repo was at least being pulled down during scripts/build.

I finally figured out that the old code was being found it in target/classes, ignoring the version on clojars. Does the target directory need to be on the "clean-targets" list.

I am sure I created this mess, mind you. I was using symlinks in the checkouts directory, or perhaps these files were created when the separate repos were all part of the problematic repo -- I started that way then split things out into separate repos.

But would there be any harm in zapping target on a lein clean under this template?

cljsbuild is not a task?

I did a local install by cloning the repository and then doing lein install followed by this:

[david@localhost ~]$ mkdir mtest
[david@localhost ~]$ cd mtest
[david@localhost mtest]$ lein new mies m060
[david@localhost mtest]$ cd m060
[david@localhost m060]$ lein cljsbuild auto
'cljsbuild' is not a task. See 'lein help'.

brepl fails to start correctly?

clojure.lang.ExceptionInfo: Referred var cljs.pprint/pprint does not exist at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 1, :tag :cljs/analysis-error}
    at clojure.core$ex_info.invoke(core.clj:4593)
    at cljs.analyzer$error.invoke(analyzer.cljc:384)
    at cljs.analyzer$error.invoke(analyzer.cljc:382)
    at cljs.analyzer$check_uses.invoke(analyzer.cljc:1300)
    at cljs.analyzer$fn__1640.invoke(analyzer.cljc:1547)
    at clojure.lang.MultiFn.invoke(MultiFn.java:251)
    at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:1900)
    at cljs.analyzer$analyze$fn__1867.invoke(analyzer.cljc:1992)
    at cljs.analyzer$analyze.invoke(analyzer.cljc:1985)
    at cljs.repl$evaluate_form.invoke(repl.cljc:429)
    at cljs.repl$repl_STAR_$fn__3613.invoke(repl.cljc:800)
    at cljs.repl$repl_STAR_$fn__3621$fn__3622.invoke(repl.cljc:830)
    at cljs.repl$repl_STAR_$fn__3621.invoke(repl.cljc:827)
    at cljs.compiler$with_core_cljs.invoke(compiler.cljc:968)
    at cljs.repl$repl_STAR_.invoke(repl.cljc:824)
    at user$eval594.invoke(brepl.clj:12)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$script_opt.invoke(main.clj:337)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:379)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at user$eval5.invoke(form-init6484620343865078537.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.eval(Compiler.java:6772)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invoke(main.clj:308)
    at clojure.main$null_opt.invoke(main.clj:343)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
To quit, type: :cljs/quit
cljs.user=>

/scripts/repl.clj malformed call to repl/repl*

Howdy,

Running the script as is throws an ArityException.
I was able to get it to run by either:

  1. Including an empty hashmap as the second argument to repl/repl*
  2. changing the call to (repl/repl (node/repl-env))

Thanks so much for all the work!

index_release.html references out-adv

Given a project created with lein new mies m060, the index_release.html file contains:

 <script src="out-adv/m060.min.js" type="text/javascript"></script>

When I do scripts/release, a release directory is created, but not one named out-adv.
Changing the attribute to src="release/m060/core.js" produces this error in the web console:

ReferenceError: goog is not defined

"Too much recursion" when trying to reload in browser REPL

In one terminal window, create a project:

[david@localhost mtest]$ lein new mies m060
[david@localhost mtest]$ cd m060
[david@localhost m060]$ vi src/m060/core.cljs # uncomment  (repl/connect "http://localhost:9000/repl")
[david@localhost m060]$ scripts/watch

In a second terminal window, do scripts\brepl. Open up a browser and connect, and show the web console.
In a third terminal window, edit src/m060/core.cljs and add (defn cube [x] (* x x x)) ; the
In the REPL: (require 'm060.core :reload)

The web console says: too much recursion

Mies could come with tests

As a newbie in Clojure and ClojureScript, I'm heavily relying in templates like mies to learn best practices and build stuff upon them.

Tests is one part that is missing from mies. Is it intentional or can we add some basic testing scenarios to mies?

scripts/brepl does not want to connect

Created a new project with latest version of mies template. Uncommented the line:
(repl/connect "http://localhost:9000/repl")

Then did this in a terminal window:

[david@localhost testor]$ scripts/brepl
Compiling client js ...
Waiting for browser to connect ...
To quit, type: :cljs/quit

Went into the browser to http://localhost:9000 and the index.html page came up, but the terminal window did not give me a browser REPL prompt. What am I doing wrong? (I also notice that lein-cljsbuild is no longer part of mies's universe)

Circular namespace dependency issues with clojurescript/1.9.52

The compiler says cljs.core -> clojure.browser.repl -> cljs.repl -> cljs.spec -> cljs.core

Stack trace ```bash ikuchan-CFSZ5-2% scripts/build Retrieving lein-npm/lein-npm/0.6.2/lein-npm-0.6.2.pom from clojars Retrieving lein-npm/lein-npm/0.6.2/lein-npm-0.6.2.jar from clojars Retrieving org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.pom from central Retrieving org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar from central Building ... Copying jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/clojure/browser/event.cljs to out/clojure/browser/event.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/clojure/browser/repl.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/clojure/browser/net.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/clojure/browser/event.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/cljs/repl.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/cljs/spec.cljs Analyzing file:/home/ikuchan/work/pc-auto-save/cljs/src/cljs/core.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/clojure/browser/repl.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/cljs/repl.cljs Analyzing jar:file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/cljs/spec.cljs Exception in thread "main" clojure.lang.ExceptionInfo: failed compiling file:out/clojure/browser/event.cljs {:file #object[java.io.File 0x707b38a1 "out/clojure/browser/event.cljs"]}, compiling:(/home/ikuchan/work/pc-auto-save/cljs/scripts/build.clj:5:1) at clojure.lang.Compiler.load(Compiler.java:7391) at clojure.lang.Compiler.loadFile(Compiler.java:7317) at clojure.main$load_script.invokeStatic(main.clj:275) at clojure.main$script_opt.invokeStatic(main.clj:335) at clojure.main$script_opt.invoke(main.clj:330) at clojure.main$main.invokeStatic(main.clj:421) at clojure.main$main.doInvoke(main.clj:384) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.lang.Var.invoke(Var.java:379) at clojure.lang.AFn.applyToHelper(AFn.java:154) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207) at user$eval5.invokeStatic(form-init8963923405122024996.clj:1) at user$eval5.invoke(form-init8963923405122024996.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6927) at clojure.lang.Compiler.eval(Compiler.java:6917) at clojure.lang.Compiler.load(Compiler.java:7379) at clojure.lang.Compiler.loadFile(Compiler.java:7317) at clojure.main$load_script.invokeStatic(main.clj:275) at clojure.main$init_opt.invokeStatic(main.clj:277) at clojure.main$init_opt.invoke(main.clj:277) at clojure.main$initialize.invokeStatic(main.clj:308) at clojure.main$null_opt.invokeStatic(main.clj:342) at clojure.main$null_opt.invoke(main.clj:339) at clojure.main$main.invokeStatic(main.clj:421) at clojure.main$main.doInvoke(main.clj:384) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) Caused by: clojure.lang.ExceptionInfo: failed compiling file:out/clojure/browser/event.cljs {:file #object[java.io.File 0x707b38a1 "out/clojure/browser/event.cljs"]} at clojure.core$ex_info.invokeStatic(core.clj:4617) at clojure.core$ex_info.invoke(core.clj:4617) at cljs.compiler$compile_file$fn__3731.invoke(compiler.cljc:1443) at cljs.compiler$compile_file.invokeStatic(compiler.cljc:1408) at cljs.compiler$compile_file.invoke(compiler.cljc:1384) at cljs.closure$compile_file.invokeStatic(closure.clj:488) at cljs.closure$compile_file.invoke(closure.clj:479) at cljs.closure$eval5521$fn__5522.invoke(closure.clj:557) at cljs.closure$eval5457$fn__5458$G__5446__5465.invoke(closure.clj:441) at cljs.closure$compile_from_jar.invokeStatic(closure.clj:539) at cljs.closure$compile_from_jar.invoke(closure.clj:527) at cljs.closure$eval5527$fn__5528.invoke(closure.clj:567) at cljs.closure$eval5457$fn__5458$G__5446__5465.invoke(closure.clj:441) at cljs.closure$compile_sources$iter__5657__5661$fn__5662.invoke(closure.clj:905) at clojure.lang.LazySeq.sval(LazySeq.java:40) at clojure.lang.LazySeq.seq(LazySeq.java:49) at clojure.lang.RT.seq(RT.java:521) at clojure.core$seq__4357.invokeStatic(core.clj:137) at clojure.core$dorun.invokeStatic(core.clj:3024) at clojure.core$doall.invokeStatic(core.clj:3039) at clojure.core$doall.invoke(core.clj:3039) at cljs.closure$compile_sources.invokeStatic(closure.clj:899) at cljs.closure$compile_sources.invoke(closure.clj:888) at cljs.closure$build.invokeStatic(closure.clj:2281) at cljs.closure$build.invoke(closure.clj:2213) at cljs.build.api$build.invokeStatic(api.clj:202) at cljs.build.api$build.invoke(api.clj:189) at cljs.build.api$build.invokeStatic(api.clj:192) at cljs.build.api$build.invoke(api.clj:189) at user$eval6347.invokeStatic(build.clj:6) at user$eval6347.invoke(build.clj:5) at clojure.lang.Compiler.eval(Compiler.java:6927) at clojure.lang.Compiler.load(Compiler.java:7379) ... 42 more Caused by: clojure.lang.ExceptionInfo: Assert failed: Circular dependency detected, cljs.core -> clojure.browser.repl -> cljs.repl -> cljs.spec -> cljs.core (every? (fn* [p1__2074#] (not (contains? *cljs-dep-set* p1__2074#))) deps) in file file:/home/ikuchan/.m2/repository/org/clojure/clojurescript/1.9.521/clojurescript-1.9.521.jar!/cljs/spec.cljs {:tag :cljs/analysis-error} at clojure.core$ex_info.invokeStatic(core.clj:4617) at clojure.core$ex_info.invoke(core.clj:4617) at cljs.analyzer$error.invokeStatic(analyzer.cljc:645) at cljs.analyzer$error.invoke(analyzer.cljc:641) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3240) at cljs.analyzer$analyze.invoke(analyzer.cljc:3226) at cljs.analyzer$analyze_file$fn__2701.invoke(analyzer.cljc:3572) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3567) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3540) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_deps.invokeStatic(analyzer.cljc:1892) at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1870) at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3132) at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3127) at cljs.analyzer$analyze_STAR_$fn__2641.invoke(analyzer.cljc:3224) at clojure.lang.PersistentVector.reduce(PersistentVector.java:341) at clojure.core$reduce.invokeStatic(core.clj:6544) at clojure.core$reduce.invoke(core.clj:6527) at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3224) at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3214) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3242) at cljs.analyzer$analyze.invoke(analyzer.cljc:3226) at cljs.analyzer$analyze_file$fn__2701.invoke(analyzer.cljc:3572) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3567) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3540) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_deps.invokeStatic(analyzer.cljc:1892) at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1870) at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3132) at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3127) at cljs.analyzer$analyze_STAR_$fn__2641.invoke(analyzer.cljc:3224) at clojure.lang.PersistentVector.reduce(PersistentVector.java:341) at clojure.core$reduce.invokeStatic(core.clj:6544) at clojure.core$reduce.invoke(core.clj:6527) at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3224) at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3214) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3242) at cljs.analyzer$analyze.invoke(analyzer.cljc:3226) at cljs.analyzer$analyze_file$fn__2701.invoke(analyzer.cljc:3572) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3567) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3540) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_deps.invokeStatic(analyzer.cljc:1892) at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1870) at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3132) at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3127) at cljs.analyzer$analyze_STAR_$fn__2641.invoke(analyzer.cljc:3224) at clojure.lang.PersistentVector.reduce(PersistentVector.java:341) at clojure.core$reduce.invokeStatic(core.clj:6544) at clojure.core$reduce.invoke(core.clj:6527) at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3224) at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3214) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3242) at cljs.analyzer$analyze.invoke(analyzer.cljc:3226) at cljs.analyzer$analyze_file$fn__2701.invoke(analyzer.cljc:3572) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3567) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3609) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:3540) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:3526) at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1177) at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1167) at cljs.compiler$compile_file_STAR_.invokeStatic(compiler.cljc:1342) at cljs.compiler$compile_file_STAR_.invoke(compiler.cljc:1335) at cljs.compiler$compile_file$fn__3731.invoke(compiler.cljc:1431) ... 72 more Caused by: java.lang.AssertionError: Assert failed: Circular dependency detected, cljs.core -> clojure.browser.repl -> cljs.repl -> cljs.spec -> cljs.core (every? (fn* [p1__2074#] (not (contains? *cljs-dep-set* p1__2074#))) deps) at cljs.analyzer$analyze_deps.invokeStatic(analyzer.cljc:1881) at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1870) at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3132) at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3127) at cljs.analyzer$analyze_STAR_$fn__2641.invoke(analyzer.cljc:3224) at clojure.lang.PersistentVector.reduce(PersistentVector.java:341) at clojure.core$reduce.invokeStatic(core.clj:6544) at clojure.core$reduce.invoke(core.clj:6527) at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3224) at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3214) at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3242) ... 136 more ```

Use of projectname.min.js

I could not find any place in the documentation that explained how to use the projectname.min.js file that lein cljsbuild once creates. Here is some possible documentation:

When you build the project, you will end up with these two files: projectname.js and projectname.min.js. The build process creates an index.html file that references projectname.js. If you want to use the minimized file, change the lines in index.html as follows:

<script src="out/goog/base.js" type="text/javascript"></script>
<script src="projectname.min.js" type="text/javascript"></script>
<!--<script type="text/javascript">goog.require("projectname.core");</script>-->

Also: what is the advantage of using projectname.min.js?

Fresh install fails to build

I'm new to the Clojure world and looking for a quick setup. I just started a project from this template and getting a failure when following the suggested build step. Let me know what i'm missing and I can PR some improvements to the docs or whatever.

Kevins-MacBook-Pro:hello-world kevzettler$ ./scripts/build
Exception in thread "main" java.lang.ExceptionInInitializerError, compiling:(/Users/kevzettler/projects/hello-world/scripts/build.clj:1:1)
    at clojure.lang.Compiler.load(Compiler.java:7239)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$script_opt.invoke(main.clj:337)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:379)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
    at user$eval5.invoke(form-init7156155563380641680.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.eval(Compiler.java:6772)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invoke(main.clj:308)
    at clojure.main$null_opt.invoke(main.clj:343)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.ExceptionInInitializerError
    at cljs.util__init.load(Unknown Source)
    at cljs.util__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at clojure.lang.RT.classForName(RT.java:2154)
    at clojure.lang.RT.classForName(RT.java:2163)
    at clojure.lang.RT.loadClassForName(RT.java:2182)
    at clojure.lang.RT.load(RT.java:436)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
    at clojure.core$load_lib.doInvoke(core.clj:5710)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$require.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.invoke(RestFn.java:619)
    at cljs.build.api$loading__5340__auto____4317.invoke(api.clj:8)
    at cljs.build.api__init.load(Unknown Source)
    at cljs.build.api__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at clojure.lang.RT.classForName(RT.java:2154)
    at clojure.lang.RT.classForName(RT.java:2163)
    at clojure.lang.RT.loadClassForName(RT.java:2182)
    at clojure.lang.RT.load(RT.java:436)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
    at clojure.core$load_lib.doInvoke(core.clj:5710)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$require.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at user$eval18.invoke(build.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    ... 36 more
Caused by: java.util.regex.PatternSyntaxException: Unknown inline modifier near index 2
(?U)^[\p{Alpha}_$]
  ^
    at java.util.regex.Pattern.error(Pattern.java:1713)
    at java.util.regex.Pattern.group0(Pattern.java:2519)
    at java.util.regex.Pattern.sequence(Pattern.java:1806)
    at java.util.regex.Pattern.expr(Pattern.java:1752)
    at java.util.regex.Pattern.compile(Pattern.java:1460)
    at java.util.regex.Pattern.<init>(Pattern.java:1133)
    at java.util.regex.Pattern.compile(Pattern.java:823)
    at cljs.util$valid_js_id_start_QMARK_.<clinit>(util.cljc:174)
    ... 84 more

Why so many (unneeded?) files in release/ directory after calling ./scripts/release?

My project is named hello-cljs. Running ./scripts/release behaves as expected, creating a release directory where none existed and saving the compiled js output to file release/hello_cljs.js. I assume that one js file is all I need to move — along with other resources (html, css, etc) — to my hosted site.

What I did not expect was the presence of other contents inside the release directory, namely:

constants_table.js

./cljs:
core.cljs
core.js
repl.cljs
repl.js

./clojure/browser:
event.cljs
event.js
net.cljs
net.js
repl.cljs
repl.js

./hello_cljs:
core.js

Is this normal?

scripts/release without prior scripts/build generates error

Given a project created with lein new mies m060, attempting to make a release version via scripts/release without first making the dev version via scripts/build (probably not a good idea, of course) produces this:

[david@localhost m060]$ scripts/release
Building ...
Analyzing jar:file:/home/david/.m2/repository/org/clojure/clojurescript/0.0-2850/clojurescript-0.0-2850.jar!/cljs/core.cljs
Compiling src/m060/core.cljs
Analyzing jar:file:/home/david/.m2/repository/org/clojure/clojurescript/0.0-2850/clojurescript-0.0-2850.jar!/clojure/browser/repl.cljs
Analyzing jar:file:/home/david/.m2/repository/org/clojure/clojurescript/0.0-2850/clojurescript-0.0-2850.jar!/clojure/browser/net.cljs
Analyzing jar:file:/home/david/.m2/repository/org/clojure/clojurescript/0.0-2850/clojurescript-0.0-2850.jar!/clojure/browser/event.cljs
Analyzing jar:file:/home/david/.m2/repository/org/clojure/clojurescript/0.0-2850/clojurescript-0.0-2850.jar!/cljs/repl.cljs
Compiling release/clojure/browser/repl.cljs
Compiling release/clojure/browser/event.cljs
Compiling release/cljs/repl.cljs
Compiling release/clojure/browser/net.cljs
Compiling release/cljs/core.cljs
Exception in thread "main" java.io.FileNotFoundException: out/m060.js (No such file or directory), compiling:(/home/david/mtest/m060/scripts/release.clj:3:25)
        at clojure.lang.Compiler.load(Compiler.java:7142)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.main$load_script.invoke(main.clj:274)
        at clojure.main$script_opt.invoke(main.clj:336)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at clojure.lang.Var.invoke(Var.java:379)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
        at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
        at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
        at user$eval5.invoke(form-init7572786293818919277.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6693)
        at clojure.lang.Compiler.load(Compiler.java:7130)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.main$load_script.invoke(main.clj:274)
        at clojure.main$init_opt.invoke(main.clj:279)
        at clojure.main$initialize.invoke(main.clj:307)
        at clojure.main$null_opt.invoke(main.clj:342)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
[snip]

Copyright...

Hey David, just noticed your copyright is to 2015. Not sure if thats intentional.

scripts/build does not exist

Is README out of date?

I followed the instructions to make a new project with lein new mies hello-world, but in that folder scripts/build does not exist.

Issue with dot in project name

There's something going on in the project.clj file generated by mies. On Windows 7, run "create new mies tester.cljs"

The resulting project.clj file then has the resulting error when attempting to be compiled:

Caused by: java.lang.RuntimeException: Unsupported escape character: \c, compiling:(c:\workspaces\ws.clj\tester.cljs\project.clj:16:37)

Looks like the output-dir results in an escape character, e.g.:

tester\cljs.js

Either pun or missing item in README

mies/README.md
might be missing item number 3

1. Uncomment the following line in src/[project name]/core.cljs: 
   ;; (repl/connect "http://localhost:9000/repl")
2. Run `./scripts/brepl`
4. Browse to http://localhost:9000 (you should see Hello World! in web console)
5. (back to step 3) you should now see the REPL prompt: ClojureScript:cljs.user> 
6. You may now evaluate ClojureScript statements in the browser context. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.