-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathjustfile
132 lines (81 loc) · 3.32 KB
/
justfile
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
_default:
@just --choose
_yarn:
yarn install
_js-test: build-wasm _yarn
yarn jest --coverage
_rust-test:
cargo test
test: _js-test _rust-test
format: _yarn
cargo fmt
yarn prettier --write js/**/*.ts
lint: _yarn format
cargo check
cargo clippy --fix --all-targets --all-features -- -D warnings
yarn eslint js/**/*.ts
clean:
rm -rf dist
rm -rf pkg
rm -rf coverage
rm -rf target
super-clean: clean
rm -rf node_modules
rm -rf local-dev/test-corpora/3b1b/*
rm -rf local-dev/test-corpora/federalist/*
fetch-test-corpora:
git submodule init
git submodule update
solo-build-federalist-index:
cargo run -q --all-features -- build --input local-dev/test-configs/federalist.toml --output local-dev/test-indexes/federalist.st
build-federalist-index: build-indexer-dev fetch-test-corpora solo-build-federalist-index
build-all-indexes: build-federalist-index
-cargo run -q --all-features -- build --input local-dev/test-configs/3b1b.toml --output local-dev/test-indexes/3b1b.st
-cargo run -q --all-features -- build --input local-dev/test-configs/beepboop.toml --output local-dev/test-indexes/beepboop.st
-cargo run -q --all-features -- build --input local-dev/test-configs/bowdoin-orient.toml --output local-dev/test-indexes/bowdoin-orient.st
-cargo run -q --all-features -- build --input local-dev/test-configs/federalist-zero.toml --output local-dev/test-indexes/federalist-zero.st
#############################################
# Production build settings
build-indexer:
cargo build --release --all-features
build-wasm:
cd stork-wasm && wasm-pack build --target web --out-name stork -- --no-default-features --features="v3"
wc -c < ./stork-wasm/pkg/stork_bg.wasm
build-wasm-all-features:
cd stork-wasm && wasm-pack build --target web --out-name stork -- --features="v2, v3"
wc -c < ./stork-wasm/pkg/stork_bg.wasm
solo-build-js:
yarn webpack --config webpack.prod.js
build-js: build-wasm _yarn solo-build-js
#############################################
# Development build settings
# for the local dev site
build-indexer-dev:
cargo build --all-features
build-wasm-dev:
cd stork-wasm && wasm-pack build --target web --out-name stork --dev -- --no-default-features --features="v3"
solo-build-js-dev:
yarn webpack --config webpack.dev.js
build-js-dev: build-wasm-dev _yarn solo-build-js-dev
solo-build-dev-site:
rm -rf local-dev/dist
mkdir local-dev/dist
cp themes/*.css local-dev/dist/
cp local-dev/index.html local-dev/dist/
cp dist/* local-dev/dist/
cp local-dev/test-indexes/*.st local-dev/dist/
@echo "You should run \`just serve-dev-site\` in another tab!"
build-dev-site: build-js-dev build-all-indexes solo-build-dev-site
build-dev-site-prod: build-js build-all-indexes solo-build-dev-site
serve-dev-site:
@echo "Open http://127.0.0.1:8025"
python3 -m http.server --directory ./local-dev/dist 8025
#############################################
# CI
upload ref="":
python3 scripts/upload_build_artifacts.py
bench bench_name="":
cargo criterion --package stork-lib --plotting-backend=disabled --message-format=json {{bench_name}}
solo-generate-stats:
python3 scripts/generate_stats.py
generate-stats: build-js solo-build-federalist-index solo-generate-stats