forked from framer/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (58 loc) · 2.25 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
###### This is coming from our common.mk in the FramerStudio repo
# Path of this file, includes trailing slash
# NOTE: Should not be used in files that import this one, use BASE_DIR instead.
__DIR__ := $(dir $(lastword $(MAKEFILE_LIST)))
# Root path of the repository, absolute (no slash suffix)
BASE_DIR := $(abspath $(__DIR__))
# 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
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
git clean -fdX .
# Use a mutex file so multiple Source dirs can be built in parallel.
WORKTREE_NODE_MODULES := $(BASE_DIR)/node_modules/.yarn-state.yml
WORKSPACE_NODE_MODULES := node_modules
# Update node modules if package.json is newer than node_modules or yarn lockfile
$(WORKTREE_NODE_MODULES) $(WORKSPACE_NODE_MODULES): $(BASE_DIR)/yarn.lock package.json packages/framer-motion/package.json packages/framer-motion-3d/package.json
yarn install
touch $@
# Install requirements, this should usually be the first dependency of build.
# Only install the worktree (root) node_modules by default. If a package has it‘s own
# node_modules, include a rule that says `bootstrap:: $(WORKSPACE_NODE_MODULES)` in the
# Makefile
bootstrap:: $(WORKTREE_NODE_MODULES)
SOURCE_FILES := $(shell find packages/framer-motion/src packages/framer-motion-3d/src -type f)
######
# The location to gather test reports
TEST_REPORT_PATH := $(if $(CIRCLE_TEST_REPORTS),$(CIRCLE_TEST_REPORTS),$(CURDIR)/test_reports)
build: bootstrap
cd packages/framer-motion && yarn build
cd packages/framer-motion-3d && yarn build
watch: bootstrap
cd packages/framer-motion && yarn watch
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
yarn test
test-ci: bootstrap
mkdir -p $(TEST_REPORT_PATH)
JEST_JUNIT_OUTPUT=$(TEST_REPORT_PATH)/framer-motion.xml yarn test-ci
lint: bootstrap
yarn lint
pretty: bootstrap
prettier --write */**/*.tsx */**/*.ts
.PHONY: dev lint