-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathMakefile
86 lines (69 loc) · 1.93 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
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 "bytes \\t kilobytes \\t file"
@echo "--- \\t\\t --- \\t\\t ---"
@ls -alh ./packages/proppy*/dist/*.min.js.gz | awk '{print $$9 }' | while read LINE; do\
SIZE="$$(cat $${LINE} | wc -c | bc)";\
SIZE_IN_KB=$$(echo "scale=1; $${SIZE} / 1024" | bc);\
echo "$${SIZE}K \\t\\t $${SIZE_IN_KB}K \\t\\t $${LINE}";\
done
##
# Site
site-build:
node ./site/bin/build.js
mkdir -p ./_site/css
./node_modules/.bin/node-sass --include-path ./node_modules ./site/assets/css/main.scss ./_site/css/site.css
mkdir -p ./_site/js
cp -r ./site/assets/js/ ./_site/js/
cp -rf ./site/assets/img ./_site/img
site-watch:
make site-build
fswatch -or './site' | xargs -I{} make site-build
site-serve-only:
echo "Starting server at http://localhost:6001"
./node_modules/.bin/live-server --port=6001 ./_site/
site-serve:
make site-build
make site-serve-only
site-publish:
rm -rf ./_site
make site-build
make site-publish-only
site-publish-only:
rm -rf ./_site/.git
cp -f CNAME ./_site/CNAME
(cd ./_site && git init)
(cd ./_site && git commit --allow-empty -m 'update site')
(cd ./_site && git checkout -b gh-pages)
(cd ./_site && touch .nojekyll)
(cd ./_site && git add .)
(cd ./_site && git commit -am 'update site')
(cd ./_site && git push git@github.com:fahad19/proppy gh-pages --force)