forked from oxc-project/oxc-resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
130 lines (116 loc) · 4.02 KB
/
Cargo.toml
File metadata and controls
130 lines (116 loc) · 4.02 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
[workspace]
members = ["napi"]
resolver = "2"
[workspace.package]
authors = ["Boshen <boshenc@gmail.com>"]
categories = ["development-tools"]
edition = "2024"
homepage = "https://github.com/oxc-project/oxc-resolver"
include = ["/src", "/examples", "/benches"]
keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/oxc-project/oxc-resolver"
rust-version = "1.85.0"
description = "ESM / CJS module resolution"
[workspace.dependencies]
oxc_resolver = { version = "11.1.0", path = "." }
[package]
name = "oxc_resolver"
version = "11.1.0"
authors.workspace = true
categories.workspace = true
edition.workspace = true
homepage.workspace = true
include.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
description.workspace = true
[lib]
doctest = false
[[bench]]
name = "resolver"
harness = false
[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.
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
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"
unnecessary_safety_comment = "warn"
undocumented_unsafe_blocks = "warn"
pedantic = { level = "warn", priority = -1 }
# This rule is too pedantic, I don't want to force this because naming things are hard.
module_name_repetitions = "allow"
doc_markdown = "allow"
# 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 }
literal_string_with_formatting_args = "allow"
missing_const_for_fn = "allow"
# cargo
multiple_crate_versions = "allow"
[[example]]
name = "resolver"
[dependencies]
cfg-if = "1"
indexmap = { version = "2", features = ["serde"] }
json-strip-comments = "1"
once_cell = "1" # Use `std::sync::OnceLock::get_or_try_init` when it is stable.
papaya = "0.2.1"
rustc-hash = { version = "2" }
serde = { version = "1", features = ["derive"], optional = true } # derive for Deserialize from package.json
serde_json = { version = "1", features = ["preserve_order"], optional = true } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]`
simdutf8 = { version = "0.1" }
thiserror = "2"
tracing = "0.1"
pnp = { version = "0.9.1", optional = true }
document-features = { version = "0.2.11", optional = true }
[dev-dependencies]
criterion2 = { version = "3.0.0", default-features = false }
normalize-path = { version = "0.2.1" }
pico-args = "0.5.0"
rayon = { version = "1.10.0" }
vfs = "0.12.1" # for testing with in memory file system
[features]
default = ["fs_cache"]
## Provides the `FsCache` implementation.
fs_cache = ["dep:serde", "dep:serde_json"]
## Enables the [PackageJsonSerde::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"]
# For codspeed benchmark
codspeed = ["criterion2/codspeed"]
[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.
opt-level = 3
lto = "fat"
codegen-units = 1
strip = "symbols" # set to `false` for debug information
debug = false # set to `true` for debug information
panic = "abort" # Let it crash and force ourselves to write safe Rust.