-
-
Notifications
You must be signed in to change notification settings - Fork 349
/
Makefile
62 lines (51 loc) · 1.07 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
BUILD_DIR = .build
TEST_DIR = .
SEMVER=prerelease --preid=beta
EXAMPLES=$(dir $(wildcard examples/*/package.json))
install:
npm ci
npm run build
$(foreach ex,$(EXAMPLES),(cd $(ex) && npm ci && npm run link && npm run build) || exit $$?;)
.PHONY: install
update:
npm ci
npm run build
$(foreach ex,$(EXAMPLES),(cd $(ex) && npm install) || exit $$?;)
.PHONY: update
up:
npm run start
open http://localhost:8080
.PHONY: up
watch:
npm run watch &
.PHONY: watch
bump: guard-SEMVER
npm --no-git-tag-version version $(SEMVER);
.PHONY: bump
build:
mkdir $(BUILD_DIR)
git archive HEAD | tar -x -C $(BUILD_DIR)
cd $(BUILD_DIR); \
npm ci; \
npm run build --production;
.PHONY: build
test:
cd $(TEST_DIR); (npm start &); \
npm run lint && \
npm run test
.PHONY: test
release: TEST_DIR=$(BUILD_DIR)
release: clean build test
cd $(BUILD_DIR); \
npm publish
npm pack @webcreate/infinite-ajax-scroll
make clean
.PHONY: release
clean:
rm -rf $(BUILD_DIR)
.PHONY: clean
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi