Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
89 lines (61 loc) 路 1.35 KB
/
Copy pathmakefile
File metadata and controls
89 lines (61 loc) 路 1.35 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
77
78
79
80
81
82
83
84
85
86
87
88
89
.PHONY: help
help: makefile
@tail -n +4 makefile | grep ".PHONY"
.PHONY: build
build: server-build
cargo build
.PHONY: test
test: test-unit test-cli
.PHONY: test-unit
test-unit:
cargo test --bin transity
.PHONY: test-cli
test-cli:
cargo test --test cli_snapshots
.PHONY: update-snapshots
update-snapshots:
cargo insta review
.PHONY: format
format:
cargo clippy --fix --allow-dirty --all-targets --quiet
cargo fmt
.PHONY: install
install: server-build
cargo install --path .
# Apache ECharts gets embedded into the binary for the trend charts
node_modules/echarts/dist/echarts.min.js: package.json bun.lock
bun install
touch $@
.PHONY: server-build
server-build: node_modules/echarts/dist/echarts.min.js
cargo leptos build
.PHONY: dev
dev: node_modules/echarts/dist/echarts.min.js
cargo leptos watch -- server examples/journal.yaml
.PHONY: wasm-build
wasm-build:
touch src/lib.rs
wasm-pack build \
--out-dir webapp/pkg \
--target web \
--dev \
--no-default-features \
--features wasm
.PHONY: wasm-build-production
wasm-build-production:
wasm-pack build \
--out-dir webapp/pkg \
--target web \
--release \
--no-default-features \
--features wasm
.PHONY: docs
docs: wasm-build-production
rm -rf docs
mkdir -p docs/docs
cp -R webapp/. docs/
mdbook build docs_src
.PHONY: clean
clean:
cargo clean
rm -rf webapp/pkg docs