Do we have npmignore for Clojars?


#1

I used it a lot when publishing npm packages. Does Clojars support ignoring?

https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package


#2

Clojars does not handle packaging, that’s mostly the responsibility of individual tools like boot, lein or clj.

I don’t know of any that support a file like .npmignore to exclude files from a jar. The way this is usually handled is that the files that should not be in the jar are in directories which are not added to the jar. Which directories are added depends on the setting of :source-paths, :resource-paths and similar.

Often aliases are used to modify these settings temporarily.


#3

True. Some problems in my projects is I build with shadow-cljs and release with meyvn. I use a single src/ folder for all the source code since I use a Calcit Editor which only covers a single folder well so I can really split my code. That resulted in the fact I need something like npmignore.

So the question now, does meyvn support using src/ folder as classpath while part of code not being packaged into the jar file? Or how about other tools?


#4

According to meyvn’s web page,

“Meyvn uses the Apache Maven Shade Plugin in order to build uberjars. … Meyvn gives you access to the exclusions facility provided by the Shade plugin, equivalent to Leiningen’s uberjar-exclusions or Boot’s standard-jar-exclusions.”

That’s on https://github.com/danielsz/meyvn .


#5

The Maven Shade plugin is used for excluding dependencies in an uberjar, but OP wants to build a jar from a source folder while not including all source files.

Meyvn takes the :paths directive from deps.edn to determine source files. Boot is better suited for fine-grained manipulation of input files.


#6

lein supports this just fine.


#7

I tried a long way to get rid of Leiningen. No intension of going back. Same for boot. Meyvn is at current the fastest way of publishing my code. Although it’s not super easily installed or upgraded.


#8

I don’t understand how meyvn is faster than lein deploy clojars, especially since you mention that the setup is more complex?

Seems to me like you are swapping whatever problems you had with lein to problems with all the other tools and effort required to set them all up properly. Are you sure it wouldn’t be easier to figure out what didn’t work for you in lein?

Did you see this example of using lein as a library via clj (see prod.clj)?


#9

I don’t understand how meyvn is faster than lein deploy clojars , especially since you mention that the setup is more complex?

You might be right since I was comparing Meyvn today with Leiningen I was using 3~4 years ago. The comparison is not fair.

I was not preparing to dig into the problem and preparing for another tool switching after several weeks of tired work in the company… and was looking for an easy answer. Could be bad habit…

Another point is being using ClojureScript most of the time, I feel repellent(rejecting?..) to tools that are heavily coupled with JVM Clojure, especially after the bad impression I got years back.