Add npm install
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8962b9d930
commit
443fd967ab
10
.drone.yml
10
.drone.yml
|
@ -1,12 +1,20 @@
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
steps:
|
steps:
|
||||||
|
- name: npm-deps
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- cd reagent-reitit-demo
|
||||||
|
- npm install
|
||||||
|
#- npx shadow-cljs build app
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
image: clojure:tools-deps
|
image: clojure:tools-deps
|
||||||
commands:
|
commands:
|
||||||
- cd reagent-reitit-demo
|
- cd reagent-reitit-demo
|
||||||
- cp resources/public/rename-me-index.html resources/public/index.html
|
- cp resources/public/rename-me-index.html resources/public/index.html
|
||||||
- clj -A:prod
|
- clj -Mbuild-dev release app
|
||||||
|
#- clj -A:prod
|
||||||
|
|
||||||
- name: deploy-site
|
- name: deploy-site
|
||||||
pull: True
|
pull: True
|
||||||
|
|
|
@ -30,4 +30,6 @@
|
||||||
com.bhauman/figwheel-main {:mvn/version "0.2.18"}}
|
com.bhauman/figwheel-main {:mvn/version "0.2.18"}}
|
||||||
:paths ["src" "resources"]
|
:paths ["src" "resources"]
|
||||||
:aliases {:prod {:main-opts ["-m" "figwheel.main" "-bo" "dev"]}
|
:aliases {:prod {:main-opts ["-m" "figwheel.main" "-bo" "dev"]}
|
||||||
|
:build-dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.23.3"}}
|
||||||
|
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
|
||||||
:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.23.3"}}}}}
|
:dev {:extra-deps {thheller/shadow-cljs {:mvn/version "2.23.3"}}}}}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<div id="app">
|
<div id="app">
|
||||||
loading here
|
loading here
|
||||||
</div>
|
</div>
|
||||||
<script src="/cljs-out/dev-main.js" type="text/javascript"></script>
|
<script src="/cljs-out/main_bundle.js" type="text/javascript"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
:deps {:aliases [:dev]}
|
||||||
|
:dev-http {8080 "resources/public/"}
|
||||||
|
:source ["src" "../../components"]
|
||||||
|
:builds {:app {:output-dir "resources/public/cljs-out/"
|
||||||
|
:asset-path "."
|
||||||
|
:target :browser
|
||||||
|
:compiler-options {:infer-externs :auto
|
||||||
|
:output-feature-set :es6}
|
||||||
|
:modules {:main_bundle {:init-fn clojure-demo.core/startup!}}
|
||||||
|
:devtools {:after-load app.main/reload!}}}}
|
|
@ -1,6 +1,6 @@
|
||||||
(ns ^:figwheel-hooks clojure-demo.core
|
(ns ^:figwheel-hooks clojure-demo.core
|
||||||
(:require ["react-dom/client" :refer [createRoot]]
|
(:require ["react-dom/client" :refer [createRoot]]
|
||||||
["@codemirror/state" :as cm-state :refer [EditorState] ]
|
["@codemirror/state" :as cm-state :refer [EditorState Transaction] ]
|
||||||
["@codemirror/view" :as cm-view :refer [EditorView ViewUpdate]]
|
["@codemirror/view" :as cm-view :refer [EditorView ViewUpdate]]
|
||||||
["@codemirror/commands" :as cm-commands :refer [defaultKeymap]]
|
["@codemirror/commands" :as cm-commands :refer [defaultKeymap]]
|
||||||
["@codemirror/theme-one-dark" :refer [oneDark]]
|
["@codemirror/theme-one-dark" :refer [oneDark]]
|
||||||
|
@ -59,22 +59,36 @@
|
||||||
;(def sci-ctx (sci/empty-environment))
|
;(def sci-ctx (sci/empty-environment))
|
||||||
(sci/alter-var-root sci/print-fn (constantly *print-fn*))
|
(sci/alter-var-root sci/print-fn (constantly *print-fn*))
|
||||||
|
|
||||||
|
(defn fetch-selected-text [v transactions]
|
||||||
|
(reduce (fn [text t]
|
||||||
|
(if (= "select.pointer" (str (.annotation t (.-userEvent Transaction) )))
|
||||||
|
(conj text
|
||||||
|
(.sliceDoc
|
||||||
|
^EditorState (.-state v)
|
||||||
|
(.-from (.-main (.-selection t)))
|
||||||
|
(.-to (.-main (.-selection t)))))
|
||||||
|
text))
|
||||||
|
[]
|
||||||
|
transactions))
|
||||||
|
|
||||||
(defn code-editor
|
(defn code-editor
|
||||||
[content]
|
[content]
|
||||||
(let [editor (atom nil)
|
(let [editor (atom nil)
|
||||||
evaled-result (reagent/atom nil)
|
evaled-result (reagent/atom nil)
|
||||||
update-timeout (reagent/atom nil)
|
update-timeout (reagent/atom nil)
|
||||||
update-fn (.of (.-updateListener EditorView)
|
update-fn (.of (.-updateListener EditorView)
|
||||||
(fn [^ViewUpdate v]
|
(fn [^ViewUpdate view-update]
|
||||||
(js/clearTimeout @update-timeout)
|
(js/clearTimeout @update-timeout)
|
||||||
(reset! update-timeout
|
(reset! update-timeout
|
||||||
(js/setTimeout
|
(js/setTimeout
|
||||||
(fn []
|
(fn []
|
||||||
(reset! evaled-result (sci/eval-string* sci-ctx
|
(let [selected-text (fetch-selected-text view-update (.-transactions view-update))
|
||||||
(.toString (.-doc (.-state v))) #_content ))
|
eval-code (if (seq selected-text)
|
||||||
(prn "updated delayed")) 2000))
|
(first selected-text)
|
||||||
#_(when (.-docChanged v)
|
(.-doc (.-state view-update)))]
|
||||||
(prn v))))
|
(reset! evaled-result (sci/eval-string* sci-ctx
|
||||||
|
(.toString eval-code) ))
|
||||||
|
(prn "updated delayed"))) 1000))))
|
||||||
start-state
|
start-state
|
||||||
(.create EditorState
|
(.create EditorState
|
||||||
(clj->js {:doc content
|
(clj->js {:doc content
|
||||||
|
|
Loading…
Reference in New Issue