Skip to content

Commit

Permalink
all ok
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Nov 10, 2024
1 parent b1ab8ba commit edda516
Show file tree
Hide file tree
Showing 38 changed files with 224 additions and 278 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ jobs:
cli: 1.10.3.929 # Clojure CLI based on tools.deps
- name: clj-fmt
run: |
cd reval
clojure -M:cljfmt
cd ../reval-ui
clojure -M:cljfmt
shell: bash
- name: test-clj
run: |
cd reval
clojure -M:test
- name: Release
if: success()
Expand All @@ -46,7 +43,6 @@ jobs:
CLOJARS_PASSWORD: ${{ secrets.ReleasePassword }}
CODECOV_TOKEN: ${{ secrets.CodecovToken }}
run: |
cd reval-ui
git config --global user.email "[email protected]"
git config --global user.name "CI/CD"
clojure -T:build jar
Expand Down
2 changes: 1 addition & 1 deletion reval-ui/build.clj → build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
))

(def lib 'org.pinkgorilla/reval)
(def version (format "0.8.%s" (b/git-count-revs nil)))
(def version (format "0.9.%s" (b/git-count-revs nil)))

(defn jar "build the JAR" [opts]
(println "Building the JAR")
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 3 additions & 12 deletions demo/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,16 @@
]
:deps
{org.pinkgorilla/reval {:local/root ".." :deps/manifest :deps}
;org.pinkgorilla/reval-ui {:local/root "../reval-ui" :deps/manifest :deps}
org.pinkgorilla/webly {:mvn/version "0.7.703"}
; ui modules for demo notebooks:
org.pinkgorilla/ui-highcharts {:mvn/version "0.0.29"}
org.pinkgorilla/ui-vega {:mvn/version "0.3.221"}

; run by default in docs-services
nrepl/nrepl {:mvn/version "1.2.0"}
cider/cider-nrepl {:mvn/version "0.49.1"}}

:aliases
{; https://github.com/weavejester/cljfmt
:cljfmt
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main" "check" "--indents" "cljfmt.edn"]}
:cljfmt-fix
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main" "fix" "--indents" "cljfmt.edn"]}

; demo ui
{; demo ui
:webly {:exec-fn webly.app.app/webly-build
:exec-args {:config ["reval/demo-config.edn"]
:profile "npm-install"}}
Expand All @@ -47,7 +38,7 @@
;; notebook eval

:nbeval {:exec-fn modular.system/start!
:exec-args {:run demo.task/eval-all-collections
:exec-args {:run demo.task/eval-all
:config ["reval/demo-config.edn"]
:services "reval/task-services.edn"}}
:nblist {:exec-fn modular.system/start!
Expand Down
3 changes: 2 additions & 1 deletion demo/src/demo/notebook.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"demo/notebook/"
;"notebook/big_list/"
]
:cljs ["notebook/cljs"
:cljs ["notebook/cljs/"
"demo/notebook/"
]})



(eval-collections *env*)


Expand Down
6 changes: 6 additions & 0 deletions demo/src/demo/task.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns demo.task
(:require
[reval.core :refer [*env* eval-collections]]))

(defn eval-all [& _]
(eval-collections *env*))
9 changes: 0 additions & 9 deletions demo/static-build.sh

This file was deleted.

59 changes: 58 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
{:deps {reval/reval {:local/root "./reval" :deps/manifest :deps}
reval/reval-ui {:local/root "./reval-ui" :deps/manifest :deps}
reval/reval-sci {:local/root "./reval-sci" :deps/manifest :deps}}


}
:aliases
{; github ci MULTI-DEPS VERSION
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.1"}
io.github.seancorfield/build-clj {:git/tag "v0.5.4" :git/sha "bc9c0cc"}
babashka/fs {:mvn/version "0.0.5"}}
:ns-default build
:jvm-opts ["-Dmaven.wagon.rto=90000"]}

; https://github.com/weavejester/cljfmt
:cljfmt
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main"
"--indents" "cljfmt.edn"
"check"
"reval/src"
"reval-ui/src"
"reval-sci/src"
]}

:cljfmt-fix
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main"
"--indents" "cljfmt.edn"
"fix"
"reval/src"
"reval-ui/src"
"reval-sci/src"
]}



