<commit_before>(ns user
  (:require
   [com.rpl.specter :as s]
   [figwheel-sidecar.repl-api :as fw-repl]
   [figwheel-sidecar.config :as fw-config]
   [taoensso.timbre :as timbre :refer [info]]))


(defn- set-closure-define
  "Sets the :closure-defines for the given `build-id` in the given
  figwheel config `config`"
  [config build-id key value]
  (s/setval
   [:data :all-builds (s/filterer #(= (:id %) build-id)) s/FIRST
    (s/keypath :build-options :closure-defines key)]
   value config))


(defn start-server! []
  (fw-repl/start-figwheel!
   (assoc-in (fw-config/fetch-config)
             [:data :figwheel-options :server-port] 4541)
   "dev-server")
  (fw-repl/cljs-repl "dev-server"))


(defn start-ui!
  [& {:keys [ui-only?] :or {ui-only? false}}]
  (let [environment (if ui-only? "prod" "dev")
        fig-config  (fw-config/fetch-config)]
    (when ui-only? (info "Performing ui-only build..."))
    (fw-repl/start-figwheel!
     (set-closure-define fig-config "dev-ui" 'name-bazaar.ui.db.environment environment)
     "dev-ui")
    (fw-repl/cljs-repl "dev-ui")))


(defn start-tests! []
  (fw-repl/start-figwheel!
   (assoc-in (fw-config/fetch-config)
             [:data :figwheel-options :server-port] 4543)
   "server-tests")<commit_msg>Document prod client build better [ci skip]<commit_after>(ns user
  (:require
   [com.rpl.specter :as s]
   [figwheel-sidecar.repl-api :as fw-repl]
   [figwheel-sidecar.config :as fw-config]
   [taoensso.timbre :as log]))


(defn- set-closure-define
  "Sets the :closure-defines for the given `build-id` in the given
  figwheel config `config`"
  [config build-id key value]
  (s/setval
   [:data :all-builds (s/filterer #(= (:id %) build-id)) s/FIRST
    (s/keypath :build-options :closure-defines key)]
   value config))


(defn start-server! []
  (fw-repl/start-figwheel!
   (assoc-in (fw-config/fetch-config)
             [:data :figwheel-options :server-port] 4541)
   "dev-server")
  (fw-repl/cljs-repl "dev-server"))


(defn start-ui!
  "Start the client build.
  Passing {:prod-config? true} points the client to the production server and logging service!"
  [& {:keys [:prod-config?]}]
  (let [environment (if prod-config? "prod" "dev")
        fig-config  (fw-config/fetch-config)]
    (when prod-config? (log/info "Performing ui-only build..."))
    (fw-repl/start-figwheel!
     (set-closure-define fig-config "dev-ui" 'name-bazaar.ui.config.environment environment)
     "dev-ui")
    (fw-repl/cljs-repl "dev-ui")))


(defn start-tests! []
  (fw-repl/start-figwheel!
   (assoc-in (fw-config/fetch-config)
             [:data :figwheel-options :server-port] 4543)
   "server-tests")
{'fraction_non_alphanumeric': 0.17081447963800905, 'fraction_numerical': 0.006033182503770739, 'mean_word_length': 3.2044374009508716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1717489', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1008, 'n_words': 219}