deps-new

fabrao 2020-09-22T22:53:35.034600Z

@fabrao has joined the channel

fabrao 2020-09-22T22:58:50.036100Z

hello all, how does it work? I want to create a custom template to my projects base, how do I do?

fabrao 2020-09-22T23:00:04.036400Z

clj -A:new -M:new template myname/myapp
?

seancorfield 2020-09-22T23:10:03.036700Z

@fabrao I'm not sure what you are asking...?

seancorfield 2020-09-22T23:11:01.037300Z

Did you read this section https://github.com/seancorfield/clj-new#clj-templates ?

fabrao 2020-09-22T23:14:01.038200Z

yes, but I didn´t understand how the flow to create my own template

fabrao 2020-09-22T23:19:03.000500Z

clj -m clj-new.create mytemplate myname/mynewapp first?

seancorfield 2020-09-22T23:19:24.000900Z

That creates you a new project that is setup like a template, yes.

seancorfield 2020-09-22T23:21:05.001700Z

If you plan to publish a template to Clojars, it must have a specific structure to its name (as explained in that link I posted above).

fabrao 2020-09-22T23:21:24.002500Z

I want to use it locally

seancorfield 2020-09-22T23:21:27.002600Z

Or you can publish it to GitHub or you can use it locally (as a :local/root dependency).

seancorfield 2020-09-22T23:21:47.003100Z

Internally, templates have to have a very specific structure (again, explained above).

seancorfield 2020-09-22T23:22:06.003600Z

Then you can create new projects based on your template.

seancorfield 2020-09-22T23:22:27.004Z

Think of a template as a library that generates projects.

fabrao 2020-09-22T23:22:41.004400Z

`Execution error (FileNotFoundException) at clojure.main/main (main.java:40). Could not locate clj_new/create__init.class, clj_new/create.clj or clj_new/create.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.` what is this for this error?

seancorfield 2020-09-22T23:22:58.004700Z

What command did you run to produce that error?

fabrao 2020-09-22T23:23:11.004900Z

clj -m clj-new.create mytemplate myname/mynewapp

fabrao 2020-09-22T23:23:43.005300Z

and beside, I´m running it on Windows

fabrao 2020-09-22T23:23:57.005800Z

is that a problem?

seancorfield 2020-09-22T23:24:04.006Z

That says you don't have clj-new on your class path.

seancorfield 2020-09-22T23:24:16.006400Z

That's not the same command you posted above (nor does it match the readme).

fabrao 2020-09-22T23:26:25.007100Z

template -- A minimal `clj-new` template. Can produce a new template with `clj -m clj-new.create mytemplate myname/mynewapp` (where `mytemplate` is the appropriate part of whatever project name you used when you asked `clj-new` to create the template project).

seancorfield 2020-09-22T23:26:50.007500Z

(! 636)-> clj -A:new -M:new template myname/myapp
Generating a project called myapp that is a 'clj-new' template
(! 637)-> clj -Sdeps '{:deps {myname/myapp {:local/root "myapp"}}}' -A:new -M:new myapp myname/myproject
Generating fresh 'clj new' myapp project.
(! 638)-> tree myproject
|____
| |____deps.edn
| |____src
| | |____myname
| | | |____myproject
| | | | |____foo.clj

seancorfield 2020-09-22T23:27:28.008200Z

The second command uses the myname/myapp project as the template for creating myname/myproject

fabrao 2020-09-22T23:28:56.008700Z

ow, now I understand

seancorfield 2020-09-22T23:29:52.009300Z

I am removing "Can produce a new template with clj -m clj-new.create mytemplate myname/mynewapp (where mytemplate is the appropriate part of whatever project name you used when you asked clj-new to create the template project)." -- it assumes you understand that you need both clj-new and your new template on your classpath before you can use that.

fabrao 2020-09-22T23:31:00.009600Z

yes, thats I thougth

seancorfield 2020-09-22T23:38:18.010600Z

I've added the above to the readme (using myname/mytemplate for the template and myname/myproject for the generated project).

fabrao 2020-09-22T23:39:56.011Z

thank you