Skip to content

Commit

Permalink
docs: document feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Mar 31, 2024
1 parent 6c629e1 commit 263c5ab
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
docs: true

- name: Run doc
run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps
run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features

test:
name: Test
Expand Down
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ typescript_tsconfig_json = { version = "0.1.4" }
nodejs_package_json = { version = "0.2.0" }

codspeed-criterion-compat = { version = "2.4.0", default-features = false, optional = true }
document-features = { version = "0.2", optional = true }

[dev-dependencies]
vfs = "0.12.0" # for testing with in memory file system
Expand All @@ -97,7 +98,12 @@ normalize-path = { version = "0.2.1" }

[features]
default = []
# Enable the PackageJson::raw_json API
## Enables the [PackageJson::raw_json] API,
## which returns the `package.json` with `serde_json::Value`.
package_json_raw_json_api = []
# For codspeed benchmark
codspeed = ["codspeed-criterion-compat"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ test:
lint:
cargo clippy -- --deny warnings

# Generate doc
doc:
RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features

# Get code coverage
codecov:
cargo codecov --html
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
//! [cjs]: https://nodejs.org/api/modules.html
//! [esm]: https://nodejs.org/api/esm.html
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
//! ## Example
//!
//! ```rust,ignore
Expand Down

0 comments on commit 263c5ab

Please sign in to comment.