-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
97 lines (70 loc) · 2.34 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# check for build/shipkit and clone if not there, this should come first
SHIPKIT_DIR = build/shipkit
$(shell [ ! -e $(SHIPKIT_DIR) ] && git clone -b v1.0.40 https://github.com/yakworks/shipkit.git $(SHIPKIT_DIR) >/dev/null 2>&1)
# Shipkit.make first, which does all the lifting to create makefile.env for the BUILD_VARS
include $(SHIPKIT_DIR)/Shipkit.make
include $(SHIPKIT_DIR)/makefiles/vault.make
include $(SHIPKIT_MAKEFILES)/docker.make
include $(SHIPKIT_MAKEFILES)/git-tools.make
include $(SHIPKIT_MAKEFILES)/ship-version.make
include $(SHIPKIT_MAKEFILES)/circle.make
# -- Variables ---
export BOT_EMAIL ?= [email protected]
karma.sh = npx karma
lint.sh = npx eslint
jest.sh = npx jest
# --- standard base build ----
node_modules:
yarn install
## runs the yarn install
install: node_modules
## Run the lint and tests, will install if not done already
check: install lint test
## runs both karma and jasmine tests
test: jest test.karma test.jasmine
## runs karma tests
test.karma:
$(karma.sh) start tests/karma.conf.js --single-run --no-auto-watch --no-sandbox $$*
## runs jasmine tests
test.jasmine:
$(karma.sh) start tests/karma-jasmine.conf.js --single-run --no-auto-watch --no-sandbox $$*
## runs jasmine tests
jest:
$(jest.sh)
## runs eslint
lint:
$(lint.sh) src/
## runs eslint with --fix
lint.fix:
$(lint.sh) src/ --fix
## runs eslint
demo.lint:
$(lint.sh) examples/demo/
## runs eslint with --fix
demo.lint.fix:
$(lint.sh) examples/demo/ --fix
## removes build and test dirs
clean:
rm -rf dist && rm -rf build
## starts the demo app
start.demo:
npx webpack-dev-server --mode=development --content-base ./examples/demo
start.svelte:
npx webpack-dev-server --content-base ./examples/svelte
clean.dist:
rm -rf dist/
## builds the demo app
build.demo: clean.dist
npx webpack --mode=production --content-base ./examples/demo
build.ag: clean.dist
npx webpack --mode=production --content-base .
build.analyze: export BUNDLE_ANALYZE=true
build.analyze: clean.dist build.ag
run.build:
cd dist && python -m SimpleHTTPServer 8090 & npx webpack-dev-server --content-base ./examples/demo
# --------- ship, version, deploy ------------
# --- Dev and testing and misc, here below is for testing and debugging ----
install-githooks:
git config core.hooksPath .githooks
start.sandbox:
npx webpack-dev-server --mode=development --content-base ./examples/sandbox