clj-newの導入

参考:https://github.com/seancorfield/clj-new 参考:https://github.com/ichisemasashi/clojure_books/blob/master/Learn_ClojureScript/001_05.md

~/.clojure/deps.edn

{:aliases
 {:new {:extra-deps {seancorfield/clj-new
                     {:mvn/version "1.1.309"}}
        :exec-fn clj-new/create}
        :exec-args {}}}

この設定により、コマンド clj -X:new を使用して、seancorfield/clj-new パッケージで提供される clj-new/create 関数を呼び出すことができる。

$ clj -X:new :template figwheel-main :name learn-cljs/weather :args '["+deps" "--reagent"]'

Generating fresh figwheel-main project.
  To get started:
  -->  Change into the 'weather' directory
  -->  Start build with 'clojure -A:fig:build'
  • :template 使用するテンプレートの名前を指定
  • :name 作成するプロジェクトの名前
  • :args テンプレートが解釈する追加の引数
% cd weather 
% tree .
.
├── README.md
├── deps.edn
├── dev.cljs.edn   # 開発ビルドのためのビルドファイル
├── figwheel-main.edn  # Figwheel構成ファイル
├── resources
│   └── public
│       ├── css
│       │   └── style.css
│       ├── index.html
│       └── test.html
├── src
│   └── learn_cljs
│       └── weather.cljs
├── target
│   └── public
├── test
│   └── learn_cljs
│       ├── test_runner.cljs
│       └── weather_test.cljs
└── test.cljs.edn  # テストビルド用のビルドファイル

9 directories, 11 files