Use inline-resource macro again

This commit is contained in:
bom 2024-03-29 10:25:48 +01:00
parent 1c0537f8e9
commit b2ce1fa75e

View file

@ -1,18 +1,14 @@
(ns dda.c4k-common.namespace.namespace-internal (ns dda.c4k-common.namespace.namespace-internal
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
#?(:cljs [shadow.resource :as rc])
#?(:clj [orchestra.core :refer [defn-spec]] #?(:clj [orchestra.core :refer [defn-spec]]
:cljs [orchestra.core :refer-macros [defn-spec]]) :cljs [orchestra.core :refer-macros [defn-spec]])
[dda.c4k-common.yaml :as yaml])) [dda.c4k-common.yaml :as yaml]
#?(:cljs [dda.c4k-common.macros :refer-macros [inline-resources]])))
#?(:cljs #?(:cljs
(defmethod yaml/load-resource :namespace [resource-name] (defmethod yaml/load-resource :namespace [resource-name]
(case resource-name (get (inline-resources "namespace") resource-name)))
"namespace/namespace.yaml" (rc/inline "namespace/namespace.yaml")
(throw (js/Error. (str "Undefined Resource: " resource-name))))))
(s/def ::namespace string?) (s/def ::namespace string?)