Skip to content

Commit d5ef218

Browse files
author
yenda
committed
use shadow-cljs
Signed-off-by: Jakub Sokołowski <jakub@status.im> Signed-off-by: yenda <eric@status.im>
1 parent 1150626 commit d5ef218

252 files changed

Lines changed: 6311 additions & 7737 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clj-kondo/config.edn

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{:lint-as {status-im.utils.views/defview clojure.core/defn
22
status-im.utils.views/letsubs clojure.core/let
3-
status-im.utils.fx/defn clojure.core/defn
3+
status-im.utils.fx/defn clj-kondo.lint-as/def-catch-all
44
status-im.utils.styles/def clojure.core/def
55
status-im.utils.styles/defn clojure.core/defn}
6-
:linters {:invalid-arity {:skip-args [status-im.utils.fx/defn]}}}
6+
:linters {:invalid-arity {:skip-args [status-im.utils.fx/defn]}
7+
;;TODO remove number when this is fixed
8+
;;https://github.com/borkdude/clj-kondo/issues/867
9+
:unresolved-symbol {:exclude [PersistentPriorityMap.EMPTY number]}}}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ figwheel_server.log
8686
.lein-failures
8787
.lein-repl-history
8888

89+
# Shadow
90+
.shadow-cljs
91+
8992
## Doo
9093
#
9194
out
@@ -100,6 +103,7 @@ Statusgo.framework
100103
#ios
101104
/ios/Pods/
102105
/ios/StatusIm.xcworkspace
106+
/ios/react-native-xcode.log
103107
.ruby-version
104108
status-e2e/
105109

@@ -184,4 +188,6 @@ status-modules/resources
184188
/fiddle/target/
185189
/fiddle/resources/public/images/
186190

187-
trace.edn
191+
trace.edn
192+
193+
app

Makefile

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ nix-add-gcroots: ##@nix Add Nix GC roots to avoid status-react expressions being
9292
nix-update-gradle: ##@nix Update maven nix expressions based on current gradle setup
9393
nix/mobile/android/maven-and-npm-deps/maven/generate-nix.sh
9494

95-
nix-update-lein: export TARGET := lein
96-
nix-update-lein: ##@nix Update maven nix expressions based on current lein setup
97-
nix/tools/lein/generate-nix.sh nix/lein
95+
nix-update-clojure: export TARGET := clojure
96+
nix-update-clojure: ##@nix Update maven nix expressions based on current clojure setup
97+
nix/deps/clojure/generate.sh
9898

99-
nix-update-gems: export TARGET := lein
99+
nix-update-gems: export TARGET := default
100100
nix-update-gems: ##@nix Update Ruby gems in fastlane/Gemfile.lock and fastlane/gemset.nix
101101
fastlane/update.sh
102102

@@ -131,14 +131,6 @@ watchman-clean: export TARGET := watchman
131131
watchman-clean: ##@prepare Delete repo directory from watchman
132132
watchman watch-del $${STATUS_REACT_HOME}
133133

134-
disable-githooks: SHELL := /bin/sh
135-
disable-githooks: ##@prepare Disables lein githooks
136-
@rm -f ${env.WORKSPACE}/.git/hooks/pre-commit && \
137-
sed -i'~' -e 's|\[rasom/lein-githooks|;; [rasom/lein-githooks|' \
138-
-e 's|:githooks|;; :githooks|' \
139-
-e 's|:pre-commit|;; :pre-commit|' project.clj; \
140-
rm project.clj~
141-
142134
pod-install: export TARGET := ios
143135
pod-install: ##@prepare Run 'pod install' to install podfiles and update Podfile.lock
144136
cd ios && pod install; cd --
@@ -196,31 +188,18 @@ prod-build-android: jsbundle-android ##@legacy temporary legacy alias for jsbund
196188
jsbundle-android: SHELL := /bin/sh
197189
jsbundle-android: export TARGET ?= android
198190
jsbundle-android: export BUILD_ENV ?= prod
199-
jsbundle-android: ##@jsbundle Compile JavaScript and Clojure into index.android.js
200-
# Call nix-build to build the 'targets.mobile.android.jsbundle' attribute and copy the index.android.js file to the project root
201-
@git clean -dxf ./index.$(TARGET).js
191+
jsbundle-android: ##@jsbundle Compile JavaScript and Clojurescript into app directory
192+
# Call nix-build to build the 'targets.mobile.android.jsbundle' attribute and copy the.js files to the project root
202193
nix/scripts/build.sh targets.mobile.android.jsbundle && \
203-
mv result/index.$(TARGET).js ./
194+
mv result/* ./
204195

205196
prod-build-ios: jsbundle-ios ##@legacy temporary legacy alias for jsbundle-ios
206197
@echo "${YELLOW}This a deprecated target name, use jsbundle-ios.$(RESET)"
207198

208199
jsbundle-ios: export TARGET ?= ios
209200
jsbundle-ios: export BUILD_ENV ?= prod
210201
jsbundle-ios: ##@jsbundle Compile JavaScript and Clojure into index.ios.js
211-
@git clean -dxf -f ./index.$(TARGET).js && \
212-
lein jsbundle-ios && \
213-
node prepare-modules.js
214-
215-
prod-build-desktop: jsbundle-desktop ##@legacy temporary legacy alias for jsbundle-desktop
216-
@echo "${YELLOW}This a deprecated target name, use jsbundle-desktop.$(RESET)"
217-
218-
jsbundle-desktop: export TARGET ?= $(HOST_OS)
219-
jsbundle-desktop: export BUILD_ENV ?= prod
220-
jsbundle-desktop: ##@jsbundle Compile JavaScript and Clojure into index.desktop.js
221-
git clean -qdxf -f ./index.desktop.js desktop/ && \
222-
lein jsbundle-desktop && \
223-
node prepare-modules.js
202+
yarn shadow-cljs release ios
224203

225204
#--------------
226205
# Clojure REPL
@@ -229,7 +208,7 @@ jsbundle-desktop: ##@jsbundle Compile JavaScript and Clojure into index.desktop.
229208
_watch-%: ##@watch Start development for device
230209
$(eval SYSTEM := $(word 2, $(subst -, , $@)))
231210
$(eval DEVICE := $(word 3, $(subst -, , $@)))
232-
clj -R:dev build.clj watch --platform $(SYSTEM) --$(SYSTEM)-device $(DEVICE)
211+
yarn shadow-cljs watch $(SYSTEM)
233212

234213
watch-ios-real: export TARGET := ios
235214
watch-ios-real: _watch-ios-real
@@ -278,21 +257,24 @@ endif
278257
# Tests
279258
#--------------
280259

281-
lint: export TARGET := lein
260+
lint: export TARGET := clojure
282261
lint: ##@test Run code style checks
283-
lein cljfmt check
262+
# yarn clj-kondo --confg .clj-kondo/config.edn --lint src
263+
clojure -Sdeps '{:deps {cljfmt {:mvn/version "0.6.7"}}}' \
264+
-m cljfmt.main check src \
265+
--indents indentation.edn
284266

285-
lint-fix: export TARGET := lein
267+
lint-fix: export TARGET := clojure
286268
lint-fix: ##@test Run code style checks and fix issues
287-
lein cljfmt fix
269+
clojure -Sdeps '{:deps {cljfmt {:mvn/version "0.6.7"}}}' \
270+
-m cljfmt.main fix src \
271+
--indents indentation.edn
288272

289-
test: export TARGET := lein
273+
test: export TARGET := clojure
290274
test: ##@test Run tests once in NodeJS
291-
lein with-profile test doo node test once
292-
293-
test-auto: export TARGET := lein
294-
test-auto: ##@test Run tests in interactive (auto) mode in NodeJS
295-
lein with-profile test doo node test
275+
yarn shadow-cljs compile mocks && \
276+
yarn shadow-cljs compile test && \
277+
node --require ./test-resources/override.js target/test/test.js
296278

297279
coverage: ##@test Run tests once in NodeJS generating coverage
298280
@scripts/run-coverage.sh

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
2121
* bundleAssetName: "index.android.bundle",
2222
*
2323
* // the entry file for bundle generation
24-
* entryFile: "index.android.js",
24+
* entryFile: "index.js",
2525
*
2626
* // whether to bundle JS and assets in debug mode
2727
* bundleInDebug: false,
@@ -70,15 +70,15 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
7070
* inputExcludes: ["android/**", "ios/**"],
7171
*
7272
* // override which node gets called and with what additional arguments
73-
* nodeExecutableAndArgs: ["node"],
73+
* nodeExecutableAndArgs: ["node", "--max-old-space-size=8192"],
7474
*
7575
* // supply additional arguments to the packager
7676
* extraPackagerArgs: []
7777
* ]
7878
*/
7979
project.ext.react = [
8080
nodeExecutableAndArgs: ["node", "--max-old-space-size=16384"],
81-
entryFile: "index.android.js",
81+
entryFile: "index.js",
8282
enableHermes: true, // clean and rebuild if changing. NOTE: Hermes engine is required for Android 64-bit builds running on 64 devices, to guard against a hang in the UI thread after invoking status-go
8383
bundleInPr: true,
8484
inputExcludes: ["android/**", "ios/**", "react-native/**", "src/**", "test/**"]

android/app/src/main/java/im/status/ethereum/MainApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected List<ReactPackage> getPackages() {
3737

3838
@Override
3939
protected String getJSMainModuleName() {
40-
return "index.android";
40+
return "index";
4141
}
4242
};
4343

0 commit comments

Comments
 (0)