Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
115 lines (94 loc) · 3.38 KB
/
Copy pathjustfile
File metadata and controls
115 lines (94 loc) · 3.38 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
#!/usr/bin/env -S just --justfile
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
set shell := ["bash", "-cu"]
_default:
@just --list -u
alias r := ready
# Make sure you have cargo-binstall installed.
# You can download the pre-compiled binary from <https://github.com/cargo-bins/cargo-binstall#installation>
# or install via `cargo install cargo-binstall`
# Initialize the project by installing all the necessary tools.
init:
cargo binstall cargo-shear@1.13.1 typos-cli watchexec-cli -y
rustup target add s390x-unknown-linux-gnu
install:
pnpm install
cd fixtures/pnp; yarn
cd fixtures/pnp/global-pnp; yarn
cd fixtures/yarn; yarn
# When ready, run the same CI commands
ready:
git diff --exit-code --quiet
just install
typos
cargo fmt
just check
just test
just lint
just doc
git status
watch *args='':
watchexec {{args}}
watch-check:
just watch "'cargo check; cargo clippy'"
watch-example target *args='':
just watch "cargo run --example {{target}} -- {{args}}"
# Run the example
example target *args='':
cargo run --example {{target}} -- {{args}}
# Format all files
fmt:
cargo shear --fix --check-test-targets # remove all unused dependencies
cargo fmt --all
node --run fmt
# Run cargo check
check:
cargo check --all-features --all-targets
cargo check --target s390x-unknown-linux-gnu
# Run all the tests
test:
cargo test
cargo test --all-features
node --run build
node --run test
cd fixtures/pnp; yarn test
# Lint the whole project
lint:
cargo clippy --all-features --all-targets -- --deny warnings
# Generate doc
doc:
RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features
# Get code coverage
codecov:
cargo codecov --html
# Run the benchmarks.
benchmark:
cargo bench --bench resolver
# Materialize fixtures/bench-pm/installs/<combo>/ from template + per-combo configs, then install each. Heavy; not part of `just install`.
install-bench-fixtures:
rm -rf fixtures/bench-pm/installs
for combo in npm-flat pnpm-isolated pnpm-hoisted yarn-flat yarn-isolated yarn-pnp bun-flat bun-isolated; do \
mkdir -p fixtures/bench-pm/installs/$combo; \
cp -R fixtures/bench-pm/template/. fixtures/bench-pm/installs/$combo/; \
cp -R fixtures/bench-pm/configs/$combo/. fixtures/bench-pm/installs/$combo/; \
done
cd fixtures/bench-pm/installs/npm-flat && npm install --no-audit --no-fund
cd fixtures/bench-pm/installs/pnpm-isolated && pnpm install
cd fixtures/bench-pm/installs/pnpm-hoisted && pnpm install
cd fixtures/bench-pm/installs/yarn-flat && yarn install
cd fixtures/bench-pm/installs/yarn-isolated && yarn install
cd fixtures/bench-pm/installs/yarn-pnp && yarn install
if command -v bun >/dev/null; then cd fixtures/bench-pm/installs/bun-flat && bun install; else echo 'skip bun-flat: bun not installed'; fi
if command -v bun >/dev/null; then cd fixtures/bench-pm/installs/bun-isolated && bun install; else echo 'skip bun-isolated: bun not installed'; fi
# Run the package-manager benchmarks. Each combo skips itself if its fixture is not installed.
benchmark-pm:
cargo bench --bench package_managers --features yarn_pnp
# Run cargo-fuzz
fuzz:
cd fuzz; cargo +nightly fuzz run --sanitizer none resolver -- -only_ascii=1 -max_total_time=900
# Manual Release
release:
cargo binstall -y release-plz
release-plz update
just check
# NOTE: make sure to update version in npm/package.json