From 853b6f6b7e59586a13b75d08ed70cdd7b96d8656 Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Sat, 18 Jan 2025 17:06:58 -0500 Subject: [PATCH 1/6] untracking `.gitignore` --- .gitignore | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3e3c5553..00000000 --- a/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -.editorconfig -.gitattributes -/resources/public/css/compiled -/resources/public/js/compiled -/resources/*_backup.pdf -figwheel_server.log -pom.xml -*jar -/lib/ -/classes/ -/out/ -/target/ -/node_modules/ -.clj-kondo -.calva -.lein-deps-sum -.lein-repl-history -.lein-plugins/ -.lein-* -.lsp -.idea -orcpub.iml -profiles.clj -env.sh -.repl -.nrepl-port -*~ -# -*#* -/data -*.crt -*.key -deploy/homebrew/* - -# As created by some LSP-protocol tooling, e.g. nvim-lsp -.lsp From 39b1a76e7abd956ec4976aefbb6f36a4a49ed3b7 Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Sun, 3 Aug 2025 16:41:55 -0400 Subject: [PATCH 2/6] Add `clean-plugin-errors` to custom handle common errors * custom list of scans to cleanup known issues with `.orcbrew` edn files during the upload process TODO: streamline the process for better speed/efficiency --- src/cljs/orcpub/dnd/e5/events.cljs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cljs/orcpub/dnd/e5/events.cljs b/src/cljs/orcpub/dnd/e5/events.cljs index 58d48455..d6f66f30 100644 --- a/src/cljs/orcpub/dnd/e5/events.cljs +++ b/src/cljs/orcpub/dnd/e5/events.cljs @@ -3197,11 +3197,21 @@ (fn [{:keys [db]} [_ plugin-name type-key key]] {:dispatch [::e5/set-plugins (-> db :plugins (update-in [plugin-name type-key key :disabled?] not))]})) +(defn clean-common-errors [plugin-text] + (-> plugin-text + (clojure.string/replace #"disabled\?\s+nil" "disabled? false") ; disabled? nil - replace w/disabled? false + (clojure.string/replace #"(?m)nil nil, " "") ; nil nil, - find+remove + (clojure.string/replace #":\w+\snil" "") ; :[a-0] nil - find+remove + (clojure.string/replace #"\{\"\"\s*\{:orcpub\.dnd\.e5" "{\"Default Option Source\" {:orcpub.dnd.e5") + (clojure.string/replace #":option-pack\s*\"\s*\"\s*," ":option-pack \"Default Option Source\",") ;:option-pack "", + )) + (reg-event-fx ::e5/import-plugin (fn [{:keys [db]} [_ plugin-name plugin-text]] - (let [plugin (try - (reader/read-string plugin-text) + (let [cleaned-plugin-text (clean-common-errors plugin-text) + plugin (try + (reader/read-string cleaned-plugin-text) (catch js/Error e nil))] (cond (spec/valid? ::e5/plugin plugin) From e90a984e6aecf17888c89720efd4f14073aa14b4 Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Sun, 3 Aug 2025 17:44:36 -0400 Subject: [PATCH 3/6] renamed `common-errors` to `clean-plugin-errors` minor - just better description --- src/cljs/orcpub/dnd/e5/events.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cljs/orcpub/dnd/e5/events.cljs b/src/cljs/orcpub/dnd/e5/events.cljs index d6f66f30..53f2a67a 100644 --- a/src/cljs/orcpub/dnd/e5/events.cljs +++ b/src/cljs/orcpub/dnd/e5/events.cljs @@ -3197,7 +3197,7 @@ (fn [{:keys [db]} [_ plugin-name type-key key]] {:dispatch [::e5/set-plugins (-> db :plugins (update-in [plugin-name type-key key :disabled?] not))]})) -(defn clean-common-errors [plugin-text] +(defn clean-plugin-errors [plugin-text] (-> plugin-text (clojure.string/replace #"disabled\?\s+nil" "disabled? false") ; disabled? nil - replace w/disabled? false (clojure.string/replace #"(?m)nil nil, " "") ; nil nil, - find+remove @@ -3209,7 +3209,7 @@ (reg-event-fx ::e5/import-plugin (fn [{:keys [db]} [_ plugin-name plugin-text]] - (let [cleaned-plugin-text (clean-common-errors plugin-text) + (let [cleaned-plugin-text (clean-plugin-errors plugin-text) plugin (try (reader/read-string cleaned-plugin-text) (catch js/Error e nil))] From 962304371d9166d589312c83b65f87a9b3ab5f02 Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Sun, 3 Aug 2025 23:28:43 -0400 Subject: [PATCH 4/6] Adds default source "Default Option Source" to every builder TODO: make the default dynamic - change in one place and propagate across builders --- src/cljs/orcpub/dnd/e5/views.cljs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/cljs/orcpub/dnd/e5/views.cljs b/src/cljs/orcpub/dnd/e5/views.cljs index df4b0188..348625c4 100644 --- a/src/cljs/orcpub/dnd/e5/views.cljs +++ b/src/cljs/orcpub/dnd/e5/views.cljs @@ -4972,6 +4972,8 @@ false #(dispatch [::feats/toggle-feat-prop kw])])]]]) +(def default-option-pack {:option-pack "Default Option Source"}) + (defn feat-builder [] (let [feat @(subscribe [::feats/builder-item])] [:div.p-20.main-text-color @@ -4983,7 +4985,7 @@ [feat-input-field option-source-name-label :option-pack - feat + (merge feat default-option-pack) "m-l-5 m-b-20"] [:div.w-100-p [:div.f-w-b @@ -5368,7 +5370,7 @@ [class-input-field option-source-name-label :option-pack - class + (merge class default-option-pack) "m-l-5 m-b-20"]]] [:div.m-b-20 [:div.f-w-b @@ -5680,7 +5682,7 @@ [subclass-input-field option-source-name-label :option-pack - subclass + (merge subclass default-option-pack) "m-l-5 m-b-20"]] (if (#{:fighter :rogue :warlock :cleric :paladin} class-key) (let [spellcasting (get subclass :spellcasting) @@ -5823,7 +5825,7 @@ [subrace-input-field option-source-name-label :option-pack - subrace + (merge subrace default-option-pack) "m-l-5 m-b-20"]] [:div.m-b-20.flex.flex-wrap [:div.m-r-5 @@ -5937,7 +5939,7 @@ [race-input-field option-source-name-label :option-pack - race + (merge race default-option-pack) "m-l-5 m-b-20"]] [:div.m-b-20 [:div.f-w-b @@ -6086,7 +6088,7 @@ [background-input-field option-source-name-label :option-pack - background + (merge background default-option-pack) "m-l-5 m-b-20"]] [:div.m-b-20 [:div.f-w-b @@ -6119,7 +6121,7 @@ [selection-input-field option-source-name-label :option-pack - selection + (merge selection default-option-pack) "m-l-5 m-b-20"]] [:div [:div.flex.justify-cont-s-b @@ -6165,7 +6167,7 @@ [language-input-field option-source-name-label :option-pack - language + (merge language default-option-pack) "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6186,7 +6188,7 @@ [boon-input-field option-source-name-label :option-pack - boon + (merge boon default-option-pack) "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6207,7 +6209,7 @@ [invocation-input-field option-source-name-label :option-pack - invocation + (merge invocation default-option-pack) "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6251,7 +6253,7 @@ [monster-input-field option-source-name-label :option-pack - monster + (merge monster default-option-pack) "m-l-5 m-b-20 flex-grow-1"]] [:div.flex.w-100-p.flex-wrap @@ -6943,7 +6945,7 @@ [encounter-input-field option-source-name-label :option-pack - encounter + (merge encounter default-option-pack) "m-l-5 m-b-20"]] [:div.m-t-20 [:div.f-s-24.f-w-b "Creatures"] @@ -6969,7 +6971,7 @@ [spell-input-field option-source-name-label :option-pack - spell + (merge spell default-option-pack) "m-l-5 m-b-20"]] [:div.flex.w-100-p.flex-wrap From 27d333b1471de7f3e0aad8006c6793dc41938d5d Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Fri, 8 Aug 2025 00:23:55 -0400 Subject: [PATCH 5/6] Revert "Adds default source "Default Option Source" to every builder" This reverts commit 962304371d9166d589312c83b65f87a9b3ab5f02. --- src/cljs/orcpub/dnd/e5/views.cljs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/cljs/orcpub/dnd/e5/views.cljs b/src/cljs/orcpub/dnd/e5/views.cljs index 348625c4..df4b0188 100644 --- a/src/cljs/orcpub/dnd/e5/views.cljs +++ b/src/cljs/orcpub/dnd/e5/views.cljs @@ -4972,8 +4972,6 @@ false #(dispatch [::feats/toggle-feat-prop kw])])]]]) -(def default-option-pack {:option-pack "Default Option Source"}) - (defn feat-builder [] (let [feat @(subscribe [::feats/builder-item])] [:div.p-20.main-text-color @@ -4985,7 +4983,7 @@ [feat-input-field option-source-name-label :option-pack - (merge feat default-option-pack) + feat "m-l-5 m-b-20"] [:div.w-100-p [:div.f-w-b @@ -5370,7 +5368,7 @@ [class-input-field option-source-name-label :option-pack - (merge class default-option-pack) + class "m-l-5 m-b-20"]]] [:div.m-b-20 [:div.f-w-b @@ -5682,7 +5680,7 @@ [subclass-input-field option-source-name-label :option-pack - (merge subclass default-option-pack) + subclass "m-l-5 m-b-20"]] (if (#{:fighter :rogue :warlock :cleric :paladin} class-key) (let [spellcasting (get subclass :spellcasting) @@ -5825,7 +5823,7 @@ [subrace-input-field option-source-name-label :option-pack - (merge subrace default-option-pack) + subrace "m-l-5 m-b-20"]] [:div.m-b-20.flex.flex-wrap [:div.m-r-5 @@ -5939,7 +5937,7 @@ [race-input-field option-source-name-label :option-pack - (merge race default-option-pack) + race "m-l-5 m-b-20"]] [:div.m-b-20 [:div.f-w-b @@ -6088,7 +6086,7 @@ [background-input-field option-source-name-label :option-pack - (merge background default-option-pack) + background "m-l-5 m-b-20"]] [:div.m-b-20 [:div.f-w-b @@ -6121,7 +6119,7 @@ [selection-input-field option-source-name-label :option-pack - (merge selection default-option-pack) + selection "m-l-5 m-b-20"]] [:div [:div.flex.justify-cont-s-b @@ -6167,7 +6165,7 @@ [language-input-field option-source-name-label :option-pack - (merge language default-option-pack) + language "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6188,7 +6186,7 @@ [boon-input-field option-source-name-label :option-pack - (merge boon default-option-pack) + boon "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6209,7 +6207,7 @@ [invocation-input-field option-source-name-label :option-pack - (merge invocation default-option-pack) + invocation "m-l-5 m-b-20"]] [:div.w-100-p [:div.f-s-24.f-w-b @@ -6253,7 +6251,7 @@ [monster-input-field option-source-name-label :option-pack - (merge monster default-option-pack) + monster "m-l-5 m-b-20 flex-grow-1"]] [:div.flex.w-100-p.flex-wrap @@ -6945,7 +6943,7 @@ [encounter-input-field option-source-name-label :option-pack - (merge encounter default-option-pack) + encounter "m-l-5 m-b-20"]] [:div.m-t-20 [:div.f-s-24.f-w-b "Creatures"] @@ -6971,7 +6969,7 @@ [spell-input-field option-source-name-label :option-pack - (merge spell default-option-pack) + spell "m-l-5 m-b-20"]] [:div.flex.w-100-p.flex-wrap From 1f15151c3f7e7e484d25797a8e3d068a00c288ea Mon Sep 17 00:00:00 2001 From: codeGlaze Date: Tue, 12 Aug 2025 19:27:04 -0400 Subject: [PATCH 6/6] Whoops. Adding `.gitignore` back *facepalm* --- .gitignore | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3e3c5553 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +.editorconfig +.gitattributes +/resources/public/css/compiled +/resources/public/js/compiled +/resources/*_backup.pdf +figwheel_server.log +pom.xml +*jar +/lib/ +/classes/ +/out/ +/target/ +/node_modules/ +.clj-kondo +.calva +.lein-deps-sum +.lein-repl-history +.lein-plugins/ +.lein-* +.lsp +.idea +orcpub.iml +profiles.clj +env.sh +.repl +.nrepl-port +*~ +# +*#* +/data +*.crt +*.key +deploy/homebrew/* + +# As created by some LSP-protocol tooling, e.g. nvim-lsp +.lsp