-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
73 lines (60 loc) · 1.62 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
FROM_TAG := ""
TO_TAG := ""
GITHUB_API_TOKEN := ""
##
# Releases
release:
npm run dist
./node_modules/.bin/lerna publish --force-publish=*
release-canary:
npm run dist
./node_modules/.bin/lerna publish --canary
##
# Changelog
changelog:
git checkout master
git pull origin master
GITHUB_AUTH=$(GITHUB_API_TOKEN) ./node_modules/.bin/lerna-changelog --tag-from $(FROM_TAG) --tag-to $(TO_TAG)
push-changelog:
git checkout master
git pull origin master
git add CHANGELOG.md
git commit -m 'changelog updated.'
git push origin master
##
# Packages
list-packages:
./node_modules/.bin/lerna ls
list-updated:
./node_modules/.bin/lerna updated
list-dists:
@echo "original \\t gzipped \\t file"
@echo "--- \\t\\t --- \\t\\t ---"
@ls -alh ./packages/frint*/dist/*.js | grep '.min.js' | awk '{print $$9 }' | while read LINE; do\
SIZE="$$(cat $${LINE} | wc -c | bc)";\
SIZE_IN_KB=$$(echo "scale=1; $${SIZE} / 1024" | bc);\
GZIPPED_SIZE="$$(gzip -c $${LINE} | wc -c | bc)";\
GZIPPED_SIZE_IN_KB=$$(echo "scale=1; $${GZIPPED_SIZE} / 1024" | bc);\
echo "$${SIZE_IN_KB}K \\t\\t $${GZIPPED_SIZE_IN_KB}K \\t\\t $${LINE}";\
done
##
# REPL
#
repl-update-dists:
npm run dist
cp -rf ./packages/frint*/dist/ ./repl/js/
repl-serve-only:
./node_modules/.bin/live-server --port=6002 ./repl
repl-serve:
make repl-update-dists
make repl-serve-only
##
# Usage stats
#
define list_usage_in_source
find ./packages -iname "*.js" | grep "/src/" | grep -v -e ".spec.js" -e "/node_modules/" | xargs cat | grep $(1) | sort -u
endef
list-usage-rxjs:
@$(call list_usage_in_source,'rxjs/')
list-usage-lodash:
@$(call list_usage_in_source,'lodash/')