-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
107 lines (88 loc) · 3.68 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# ==================================================================================================
# BASIC COMMANDS
# To get the project running locally.
# To be run when first setting up the repository.
setup: init-modules install-frozen
cd packages/contracts && make setup
.PHONY: setup
# Runs the project locally via run-pty, which manages multiple background processes in a single
# terminal. This does not work in all terminal emulators, and might not be the most convenient
# option for you, so you can also run
dev:
pnpm run-pty % make anvil % make webdev % make deploy % make circuits
.PHONY: dev
# Runs anvil (local EVM node).
anvil:
cd packages/contracts && make anvil
.PHONY: anvil
# Runs the webapp in dev mode.
webdev:
cd packages/webapp && make dev
.PHONY: webdev
# Deploys to the contracts to the local node (requires anvil to be running).
deploy:
cd packages/contracts && make deploy
.PHONY: deploy
# Build the zero-knowledge circuits.
circuits:
cd packages/circuits && make install-all
.PHONY: circuits
# Performs code-quality checks.
check:
cd packages/contracts && make check
cd packages/webapp && make check
.PHONY: check
# Performs code formatting for the webapp files and contracts in their respective directories.
format:
cd packages/webapp && make format
cd packages/contracts && make format
.PHONY: format
# ==================================================================================================
# IMPLEMENTATION DETAILS
# NOTE: we don't have any submodules currently, they are best avoided.
init-modules:
git submodule update --init --recursive
.PHONY: init-modules
# Install packages as specified in the pnpm-lockfile.yaml.
install-frozen:
pnpm install --frozen-lockfile
.PHONY: install-deps
# ==================================================================================================
# DEPENDENCY MANAGEMENT
# Update dependencies, check for outdated dependencies, etc.
# NOTES:
# Below "version specifier" refers to the version strings (e.g. "^1.2.3") in package.json.
# You can safely use pnpm commands inside the packages, and things will behave like your expect
# (i.e. update only the package, but use the pnpm monorepo architecture).
# Like npm install: if a version matching version specifier is installed, does nothing, otherwise
# install the most up-to-date version matching the specifier.
install:
pnpm install -r
@echo "If the lockfileVersion changed, please update 'packageManager' in package.json!"
.PHONY: install
# Shows packages for which new versions are available (compared to the installed version).
# This will also show new version that do not match the version specifiers!
outdated:
pnpm outdated -r
.PHONY: outdated
# Updates all packages to their latest version that match the version specifier.
# It will also update the version specifiers to point to the new version.
# You can also run this if your installed versions are > than the version specifiers and you want
# to update them.
update:
pnpm update -r
@echo "If the lockfileVersion changed, please update 'packageManager' in package.json!"
.PHONY: update
# Updates all packages to their latest version (even if they do not match the version specifier!).
# It will also update the version specifiers to point to the new version.
update-latest:
pnpm update -r --latest
@echo "If the lockfileVersion changed, please update 'packageManager' in package.json!"
.PHONY: update-latest
# In case you accidentally pollute the node_modules directories
# (e.g. by running npm instead of pnpm)
reset-modules:
rm -rf node_modules packages/*/node_modules
pnpm install --frozen-lockfile
.PHONY: reset-modules
# ==================================================================================================