Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
#+HTML: <h1>Closcri <sub><sub><sub>ClojureScript Boilerplate</sub></sub></sub></h1> [[https://travis-ci.org/jupl/closcri][file:http://img.shields.io/travis/jupl/closcri.svg?label=travis]] [[https://jarkeeper.com/jupl/closcri][file:https://jarkeeper.com/jupl/closcri/status.svg]] ** Table of Contents - [[#about][About]] - [[#prerequisites][Prerequisites]] - [[#getting-started][Getting Started]] - [[#project-structure][Project Structure]] - [[#tasks][Tasks]] - [[#project-resources][Project Resources]] ** About This is a boilerplate project for developing client-side code using [[https://clojurescript.org/][ClojureScript]]. Flavors: - [[https://github.com/jupl/closcri/tree/master][ClojureScript]] - [[https://github.com/jupl/closcri/tree/electron][ClojureScript with Electron]] - [[https://github.com/jupl/closcri/tree/server][ClojureScript with Clojure Server]] ^{[[#closcri-clojurescript-boilerplate][Back to top]]} ** Prerequisites - JDK 1.7+ - [[http://openjdk.java.net/install/index.html][OpenJDK]] - [[http://www.oracle.com/technetwork/java/javase/downloads/index.html][Oracle]] - [[http://boot-clj.com/][Boot]] ^{[[#closcri-clojurescript-boilerplate][Back to top]]} ** Getting Started 1. Follow the [[https://github.com/boot-clj/boot#install][instructions for installing Boot]] 2. Clone/download this repository 3. Start running tasks as described below in the [[#tasks][tasks section]] ^{[[#closcri-clojurescript-boilerplate][Back to top]]} ** Project structure *** Overview #+BEGIN_EXAMPLE closcri/ ├─ resources/ # Files to be included in build │ ├─ assets/ # Static files │ ├─ app.cljs.edn # Application entry point │ ├─ devcards.cljs.edn # Devcards entry point │ ├─ devcards.html # HTML to present Devcards │ └─ index.html # HTML to present application ├─ src/ │ └─ projectname/ # Project namespace │ ├─ app/ # Application namespace │ │ └─ main.cljs # Application entry point │ └─ common/ # Shared code namespace │ ├─ config.cljc # Configuration data/functions │ ├─ devcards.cljs # Devcards entry point │ └─ reload.cljs # Helpers for hot reload ├─ boot.properties # Boot properties └─ build.boot # Tasks and dependencies for project #+END_EXAMPLE *** Entry Points When JavaScript code is built, entry points are defined by the =.cljs.edn= file inside the =resources/= directory. The entry point files reference namespaces and functions in the =src/= directory. ^{[[#closcri-clojurescript-boilerplate][Back to top]]} ** Tasks Tasks can be executed in the following manner: #+BEGIN_EXAMPLE boot [command] #+END_EXAMPLE Examples: #+BEGIN_EXAMPLE boot dev -s -p 8000 boot build #+END_EXAMPLE *** =boot dev [-d] [-s] [-p PORT]= Create a development build with source maps. - If you want to include Devcards, use the =-d= option. - If you want to run a local server with live updates and a REPL, use the =-s= option. The =-p= option is also available to specify the port number. *** =boot build= Create a production build with optimizations. *** =boot serve build [-p PORT]= Create a production build with optimizations, and serve on a static server. *** =boot devcards= Create a standalone build of devcards only. *** =boot test= Run all CLJS tests once. If tests are defined with devcards, those are included. *** =boot watch test= Run all CLJS tests once and run again on file changes. If tests are defined with devcards, those are included. *** =boot lint= Check and analyze source code. ^{[[#closcri-clojurescript-boilerplate][Back to top]]} ** Project Resources - Language - [[https://clojurescript.org][ClojureScript]] - Development Tools - [[https://github.com/bhauman/devcards][Devcards]] - [[https://github.com/boot-clj/boot-cljs-devtools][Boot CLJS DevTools]] - Build Tools - [[https://github.com/boot-clj/boot][Boot]] ^{[[#closcri-clojurescript-boilerplate][Back to top]]}