-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (71 loc) · 2.2 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
.PHONY: build
#########
# Setup #
#########
install:
npm install
## Serve - Watch for design system changes and serve the demo.
serve:
npx concurrently "make watch" "cd demo && make serve" --names="Lib,Demo" --prefix=name --kill-others --kill-others-on-fail
## Serve - Watch for design system changes and serve the demo (assets only).
serve.assets:
npx concurrently "make watch" "cd demo && make serve.assets" --names="Lib,Demo" --prefix=name --kill-others --kill-others-on-fail
#########
# Build #
#########
## Build assets
build:
npx webpack --mode=production
## Build assets and watch
watch:
npx webpack --mode=development --watch
# Lint and code style fix
lint: lint.fix
lint.fix:
npx eslint src --ext .js --fix
lint.dry-run:
npx eslint src --ext .js
lint@integration: lint.dry-run
# Publish package
publish: build
npm publish . --access public
# Publish package
publish@beta: build
npm publish . --access public --tag beta
########
# Demo #
########
demo.clear:
rm -rf demo/build demo/public/build
demo.install:
cd demo && make install
## Simulates GH Pages deploy into a subdir / with base url
demo.build: export APP_ENV = prod
demo.build: export WEBPACK_PUBLIC_PATH = /elao-admin/build
demo.build: export ROUTER_DEFAULT_URI = http://localhost:8001/elao-admin
demo.build: install build demo.clear demo.install
cd demo && make build.assets
cd demo && symfony console cache:clear
cd demo && symfony console stenope:build build/elao-admin
## Serve the static version of the site from a subdir / with base url
serve.static-demo:
open http://localhost:8001/elao-admin
cd demo && php -S localhost:8001 -t build
#########
# Fonts #
#########
FONTELLO_DIR ?= ./vendor/fontello
FONTELLO_HOST ?= https://fontello.com
fontello.pull:
rm -rf .fontello.src .fontello.zip
curl --silent --show-error --fail --output .fontello.zip \
${FONTELLO_HOST}/`cat .fontello`/get
unzip .fontello.zip -d .fontello.src
rm -rf ${FONTELLO_DIR}
mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'` ${FONTELLO_DIR}
rm -rf .fontello.src .fontello.zip
fontello.push:
curl --silent --show-error --fail --output .fontello \
--form "config=@${FONTELLO_DIR}/config.json" \
${FONTELLO_HOST}
open ${FONTELLO_HOST}/`cat .fontello`