[workspace] members = ["napi"] resolver = "2" [package] version = "0.3.5" name = "rspack_resolver" authors = ["Rspack"] categories = ["development-tools"] description = "ESM / CJS module resolution" edition = "2021" homepage = "https://github.com/web-infra-dev/rspack-resolver" keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"] license = "MIT" readme = "README.md" repository = "https://github.com/web-infra-dev/rspack-resolver" rust-version = "1.70" include = ["/src", "/examples", "/benches"] [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" # 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] tracing = "0.1.40" dashmap = "6.0.1" serde = { version = "1.0.203", features = ["derive"] } # derive for Deserialize from package.json serde_json = { version = "1.0.117", features = [ "preserve_order", ] } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]` rustc-hash = { version = "2.0.0", default-features = false, features = ["std"] } dunce = "1.0.4" # Normalize Windows paths to the most compatible format, avoiding UNC where possible once_cell = "1.19.0" # Use `std::sync::OnceLock::get_or_try_init` when it is stable. thiserror = "1.0.61" json-strip-comments = "1.0.2" indexmap = { version = "2.2.6", features = ["serde"] } cfg-if = "1.0" simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] } pnp = { version = "0.9.0", optional = true } document-features = { version = "0.2.8", optional = true } [dev-dependencies] vfs = "0.12.0" # for testing with in memory file system rayon = { version = "1.10.0" } criterion2 = { version = "1.0.0", default-features = false } normalize-path = { version = "0.2.1" } [features] default = [] ## 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"] # 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.