Skip to content

Commit

Permalink
Remove lein-shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Mar 26, 2024
1 parent b9bd9bc commit 1db8779
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 58 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ compiled*/
misc/
/node_modules/
/.shadow-cljs/
/shadow-cljs.edn
/.clj-kondo/
/.lsp/
.*
73 changes: 16 additions & 57 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
(require 'leiningen.core.eval)

(def http-port 3449)

;; ---------------------------------------------------------------------------------------

(defproject re-com "lein-git-inject/version"
Expand All @@ -15,12 +13,12 @@
org.clojure/google-closure-library
org.clojure/google-closure-library-third-party]]
[thheller/shadow-cljs "2.27.2" :scope "provided"]
[reagent "1.1.0" :scope "provided"]
[reagent/reagent "1.1.0" :scope "provided"]
[org.clojure/core.async "1.3.618"]
[com.andrewmcveigh/cljs-time "0.5.2"]]
[com.andrewmcveigh/cljs-time "0.5.2"]
[day8/shadow-git-inject "0.0.5"]]

:plugins [[day8/lein-git-inject "0.0.15"]
[lein-shadow "0.4.0"]
[com.github.liquidz/antq "RELEASE"]
[lein-shell "0.5.0"]
[lein-pprint "1.3.2"]]
Expand All @@ -43,7 +41,6 @@
:resource-paths ["run/resources"]

:clean-targets ^{:protect false} [:target-path
"shadow-cljs.edn"
"node_modules"
"run/resources/public/compiled_dev"
"run/resources/public/compiled_prod"
Expand All @@ -57,50 +54,6 @@
;; Exclude the demo and compiled files from the output of either 'lein jar' or 'lein install'
:jar-exclusions [#"(?:^|\/)re_demo\/" #"(?:^|\/)demo\/" #"(?:^|\/)compiled.*\/" #"html$"]

:shadow-cljs {:nrepl {:port 7777}

:builds {:demo {:target :browser
:modules {:demo {:init-fn re-demo.core/mount-demo}}
:compiler-options {:closure-defines {re-com.config/version "lein-git-inject/version"
;; For production builds of the demo app, set goog.DEBUG
;; to be true so that the debugging demo page works as expected.
goog.DEBUG true
re-com.config/force-include-args-desc? true}
;; For production builds of the demo app, keep the component name
;; symbols for display in validation error logging.
:pseudo-names true
:externs ["externs/detect-element-resize-externs.js"]}
:dev {:asset-path "/compiled_dev/demo"
:output-dir "run/resources/public/compiled_dev/demo"
:compiler-options {:closure-defines {;; When re-com produces validation errors it tries to provide links
;; to source code. These links require that you provide the root URL
;; to the ClojureScript compiler output with source maps.
re-com.config/root-url-for-compiler-output "http://localhost:3449/compiled_dev/demo/cljs-runtime/"}
:external-config {:devtools/config {:features-to-install [:formatters :hints]}}}}
:release {:output-dir "run/resources/public/compiled_prod/demo"
:compiler-options {:closure-defines {;; For production builds, such as the demo website, there is no source
;; code to link to in validation errors or component stacks, so we set
;; it to an empty string to cause links to not be displayed at all.
re-com.config/root-url-for-compiler-output ""}}}
:devtools {:http-port ~http-port
:http-root "run/resources/public"
:push-state/index "index_dev.html"}}

:browser-test {:target :browser-test
:ns-regexp "-test$"
:test-dir "run/resources/public/compiled_test/demo"
:compiler-options {:closure-defines {re-com.config/version "lein-git-inject/version"}
:externs ["externs/detect-element-resize-externs.js"]
:external-config {:devtools/config {:features-to-install [:formatters :hints]}}}
:devtools {:http-port 8021
:http-root "run/resources/public/compiled_test/demo"}}
:karma-test {:target :karma
:ns-regexp ".*-test$"
:output-to "target/karma/test.js"
:compiler-options {:pretty-print true
:closure-defines {re-com.config/version "lein-git-inject/version"}
:externs ["externs/detect-element-resize-externs.js"]}}}}

:release-tasks [["deploy" "clojars"]]

:shell {:commands {"karma" {:windows ["cmd" "/c" "karma"]
Expand All @@ -112,28 +65,34 @@
:aliases {;; *** DEV ***
"watch" ["with-profile" "+dev,+demo" "do"
["clean"]
["shadow" "watch" "demo" "browser-test" "karma-test"]]
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "watch" "demo" "browser-test" "karma-test"]]

;; *** PROD ***
"prod-once" ["with-profile" "+demo,-dev" "do"
["clean"]
["shadow" "release" "demo"]]
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "release" "demo"]]

"deploy-aws" ["with-profile" "+demo,-dev" "do"
["clean"]
["shadow" "release" "demo"]
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "release" "demo"]
~["shell" "aws" "s3" "sync" "run/resources/public" "s3://re-demo/" "--acl" "public-read" "--cache-control" "max-age=2592000,public"]]

;; *** TEST ***
"build-report-ci" ["with-profile" "+demo,-dev" "do"
["clean"]
["shadow" "run" "shadow.cljs.build-report" "demo" "target/build-report.html"]]
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "clj-run" "shadow.cljs.build-report" "demo" "target/build-report.html"]]

