From dda4ecb1fb13f12ec49d8afaf56967d07644a22f Mon Sep 17 00:00:00 2001 From: patdyn Date: Thu, 4 Jul 2024 10:47:18 +0200 Subject: [PATCH] Implement inline resources --- project.clj | 2 +- shadow-cljs.edn | 2 +- src/main/cljc/dda/c4k_keycloak/keycloak.cljc | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/project.clj b/project.clj index b8c66e1..f0c3083 100644 --- a/project.clj +++ b/project.clj @@ -5,7 +5,7 @@ :url "https://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.11.1"] [org.clojure/tools.reader "1.3.6"] - [org.domaindrivenarchitecture/c4k-common-clj "6.0.1"]] + [org.domaindrivenarchitecture/c4k-common-clj "6.1.0"]] :target-path "target/%s/" :source-paths ["src/main/cljc" "src/main/clj"] diff --git a/shadow-cljs.edn b/shadow-cljs.edn index e3293f3..d98ed25 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -4,7 +4,7 @@ "src/test/cljc" "src/test/cljs" "src/test/resources"] - :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.0.1"] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.1.0"] [hickory "0.7.1"]] :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-keycloak.browser/init}} diff --git a/src/main/cljc/dda/c4k_keycloak/keycloak.cljc b/src/main/cljc/dda/c4k_keycloak/keycloak.cljc index 9a5a208..3378846 100644 --- a/src/main/cljc/dda/c4k_keycloak/keycloak.cljc +++ b/src/main/cljc/dda/c4k_keycloak/keycloak.cljc @@ -1,7 +1,7 @@ (ns dda.c4k-keycloak.keycloak (:require [clojure.spec.alpha :as s] - #?(:cljs [shadow.resource :as rc]) + #?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]]) #?(:clj [orchestra.core :refer [defn-spec]] :cljs [orchestra.core :refer-macros [defn-spec]]) [dda.c4k-common.yaml :as yaml] @@ -23,11 +23,7 @@ #?(:cljs (defmethod yaml/load-resource :keycloak [resource-name] - (case resource-name - "keycloak/deployment.yaml" (rc/inline "keycloak/deployment.yaml") - "keycloak/secret.yaml" (rc/inline "keycloak/secret.yaml") - "keycloak/service.yaml" (rc/inline "keycloak/service.yaml") - (throw (js/Error. "Undefined Resource!"))))) + (get (inline-resources "keycloak") resource-name))) (defn-spec generate-ingress cp/map-or-seq? [config config?]