0.1.3 • Published 11 years ago

yakshave v0.1.3

Weekly downloads
16
License
-
Repository
-
Last release
11 years ago
  • yakshave

    #+BEGIN_QUOTE Richter: Die monster. You don’t belong in this world!

    Dracula: It was not by my hand I was once again given flesh. I was brought here by humans who wished to be me tribute!

    Richter: Tribute!? You steal men’s souls, and make them your slaves!

    Dracula: Perhaps the same could be said of all religions…

    Richter: Your words are as empty as your soul! Mankind ill needs a savior such as you!

    Dracula: What is a man? A miserable little pile of secrets. But enough talk… Have at you! #+END_QUOTE

** What is a yakshave? Yakshave is a tool written in Clojurescript (Nodejs) for managing and generating [https://github.com/technomancy/leiningen] projects. It aims to handle the scripting tasks that leiningen is currently used for and more.

Provided that you have nodejs, you can install yakshave with:

#+BEGIN_SRC sh $ npm install yakshave -g #+END_SRC

The latest version is 0.1.2.

You can also fork it and run:

#+BEGIN_SRC sh $ lein cljsbuild once prod $ npm install -g #+END_SRC

** Why should I yakshave? It's a lot faster - in the initial release:

#+BEGIN_SRC sh $ time yakshave new foobar

yakshave new foobar 0.60s user 0.05s system 96% cpu 0.668 total

$ time lein new bizbar

lein new bizbar 4.07s user 0.10s system 145% cpu 2.877 total

#+END_SRC

Hmm. Like 6 times faster. But remember, those templates are buried deep within the leiningen.jar.

#+BEGIN_SRC sh $ time ys new compojure example !2804 yakshave new compojure example 0.18s user 0.01s system 101% cpu 0.191 total

$ time lein new compojure example2 !2841 lein new compojure example2 4.66s user 0.18s system 120% cpu 4.020 total #+END_SRC

For small templates it's almost 26 times faster! Note that the compojure template refers to this repository: https://github.com/johnwalker/compojure-template

Aliasing yakshave to ys for finger performance is recommended.

#+BEGIN_SRC sh

in .bashrc / .zshrc

alias ys='yakshave' #+END_SRC Why shouldn't I yakshave? It's not battle-tested. There are probably a lot of bugs, too. Many lein templates aren't yet compatible with yakshave. [http://pages.citebite.com/b2x0j8q1megb] Complete list of supported tasks #+BEGIN_SRC sh yakshave new template-name? project-name #+END_SRC Usage * new - Generating projects Yakshave templates -- just like leiningen -- are hosted in maven repositories. It is very easy for a leiningen template to be a yakshave template, and vice versa. The difference between the two is that yakshave templates use edn, while leiningen templates are fully programmatic, as they are written in Clojure. Since yakshave is brand new, many lein templates will not work yet. If you're the author of a template and want some help setting it up for yakshave, please open an issue!

One very important difference is that *yakshave doesn't fetch
templates yet.*

#+BEGIN_EXAMPLE
yakshave new foobar
yakshave new app foobar
#+END_EXAMPLE

**** Creating yakshave compatible templates If you squint, yakshave templates look a lot like leiningen ones. Here is what the app template looks like when it's described with yakshave:

 #+BEGIN_SRC clojure

{:renderer "app" :files ["project.clj" "project.clj" "doc/intro.md" "intro.md" "src/{{nested-dirs}}.clj" "core.clj" "LICENSE" "LICENSE" "resources"] :data {:raw-name :identity :name :project-name :namespace :sanitize-ns :multi-segment :nested-dirs :sanitize-ns :multi-segment :name-to-path :year :year}} #+END_SRC

 The vector is treated as thread-first on the name the user passes
 to yakshave. If a string were passed instead, then that value
 would merely be substituted. For example, in the "template" template:
 #+BEGIN_SRC  clojure

{:renderer "template" :files ["README.md" "README.md" ".gitignore" "gitignore" "resources/leiningen/new/{{sanitized}}/foo.clj" "foo.clj"] :data {:name :identity :sanitized :sanitize :placeholder "{{:sanitized}}" :year :year}} #+END_SRC

 The valid keys are

 #+BEGIN_SRC clojure

:year :identity :sanitize-ns :sanitize :multi-segment :name-to-path :group-name :project-name :unprefix #+END_SRC

 which correspond directly to the built-in leiningen ones. Two new
 keys are :identity and :unprefix. You already know what :identity
 does, and you don't care about :unprefix.

**** List of yakshave compatible templates The built-in leiningen templates:

 + app
 + default
 + template
 + plugin

   The compojure fork: https://github.com/johnwalker/compojure-template

**** Template wishlist These are some high priority templates for yakshave compatibility.

 + cljs-start
 + compojure
 + mies
 + mies-node
 + reloaded

* Contributing Contributors are wanted very badly.* There are many ways to help out - porting lein-templates to yakshave, general refactoring, writing documentation, blogging about yakshave and contributing criticism are all great help.

Outside of yakshave itself, these are extremely critical:

** Discussion

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago