Fork me on GitHub
#deps-new
<
2021-07-16
>
rafaeldelboni19:07:23

Hey hello I'm having the following error when trying to use templates from maven repositories: clj -X:new :template dv.fulcro-template :name my-username/my-project-name Output:

Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
/home/delboni/Workpaces/180s/deps.edn (No such file or directory)

Full report at:
/tmp/clojure-14243314588760477617.edn
But if I run this it works fine: clj -X:new :template app :name my-username/my-project-name Output:
Generating a project called my-project-name based on the 'app' template.
Strangely if I create a empty deps.edn file in the folder I'm executing the clj-new command it works fine also:
echo "{}" >> deps.edn
clj -X:new :template dv.fulcro-template :name my-username/my-project-name
Output:
Downloading: dv/fulcro-template/clj-template/maven-metadata.xml from clojars
Downloading: dv/fulcro-template/clj-template/maven-metadata.xml from release
Generating fresh 'clj new' dv.fulcro-template project.
Is there some configuration I'm missing? https://github.com/rafaeldelboni/dotfiles/blob/master/clojure/deps.edn

seancorfield20:07:52

Looks like a bug in the latest release of clj-new. Sorry about that. I switched it to use tools.deps.alpha's create-basis function and it seems that assumes there is always a deps.edn file in the current directory 😞

rafaeldelboni20:07:50

I'm gonna watch this issue thanks a lot for your work

rafaeldelboni20:07:59

Version 1.1.314 should work fine?

seancorfield20:07:53

1.1.321 will be available in just a few moments with a fix...

rafaeldelboni20:07:58

Just tested, worked fine!

rafaeldelboni20:07:07

Thanks for you super fast support

seancorfield20:07:44

I should have caught that change in behavior, sorry. Thanks for reporting it!

seancorfield20:07:05

# with clj-new 1.1.317 installed:
(! 531)-> clojure -Tnew create :template dv.fulcro-template :name myname/myapp
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
/Users/sean/clojure/fresh/deps.edn (No such file or directory)

Full report at:
/var/folders/p1/30gnjddx6p193frh670pl8nh0000gn/T/clojure-10389015204938500302.edn
# updating to new release:
(! 532)-> clojure -Ttools install com.github.seancorfield/clj-new '{:git/tag "v1.1.321"}' :as new
Checking out:  at 87bb8452d4e47386ea0afb5e7b0ccb4344f19cdc
Installed new
(! 533)-> clojure -Tnew create :template dv.fulcro-template :name myname/myapp
Generating fresh 'clj new' dv.fulcro-template project.

seancorfield20:07:02

(I really need to figure out a solid way to write a test suite for clj-new!)

rafaeldelboni21:07:17

You could create a simple gh-action that get your current commit, compiles and try to generate some templates (and even a remote template) If something goes wrong the clj -X:new command outputs an stderr and fails

rafaeldelboni21:07:02

Is a full integration test, but could catch something like what happened today 😁

rafaeldelboni21:07:46

if you want I can do this via PR

seancorfield21:07:51

I know how to set up Actions and CI etc.

seancorfield21:07:03

The tricky part is writing the actual tests 🙂

seancorfield21:07:39

See what I did for depstar: I'd want to do something similar for clj-new so that I can verify the generated projects are actually correct.

seancorfield21:07:18

(I think clj-new is my only project without CI setup right now)

rafaeldelboni21:07:28

I've made a quick and dirty one https://github.com/rafaeldelboni/clj-new/blob/develop/.github/workflows/tests.yml Do you think if something would help until you write the unit tests?

rafaeldelboni22:07:08

Oh actually this bug wouldn't happen because the deps.edn should exists haha

seancorfield22:07:33

Like I said: the tricky part is the actual tests, not the CI workflow stuff 🙂

seancorfield22:07:10

Did you look at the depstar test setup and the test suite there?

rafaeldelboni22:07:19

Yeah, I was just thinking about some basic checks, but you right :)