Skip to content

Commit

Permalink
Clean up the example project
Browse files Browse the repository at this point in the history
- Move test.clj and repl.clj to test/ and dev/, respectively
- Remove secrets.env and the old config.edn file
- Remove bb tasks
  • Loading branch information
jacobobryant committed Feb 3, 2024
1 parent 731c971 commit 700fa17
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 101 deletions.
19 changes: 0 additions & 19 deletions example/bb.edn

This file was deleted.

2 changes: 0 additions & 2 deletions example/bb/deps.edn

This file was deleted.

6 changes: 0 additions & 6 deletions example/bb/src/com/example/tasks.clj

This file was deleted.

55 changes: 0 additions & 55 deletions example/config.edn.TEMPLATE

This file was deleted.

2 changes: 1 addition & 1 deletion example/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
org.slf4j/jcl-over-slf4j {:mvn/version "1.7.36"}}
:aliases
{:dev {:extra-deps {com.biffweb/tasks {:local/root "../libs/tasks"}}
:extra-paths ["dev"]
:extra-paths ["dev" "test"]
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"
"-XX:+CrashOnOutOfMemoryError"
"-Dbiff.env.BIFF_PROFILE=dev"]
Expand Down
13 changes: 6 additions & 7 deletions example/src/com/example/repl.clj → example/dev/repl.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns com.example.repl
(ns repl
(:require [com.example :as main]
[com.biffweb :as biff :refer [q]]
[clojure.edn :as edn]
Expand All @@ -11,12 +11,12 @@
;; cases, that's all you'll need to do for your changes to take effect. (See main/refresh
;; below for more details.)
;;
;; The `bb dev` command also starts an nREPL server on port 7888, so if you're already
;; familiar with REPL-driven development, you can connect to that with your editor.
;; The `clj -Mdev dev` command also starts an nREPL server on port 7888, so if you're
;; already familiar with REPL-driven development, you can connect to that with your editor.
;;
;; If you're used to jacking in with your editor first and then starting your app via the
;; REPL, you will need to instead connect your editor to the nREPL server that `bb dev`
;; starts. e.g. if you use emacs, instead of running `cider-jack-in`, you would run
;; REPL, you will need to instead connect your editor to the nREPL server that `clj -Mdev
;; dev` starts. e.g. if you use emacs, instead of running `cider-jack-in`, you would run
;; `cider-connect`. See "Connecting to a Running nREPL Server:"
;; https://docs.cider.mx/cider/basics/up_and_running.html#connect-to-a-running-nrepl-server
;; ----------------------------------------------------------------------------------------
Expand Down Expand Up @@ -55,8 +55,7 @@

(comment
;; Call this function if you make a change to main/initial-system,
;; main/components, :tasks, :queues, config.edn, or deps.edn. If you update
;; secrets.env, you'll need to restart the app.
;; main/components, :tasks, :queues, config.env, or deps.edn.
(main/refresh)

;; Call this in dev if you'd like to add some seed data to your database. If
Expand Down
5 changes: 0 additions & 5 deletions example/secrets.env.TEMPLATE

This file was deleted.

3 changes: 2 additions & 1 deletion example/src/com/example.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
(biff/add-libs)
(biff/eval-files! ctx)
(generate-assets! ctx)
(test/run-all-tests #"com.example.test.*"))
(biff/catchall (require 'com.example-test))
(test/run-all-tests #"com.example.*-test"))

(def malli-opts
{:registry (malr/composite-registry
Expand Down
5 changes: 0 additions & 5 deletions example/src/com/example/test.clj

This file was deleted.

6 changes: 6 additions & 0 deletions example/test/com/example_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns com.example-test
;; If you add more test files, require them here so that they'll get loaded by com.example/on-save
(:require [clojure.test :refer [deftest is]]))

(deftest example-test
(is (= 4 (+ 2 2))))

0 comments on commit 700fa17

Please sign in to comment.