forked from RailsEventStore/rails_event_store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (44 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
GEM_VERSION = $(shell cat ../RES_VERSION)
GEM_NAME = ruby_event_store-browser
JS_OUTFILE = public/ruby_event_store_browser.js
CSS_OUTFILE = public/ruby_event_store_browser.css
include ../support/make/install.mk
include ../support/make/test.mk
include ../support/make/mutant.mk
include ../support/make/gem.mk
include ../support/make/help.mk
install: install-npm
test: $(JS_OUTFILE) $(CSS_OUTFILE) test-elm
build: $(JS_OUTFILE) $(CSS_OUTFILE)
push: $(JS_OUTFILE) $(CSS_OUTFILE)
clean: clean-elm clean-css
clean-elm:
@rm $(JS_OUTFILE) 2>/dev/null || true
clean-css:
@rm $(CSS_OUTFILE) 2>/dev/null || true
watch-elm: clean-elm
@cd elm; \
npx chokidar-cli "src/**/*.elm" \
-c "npx elm make src/Main.elm --output ../$(JS_OUTFILE)" \
--initial
watch-css: clean-css
@cd elm; \
npx tailwindcss -w \
-i src/style.css \
-o ../$(CSS_OUTFILE)
dev: ## Start standalone browser seeded with some events and Elm/CSS recompile on change
@$(MAKE) -j3 serve watch-elm watch-css
serve:
@bundle exec rackup --port 9393 devserver/config.ru
build-npm: $(JS_OUTFILE) $(CSS_OUTFILE)
install-npm:
@cd elm; npm install --no-fund --no-audit
test-elm:
@cd elm; npx elm-test
$(CSS_OUTFILE):
@echo "Building browser CSS"
@cd elm; NODE_ENV=production npx tailwindcss -m -i src/style.css -o ../public/ruby_event_store_browser.css 2> /dev/null
$(JS_OUTFILE):
@echo "Building browser JS"
@cd elm; npx elm make --optimize --output=../public/ruby_event_store_browser.js src/Main.elm > /dev/null
@cd elm; npx uglify-js ../public/ruby_event_store_browser.js --compress "pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe" | npx uglify-js --mangle --output ../public/ruby_event_store_browser.js