forked from lpotthast/leptonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
127 lines (110 loc) · 5.93 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
# Run `cargo install just`. Then simply run `just` to get a list of executable recepies.
# See https://github.com/casey/just for furthrt details about Just.
# Lists all available commands.
default:
just --list
# Perform a one-time setup to get up and running with Rust development.
once:
just enable-wasm
just use-stable
just install-tools
# Enable the WASM target, enabling frontend build.
enable-wasm:
rustup target add wasm32-unknown-unknown
# Enable the nightly Rust compiler
use-nightly:
rustup default nightly
rustup update
# Enable the stable Rust compiler
use-stable:
rustup default stable
rustup update
# Install dependencies for building, running examples, profiling and more...
install-tools:
cargo install cargo-clean-all # Clean up build artifact cluttering up your system.
cargo install cargo-edit # Make `cargo upgrade` available, upgrading dependencies in your Cargo.toml.
cargo install cargo-expand # Expand macros, super helpful ehn debugging procedural macros.
cargo install cargo-llvm-lines # Count lines of LLVM IR per generic function.
cargo install cargo-sort # Sort the dependencies section of a Cargo.toml file.
cargo install cargo-udeps # Find unused dependencies.
cargo install cargo-upgrades # Check for upgradable dependencies.
cargo install cargo-watch # Run a command and watch for filesystem changes.
cargo install cargo-whatfeatures # Inspect features made available by a specific crate.
cargo install just # Tool to execute the recepies of this Justfile.
cargo install tokei # Count your code, line counts, quickly.
cargo install trunk # Build, watch, server WASM frontends.
cargo install twiggy # Inspect WASM bundles.
cargo install create-tauri-app # Create new Tauri application.
cargo install [email protected] # Run tauri applications.
# Find the minimum supported rust version
msrv:
cargo install cargo-msrv
cargo msrv --min "2021" --path leptonic
cargo msrv --min "2021" --path leptonic-theme
# Serve the Book example
serve:
cd ./examples/book && trunk serve
# Check which process is occupying the given port.
# This can help you find out which process to kill if some process has gone rogue.
check-port port:
lsof -i :{{port}}
# Run `cargo sort` for every crate.
sort:
cargo sort ./leptonic -w -g
cargo sort ./leptonic-theme -w -g
cargo sort ./examples/book-ssr -w -g
cargo sort ./examples/leptonic-template-csr -w -g
cargo sort ./examples/leptonic-template-ssr -w -g
cargo sort ./examples/leptonic-template-tauri -w -g
# Run `cargo fmt` for every crate.
fmt:
cargo fmt --all --manifest-path ./leptonic/Cargo.toml
cargo fmt --all --manifest-path ./leptonic-theme/Cargo.toml
cargo fmt --all --manifest-path ./examples/book-ssr/Cargo.toml
cargo fmt --all --manifest-path ./examples/leptonic-template-csr/Cargo.toml
cargo fmt --all --manifest-path ./examples/leptonic-template-ssr/Cargo.toml
cargo fmt --all --manifest-path ./examples/leptonic-template-tauri/Cargo.toml
leptosfmt:
cargo install leptosfmt
leptosfmt ./leptonic/*
leptosfmt ./examples/book/*
# Run `cargo update` for every crate, updating the dependencies of all crates to the latest non-breaking version. Rewrites Cargo.lock files.
update:
cargo update --manifest-path ./leptonic/Cargo.toml
cargo update --manifest-path ./leptonic-theme/Cargo.toml
cargo update --manifest-path ./examples/book-ssr/Cargo.toml
cargo update --manifest-path ./examples/leptonic-template-csr/Cargo.toml
cargo update --manifest-path ./examples/leptonic-template-ssr/Cargo.toml
cargo update --manifest-path ./examples/leptonic-template-tauri/Cargo.toml
# Run `cargo test` for every crate.
test:
cargo test --manifest-path ./leptonic/Cargo.toml
cargo test --manifest-path ./leptonic-theme/Cargo.toml
cargo test --manifest-path ./examples/book-ssr/Cargo.toml
cargo test --manifest-path ./examples/leptonic-template-csr/Cargo.toml
cargo test --manifest-path ./examples/leptonic-template-ssr/Cargo.toml
cargo test --manifest-path ./examples/leptonic-template-tauri/Cargo.toml
# Run `cargo upgrades` for every crate, checking if new crate versions including potentially breaking changes are available.
upgrades: # "-" prefixes allow for non-zero status codes!
-cargo upgrades --manifest-path ./leptonic/Cargo.toml
-cargo upgrades --manifest-path ./leptonic-theme/Cargo.toml
-cargo upgrades --manifest-path ./examples/book-ssr/Cargo.toml
-cargo upgrades --manifest-path ./examples/leptonic-template-csr/Cargo.toml
-cargo upgrades --manifest-path ./examples/leptonic-template-ssr/Cargo.toml
-cargo upgrades --manifest-path ./examples/leptonic-template-tauri/Cargo.toml
# Run `cargo upgrade` for every crate, automatically bumping all dependencies to their latest versions
upgrade: # "-" prefixes allow for non-zero status codes!
-cargo upgrade --manifest-path ./leptonic/Cargo.toml
-cargo upgrade --manifest-path ./leptonic-theme/Cargo.toml
-cargo upgrade --manifest-path ./examples/book-ssr/Cargo.toml
-cargo upgrade --manifest-path ./examples/leptonic-template-csr/Cargo.toml
-cargo upgrade --manifest-path ./examples/leptonic-template-ssr/Cargo.toml
-cargo upgrade --manifest-path ./examples/leptonic-template-tauri/Cargo.toml
# Run `cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic` for every crate.
clippy: # "-" prefixes allow for non-zero status codes!
-cargo clippy --tests --manifest-path ./leptonic/Cargo.toml -- -Dclippy::all -Dclippy::pedantic
-cargo clippy --tests --manifest-path ./leptonic-theme/Cargo.toml -- -Dclippy::all -Dclippy::pedantic
-cargo clippy --tests --manifest-path ./examples/book-ssr/Cargo.toml -- -Dclippy::all -Dclippy::pedantic
-cargo clippy --tests --manifest-path ./examples/leptonic-template-csr/Cargo.toml -- -Dclippy::all -Dclippy::pedantic
-cargo clippy --tests --manifest-path ./examples/leptonic-template-ssr/Cargo.toml -- -Dclippy::all -Dclippy::pedantic
-cargo clippy --tests --manifest-path ./examples/leptonic-template-tauri/Cargo.toml -- -Dclippy::all -Dclippy::pedantic