Skip to content

Commit 42ab6a3

Browse files
authored
Migrate to virtual workspace layout (#1210)
1 parent 03f13b9 commit 42ab6a3

File tree

132 files changed

+133
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+133
-69
lines changed

Cargo.toml

Lines changed: 12 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
members = ["crates/*"]
3+
resolver = "2"
34

45
[workspace.package]
56
version = "0.2.21"
@@ -12,42 +13,12 @@ license = "MIT"
1213
prek-consts = { path = "crates/prek-consts", version = "0.2.21" }
1314
prek-pty = { path = "crates/prek-pty", version = "0.2.21" }
1415

15-
rustix = { version = "1.0.8", features = ["pty", "process", "fs", "termios"] }
16-
thiserror = { version = "2.0.11" }
17-
tokio = { version = "1.47.1", features = ["fs", "process", "rt", "sync", "macros", "net"] }
18-
tracing = { version = "0.1.40" }
19-
20-
[package]
21-
name = "prek"
22-
authors = ["j178 <[email protected]>"]
23-
description = "Better `pre-commit`, re-engineered in Rust"
24-
version = { workspace = true }
25-
repository = { workspace = true }
26-
homepage = { workspace = true }
27-
edition = { workspace = true }
28-
license = { workspace = true }
29-
30-
default-run = "prek"
31-
32-
[features]
33-
default = ["docker"]
34-
# Adds self-update functionality. This feature is only enabled for prek built binarys
35-
# and should be left unselected when building prek for package managers.
36-
self-update = ["dep:axoupdater"]
37-
# Enable the profiler for benchmarking
38-
profiler = ["dep:pprof", "pprof/flamegraph"]
39-
# Enable docker related tests in integration tests
40-
docker = []
41-
42-
[dependencies]
43-
prek-consts = { workspace = true }
44-
4516
anstream = { version = "0.6.15" }
4617
anstyle-query = { version = "1.1.5" }
4718
anyhow = { version = "1.0.86" }
4819
async-compression = { version = "0.4.18", features = ["gzip", "xz", "tokio"] }
4920
async_zip = { version = "0.0.17", package = "astral_async_zip", features = ["deflate", "tokio"] }
50-
axoupdater = { version = "0.9.0", default-features = false, features = ["github_releases"], optional = true }
21+
axoupdater = { version = "0.9.0", default-features = false, features = ["github_releases"] }
5122
bstr = { version = "1.11.0" }
5223
cargo_metadata = { version = "0.23.1" }
5324
clap = { version = "4.5.16", features = ["derive", "env", "string", "wrap_help"] }
@@ -66,17 +37,20 @@ indoc = { version = "2.0.5" }
6637
itertools = { version = "0.14.0" }
6738
lazy-regex = { version = "3.4.2" }
6839
levenshtein = { version = "1.0.5" }
40+
libc = { version = "0.2.164" }
6941
# Enable static linking for liblzma
7042
# This is required for the `xz` feature in `async-compression`
7143
liblzma = { version = "0.4.5", features = ["static"] }
7244
memchr = { version = "2.7.5" }
7345
owo-colors = { version = "4.1.0" }
7446
path-clean = { version = "1.0.1" }
47+
pprof = { version = "0.15.0" }
7548
quick-xml = { version = "0.38" }
7649
rand = { version = "0.9.0" }
7750
rayon = { version = "1.10.0" }
7851
reqwest = { version = "0.12.9", default-features = false, features = ["http2", "stream", "json", "rustls-tls-native-roots", "rustls-tls-webpki-roots"] }
7952
rustc-hash = { version = "2.1.1" }
53+
rustix = { version = "1.0.8", features = ["pty", "process", "fs", "termios"] }
8054
same-file = { version = "1.0.6" }
8155
semver = { version = "1.0.24", features = ["serde"] }
8256
serde = { version = "1.0.210", features = ["derive"] }
@@ -88,55 +62,26 @@ smallvec = { version = "1.15.1" }
8862
target-lexicon = { version = "0.13.0" }
8963
tempfile = { version = "3.13.0" }
9064
textwrap = { version = "0.16.1" }
91-
thiserror = { workspace = true }
92-
tokio = { workspace = true }
65+
thiserror = { version = "2.0.11" }
66+
tokio = { version = "1.47.1", features = ["fs", "process", "rt", "sync", "macros", "net"] }
9367
tokio-tar = { version = "0.5.1", package = "astral-tokio-tar" }
9468
tokio-util = { version = "0.7.13" }
9569
toml = { version = "0.9.5", default-features = false, features = ["fast_hash", "parse", "preserve_order", "serde"] }
96-
tracing = { workspace = true }
70+
tracing = { version = "0.1.40" }
9771
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
9872
unicode-width = { version = "0.2.0" }
9973
walkdir = { version = "2.5.0" }
10074
which = { version = "8.0.0" }
10175

102-
[target.'cfg(unix)'.dependencies]
103-
prek-pty = { workspace = true }
104-
105-
libc = { version = "0.2.164" }
106-
pprof = { version = "0.15.0", optional = true }
107-
108-
[build-dependencies]
109-
fs-err = { version = "3.1.0" }
110-
111-
[dev-dependencies]
76+
# dev-dependencies
11277
assert_cmd = { version = "2.0.16", features = ["color"] }
11378
assert_fs = { version = "1.1.2" }
114-
etcetera = { version = "0.11.0" }
11579
insta = { version = "1.40.0", features = ["filters"] }
11680
insta-cmd = { version = "0.6.0" }
11781
markdown = { version = "1.0.0" }
11882
predicates = { version = "3.1.2" }
11983
pretty_assertions = { version = "1.4.1" }
12084
regex = { version = "1.11.0" }
121-
tempfile = { version = "3.13.0" }
122-
123-
[package.metadata.binstall]
124-
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }{ archive-suffix }"
125-
pkg-fmt = "tgz"
126-
127-
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
128-
pkg-fmt = "zip"
129-
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.zip"
130-
131-
[package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
132-
pkg-fmt = "zip"
133-
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.zip"
134-
135-
[package.metadata.cargo-shear]
136-
ignored = ["liblzma"]
137-
138-
[lints]
139-
workspace = true
14085

14186
[workspace.lints.rust]
14287
dead_code = "allow"
@@ -175,6 +120,9 @@ edn = "edn"
175120
styl = "styl"
176121
jod = "jod"
177122

123+
[workspace.metadata.cargo-shear]
124+
ignored = ["liblzma"]
125+
178126
[profile.profiling]
179127
inherits = "release"
180128
strip = false

crates/prek/Cargo.toml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
[package]
2+
name = "prek"
3+
authors = ["j178 <[email protected]>"]
4+
description = "Better `pre-commit`, re-engineered in Rust"
5+
version = { workspace = true }
6+
repository = { workspace = true }
7+
homepage = { workspace = true }
8+
edition = { workspace = true }
9+
license = { workspace = true }
10+
11+
[features]
12+
default = ["docker"]
13+
# Adds self-update functionality. This feature is only enabled for prek built binarys
14+
# and should be left unselected when building prek for package managers.
15+
self-update = ["dep:axoupdater"]
16+
# Enable the profiler for benchmarking
17+
profiler = ["dep:pprof", "pprof/flamegraph"]
18+
# Enable docker related tests in integration tests
19+
docker = []
20+
21+
[dependencies]
22+
prek-consts = { workspace = true }
23+
24+
anstream = { workspace = true }
25+
anstyle-query = { workspace = true }
26+
anyhow = { workspace = true }
27+
async-compression = { workspace = true, features = ["gzip", "xz", "tokio"] }
28+
async_zip = { workspace = true, features = ["deflate", "tokio"] }
29+
axoupdater = { workspace = true, default-features = false, features = ["github_releases"], optional = true }
30+
bstr = { workspace = true }
31+
cargo_metadata = { workspace = true }
32+
clap = { workspace = true, features = ["derive", "env", "string", "wrap_help"] }
33+
clap_complete = { workspace = true, features = ["unstable-dynamic"] }
34+
ctrlc = { workspace = true }
35+
dunce = { workspace = true }
36+
etcetera = { workspace = true }
37+
fancy-regex = { workspace = true }
38+
fs-err = { workspace = true, features = ["tokio"] }
39+
futures = { workspace = true }
40+
hex = { workspace = true }
41+
http = { workspace = true }
42+
ignore = { workspace = true }
43+
indicatif = { workspace = true }
44+
indoc = { workspace = true }
45+
itertools = { workspace = true }
46+
lazy-regex = { workspace = true }
47+
levenshtein = { workspace = true }
48+
# Enable static linking for liblzma
49+
# This is required for the `xz` feature in `async-compression`
50+
liblzma = { workspace = true, features = ["static"] }
51+
memchr = { workspace = true }
52+
owo-colors = { workspace = true }
53+
path-clean = { workspace = true }
54+
quick-xml = { workspace = true }
55+
rand = { workspace = true }
56+
rayon = { workspace = true }
57+
reqwest = { workspace = true, default-features = false, features = ["http2", "stream", "json", "rustls-tls-native-roots", "rustls-tls-webpki-roots"] }
58+
rustc-hash = { workspace = true }
59+
same-file = { workspace = true }
60+
semver = { workspace = true, features = ["serde"] }
61+
serde = { workspace = true, features = ["derive"] }
62+
serde_json = { workspace = true, features = ["unbounded_depth"] }
63+
serde_stacker = { workspace = true }
64+
serde_yaml = { workspace = true }
65+
shlex = { workspace = true }
66+
smallvec = { workspace = true }
67+
target-lexicon = { workspace = true }
68+
tempfile = { workspace = true }
69+
textwrap = { workspace = true }
70+
thiserror = { workspace = true }
71+
tokio = { workspace = true }
72+
tokio-tar = { workspace = true }
73+
tokio-util = { workspace = true }
74+
toml = { workspace = true, default-features = false, features = ["fast_hash", "parse", "preserve_order", "serde"] }
75+
tracing = { workspace = true }
76+
tracing-subscriber = { workspace = true, features = ["env-filter"] }
77+
unicode-width = { workspace = true }
78+
walkdir = { workspace = true }
79+
which = { workspace = true }
80+
81+
[target.'cfg(unix)'.dependencies]
82+
prek-pty = { workspace = true }
83+
84+
libc = { workspace = true }
85+
pprof = { workspace = true, optional = true }
86+
87+
[build-dependencies]
88+
fs-err = { workspace = true }
89+
90+
[dev-dependencies]
91+
assert_cmd = { workspace = true, features = ["color"] }
92+
assert_fs = { workspace = true }
93+
etcetera = { workspace = true }
94+
insta = { workspace = true, features = ["filters"] }
95+
insta-cmd = { workspace = true }
96+
markdown = { workspace = true }
97+
predicates = { workspace = true }
98+
pretty_assertions = { workspace = true }
99+
regex = { workspace = true }
100+
tempfile = { workspace = true }
101+
102+
[package.metadata.binstall]
103+
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }{ archive-suffix }"
104+
pkg-fmt = "tgz"
105+
106+
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
107+
pkg-fmt = "zip"
108+
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.zip"
109+
110+
[package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
111+
pkg-fmt = "zip"
112+
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.zip"
113+
114+
[package.metadata.cargo-shear]
115+
ignored = ["liblzma"]
116+
117+
[lints]
118+
workspace = true

build.rs renamed to crates/prek/build.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
*/
2323

24-
use std::{
25-
path::{Path, PathBuf},
26-
process::Command,
27-
};
24+
use std::path::{Path, PathBuf};
25+
use std::process::Command;
2826

2927
use fs_err as fs;
3028

0 commit comments

Comments
 (0)