<commit_before>;; Copyright © 2016-2018, JUXT LTD.
(ns dev
  (:require
   [clojure.pprint :refer [pprint]]
   [clojure.test :refer [run-all-tests]]
   [clojure.reflect :refer [reflect]]
   [clojure.repl :refer [apropos dir doc find-doc pst source]]
   [clojure.tools.namespace.repl :refer [refresh refresh-all]]
   [clojure.java.io :as io]
   [com.stuartsierra.component :as component]
   [clojure.core.async :as a :refer [>! <! >!! <!! chan buffer dropping-buffer sliding-buffer close! timeout alts! alts!! go-loop]]
   [edge.system :as system]
   [reloaded.repl :refer [system init start stop reset reset-all]]
   [yada.test :refer [response-for]]
   [io.aviso.ansi]))

(when (System/getProperty "edge.load_krei")
  (require 'load-krei))

(defn new-dev-system
  "Create a development system"
  []
  (component/system-using
   (system/new-system-map (system/config :dev))
   (system/new-dependency-map)))

(defn go []
  (let [res (reloaded.repl/go)]
    (println (io.aviso.ansi/yellow (format "[Edge] Website can be browsed at http://%s/" (-> system :web-server :host))))
    (println (io.aviso.ansi/bold-yellow "[Edge] Now make code changes, then enter (reset) here"))
    res))

(reloaded.repl/set-init! new-dev-system)

(defn test-all []
  (run-all-tests #"edge.*test$"))

(defn reset-and-test []
  (reset)
  (time (test-all)))

(defn cljs-repl
  "Start a ClojureScript REPL"
  []
  (eval
   '(do (in-ns 'boot.user)
        (start-repl))))


;; REPL Convenience helpers<commit_msg>Fix basic cljs-repl function<commit_after>;; Copyright © 2016-2018, JUXT LTD.
(ns dev
  (:require
   [clojure.core.async :as a :refer [>! <! >!! <!! chan buffer dropping-buffer sliding-buffer close! timeout alts! alts!! go-loop]]
   [clojure.java.io :as io]
   [clojure.pprint :refer [pprint]]
   [clojure.reflect :refer [reflect]]
   [clojure.repl :refer [apropos dir doc find-doc pst source]]
   [clojure.test :refer [run-all-tests]]
   [clojure.tools.namespace.repl :refer [refresh refresh-all]]
   [com.stuartsierra.component :as component]
   [edge.system :as system]
   [figwheel-sidecar.repl-api]
   [io.aviso.ansi]
   [reloaded.repl :refer [system init start stop go reset reset-all]]
   [yada.test :refer [response-for]]))

(when (System/getProperty "edge.load_krei")
  (require 'load-krei))

(defn new-dev-system
  "Create a development system"
  []
  (component/system-using
   (system/new-system-map (system/config :dev))
   (system/new-dependency-map)))

(defn go []
  (let [res (reloaded.repl/go)]
    (println (io.aviso.ansi/yellow (format "[Edge] Website can be browsed at http://%s/" (-> system :web-server :host))))
    (println (io.aviso.ansi/bold-yellow "[Edge] Now make code changes, then enter (reset) here"))
    res))

(reloaded.repl/set-init! new-dev-system)

(defn test-all []
  (run-all-tests #"edge.*test$"))

(defn reset-and-test []
  (reset)
  (time (test-all)))

(defn cljs-repl
  "Start a ClojureScript REPL"
  []
  (figwheel-sidecar.repl-api/cljs-repl))


;; REPL Convenience helpers
{'fraction_non_alphanumeric': 0.16994335221592802, 'fraction_numerical': 0.005331556147950683, 'mean_word_length': 3.75, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2077215', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1148, 'n_words': 270}