; https://github.com/clj-kondo/clj-kondo/blob/master/doc/jvm.md
:lint
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "2024.03.13"}}
:main-opts ["-m" "clj-kondo.main"
"--lint"
"reval/src"
"reval-ui/src"
"reval-sci/src"
"--config" "cljkondo.edn"]}

:check
{:extra-deps {athos/clj-check {:git/url "https://github.com/athos/clj-check.git"
:sha "518d5a1cbfcd7c952f548e6dbfcb9a4a5faf9062"}}
:main-opts ["-m" "clj-check.check"]}

:test
{:extra-paths ["test" "demo"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "dd6da11611eeb87f08780a30ac8ea6012d4c05ce"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}

;
}}
File renamed without changes.
2 changes: 1 addition & 1 deletion demo/http-server.sh → http-server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env /home/florian/babashka/bb
#!/usr/bin/env /home/florian/.guix-profile/bin/bb

(require '[babashka.deps :as deps])
(deps/add-deps
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions reval-sci/src/dali/plot/exception.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
(:require
[dali.spec :refer [create-dali-spec]]))



(defn exception
"returns a plot specification {:render-fn :spec :data}.
The ui shows the exception."
Expand Down
6 changes: 3 additions & 3 deletions reval-sci/src/reval/init.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns reval.init
(:require
[taoensso.timbre :as timbre :refer [info]]
[webly.module.build :refer [load-namespace]]))
(:require
[taoensso.timbre :as timbre :refer [info]]
[webly.module.build :refer [load-namespace]]))

(defn reval-cljs-kernel-init []
(info "goldly reval cljs-kernel-init ..")
Expand Down
10 changes: 5 additions & 5 deletions reval-sci/src/reval/kernel/cljs_sci.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

(defn err-adjust [e]
(when-let [sci-err (exception->error e)]
(plot/hiccup
[:div
(pr-str
{:sci-compilation-error true
:err-sci sci-err})])))
(plot/hiccup
[:div
(pr-str
{:sci-compilation-error true
:err-sci sci-err})])))

(defonce cur-ns (r/atom "user"))

Expand Down
4 changes: 0 additions & 4 deletions reval-ui/cljfmt.edn

This file was deleted.

48 changes: 2 additions & 46 deletions reval-ui/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,9 @@
org.pinkgorilla/ui-codemirror {:mvn/version "0.1.48"}
org.pinkgorilla/ui-highlightjs {:mvn/version "0.1.19"}
org.pinkgorilla/clj-service {:mvn/version "0.3.20"}

org.pinkgorilla/reval {:local/root "../reval" :deps/manifest :deps}
org.pinkgorilla/goldly {:mvn/version "0.7.684"}
org.pinkgorilla/reval {:local/root "../reval" :deps/manifest :deps}}


}

:aliases
{; github ci MULTI-DEPS VERSION
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.1"}
io.github.seancorfield/build-clj {:git/tag "v0.5.4" :git/sha "bc9c0cc"}
babashka/fs {:mvn/version "0.0.5"}
;org.pinkgorilla/modular {:mvn/version "0.2.56"} ; modular.date
}
:ns-default build
:jvm-opts ["-Dmaven.wagon.rto=90000"]}

; https://github.com/weavejester/cljfmt
:cljfmt
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main" "check" "--indents" "cljfmt.edn"]}
:cljfmt-fix
{:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}}
:main-opts ["-m" "cljfmt.main" "fix" "--indents" "cljfmt.edn"]}

; https://github.com/clj-kondo/clj-kondo/blob/master/doc/jvm.md
:lint
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
:main-opts ["-m" "clj-kondo.main"
"--lint"
"src" "test"
"--config" "cljkondo.edn"]}

:check
{:extra-deps {athos/clj-check {:git/url "https://github.com/athos/clj-check.git"
:sha "518d5a1cbfcd7c952f548e6dbfcb9a4a5faf9062"}}
:main-opts ["-m" "clj-check.check"]}

