From b22f5058354d014e81bc8d357846421ff19e8154 Mon Sep 17 00:00:00 2001 From: Respatialized Date: Wed, 11 Dec 2024 19:58:29 -0500 Subject: [PATCH] Standardize naming convention for entries + fix tests --- deps.edn | 2 +- src/site/fabricate/api.clj | 8 ++++---- test/site/fabricate/api_test.clj | 12 +++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/deps.edn b/deps.edn index 9c7e465..4234c4a 100644 --- a/deps.edn +++ b/deps.edn @@ -14,7 +14,7 @@ org.clojure/test.check {:mvn/version "1.1.1"} site.fabricate/manual {:git/url "https://github.com/fabricate-site/manual.git" - :sha "67e02b757d06d90761978f5e37504ff900778b83"}} + :sha "0285311b5517b806dca43360235bc0fff4970728"}} :extra-paths ["test"]} :validate {:exec-args {:dirs ["docs/"]} :exec-fn site.fabricate.prototype.check/html}} diff --git a/src/site/fabricate/api.clj b/src/site/fabricate/api.clj index 7048e22..91239f3 100644 --- a/src/site/fabricate/api.clj +++ b/src/site/fabricate/api.clj @@ -121,14 +121,14 @@ :site.fabricate.page/modified-time :site.fabricate.page/tags :site.fabricate.entry/id :site.fabricate.entry/namespace])) ;; entries ultimately have to come from somewhere. - [:site.fabricate.entry/source :site.fabricate.source/location + [:site.fabricate.api/source :site.fabricate.source/location :site.fabricate.source/format])) (defn collect-dispatch "Equivalent to a multi-arg version of `clojure.core/identity` for a source." - {:malli/schema (m/schema [:=> [:cat :site.fabricate.entry/source :map] - :site.fabricate.entry/source]) + {:malli/schema (m/schema [:=> [:cat :site.fabricate.api/source :map] + :site.fabricate.api/source]) :private true} [src options] src) @@ -143,7 +143,7 @@ A site is the primary map passed between the 3 core API functions: plan!, assemble, and construct!" (m/schema [:map [:site.fabricate.api/entries [:* entry-schema]] - [:site.fabricate.api/options [:map-of :any :any]]])) + [:site.fabricate.api/options :map]])) (def site-fn-schema "Function schema for functions that operate on a site" diff --git a/test/site/fabricate/api_test.clj b/test/site/fabricate/api_test.clj index bfa6dab..f4abca1 100644 --- a/test/site/fabricate/api_test.clj +++ b/test/site/fabricate/api_test.clj @@ -72,7 +72,7 @@ (def api-contracts (let [entry-schema - [:map [:site.fabricate.entry/source :site.fabricate.entry/source] + [:map [:site.fabricate.api/source :site.fabricate.api/source] [:site.fabricate.source/location :site.fabricate.source/location] [:site.fabricate.page/output {:optional true} :site.fabricate.page/output] @@ -127,8 +127,7 @@ [:map [:site.fabricate.api/entries [:* - [:map - [:site.fabricate.entry/source :site.fabricate.entry/source] + [:map [:site.fabricate.api/source :site.fabricate.api/source] [:site.fabricate.source/location :site.fabricate.source/location] [:site.fabricate.page/output {:optional true} @@ -178,8 +177,7 @@ [:map [:site.fabricate.api/entries [:* - [:map - [:site.fabricate.entry/source :site.fabricate.entry/source] + [:map [:site.fabricate.api/source :site.fabricate.api/source] [:site.fabricate.source/location :site.fabricate.source/location] [:site.fabricate.page/output {:optional true} @@ -226,8 +224,8 @@ :site.fabricate.entry/namespace]]]] [:site.fabricate.api/options :map]]]]}} :site.fabricate.api/site-fn]] - {#'api/collect (m/schema [:=> [:cat :site.fabricate.entry/source :map] - :site.fabricate.entry/source]) + {#'api/collect (m/schema [:=> [:cat :site.fabricate.api/source :map] + :site.fabricate.api/source]) #'api/plan! site-fn-schema #'api/build (m/schema [:=> [:cat entry-schema :map] [:tuple :site.fabricate.source/format