-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
92 lines (76 loc) · 3.14 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
# ==================================================================================================
# BASICS COMMANDS
# To get the project running locally.
# To be run when first setting up the repository.
setup: install-frozen
cd packages/contracts && make setup
.PHONY: setup
# Build contracts & frontend
build:
cd packages/contracts && make build
# cd packages/sdk && pnpm run generate:contract-type
cd packages/ui && make build
.PHONY: build
# Runs anvil (local EVM node).
anvil:
cd packages/contracts && make anvil
.PHONY: anvil
# Runs the webapp in dev mode.
webdev:
# cd packages/sdk && pnpm run generate:contract-type
cd packages/ui && 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
# Performs code-quality checks.
check:
cd packages/contracts && make check
cd packages/ui && make check
.PHONY: check
# ==================================================================================================
# IMPLEMENTATION DETAILS
# 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 pnpm 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
# ==================================================================================================