forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
162 lines (116 loc) · 3.33 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
set windows-shell := ["powershell"]
set shell := ["bash", "-cu"]
alias ued := update-esbuild-diff
_default:
just --list -u
setup:
just check-setup-prerequisites
# Rust related setup
cargo install cargo-binstall
cargo binstall taplo-cli cargo-insta cargo-deny cargo-shear -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
just ued
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: check-rust check-node
check-rust:
cargo check --workspace
check-node:
pnpm type-check
update-esbuild-diff *args="":
pnpm --filter=scripts esbuild-snap-diff {{ args }}
# run tests for both Rust and Node.js
test: test-rust test-node
# run all tests and update snapshot
test-update:
just test-rust
just test-node all -u
test-rust:
cargo test --workspace --exclude rolldown_binding
# Supported presets: all, rolldown, rollup
test-node preset="all" *args="": _build-native-debug
just _test-node-{{ preset }} {{ args }}
test-node-only preset="all" *args="":
just _test-node-{{ preset }} {{ args }}
_test-node-all *args="":
pnpm run --recursive --parallel --filter=!rollup-tests test {{ args }}
# We run rollup tests separately to have a clean output.
pnpm run --filter rollup-tests test
_test-node-rolldown *args:
pnpm run --filter rolldown test {{ args }}
_test-node-rollup command="":
pnpm run --filter rollup-tests test{{ command }}
# Fix formatting issues both for Rust, Node.js and all files in the repository
fmt: fmt-rust 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: lint-rust lint-node lint-repo
lint-rust:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- --deny warnings
cargo shear
lint-node:
pnpm lint-code
lint-repo:
pnpm lint-repo
# Fix formatting and some linting issues
fix: fix-rust fix-repo
fix-rust:
just fmt-rust
cargo fix --allow-dirty --allow-staged
cargo shear --fix
fix-repo:
pnpm lint-code -- --fix
just fmt-repo
# Support `just build [native|wasi] [debug|release]`
build target="native" mode="debug":
pnpm run --filter rolldown build-{{ target }}:{{ mode }}
_build-native-debug:
just build native debug
run *args:
pnpm rolldown {{ args }}
# 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
check-setup-prerequisites:
node ./scripts/misc/setup-prerequisites/node.js