Skip to content

Commit

Permalink
examples cljs compiler change: figwhel --> shadow-cljs
Browse files Browse the repository at this point in the history
  • Loading branch information
philoskim committed Apr 6, 2023
1 parent befce97 commit 302e1ae
Show file tree
Hide file tree
Showing 8 changed files with 676 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
.lein-repl-history
.lsp
.clj-kondo
.DS_Store
.shadow-cljs
/pom.xml
/pom.xml.asc
figwheel_server.log

/examples/target
/examples/pom.xml
/examples/node_modules
/examples/resources/public/js
/examples/figwheel_server.log
/examples/.rebel_readline_history
/examples/.lein-repl-history

Expand Down
7 changes: 4 additions & 3 deletions examples/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ $ lein run

[listing]
----
$ lein clean
$ lein figwheel
$ yarn install
$ yarn clean
$ yarn test
----

. Open the URL http://localhost:3449/ in your browser.
. Open the URL http://localhost:8080/ in your browser.

. Open the DevTool's console widnow by pressing <Ctrl-Shift-I> in case of Google Chrome
and you will see the evaluated results of the examples.
10 changes: 10 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"private": true,
"devDependencies": {
"shadow-cljs": "2.16.5"
},
"scripts": {
"test": "npx shadow-cljs watch test",
"clean": "rm -rf resources/public/js"
}
}
12 changes: 1 addition & 11 deletions examples/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,4 @@
["target"
"resources/public/js/out"
"resources/public/js/app.js"
"resources/public/js/app.js.map"]
:cljsbuild {:builds [{:id "dev"
:source-paths ["src/cljs" "src/cljc"]
:figwheel true
:compiler {:main examples.core
:preloads [examples.preload #_devtools.preload]
:asset-path "js/out"
:output-to "resources/public/js/app.js"
:output-dir "resources/public/js/out"
:source-map true
:optimizations :none} }]})
"resources/public/js/app.js.map"])
2 changes: 1 addition & 1 deletion examples/resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<h2>cljs.debux example</h2>
<h3>Look at the developer console of the browser!</h3>

<script src="js/app.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions examples/shadow-cljs.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; shadow-cljs configuration
{:source-paths ["src/cljs" "src/cljc"]
:dependencies [[philoskim/debux "0.8.2"]]
:dev-http {8080 "resources/public"}
:builds {:test {:target :browser
:output-dir "resources/public/js"
:asset-path "/js"
:modules {:main {:init-fn examples.core/init}} }}}
2 changes: 2 additions & 0 deletions examples/src/cljs/examples/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
;examples.lab
))

(defn init [])

Loading

0 comments on commit 302e1ae

Please sign in to comment.