(ensure-no-cycles! packages)Same as find-cycles but will throw an exception if any cycles are found.
Same as [[find-cycles]] but will throw an exception if any cycles are found.
(filter-by predicate-fn packages)(filter-by predicate-fn {:keys [include-dependents]} packages)Filter a given packages map by those that match the given predicate-fn.
If the :include-dependents property is true then all dependent packages of
the retained packages will also be kept.
This function will update the :depends-on and :dependent keys of each
retained package to include only other packages that still remain in the map.
It's generally recommended to use this function instead of writing your own
package filtering. If you need to write your own then you should also make
sure to keep the :depends-on and :dependents updated.
Filter a given `packages` map by those that match the given `predicate-fn`. If the `:include-dependents` property is `true` then all dependent packages of the retained packages will also be kept. This function will update the `:depends-on` and `:dependent` keys of each retained package to include only other packages that still remain in the map. It's generally recommended to use this function instead of writing your own package filtering. If you need to write your own then you should also make sure to keep the `:depends-on` and `:dependents` updated.
(find-cycles packages)Try find cyclic dependencies between packages in a given packages map
Try find cyclic dependencies between packages in a given `packages` map
(parallel-topo-sort packages)Sort a given packages map by the order in which the packages therein depend
on each other.
As an example, if I have 3 packages a, b, c and b depends on a then:
(parallel-topo-sort {a {} b {} c {}})
;; => [[a c] [b]]
This is generally used to calculate the execution order of packages when trying to run commands in subpackages or build/release packages in the correct order.
Sort a given `packages` map by the order in which the packages therein depend
on each other.
As an example, if I have 3 packages `a`, `b`, `c` and `b` depends on `a` then:
```clojure
(parallel-topo-sort {a {} b {} c {}})
;; => [[a c] [b]]
```
This is generally used to calculate the execution order of packages when
trying to run commands in subpackages or build/release packages in the
correct order.(query-dependents packages pkg-name)Find all dependent packages of pkg-name within the give packages map.
This includes all transitive dependencies.
Find all dependent packages of `pkg-name` within the give `packages` map. This includes all transitive dependencies.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |