This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-22
Channels
- # announcements (11)
- # architecture (7)
- # babashka (26)
- # beginners (314)
- # calva (20)
- # chlorine-clover (1)
- # cider (5)
- # circleci (27)
- # clara (6)
- # clj-kondo (41)
- # cljsrn (6)
- # clojure (120)
- # clojure-berlin (2)
- # clojure-czech (2)
- # clojure-dev (4)
- # clojure-europe (45)
- # clojure-france (4)
- # clojure-germany (1)
- # clojure-nl (5)
- # clojure-uk (20)
- # clojuredesign-podcast (8)
- # clojurescript (6)
- # conjure (42)
- # datascript (5)
- # datomic (21)
- # deps-new (28)
- # duct (1)
- # fulcro (36)
- # graalvm (10)
- # graphql (24)
- # jackdaw (19)
- # jobs (2)
- # jobs-discuss (46)
- # kaocha (6)
- # malli (26)
- # off-topic (21)
- # parinfer (5)
- # re-frame (10)
- # sci (19)
- # shadow-cljs (95)
- # tools-deps (24)
- # vim (3)
hello all, how does it work? I want to create a custom template to my projects base, how do I do?
@fabrao I'm not sure what you are asking...?
Did you read this section https://github.com/seancorfield/clj-new#clj-templates ?
That creates you a new project that is setup like a template, yes.
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).
Or you can publish it to GitHub or you can use it locally (as a :local/root
dependency).
Internally, templates have to have a very specific structure (again, explained above).
Then you can create new projects based on your template.
Think of a template as a library that generates projects.
`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?
What command did you run to produce that error?
That says you don't have clj-new on your class path.
That's not the same command you posted above (nor does it match the readme).
• 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).
(! 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
The second command uses the myname/myapp
project as the template for creating myname/myproject
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.
I've added the above to the readme (using myname/mytemplate
for the template and myname/myproject
for the generated project).