From eb7f383c2b30108b56570ffff2199e0c1eabb3f1 Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Sun, 17 Dec 2023 10:57:41 +0100 Subject: [PATCH] Remove lein-shadow --- .gitignore | 1 - project.clj | 73 +++++++++++-------------------------------------- shadow-cljs.edn | 50 +++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 58 deletions(-) create mode 100644 shadow-cljs.edn diff --git a/.gitignore b/.gitignore index 2ba2f332..9dde18b6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ compiled*/ misc/ /node_modules/ /.shadow-cljs/ -/shadow-cljs.edn /.clj-kondo/ /.lsp/ .* \ No newline at end of file diff --git a/project.clj b/project.clj index 1acfcf6d..cf8103c3 100644 --- a/project.clj +++ b/project.clj @@ -1,7 +1,5 @@ (require 'leiningen.core.eval) -(def http-port 3449) - ;; --------------------------------------------------------------------------------------- (defproject re-com "lein-git-inject/version" @@ -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"]] @@ -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" @@ -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"] @@ -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"]]]}) diff --git a/shadow-cljs.edn b/shadow-cljs.edn new file mode 100644 index 00000000..82a178d6 --- /dev/null +++ b/shadow-cljs.edn @@ -0,0 +1,50 @@ +{:deps 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"]}}}} +-