forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
137 lines (103 loc) · 2.67 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
133
134
135
136
137
set windows-shell := ["powershell"]
set shell := ["bash", "-cu"]
_default:
just --list -u
setup:
# Rust related setup
cargo install cargo-binstall
cargo binstall taplo-cli cargo-insta cargo-deny -y
# Node.js related setup
corepack enable
pnpm install
just setup-submodule
just setup-bench
echo "✅✅✅ Setup complete!"
setup-submodule:
git submodule update --init
setup-bench:
node ./scripts/misc/setup-benchmark-input/index.js
# Update the submodule to the latest commit
update-submodule:
git submodule update --init
# `roll` command almost run all ci checks locally. It's useful to run this before pushing your changes.
roll:
just roll-rust
just roll-node
just roll-repo
roll-rust:
just check-rust
just test-rust
just lint-rust
roll-node:
just test-node
just check-node
just lint-node
roll-repo:
just lint-repo
# CHECKING
check-rust:
cargo check --workspace
check-node:
pnpm type-check
check:
just check-rust
just check-node
# run tests for both Rust and Node.js
test:
just test-rust
just test-node
test-rust:
cargo test --no-fail-fast
# Supported presets: all, rolldown, rollup
test-node preset="all" *args="":
just _test-node-{{preset}} {{args}}
_test-node-all:
just build native debug
pnpm run --recursive --parallel --filter=!rollup-tests test
# We run rollup tests separately to have a clean output.
pnpm run --filter rollup-tests test
_test-node-rolldown *args:
just build native debug
pnpm run --filter rolldown test {{args}}
_test-node-rollup command="":
just build native debug
pnpm run --filter rollup-tests test{{command}}
# Fix formatting issues both for Rust, Node.js and all files in the repository
fmt:
just fmt-rust
just fmt-repo
fmt-rust:
cargo fmt --all -- --emit=files
taplo fmt
fmt-repo:
pnpm lint-prettier:fix
pnpm lint-toml:fix
# lint the codebase
lint:
just lint-rust
just lint-node
lint-rust:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- --deny warnings
lint-node:
pnpm lint-code
lint-repo:
pnpm lint-filename
pnpm lint-prettier
pnpm lint-spell
pnpm lint-toml
# Support `just build [native|wasi] [debug|release]`
build target="native" mode="debug":
pnpm run --filter rolldown build-{{target}}:{{mode}}
# BENCHING
bench-rust:
cargo bench -p bench
bench-node:
pnpm --filter bench run bench
bench-node-par:
pnpm --filter bench exec node ./benches/par.js
# RELEASING
bump packages *args:
node ./scripts/misc/bump-version.js {{args}}
changelog:
pnpm conventional-changelog --preset angular --i CHANGELOG.md --same-file --pkg=./packages/rolldown/package.json