(defn rename-to-js
"Change the file extension from .cljs to .js. Takes a File or a
String. Always returns a String."
[^String file-str]
(cond
(.endsWith file-str ".cljs")
(clojure.string/replace file-str #"\.cljs$" ".js")
(.endsWith file-str ".cljc")
(if (= "cljs/core.cljc" file-str)
"cljs/core$macros.js"
(clojure.string/replace file-str #"\.cljc$" ".js"))
:else
(throw (IllegalArgumentException.
(str "Invalid source file extension " file-str)))))