You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library is mainly an extraction from
mranderson's move namespace. It allows you
to rename namespaces as well as your whole project across clj, cljc and cljs files.
As clojure is a dynamic language this won't work in all cases, but should work for anything
reasonable.
(require '[kusonga.move :as move])
(move/move-ns 'old.namespace.name
'new.namespace.name
src-dir ; where to find the namespace
[src-dir another-dir]) ; directories where to rename occurences;; in case one wants to only move the Clojure namespace
(move/move-ns 'old.namespace.name 'new-namespace-name src-dir ".clj" [src-dir another-dir])
In case you want to rename your project there is a function to replace the prefix of all
namespaces that match.
Beware that moving and renaming namespaces also affects edn files.
Namespaced keys and symbols are affected whenever the
corresponding namespace gets moved.
{:foo.bar/totonil
foo.bar nil:foo.toto/barnil}
becomes
{:foo.fizz/totonil
foo.fizz nil:foo.toto/barnil}
when renaming the namespace 'foo.bar to 'foo.fizz.
Test
Tests can be run via
clojure -X:test
Contributing
If you find a case where the library does do what it is expected to do,
please file an issue. PR's are welcome.