Skip to content

Commit

Permalink
prep for v0.3.0; document template creation
Browse files Browse the repository at this point in the history
  • Loading branch information
seancorfield committed Sep 20, 2021
1 parent 8db37ea commit 419420c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes

* v0.3.0 -- 2021-09-19
* Address #8 by adding generation of a `template` project.
* Fixes a bug in `:transform` handling while copying files that were not explicitly listed.
* Fixes a bug in the group/artifact ID used in generated `build.clj` files.

* v0.2.1 411e687 -- 2021-09-17
* Update `build-clj` in `app` and `lib` to v0.3.1 (which uses updated `tools.build` and `deps-deploy` versions).

Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A new, simpler alternative to `clj-new`.
Intended to be installed as a "tool" (Clojure CLI 1.10.3.933 or later).

```bash
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.2.1"}' :as new
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.3.0"}' :as new
```

> `clj-new` inherently carries along all of the baggage of `lein new` and `boot new`, including a modified chunk of Leiningen itself, as well as depending on Pomegranate for loading dependencies (so as to be compatible with Leiningen and Boot), and Stencil for the variable substitution in templates. The recently-released `tools.build` library, from the core Clojure team, provides all of the functionality needed to create new projects from templates, so `deps-new` aims to provide a wrapper around `tools.build`, some standard templates "out of the box", and machinery to allow you to easily write your own templates, mostly with no code needed at all.
Expand Down Expand Up @@ -64,6 +64,26 @@ clojure -Tnew lib :name myusername/mycoollib :target-dir projects/newlib
Creates a directory `projects/newlib` containing a new library project, with `myusername` as
the "top" namespace and `mycoollib` as the main project namespace under that.

## Create a template

```bash
clojure -Tnew template :name myusername/mytemplate
```

Creates a directory `mytemplate` containing a new template project, with `myusername` as the "top" namespace
and `mytemplate` as the main project namespace under that. By default, the generated template
project will work as a template that produces a library project.

If you want to generate the project into a different directory than the project name, use
the `:target-dir` option to specify a path to the directory that should be created:

```bash
clojure -Tnew template :name myusername/mytemplate :target-dir projects/newtemplate
```

Creates a directory `projects/newtemplate` containing a new library project, with `myusername` as
the "top" namespace and `mytemplate` as the main project namespace under that.

## Create a Minimal "scratch" Project

If you just want a very minimal `deps.edn` project to experiment with:
Expand Down
2 changes: 1 addition & 1 deletion resources/org/corfield/new/template/root/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As originally generated, it will produce a new library project when run:
Assuming you have installed `deps-new` as your `new` "tool" via:

```bash
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.2.1"}' :as new
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.3.0"}' :as new
```

Run this template project's tests (they'll fail until you edit them):
Expand Down

0 comments on commit 419420c

Please sign in to comment.