cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.09k stars 96 forks source link

Support for deps tools instead of lein #221

Closed holyjak closed 3 years ago

holyjak commented 3 years ago

With this change you can use clj-new (or still lein new) and then use the clojure CLI instead of leiningen to build/ serve the site.

An advantage is that it is possible to switch to versions of libraries based on local paths or git URLs and SHAs.

holyjak commented 3 years ago

I have no experience with lein new so I do not know how to test the changes. Any guidance welcome!

bombaywalla commented 3 years ago

Thanks for this PR.

I tested to check whether the lein and clj versions generate the same HTML files, by doing the following:

git clone https://github.com/holyjak/cryogen
cd cryogen
git checkout --track origin/feat/deps-edn
lein new cryogen foobar
cd foobar
lein run
mv public public-lein
clj -M:build
diff -r public public-lein

The results were the same (except for timestamps).

bombaywalla commented 3 years ago

Would you please make the following changes to this PR.

  1. Add .lein-failures to the .gitignore file. Might also want to add the other lein-related ignore lines.
  2. Add the clj commands to the README.md in the appropriate places. clj -M:build near the lein run and clj -X:serve near the lein ring server.
bombaywalla commented 3 years ago

I'd be okay merging this PR with the above changes.

Separately, wondering whether it might be a good idea to use the lein-tools-deps plugin so that there is only one place to update any dependencies. Currently, if any dependencies change, they will need to be updated in the generated project.clj and in the deps.edn.

holyjak commented 3 years ago

Thanks a lot! Done.

I am not sure how well the lein-tools-deps plugin works and did not want to risk causing any problems.

bombaywalla commented 3 years ago

Agree on lein-tools-deps for now.