:test
{:extra-paths ["test" "demo"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "dd6da11611eeb87f08780a30ac8ea6012d4c05ce"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}


;
}}
}
2 changes: 2 additions & 0 deletions reval-ui/resources/ext/reval-ui.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
reval.dali.viewer.notebook-viewer
reval.dali.viewer.collection
reval.dali.viewer.collection-viewer
reval.dali.viewer.list
; reval
reval.kernel.protocol
reval.type.converter
Expand All @@ -33,6 +34,7 @@
reval.dali.viewer.collection {'notebook-collection reval.dali.viewer.collection/notebook-collection }
reval.dali.viewer.collection-viewer {'load-transform-edn reval.dali.viewer.collection-viewer/load-transform-edn
'collection-viewer reval.dali.viewer.collection-viewer/collection-viewer}
reval.dali.viewer.list {'list-view reval.dali.viewer.list/list-view }

; reval
'reval.kernel.protocol {'available-kernels reval.kernel.protocol/available-kernels
Expand Down
7 changes: 3 additions & 4 deletions reval-ui/src/reval/dali/viewer/collection.cljs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
(ns reval.dali.viewer.collection
(:require
[clojure.string :refer [split]]
[re-frame.core :as rf]))
[clojure.string :refer [split]]))

;; COLLECTION UI

(defn nb-item [open-link nbns]
(defn nb-item [open-link {:keys [nbns] :as nbinfo}]
[:a
[:p.w-full.truncate.bg-blue-200.hover:bg-blue-300.border.border-solid.border-blue-300.p-1.cursor-pointer
; trunctate does the text magic
; .overflow-x-hidden
;[:a ;.m-1
{:class "text-blue-500"
:on-click #(rf/dispatch [:bidi/goto open-link :query-params {:ns nbns}])}
:on-click #(open-link nbinfo)}
;(-> (split nbns ".") last)
nbns
;]
Expand Down
3 changes: 0 additions & 3 deletions reval-ui/src/reval/dali/viewer/collection_viewer.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
[webly.spa.mode :refer [get-resource-path]]
[dali.viewer :refer [viewer2]]))


(defn url-collections []
; target/webly/public/rdocument/notebooks.edn
(str (get-resource-path) "rdocument/notebooks.edn"))


(defn load-transform-edn [{:keys [url link] :as opts}]
(-> (load-edn opts)
(p/then (fn [data]
{:link link
:data data}))))


(defn collection-viewer [{:keys [link]}]
[viewer2
{:viewer-fn 'reval.dali.viewer.collection/notebook-collection
Expand Down
1 change: 0 additions & 1 deletion reval-ui/src/reval/dali/viewer/evalerr.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(ns reval.dali.viewer.evalerr)


;; currently not used.

(def show-stacktrace true)
Expand Down
18 changes: 9 additions & 9 deletions reval-ui/src/reval/dali/viewer/list.cljs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
(ns reval.dali.viewer.list
(:require
[dali.viewer :refer [viewer2]]))
(:require
[dali.viewer :refer [viewer2]]))

;; used to show seq/vec/maps where the children
;; are dali-specs

(defn one [dali-spec]
[:span.mr-1
[viewer2 dali-spec]])
[viewer2 dali-spec]])

(defn list-view [{:keys [class open close children]} ]
[:span {:class class}
[:span.font-bold.teal-700.mr-1 open]
(defn list-view [{:keys [class open close children]}]
[:span {:class class}
[:span.font-bold.teal-700.mr-1 open]
; [:span "#" (count children)]
(into [:span.items]
(map one children))
[:span.font-bold.teal-700.ml-1 close]])
(into [:span.items]
(map one children))
[:span.font-bold.teal-700.ml-1 close]])


13 changes: 8 additions & 5 deletions reval-ui/src/reval/dali/viewer/notebook.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
(when scode
[highlightjs scode])
(when result
[:div.mt-1.mb-1.w-full
[:div.mt-1.mb-1.w-full.h-full
{:style {:max-width "800px"
:max-height "400px"}}
[viewer2 result]])
(when err
[viewer2 err])
[:div.mt-1.mb-1.w-full.h-full
{:style {:max-width "800px"
:max-height "400px"}}
[viewer2 err]])
(when (not (blank? out))
[:div.bg-blue-200.max-w-full.overflow-x-auto
[text2 out]])

]))
[text2 out]])]))

;; notebook

Expand Down
Loading

0 comments on commit edda516

Please sign in to comment.