/aviv

A tool for building ClojureScript projects for NodeJS

Primary LanguageClojure

aviv

A simple classpath manager for lumo ClojureScript projects.

Movtivation

Lumo is a project that allows ClojureScript code targeting NodeJS to run quickly, without compilation, and depend on Node modules from NPM. The fact that lumo isn't tied to the JVM and is able to leverage the NPM ecosystem makes it an interesting platform for developing. The goal of aviv is to make it easy to depend on other ClojureScript files in your project, as well as depend on ClojureScript NPM packages. A longer term goal is to provide a fast build tool for working with ClojureScript that targets NodeJS.

Dependencies

Aviv depends on lumo, and will not work unless lumo is on the path. Currently, aviv depends on my fork of lumo, which contains features that I'm currently trying to get into the project.

Installation

Coming soon!

Usage

Aviv projects should be set up in a similar manner to traditional Clojure projects. There should be a source directory or directories that contain directories with names that corrospond to the namespaces of the files (with '-' replaced by '_'). Instead of a build.boot or project.clj, Aviv leverages the package.json in order to make integration with NPM easier. In the package.json, define a "cljs-source" property to be an array of source directories. Define the "main" property to be a path to the entrypoint of your project. If the "dependencies" property is up to date, this should be sufficient for running Aviv. Simply run the aviv command in the root of the project.

NPM Integration

Aviv projects can be easily published to NPM, as it uses the package.json file. In addition, valid Aviv projects can depend on other valid Aviv projects hosted on NPM. Simply npm install --save <package-name> and require the namespace in your ns macro and Aviv ensures that the file is on the classpath, and that the namespace is useable.