Files
next.js/crates/next-custom-transforms/Cargo.toml
T
Luke SandbergandGitHub f93a867d77 Update wasm and next-custom-transforms crates to Rust edition 2024 (#90350)
The `wasm` and `next-custom-transforms` crates were still on Rust edition 2018 while the rest of the crates in this repo use edition 2024. This caused a pre-commit hook conflict:

- `cargo fmt` passes the crate's own edition (2018) to `rustfmt`, which uses **case-insensitive** import sorting
- The lint-staged pre-commit hook runs `rustfmt --edition 2024 --`, which uses **ASCII order** import sorting (uppercase before lowercase)

These two sort orders disagree on items like `{custom_before_pass, TransformOptions}` vs `{TransformOptions, custom_before_pass}`, causing an infinite flip-flop: every commit would reorder imports, and the next `cargo fmt` would reorder them back.

## Changes

- Bump `crates/wasm` and `crates/next-custom-transforms` from edition 2018 to 2024
- Add `+ use<C>` precise capturing to `server_actions()` return type to satisfy edition 2024's stricter `impl Trait` lifetime capture rules
- Add `style_edition = "2024"` to `.rustfmt.toml` as a safety net so `cargo fmt` uses 2024-style formatting regardless of individual crate editions
- Reformat all affected files with `cargo fmt`
- Apply new clippy rules
2026-02-23 01:48:12 -08:00

79 lines
2.1 KiB
TOML

[package]
edition = "2024"
name = "next-custom-transforms"
version = "0.0.0"
publish = false
[features]
plugin = [
"swc_core/plugin_transform_host_native",
"turbopack-ecmascript-plugins/swc_ecma_transform_plugin",
]
[package.metadata.cargo-shear]
ignored = [
# when using the `plugin` feature, we need to set a feature flag on `turbopack-ecmascript-plugins`
# so we must list it as a dependency even though we don't directly use it
"turbopack-ecmascript-plugins",
]
[lints]
workspace = true
[dependencies]
base64 = "0.21.0"
bytes-str = { workspace = true }
chrono = "0.4"
easy-error = "1.0.0"
either = "1"
hex = "0.4.3"
indexmap = { workspace = true }
indoc = { workspace = true }
once_cell = { workspace = true }
pathdiff = { workspace = true }
regex = "1.5"
rustc-hash = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, features = ["preserve_order"] }
sha1 = "0.10.1"
tracing = { version = "0.1.37" }
anyhow = { workspace = true }
swc_core = { workspace = true, features = [
"base",
"common_concurrent",
"ecma_ast",
"ecma_codegen",
"ecma_loader_lru",
"ecma_loader_node",
"ecma_minifier",
"ecma_parser",
"ecma_parser_typescript",
"ecma_preset_env",
"ecma_quote",
"ecma_transforms",
"ecma_transforms_optimization",
"ecma_transforms_react",
"ecma_transforms_typescript",
"ecma_utils",
"ecma_visit",
] }
modularize_imports = { workspace = true }
styled_components = { workspace = true }
styled_jsx = { workspace = true }
swc_emotion = { workspace = true }
swc_relay = { workspace = true }
turbopack-ecmascript-plugins = { workspace = true, optional = true }
turbo-rcstr = { workspace = true }
urlencoding = { workspace = true }
react_remove_properties = { workspace = true }
remove_console = { workspace = true }
preset_env_base = { workspace = true }
[dev-dependencies]
testing = { workspace = true }
# effectively enable the "plugin" feature for tests, plus swc_core/plugin_backend_wasmer
swc_core = { workspace = true, features = ["testing_transform", "plugin_transform_host_native", "plugin_backend_wasmer"] }
turbopack-ecmascript-plugins = { workspace = true, features = ["swc_ecma_transform_plugin"] }