markdown-to-hiccup icon indicating copy to clipboard operation
markdown-to-hiccup copied to clipboard

Clojars artifact contains dev time compiled Clojurescript

Open viesti opened this issue 6 years ago • 4 comments

Hi!

Through a rabbit hole, I noticed that the Clojars artifact of this library contains development time compiled Clojurescript output:

0% unzip -l markdown-to-hiccup-0.6.1.jar | grep public/ | tail
   491134  01-23-2018 21:33   public/js/out/cljs/pprint.js
    19489  01-23-2018 21:33   public/js/out/cljs/reader.js
   181595  11-29-2018 07:31   public/js/out/cljs/pprint.js.map
     2154  01-23-2018 21:33   public/js/out/cljs/repl.cljs
        0  11-29-2018 07:31   public/js/out/process/
      565  01-23-2018 21:33   public/js/out/process/env.cljs
      589  01-23-2018 21:33   public/js/out/process/env.cljs.cache.edn
      223  01-23-2018 21:33   public/js/out/process/env.js
      257  11-29-2018 07:31   public/js/out/process/env.js.map
      708  11-29-2018 07:40   public/js/example.js

I guess this doesn't need to be in the distributed jar?

viesti avatar Feb 01 '19 22:02 viesti

To outline this a bit more, the Clojars artifact also contains a public/index.html entry, in which case, any user of this library, serving a index.html via (io/resource "public/index.html") risks getting the dev time version (accidentally) published in this library, instead of their own resource:

0% unzip -l markdown-to-hiccup-0.6.2.jar | grep index.html
      164  12-01-2018 15:50   public/index.html

viesti avatar Feb 02 '19 16:02 viesti

Hi there,

Yeah that probably doesn’t need to be there. There is some general cleaning up I need to do in this repository and I plan to get to it this weekend. When I do I’ll make sure to tackle this.

mpcarolin avatar Feb 06 '19 18:02 mpcarolin

Neat!

I guess adding resources/public to :clean-targets in project.clj or putting the dev time cljsbuild to :dev profile together with a separate resource path + clean-target, could avoid putting compilation resources onto the classpath at jar time.

viesti avatar Feb 06 '19 19:02 viesti

Any updates on this? I just went down the same rabbit hole in a project with a lein figwheel ring handler. It should have been serving a dynamically generated index.html file, but instead, I kept getting the index.html file from this repo because it found it on the path and would not fall through to my handler.

michaelcameron avatar Jun 19 '19 01:06 michaelcameron