-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
115 lines (90 loc) · 2.25 KB
/
justfile
File metadata and controls
115 lines (90 loc) · 2.25 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
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
_default:
just --list -u
alias t := test
alias f := format
alias l := lint
alias b := build
alias x := xtask
alias tsc := typecheck
alias bench := benchmark
# Setup development environment
setup:
# Setup Node.js environment
corepack enable
corepack prepare --activate
yarn
yarn lefthook install
# Setup xtask
yarn workspace xtask run setup
# Run build
just build
# Test all files
test: test-rs test-js
# Test JS files
test-js: build-napi build-js
yarn vitest run
# Test Rust files
test-rs:
cargo test --workspace --no-fail-fast --all-features
# Format all files
format: format-rs format-js format-toml
# Format Rust files
format-rs:
cargo fmt --all
# Format JS files via oxfmt
format-js:
yarn oxfmt
# Format TOML files via taplo
format-toml:
yarn taplo format
# Lint all files
lint: lint-rs lint-js
# Lint JS files via oxlint
lint-js:
yarn oxlint --type-aware
# Lint Rust files via Clippy
lint-rs:
cargo clippy --workspace
# Typechecking with TSC
typecheck:
yarn workspaces foreach -Apt run typecheck
# Build as release mode
build: build-rs build-napi build-js
# Build NAPI modules
build-napi:
yarn workspaces foreach -Apt --include='@wvb/*' run build-napi
# Build Rust workspaces
build-rs:
cargo build --workspace
# Build JS packages
build-js:
yarn workspaces foreach -Apt --include='@wvb/*' run build
# Run benchmarks
benchmark: build
yarn workspaces foreach -Apt --include='@benchmark/*' run bench
# Start website dev server
website:
yarn workspace wvb-website run typegen
yarn workspace wvb-website run dev
# Run xtask
xtask *ARGS:
node ./xtask/cli.ts {{ ARGS }}
git_current_branch := shell('git rev-parse --abbrev-ref HEAD')
# Prerelease
prerelease:
#!/usr/bin/env bash
if [ "{{ git_current_branch}}" != "main" ]; then \
echo "prerelease script must be run in \"main\" branch"; \
exit 1; \
fi
git tag -a prerelease -m "prerelease" --force
git push origin prerelease --force
# Release
release:
#!/usr/bin/env bash
if [ "{{ git_current_branch}}" != "main" ]; then \
echo "release script must be run in \"main\" branch"; \
exit 1; \
fi
git tag -a release -m "release" --force
git push origin release --force