 
 (def goog-dependencies (memoize goog-dependencies*))
 
-(defn dependency-order
-  "Topologically sort a collection of dependencies."
-  [coll]
-  (let [state (build-index coll)]
-    (distinct (:order (reduce comp/dependency-order-visit (assoc state :order []) (keys state))))))
-
 (defn js-dependency-index
   "Returns the index for all JavaScript dependencies. Lookup by
   namespace or file name."

        out-name (output-path js)
        out-file (io/file out-dir out-name)]
    (do (when-not (.exists out-file)
          (do (mkdirs out-file)
              (spit out-file (-source js))))
        {:url (to-url out-file) :requires (-requires js) :provides (-provides js) :group (:group js)})))


  [opts & inputs]
  (let [requires (mapcat -requires inputs)
        required-cljs (cljs-dependencies opts requires)
        required (dependencies opts (set (concat (mapcat -requires required-cljs) requires)))]
    (concat (map #(-> (javascript-file (or (:url %) (io/resource (:file %)))
                                       (:provides %)
                                       (:requires %))
                      (assoc :group (:group %))) required)
            required-cljs
            inputs)))

(comment
  ;; add dependencies to literal js
