           ;; mod-b :require clojure.string :depends-on common
           ;; mod-a,mod-b would try to compile clojure/string.js blow up closure optimizer
 
-          ;; FIXME: this may result in dependencies in the wrong order since find returns a map
           dups (find-sources-used-more-than-once modules)
+          ;; bring back into dependency order
           sorted-dups (->> module-order
                            (mapcat #(get-in modules [% :sources]))
                            (distinct)

     (when-not (keyword? module-name)
       (throw (ex-info "module name should be a keyword" {:module-name module-name})))
     (when-not (every? keyword? depends-on)
       (throw (ex-info "module deps should be a keywords" {:module-deps depends-on})))

     (let [state (reduce do-resolve-main state module-mains)
           module-deps (->> module-mains

                                          )))))))))))


(defn- ns-list-string [coll]
  (->> coll
       (map #(str "'" (comp/munge %) "'"))
