This is something I have been considering for a while. I ended up being not 
able to package the script and having to run it through a wrapper and symbolic 
link. Then, I abandoned the idea altogether.

Once you pushed the required changes, would you published your efforts and the 
said lein template somewhere? I (and probably others) would be pretty 
interested in smoothing a cljs nodejs scripting workflow.

Nice initiative. 


On Thursday, 30 April 2015 17:25:47 UTC+2, Jeremy Shoemaker  wrote:
> Hi,
> 
> I started playing around with ClojureScript on NodeJS recently, and I was 
> looking at making a lein template for making CLI tools that would work with 
> npm so that the "binaries" end up in your path and can be used like any other 
> NodeJS CLI tool.
> 
> I ran into trouble quickly because it seems when you compile using :target 
> :nodejs, at runtime, it's expected that you set *main-cli-fn* to something.
> 
> In this case, I don't need that because I'm writing a wrapper JS file that 
> runs the tool and is specified in the "bin" section of the package.json file 
> that npm looks for.
> 
> It looks like it's trying to execute the main function as soon as I require 
> the compiled JS file.
> 
> My question is, why is this behaviour forced as it is?  It breaks what I'm 
> trying to do, but worse it seems to preclude the possibility of writing a 
> library that can be required into other NodeJS projects, even Javascript 
> projects.  It just seems to me that forcing this makes it harder to use 
> ClojureScript with the rest of the Javascript NodeJS ecosystem.  I don't see 
> how I could write a ClojureScript NodeJS library that can be used by someone 
> using Javascript on NodeJS.
> 
> Is there some way I can work around this limitation?  If you need example 
> code, I can provide some.
> 
> Thanks,
> Jeremy

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to