diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 124d153..83a4259 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,26 +14,26 @@ jobs: environment: deploy steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 with: fetch-depth: 0 - - uses: DeLaGuardo/setup-clojure@10.1 + - uses: DeLaGuardo/setup-clojure@13.4 with: - cli: '1.11.1.1435' + cli: '1.12.3.1577' - - uses: actions/cache@v3 + - uses: actions/cache@v4.3.0 with: path: ~/.m2 key: default-build - run: clojure -T:build ci - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v5.5.1 - name: deploy if: github.event.release run: clojure -T:build deploy env: CLOJARS_USERNAME: ${{secrets.CLOJARS_USERNAME}} - CLOJARS_PASSWORD: ${{secrets.CLOJARS_PASSWORD}} \ No newline at end of file + CLOJARS_PASSWORD: ${{secrets.CLOJARS_PASSWORD}} diff --git a/deps.edn b/deps.edn index 9b2ac43..fa60514 100644 --- a/deps.edn +++ b/deps.edn @@ -1,17 +1,17 @@ {:paths ["src"] :aliases {:dev ;for development {:extra-paths ["test"] - :extra-deps {manifold/manifold {:mvn/version "0.4.1"} + :extra-deps {manifold/manifold {:mvn/version "0.4.3"} org.clojure/clojurescript {:mvn/version "1.11.121"}}} :test ;run tests under console. e.g. clj -M:dev:test - {:extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1366"} + {:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"} lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}} :main-opts ["-m" "kaocha.runner"]} :cljs-test {:extra-paths ["test"] - :extra-deps {olical/cljs-test-runner {:mvn/version "3.8.0"}} + :extra-deps {olical/cljs-test-runner {:mvn/version "3.8.1"}} :main-opts ["-m" "cljs-test-runner.main"]} :build ;customized building process running. e.g. clj -T:build ci {:deps {io.github.robertluo/build-clj {:git/sha "5d45f58cc20747c136bb320c9b13d65d2bf4cf58"}} :ns-default build} - :clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2023.12.15"}}}}} + :clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2025.09.22"}}}}} diff --git a/src/robertluo/fun_map.cljc b/src/robertluo/fun_map.cljc index 736375e..2d9fbf1 100644 --- a/src/robertluo/fun_map.cljc +++ b/src/robertluo/fun_map.cljc @@ -91,9 +91,14 @@ `args` key of the fun-map, it will *focus* on the keys also." {:style/indent 1} [args & body] - `(fw {:keys ~args - :focus ~args} - ~@body))) + (let [focus (mapv (comp symbol name) args)] + `(fw {:keys ~args + :focus ~focus} + ~@body)))) + +(comment + (macroexpand-1 '(fnk [a :ns/b] (+ a b))) + ) ;;;;;; life cycle map diff --git a/test/robertluo/fun_map_test.cljc b/test/robertluo/fun_map_test.cljc index a32481b..b7e4545 100644 --- a/test/robertluo/fun_map_test.cljc +++ b/test/robertluo/fun_map_test.cljc @@ -1,6 +1,6 @@ (ns robertluo.fun-map-test (:require - [clojure.test :refer [deftest testing is]] + [clojure.test :refer [deftest testing is are]] #?(:clj [robertluo.fun-map :refer [fun-map? fnk fw fun-map closeable life-cycle-map touch halt! lookup]] :cljs @@ -155,3 +155,10 @@ (deftest lookup-test (is (= 3 (get (lookup identity) 3))) (is (= [:foo :foo] (find (lookup identity) :foo))))) + +(deftest fnk-focus-symbol-test + "testing fnk focus using right symbol (without ns)" + (let [m (fun-map {:a (fnk [:ns/b] b)})] + (are [v exp] (= exp (-> m (assoc :ns/b v) :a)) + 2 2 + 3 3)))