forked from motiondivision/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (59 loc) · 1.9 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
SHELL := /bin/bash
###### This is coming from our shared.mk in the FramerStudio repo
# Include node modules in the path
PATH := $(CURDIR)/node_modules/.bin:$(PATH)
# Use a modern shell
SHELL := /bin/bash
# Default target is build
default: build
# Cleaning removes build dir and node_modules. Use double colon so it can be extended.
clean::
rm -rf build
rm -rf node_modules
git clean -fdX .
# Update node modules if package.json is newer than node_modules or yarn lockfile
# Use a mutex file so multiple Source dirs can be built in parallel.
node_modules/.yarn-integrity: yarn.lock package.json
yarn install --mutex network
touch $@
bootstrap:: node_modules/.yarn-integrity
SOURCE_FILES := $(shell find ./src -type f)
######
# The location to gather test reports
TEST_REPORT_PATH := $(if $(CIRCLE_TEST_REPORTS),$(CIRCLE_TEST_REPORTS),$(CURDIR)/test_reports)
API_TARGET=dist/framer-motion.api.json
API_REVIEW_FILE=api/framer-motion.api.ts
DECLARATION_TARGET=types/index.d.ts
build: bootstrap
yarn build
watch: bootstrap
yarn watch
dev: bootstrap
npm run start-dev-server
test-watch: bootstrap
if test -f coverage/lcov-report/index.html; then \
open coverage/lcov-report/index.html; \
fi;
yarn test-watch
bump:
npm version patch
publish: clean bootstrap
npm publish
git push
test: bootstrap $(API_TARGET)
yarn test
yarn tsc dist/framer-motion.d.ts --skipLibCheck
test-ci: bootstrap $(API_TARGET)
mkdir -p $(TEST_REPORT_PATH)
JEST_JUNIT_OUTPUT=$(TEST_REPORT_PATH)/framer-motion.xml yarn test-ci --ci --reporters=jest-junit
yarn tsc dist/framer-motion.d.ts --skipLibCheck
lint: bootstrap
yarn lint
pretty: bootstrap
prettier --write */**/*.tsx */**/*.ts
$(DECLARATION_TARGET): $(SOURCE_FILES)
yarn tsc -p . --emitDeclarationOnly --removeComments false
$(API_TARGET) $(API_REVIEW_FILE): api-extractor.json $(DECLARATION_TARGET)
yarn api-extractor run -l
api: bootstrap $(API_TARGET)
.PHONY: dev lint