Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
metasoarous committed Apr 29, 2017
2 parents dcec350 + d5f7809 commit 4d51d50
Show file tree
Hide file tree
Showing 21 changed files with 90 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns dat.sys.dev.figwheel-server
(ns dat.sys.figwheel-server
(:require [com.stuartsierra.component :as component]
[figwheel-sidecar.system :as figwheel]
[dat.sys.shared.utils :refer [deep-merge]]
[dat.sys.utils :refer [deep-merge]]
[taoensso.timbre :as log :include-macros true]))


Expand Down
2 changes: 1 addition & 1 deletion dev/user.clj → dev/clj/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[clojure.tools.namespace.repl :refer [refresh refresh-all]]
[dat.sys.system :as system]
[taoensso.timbre :as log :include-macros true]
[dat.sys.dev.figwheel-server :as fserver]))
[dat.sys.figwheel-server :as fserver]))

(def system nil)

Expand Down
15 changes: 15 additions & 0 deletions dev/cljs/dat/sys/start.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(ns dat.sys.start
(:require [dat.sys.app :as app]
[dat.view :as view]
[taoensso.timbre :as log :include-macros true]))


(defn on-js-reload []
(log/info "------ Figwheel Has Reloaded ------")
(do
;;(app/main)
(view/dispatch! (:app app/system) [:figwheel/reload nil])))



;(app/main)
6 changes: 0 additions & 6 deletions dev/dat/sys/dev/start.cljs

This file was deleted.

96 changes: 48 additions & 48 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
(defproject datsys "0.0.1-alpha1-SNAPSHOT"
(defproject datsys "0.0.1-alpha3"
:description "(+ clj cljs datomic datascript frp) web development framework" ;;should this be "an" or "un"?
:url "https://github.com/metasoarous/datsys"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.9.0-alpha7"]
:dependencies [[org.clojure/clojure "1.9.0-alpha15"]
[org.clojure/tools.reader "1.0.0-beta3"]
[org.clojure/clojurescript "1.9.293"]
[org.clojure/core.async "0.2.395"]
;; [org.clojure/tools.logging "0.3.1"] ;; Should remove this for timbre
[org.clojure/clojurescript "1.9.518"]
[org.clojure/core.async "0.3.442"]
[org.clojure/core.match "0.3.0-alpha4"]
;; [org.clojure/core.typed "0.3.28"] ;; WARNING: 0.3.28 breaks piggieback(!); 0.3.23 known-safe
;[org.clojure/core.typed "0.3.28"] ;; WARNING: 0.3.28 breaks piggieback(!); 0.3.23 known-safe
;; Datsys things
[datsync "0.0.1-alpha1-SNAPSHOT"]
[datview "0.0.1-alpha2-SNAPSHOT"]
[datspec "0.0.1-alpha1-SNAPSHOT"]
[datreactor "0.0.1-alpha1-SNAPSHOT"]
[datsync "0.0.1-alpha3"]
[datview "0.0.1-alpha3"]
[datspec "0.0.1-alpha3"]
[datreactor "0.0.1-alpha3"]
;; Other stuff (should try to clean things up once in main project)
[com.stuartsierra/component "0.3.2"]
[environ "1.1.0"]
Expand Down Expand Up @@ -48,18 +47,31 @@
[org.clojure/tools.analyzer "0.6.9"]
[medley "0.8.4"]]

:plugins [[lein-cljsbuild "1.1.1" :exclusions [org.clojure/clojure]]]
:plugins [[lein-cljsbuild "1.1.5" :exclusions [org.clojure/clojure]]]
;; For Datomic Pro uncomment the following and set the DATOMIC_USERNAME and DATAOMIC_PASSWORD environment
;; variables of the process in which you run this program to those matching your Datomic Pro account. You'll
;; have to start your own transactor separately from this process as well. More instructions on how to do
;; that in the Wiki (I think... bug us if you can't find them).
;; TODO Add `+datomic-pro` toggle for this
;:repositories {"my.datomic.com" {:url
; "https://my.datomic.com/repo"
; :username
; [:env/datomic_username]
; :password
; [:env/datomic_password]}}
:source-paths ["src"]
:source-paths ["src/cljc"
"src/clj"
;; TODO Uncomment if you would like checkouts; This should be +edge for everything on
;"checkouts/datview/src/clj"
;"checkouts/datview/src/cljc"
;"checkouts/datsync/src/clj"
;"checkouts/datsync/src/cljc"
;"checkouts/datreactor/src/clj"
;"checkouts/datreactor/src/cljc"
;"checkouts/datspec/src/clj"
;"checkouts/datspec/src/cljc"
#_:end]

:resource-paths ["resources"]
:target-path "target/%s"

Expand All @@ -69,53 +81,32 @@
:main ^:skip-aot dat.sys.run
:cljsbuild {:builds
{:client
{:source-paths ["src/dat/sys/client"
"dev"]
;; Uncomment if you'd like to checkout one of the sources below for dev
;"checkouts/datview/src"
;"checkouts/datsync/src"
;"checkouts/datreactor/src"
;"checkouts/datspec/src"]
:compiler {:main dat.sys.client.start
{:source-paths ["src/cljc" "src/cljs"]
:compiler {:main dat.sys.app
:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:optimizations :none
:source-map true
:source-map-timestamp true}}}} ;; helps prevent browser caching from interferring with interactive dev

;:devcards {:source-paths ["src"]
;:figwheel {:devcards true} ;; <- note this
;:compiler {:main "dat.sys.client.cards"
;:asset-path "js/compiled/devcards_out"
;:output-to "resources/public/js/datsys_devcards.js"
;:output-dir "resources/public/js/devcards_out"
;:source-map-timestamp true}}}}

;; The figwheel config is adapted from https://github.com/plexus/chestnut

;; nREPL by default starts in the :main namespace, we want to start in `user`
;; because that's where our development helper functions like (run) and
;; (browser-repl) live.
:repl-options {:init-ns user}
:repl-options {:init-ns user
;should have this auto-gen
:port 11233}

;; When running figwheel from nREPL, figwheel will read this configuration
;; stanza, but it will read it without passing through leiningen's profile
;; merging. So don't put a :figwheel section under the :dev profile, it will
;; not be picked up, instead configure figwheel here on the top level.

:figwheel {;; :server-port 3449 ;; default. overwritten by datsys config anyways
:figwheel {:server-port 11234 ;; default. overwritten by datsys config anyways
;; :server-ip "127.0.0.1" ;; default
:css-dirs ["resources/public/css"] ;; watch and update CSS

;; To be able to open files in your editor from the heads up display
;; you will need to put a script on your path.
;; that script will have to take a file path and a line number
;; ie. in ~/bin/myfile-opener
;; #! /bin/sh
;; emacsclient -n +$2 $1
;;
;; :open-file-command "myfile-opener"

:server-logfile "logs/figwheel.log"}


Expand All @@ -129,27 +120,36 @@
[org.clojure/tools.nrepl "0.2.12"]
[devcards "0.2.2" :exclusions [cljsjs/react-dom]]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
:cljsbuild {:builds {:client {:figwheel {:on-jsload "dat.sys.dev.start/on-js-reload"}}}}
:cljsbuild {:builds {:client {:source-paths ["dev/cljs" "dev/cljc"]
:figwheel {:on-jsload "dat.sys.start/on-js-reload"}}}}
:plugins [[lein-figwheel "0.5.8"] ;;:exclusions [org.clojure/clojure org.clojure/clojurescript org.codehaus.plexus/plexus-utils]

[com.palletops/lein-shorthand "0.4.0"]
;[com.palletops/lein-shorthand "0.4.0"]
[lein-environ "1.0.1"]]
;; The lein-shorthand plugin gives us access to the following shortcuts as `./*` (e.g. `./pprint`)
:shorthand {. [clojure.pprint/pprint
alembic.still/distill
alembic.still/lein
taoensso.timbre/trace
taoensso.timbre/spy]}
:source-paths ["dev"]
:source-paths ["dev/clj"
"dev/cljc"
;; TODO Uncomment if you would like checkouts; This should be +edge opton or some such
;"checkouts/datview/src/cljs"
;"checkouts/datview/src/cljc"
;"checkouts/datsync/src/cljs"
;"checkouts/datsync/src/cljc"
;"checkouts/datreactor/src/cljs"
;"checkouts/datreactor/src/cljc"
;"checkouts/datspec/src/cljs"
;"checkouts/datspec/src/cljc"
#_:end]
;; libs/datsync/resources is important here; It's lib code need access to it's resources
;; dir in dev
:resource-paths ^:replace ["resources" "libs/datsync/resources"]}]
:prod {:cljsbuild
{:builds
{:client {:source-paths ^:replace ["src/dat/sys/client"] ; no "dev", so no figwheel
:figwheel false
:compiler {:main dat.sys.client.start-prod
:output-dir "resources/public/js/compiled"
{:client {:figwheel false
:compiler {:output-dir "resources/public/js/compiled"
:output-to "resources/public/js/compiled/app.js"
:source-map "resources/public/js/compiled/app.js.map"
;:pseudo-names true
Expand Down
4 changes: 2 additions & 2 deletions resources/test-data.edn
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
{:db/id #db/id[:db.part/user -153] :e/type :e.type/Todo :e/name "compose symphony" :e/tags [#db/id[:db.part/user -30]]}
{:db/id #db/id[:db.part/user -154] :e/type :e.type/Todo :e/name "compose really epic symphony" :e/tags [#db/id[:db.part/user -30]]}
{:db/id #db/id[:db.part/user -155] :e/type :e.type/Todo :e/name "write book with colin" :e/description "About patterns and chaos" :e/category #db/id[:db.part/user -3]}
{:db/id #db/id[:db.part/user -156] :e/type :e.type/Todo :e/name "ride bike with Calvin" :e/category #db/id[:db.part/user -2]}
{:db/id #db/id[:db.part/user -156] :e/type :e.type/Todo :e/name "ride bike with Calvin" :e/category #db/id[:db.part/user -2]}]


]
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/dat/sys/import.clj → src/clj/dat/sys/import.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(defrecord Importer [config datomic]
component/Lifecycle
(start [component]
(log/info "Importering data")
(log/info "Importing data")
(let [data (-> "resources/test-data.edn" slurp read-string)]
@(d/transact (:conn datomic) data)))
(stop [component]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/dat/sys/system.clj → src/clj/dat/sys/system.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[dat.sys.config :as config]
[dat.sys.datomic :as datomic]
[dat.sys.server :as server]
[dat.sys.shared.routes :as routes]
[dat.sys.routes :as routes]
[dat.sys.ring-handler :as handler]
[dat.sys.app :as app]
[dat.sys.import :as import]))
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns dat.sys.client.events
(ns dat.sys.events
(:require [dat.reactor :as reactor]
[datascript.core :as d]))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns dat.sys.shared.routes
(ns dat.sys.routes
(:require [taoensso.timbre :as log :include-macros true]
[com.stuartsierra.component :as component]
[bidi.bidi :as bidi]

#?(:clj [compojure.core :refer [routes GET POST]])
))
#?(:clj [compojure.core :refer [routes GET POST]])))


(defn test-routes []
#?(:clj
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns dat.sys.shared.utils)
(ns dat.sys.utils)

(defn deref-or-value
[val-or-atom]
Expand Down
10 changes: 7 additions & 3 deletions src/dat/sys/client/app.cljs → src/cljs/dat/sys/app.cljs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
(ns dat.sys.client.app
(ns dat.sys.app
(:require-macros [cljs.core.async.macros :refer [go-loop]]
[reagent.ratom :refer [reaction]])
(:require [dat.view]
[dat.reactor :as reactor]
[dat.remote]
[dat.remote.impl.sente :as sente]
;; TODO Chacge over to new ns
[dat.sync.client :as dat.sync]
[dat.sys.client.views :as views]
[dat.sys.client.events]
[dat.sys.views :as views]
[dat.sys.events]
[dat.reactor.dispatcher :as dispatcher]
[datascript.core :as d]
[taoensso.timbre :as log :include-macros true]
Expand Down Expand Up @@ -97,3 +98,6 @@
(log/info "Running main function")
(when-let [root (.getElementById js/document "app")]
(r/render-component [views/main (:app system)] root)))


(main)
14 changes: 8 additions & 6 deletions src/dat/sys/client/views.cljs → src/cljs/dat/sys/views.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(ns dat.sys.client.views
(ns dat.sys.views
"# Views"
(:require [dat.view]
[posh.reagent :as posh]
[reagent.core :as r]
[taoensso.timbre :as log]
[re-com.core :as re-com]))


Expand Down Expand Up @@ -91,11 +92,12 @@
[:p {:style {:font-size "18px"}} "Congrats! You've got a Datsys app running :-)"]
;; A debug example:
;[dat.view/debug "todo instance eids:" @(type-instance-eids-rx app :e.type/Todo)]
;[dat.view/debug "Here's a debug example:"
;@(posh/q (:conn app)
;'[:find ?e ?t-ident
;:where [?e :e/type ?t]
;[?t :db/ident ?t-ident]])]
(log/info "inside the main function")
[dat.view/debug "Here's a debug example:"
@(posh/q '[:find ?e ?t-ident
:where [?e :e/type ?t]
[?t :db/ident ?t-ident]]
(:conn app))]
;; XXX TODO Get this working now...
[todos-view app]]])

15 changes: 0 additions & 15 deletions src/dat/sys/client/start.cljs

This file was deleted.

0 comments on commit 4d51d50

Please sign in to comment.