"ci" ["do"
["with-profile" "+dev" "do"
["clean"]
["shadow" "compile" "karma-test"]
["shell" "karma" "start" "--single-run" "--reporters" "junit,dots"]]
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "compile" "karma-test"]
["shell" "npx" "karma" "start" "--single-run" "--reporters" "junit,dots"]]
["with-profile" "+demo,-dev" "do"
["clean"]
["shadow" "release" "demo"]]]})
["shell" "npm" "install"]
["shell" "npx" "shadow-cljs" "release" "demo"]]]})
49 changes: 49 additions & 0 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{:lein true
:nrepl {:port 7777}

:builds {:demo
{:target :browser
:modules {:demo {:init-fn re-demo.core/mount-demo}}
:build-hooks [(shadow-git-inject.core/hook)]
:compiler-options {:closure-defines {re-com.config/version :shadow-git-inject/version
;; For production builds of the demo app, set goog.DEBUG
;; to be true so that the debugging demo page works as expected.
goog.DEBUG true
re-com.config/force-include-args-desc? true}
;; For production builds of the demo app, keep the component name
;; symbols for display in validation error logging.
:pseudo-names true
:externs ["externs/detect-element-resize-externs.js"]}
:dev {:asset-path "/compiled_dev/demo"
:output-dir "run/resources/public/compiled_dev/demo"
:compiler-options
{:closure-defines {;; When re-com produces validation errors it tries to provide links
;; to source code. These links require that you provide the root URL
;; to the ClojureScript compiler output with source maps.
re-com.config/root-url-for-compiler-output
"http://localhost:3449/compiled_dev/demo/cljs-runtime/"}
:external-config {:devtools/config {:features-to-install [:formatters :hints]}}}}
:release {:output-dir "run/resources/public/compiled_prod/demo"
:compiler-options {:closure-defines {;; For production builds, such as the demo website, there is no source
;; code to link to in validation errors or component stacks, so we set
;; it to an empty string to cause links to not be displayed at all.
re-com.config/root-url-for-compiler-output ""}}}
:devtools {:http-port 3449
:http-root "run/resources/public"
:push-state/index "index_dev.html"
:preloads [hashp.core]}}

:browser-test {:target :browser-test
:ns-regexp "-test$"
:test-dir "run/resources/public/compiled_test/demo"
:compiler-options {:closure-defines {re-com.config/version :shadow-git-inject/version}
:externs ["externs/detect-element-resize-externs.js"]
:external-config {:devtools/config {:features-to-install [:formatters :hints]}}}
:devtools {:http-port 8021
:http-root "run/resources/public/compiled_test/demo"}}
:karma-test {:target :karma
:ns-regexp ".*-test$"
:output-to "target/karma/test.js"
:compiler-options {:pretty-print true
:closure-defines {re-com.config/version :shadow-git-inject/version}
:externs ["externs/detect-element-resize-externs.js"]}}}}

0 comments on commit 1db8779

Please sign in to comment.