-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCargo.toml
More file actions
148 lines (131 loc) · 5.53 KB
/
Cargo.toml
File metadata and controls
148 lines (131 loc) · 5.53 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
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
[workspace]
members = ["napi"]
resolver = "2"
[package]
authors = ["Rspack"]
categories = ["development-tools"]
description = "ESM / CJS module resolution"
edition = "2021"
homepage = "https://github.com/rstackjs/rspack-resolver"
include = ["/src", "/examples", "/benches", "!/benches/pnpm-lock.yaml", "!/benches/node_modules"]
keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"]
license = "MIT"
name = "rspack_resolver"
readme = "README.md"
repository = "https://github.com/rstackjs/rspack-resolver"
rust-version = "1.70"
version = "0.8.0"
[lib]
doctest = false
[[bench]]
harness = false
name = "resolver"
[lints.clippy]
all = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
# restriction
dbg_macro = "warn"
todo = "warn"
unimplemented = "warn"
# I like the explicitness of this rule as it removes confusion around `clone`.
# This increases readability, avoids `clone` mindlessly and heap allocating on accident.
clone_on_ref_ptr = "warn"
# These two are mutually exclusive, I like `mod.rs` files for better fuzzy searches on module entries.
empty_drop = "warn"
empty_structs_with_brackets = "warn"
exit = "warn"
filetype_is_file = "warn"
get_unwrap = "warn"
impl_trait_in_params = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
# I want to write the best Rust code so both pedantic and nursery is enabled.
# We should only disable rules globally if they are either false positives, chaotic, or does not make sense.
nursery = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Allowed rules
# pedantic
# This rule is too pedantic, I don't want to force this because naming things are hard.
module_name_repetitions = "allow"
# All triggers are mostly ignored in our codebase, so this is ignored globally.
struct_excessive_bools = "allow"
too_many_lines = "allow"
# #[must_use] is creating too much noise for this codebase, it does not add much value except nagging
# the programmer to add a #[must_use] after clippy has been run.
# Having #[must_use] every where also hinders readability.
must_use_candidate = "allow"
# used_underscore_binding= "allow"
doc_markdown = "allow"
# nursery
# `const` functions do not make sense for our project because this is not a `const` library.
# This rule also confuses new comers and forces them to add `const` blindlessly without any reason.
missing_const_for_fn = "allow"
# cargo
multiple_crate_versions = "allow"
[[example]]
name = "resolver"
[dependencies]
dashmap = "6.1.0"
serde = { version = "1.0.228", features = ["derive"] } # derive for Deserialize from package.json
serde_json = { version = "1.0.145", features = [
"preserve_order",
] } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]`
tracing = "0.1.41"
simd-json = { version = "0.17.0", features = ["serde_impl", "runtime-detection"], default-features = false }
cfg-if = "1.0"
dunce = "1.0.5" # Normalize Windows paths to the most compatible format, avoiding UNC where possible
indexmap = { version = "2.12.0", features = ["serde"] }
json-strip-comments = "3.0.1"
rustc-hash = { version = "2.1.1", default-features = false, features = ["std"] }
thiserror = "2.0.17"
pnp = { version = "0.12.5", optional = true }
arc-swap = { version = "1.8.2", optional = true }
async-trait = "0.1.89"
document-features = { version = "0.2.8", optional = true }
futures = "0.3.31"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.48.0", default-features = false, features = ["sync", "rt-multi-thread", "macros", "fs"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { version = "1.48.0", default-features = false, features = ["sync", "rt", "macros"] }
[dev-dependencies]
criterion = { version = "4.3.0", package = "codspeed-criterion-compat", default-features = false, features = [
"async_tokio",
] }
normalize-path = { version = "0.2.1" }
rayon = { version = "1.11.0" }
regex = "1.12.2"
vfs = "0.13.0" # for testing with in memory file system
[features]
default = ["yarn_pnp"]
## Enables the [PackageJson::raw_json] API,
## which returns the `package.json` with `serde_json::Value`.
package_json_raw_json_api = []
## [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp)
yarn_pnp = ["pnp", "arc-swap"]
# For remove tracing calls in release build
enable_instrument = []
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# For napi
[profile.release]
# Configurations explicitly listed here for clarity.
# Using the best options for performance.
codegen-units = 1
debug = false # set to `true` for debug information
lto = "fat"
opt-level = 3
panic = "abort" # Let it crash and force ourselves to write safe Rust.
strip = "symbols" # set to `false` for debug information
[profile.profiling]
codegen-units = 1
debug = false # set to `true` for debug information
inherits = "release"
lto = "fat"
opt-level = 3
panic = "abort"
strip = false # set to `false` for debug information