deps-new

rafaeldelboni 2021-07-16T19:52:23.032400Z

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

seancorfield 2021-07-16T20:22:52.034Z

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 😞

seancorfield 2021-07-16T20:28:18.034200Z

https://github.com/seancorfield/clj-new/issues/69

rafaeldelboni 2021-07-16T20:28:50.034700Z

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

rafaeldelboni 2021-07-16T20:29:59.035600Z

Version 1.1.314 should work fine?

seancorfield 2021-07-16T20:31:53.036100Z

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

rafaeldelboni 2021-07-16T20:33:30.036300Z

Woah thanks!!

seancorfield 2021-07-16T20:33:34.036500Z

OK, try https://github.com/seancorfield/clj-new/releases/tag/v1.1.321

rafaeldelboni 2021-07-16T20:36:58.036900Z

Just tested, worked fine!

rafaeldelboni 2021-07-16T20:37:07.037200Z

Thanks for you super fast support

seancorfield 2021-07-16T20:51:44.037600Z

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

seancorfield 2021-07-16T20:57:05.038300Z

# 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.

seancorfield 2021-07-16T20:58:02.038700Z

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

rafaeldelboni 2021-07-16T21:33:17.038800Z

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

rafaeldelboni 2021-07-16T21:34:02.039Z

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

rafaeldelboni 2021-07-16T21:34:46.039200Z

if you want I can do this via PR

seancorfield 2021-07-16T21:38:51.039400Z

I know how to set up Actions and CI etc.

seancorfield 2021-07-16T21:39:03.039600Z

The tricky part is writing the actual tests 🙂

seancorfield 2021-07-16T21:42:39.039800Z

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.

seancorfield 2021-07-16T21:43:18.040Z

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

rafaeldelboni 2021-07-16T21:51:28.040200Z

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?

rafaeldelboni 2021-07-16T22:02:08.040600Z

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

rafaeldelboni 2021-07-16T22:02:12.040800Z

😞

rafaeldelboni 2021-07-16T22:02:13.041Z

haha

seancorfield 2021-07-16T22:07:33.041200Z

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

seancorfield 2021-07-16T22:08:10.041400Z

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

rafaeldelboni 2021-07-16T22:11:19.041600Z

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