-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (55 loc) · 2.59 KB
/
Makefile
File metadata and controls
76 lines (55 loc) · 2.59 KB
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
CLI_DIR = src/apps/cli
TEMPLATE_DIR = src/templates/shared-counter
.PHONY: install dev frontend build compile compile-all build-registry deploy-registry build-template test clean format format-check format-ts format-rs format-ts-check format-rs-check
setup:
pnpm install
$(MAKE) build-template
start-network:
cd ppn && make start
install: embed-templates
pnpm -r build
bun build --compile $(CLI_DIR)/src/cli.ts --outfile ~/.cdm/bin/cdm
dev: embed-templates
bun run $(CLI_DIR)/src/cli.ts
frontend:
pnpm --filter @dotdm/frontend dev
build:
pnpm --filter @dotdm/frontend build
embed-templates:
bun run src/lib/scripts/embed-templates.ts
compile: embed-templates
bun build --compile $(CLI_DIR)/src/cli.ts --outfile dist/cdm
compile-all: embed-templates
mkdir -p dist
bun build --compile --target=bun-darwin-arm64 $(CLI_DIR)/src/cli.ts --outfile dist/cdm-darwin-arm64
bun build --compile --target=bun-darwin-x64 $(CLI_DIR)/src/cli.ts --outfile dist/cdm-darwin-x64
bun build --compile --target=bun-linux-x64 $(CLI_DIR)/src/cli.ts --outfile dist/cdm-linux-x64
bun build --compile --target=bun-linux-arm64 $(CLI_DIR)/src/cli.ts --outfile dist/cdm-linux-arm64
build-registry:
cargo pvm-contract build --manifest-path $(CURDIR)/Cargo.toml -p contract-registry
cd src/lib/descriptors && pnpm exec papi sol add ../../../target/contract-registry.release.abi.json contractsRegistry
deploy-registry: build-registry
bun run src/lib/scripts/deploy-registry.ts --name $(or $(CHAIN),local)
build-template:
cargo pvm-contract build --manifest-path $(CURDIR)/$(TEMPLATE_DIR)/Cargo.toml -p counter
cargo pvm-contract build --manifest-path $(CURDIR)/$(TEMPLATE_DIR)/Cargo.toml -p counter_reader
cargo pvm-contract build --manifest-path $(CURDIR)/$(TEMPLATE_DIR)/Cargo.toml -p counter_writer
cd src/lib/descriptors && pnpm exec papi sol add ../../../$(TEMPLATE_DIR)/target/counter.release.abi.json counter --skip-codegen
cd src/lib/descriptors && pnpm exec papi sol add ../../../$(TEMPLATE_DIR)/target/counter_reader.release.abi.json counterReader --skip-codegen
cd src/lib/descriptors && pnpm exec papi sol add ../../../$(TEMPLATE_DIR)/target/counter_writer.release.abi.json counterWriter
test:
pnpm vitest run
clean:
rm -rf dist/ target/ node_modules/
format-ts:
pnpm biome format --write .
format-rs:
cargo fmt --all
cargo fmt --all --manifest-path $(CURDIR)/$(TEMPLATE_DIR)/Cargo.toml
format-ts-check:
pnpm biome format .
format-rs-check:
cargo fmt --all -- --check
cargo fmt --all --manifest-path $(CURDIR)/$(TEMPLATE_DIR)/Cargo.toml -- --check
format: format-ts format-rs
format-check: format-ts-check format-rs-check