-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cargo.toml
264 lines (236 loc) · 13.7 KB
/
Cargo.toml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# -----------------------------------------------------------------------------
# Shokunin - A lightning-fast static site generator (SSG) optimised for search engine visibility (SEO) and compliant with WCAG 2.1 Level AA accessibility standards.
# -----------------------------------------------------------------------------
[package]
# General project metadata
name = "ssg" # The name of the library
version = "0.0.30" # The version of the library
authors = ["Shokunin Contributors"] # The authors of the library
edition = "2021" # The edition of the library
rust-version = "1.56.0" # Minimum supported Rust version
license = "MIT OR Apache-2.0" # Dual licensing strategy
description = """
A Content-First Open Source Static Site Generator (SSG) crafted in Rust.
"""
homepage = "https://shokunin.one" # The project's homepage
documentation = "https://shokunin.one/documentation/index.html" # Doc URL
repository = "https://github.com/sebastienrousseau/shokunin"
readme = "README.md" # The README file
build = "build.rs" # The build script
# -----------------------------------------------------------------------------
# Crate Configuration
# -----------------------------------------------------------------------------
# Crates.io categories
categories = [
"command-line-utilities",
"parsing",
"template-engine",
"web-programming",
]
# Keywords for easier discoverability on Crates.io
keywords = ["cli", "generator", "site", "ssg", "static"]
# Excluding unnecessary files from the package
exclude = [
"/.git/*", # Exclude version control files
"/.github/*", # Exclude GitHub workflows
"/.gitignore", # Ignore Git ignore file
"/.vscode/*" # Ignore VSCode settings
]
# Including necessary files in the package
include = [
"/CONTRIBUTING.md",
"/LICENSE-APACHE",
"/LICENSE-MIT",
"/benches/**",
"/build.rs",
"/Cargo.toml",
"/content/**",
"/examples/**",
"/README.md",
"/src/**",
"/template/**",
"/tests/**",
]
# -----------------------------------------------------------------------------
# Library Information
# -----------------------------------------------------------------------------
# The library file that contains the main logic for the binary.
[lib]
name = "ssg" # Internal name of the library
path = "src/lib.rs" # Path to the library entry point
# The main file that contains the entry point for the binary.
[[bin]]
name = "ssg" # Name of the binary
path = "src/main.rs" # Path to the binary entry point
# -----------------------------------------------------------------------------
# Features
# -----------------------------------------------------------------------------
[features]
# Optional features that can be enabled or disabled.
default = ["async", "tokio"] # No default features enabled
async = ["tokio"] # This enables tokio when the async feature is enabled
cli = [] # Enable command-line interface support
# -----------------------------------------------------------------------------
# Build Dependencies
# -----------------------------------------------------------------------------
[build-dependencies]
# Dependencies for the build script, used for pre-compilation tasks.
version_check = "0.9" # Ensures that a compatible Rust version is used
# -----------------------------------------------------------------------------
# Development Dependencies
# -----------------------------------------------------------------------------
[dev-dependencies]
# Dependencies required for testing and development.
criterion = "0.5" # Benchmarking library to test performance
# -----------------------------------------------------------------------------
# Dependencies
# -----------------------------------------------------------------------------
[dependencies]
# Required dependencies for building and running the project.
anyhow = "1.0.93"
clap = { version = "4.5.21", features = ["derive", "cargo", "env"] }
dtt = "0.0.8"
http-handle = "0.0.2"
langweave = "0.0.1"
log = { version = "0.4.22", features = ["std"] }
rayon = "1.10.0"
rlg = "0.0.6"
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.133"
staticdatagen = "0.0.1"
tempfile = "3.14.0"
thiserror = "2.0.3"
toml = "0.8.19"
tokio = { version = "1.41.1", features = ["full"], optional = true }
url = "2.5.3"
uuid = { version = "1.11.0", features = ["v4"] }
# Platform-specific dependency for Unix with OpenSSL
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
# -----------------------------------------------------------------------------
# Criterion Benchmark
# -----------------------------------------------------------------------------
[[bench]]
# Benchmarking configuration for performance testing.
name = "bench" # Name of the benchmark
harness = false # Disable the default benchmark harness (used by Criterion)
# -----------------------------------------------------------------------------
# Documentation Configuration
# -----------------------------------------------------------------------------
[package.metadata.docs.rs]
# Settings for building and hosting documentation on docs.rs.
all-features = true # Build documentation with all features enabled
rustdoc-args = ["--cfg", "docsrs"] # Arguments passed to `rustdoc` when building the documentation
targets = ["x86_64-unknown-linux-gnu"] # Default target platform for the docs
# -----------------------------------------------------------------------------
# Linting Configuration
# -----------------------------------------------------------------------------
[lints.rust]
# Linting rules for the project.
## Warnings
missing_copy_implementations = "warn" # Warn if types can implement `Copy` but don’t
missing_docs = "warn" # Warn if public items lack documentation
unstable_features = "warn" # Warn on the usage of unstable features
unused_extern_crates = "warn" # Warn about unused external crates
unused_results = "warn" # Warn if a result type is unused (e.g., errors ignored)
## Allowances
bare_trait_objects = "allow" # Allow bare trait objects (e.g., `Box<dyn Trait>`)
elided_lifetimes_in_paths = "allow" # Allow lifetimes to be elided in paths
non_camel_case_types = "allow" # Allow non-camel-case types
non_upper_case_globals = "allow" # Allow non-uppercase global variables
trivial_bounds = "allow" # Allow trivial bounds in trait definitions
unsafe_code = "allow" # Allow the usage of unsafe code blocks
## Forbidden
missing_debug_implementations = "forbid" # Forbid missing `Debug` implementations
non_ascii_idents = "forbid" # Forbid non-ASCII identifiers
unreachable_pub = "forbid" # Forbid unreachable `pub` items
## Denials
dead_code = "deny" # Deny unused, dead code in the project
deprecated_in_future = "deny" # Deny code that will be deprecated in the future
ellipsis_inclusive_range_patterns = "deny" # Deny usage of inclusive ranges in match patterns (`...`)
explicit_outlives_requirements = "deny" # Deny unnecessary lifetime outlives requirements
future_incompatible = { level = "deny", priority = -1 } # Handle future compatibility issues
keyword_idents = { level = "deny", priority = -1 } # Deny usage of keywords as identifiers
macro_use_extern_crate = "deny" # Deny macro use of `extern crate`
meta_variable_misuse = "deny" # Deny misuse of meta variables in macros
missing_fragment_specifier = "deny" # Deny missing fragment specifiers in macros
noop_method_call = "deny" # Deny method calls that have no effect
rust_2018_idioms = { level = "deny", priority = -1 } # Enforce Rust 2018 idioms
rust_2021_compatibility = { level = "deny", priority = -1 } # Enforce Rust 2021 compatibility
single_use_lifetimes = "deny" # Deny lifetimes that are used only once
trivial_casts = "deny" # Deny trivial casts (e.g., `as` when unnecessary)
trivial_numeric_casts = "deny" # Deny trivial numeric casts (e.g., `i32` to `i64`)
unused = { level = "deny", priority = -1 } # Deny unused code, variables, etc.
unused_features = "deny" # Deny unused features
unused_import_braces = "deny" # Deny unnecessary braces around imports
unused_labels = "deny" # Deny unused labels in loops
unused_lifetimes = "deny" # Deny unused lifetimes
unused_macro_rules = "deny" # Deny unused macros
unused_qualifications = "deny" # Deny unnecessary type qualifications
variant_size_differences = "deny" # Deny enum variants with significant size differences
# -----------------------------------------------------------------------------
# Clippy Configuration
# -----------------------------------------------------------------------------
[package.metadata.clippy]
# Clippy lint configuration for enhanced code analysis.
warn-lints = [
"clippy::all", # Enable all common Clippy lints
"clippy::pedantic", # Enable pedantic lints for stricter checking
"clippy::cargo", # Enable lints specific to cargo
"clippy::nursery", # Enable experimental lints from Clippy’s nursery
"clippy::complexity", # Warn on code complexity and suggest improvements
"clippy::correctness", # Ensure code correctness, flagging potential issues
"clippy::perf", # Lints that catch performance issues
"clippy::style", # Suggest stylistic improvements
"clippy::suspicious", # Detect suspicious code patterns
"clippy::module_name_repetitions", # Avoid repeating module names in the crate name
]
# Customize Clippy to allow certain less critical lints.
allow-lints = [
"clippy::module_inception", # Allow modules with the same name as their parents
"clippy::too_many_arguments", # Allow functions with more than 7 arguments if justified
"clippy::missing_docs_in_private_items", # Skip requiring documentation for private items
]
# Enforce specific warnings and errors more strictly.
deny-lints = [
"clippy::unwrap_used", # Deny the use of unwrap to ensure error handling
"clippy::expect_used", # Deny the use of expect to avoid improper error handling
]
# -----------------------------------------------------------------------------
# Profiles
# -----------------------------------------------------------------------------
[profile.dev]
# Development profile configuration for fast builds and debugging.
codegen-units = 256 # Increase codegen units for faster compilation
debug = true # Enable debugging symbols
debug-assertions = true # Enable debug assertions
incremental = true # Enable incremental compilation
lto = false # Disable link-time optimization for development
opt-level = 0 # No optimizations in development
overflow-checks = true # Enable overflow checks for arithmetic operations
panic = 'unwind' # Enable unwinding for panics (useful in development)
rpath = false # Disable rpath generation
strip = false # Do not strip symbols in development builds
[profile.release]
# Release profile configuration for optimized builds.
codegen-units = 1 # Reduce codegen units for better performance
debug = false # Disable debug symbols in release builds
debug-assertions = false # Disable debug assertions
incremental = false # Disable incremental compilation for optimal binary size
lto = true # Enable link-time optimization for smaller and faster binaries
opt-level = "z" # Optimize for binary size
overflow-checks = false # Disable overflow checks for performance
panic = "abort" # Use abort on panic for minimal overhead
rpath = false # Disable rpath generation
strip = "symbols" # Strip symbols for smaller binary size
[profile.test]
# Test profile configuration for debugging and development.
codegen-units = 256 # Increase codegen units for faster test builds
debug = true # Enable debugging symbols for test builds
debug-assertions = true # Enable debug assertions for tests
incremental = true # Enable incremental compilation for tests
lto = false # Disable link-time optimization during testing
opt-level = 0 # No optimizations in test builds
overflow-checks = true # Enable overflow checks for tests
rpath = false # Disable rpath generation
strip = false # Do not strip symbols in test builds