Skip to content

Commit 6cd2138

Browse files
committed
fix: make oxc optional for crates.io publishing
The oxc_linter crate is only available via git, not crates.io. This blocked publishing of rma-analyzer and dependent crates. Changes: - Make oxc dependencies optional with "oxc" feature flag - Enable oxc by default for local/binary builds - Publish to crates.io without oxc (--no-default-features) - Wrap oxc-specific code with #[cfg(feature = "oxc")] All 8 RMA crates can now be published: - rma-common, rma-parser, rma-analyzer, rma-indexer - rma-ai, rma-plugins, rma-daemon, rma-cli Bump to v0.10.0
1 parent 472d392 commit 6cd2138

File tree

13 files changed

+63
-42
lines changed

13 files changed

+63
-42
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,13 @@ jobs:
151151
env:
152152
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
153153
run: |
154+
# Publish in dependency order
154155
cargo publish -p rma-common --allow-dirty || true
155156
sleep 15
156157
cargo publish -p rma-parser --allow-dirty || true
157158
sleep 15
158-
cargo publish -p rma-analyzer --allow-dirty || true
159+
# Analyzer without oxc feature (oxc uses git deps not on crates.io)
160+
cargo publish -p rma-analyzer --allow-dirty --no-default-features || true
159161
sleep 15
160162
cargo publish -p rma-indexer --allow-dirty || true
161163
sleep 15

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ members = [
1313
]
1414

1515
[workspace.package]
16-
version = "0.9.0"
16+
version = "0.10.0"
1717
edition = "2024"
1818
authors = ["Rust Monorepo Analyzer Team"]
1919
license = "MIT OR Apache-2.0"

crates/ai/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ edition.workspace = true
66
license.workspace = true
77

88
[dependencies]
9-
rma-common = { version = "0.9.0", path = "../common" }
10-
rma-parser = { version = "0.9.0", path = "../parser" }
9+
rma-common = { version = "0.10.0", path = "../common" }
10+
rma-parser = { version = "0.10.0", path = "../parser" }
1111
anyhow.workspace = true
1212
thiserror.workspace = true
1313
tracing.workspace = true

crates/analyzer/Cargo.toml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@ version.workspace = true
55
edition.workspace = true
66
license.workspace = true
77

8+
[features]
9+
default = ["oxc"]
10+
oxc = [
11+
"dep:oxc_linter",
12+
"dep:oxc_diagnostics",
13+
"dep:oxc_span",
14+
"dep:oxc_allocator",
15+
"dep:oxc_parser",
16+
"dep:oxc_semantic",
17+
"dep:oxc_ast",
18+
]
19+
820
[dependencies]
9-
rma-common = { version = "0.9.0", path = "../common" }
10-
rma-parser = { version = "0.9.0", path = "../parser" }
21+
rma-common = { version = "0.10.0", path = "../common" }
22+
rma-parser = { version = "0.10.0", path = "../parser" }
1123
anyhow.workspace = true
1224
thiserror.workspace = true
1325
tracing.workspace = true
@@ -24,14 +36,14 @@ walkdir.workspace = true
2436
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
2537
toml = "0.8"
2638

27-
# Native JS/TS linting via oxc
28-
oxc_linter.workspace = true
29-
oxc_diagnostics.workspace = true
30-
oxc_span.workspace = true
31-
oxc_allocator.workspace = true
32-
oxc_parser.workspace = true
33-
oxc_semantic.workspace = true
34-
oxc_ast.workspace = true
39+
# Native JS/TS linting via oxc (optional for crates.io publishing)
40+
oxc_linter = { workspace = true, optional = true }
41+
oxc_diagnostics = { workspace = true, optional = true }
42+
oxc_span = { workspace = true, optional = true }
43+
oxc_allocator = { workspace = true, optional = true }
44+
oxc_parser = { workspace = true, optional = true }
45+
oxc_semantic = { workspace = true, optional = true }
46+
oxc_ast = { workspace = true, optional = true }
3547

3648
[dev-dependencies]
3749
tempfile.workspace = true

crates/analyzer/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ impl AnalyzerEngine {
162162
);
163163
}
164164
}
165+
#[cfg(feature = "oxc")]
165166
ProviderType::Oxc => {
166167
let oxc = providers::OxcNativeProvider::new();
167168
if oxc.is_available() {
@@ -172,6 +173,10 @@ impl AnalyzerEngine {
172173
self.provider_registry.register(Box::new(oxc));
173174
}
174175
}
176+
#[cfg(not(feature = "oxc"))]
177+
ProviderType::Oxc => {
178+
warn!("Oxc provider not available - compiled without oxc feature");
179+
}
175180
ProviderType::Osv => {
176181
let osv = providers::OsvProvider::new(config.osv.clone());
177182
if osv.is_available() {

crates/analyzer/src/providers/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
2525
pub mod gosec;
2626
pub mod osv;
27+
#[cfg(feature = "oxc")]
2728
pub mod oxc_native;
2829
pub mod oxlint;
2930
pub mod pmd;
3031
pub mod rustsec;
3132

3233
pub use gosec::GosecProvider;
3334
pub use osv::OsvProvider;
35+
#[cfg(feature = "oxc")]
3436
pub use oxc_native::OxcNativeProvider;
3537
pub use oxlint::OxlintProvider;
3638
pub use pmd::PmdProvider;

crates/cli/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ name = "rma"
1010
path = "src/main.rs"
1111

1212
[dependencies]
13-
rma-common = { version = "0.9.0", path = "../common" }
14-
rma-parser = { version = "0.9.0", path = "../parser" }
15-
rma-analyzer = { version = "0.9.0", path = "../analyzer" }
16-
rma-indexer = { version = "0.9.0", path = "../indexer" }
17-
rma-ai = { version = "0.9.0", path = "../ai" }
18-
rma-daemon = { version = "0.9.0", path = "../daemon" }
19-
rma-plugins = { version = "0.9.0", path = "../plugins" }
13+
rma-common = { version = "0.10.0", path = "../common" }
14+
rma-parser = { version = "0.10.0", path = "../parser" }
15+
rma-analyzer = { version = "0.10.0", path = "../analyzer" }
16+
rma-indexer = { version = "0.10.0", path = "../indexer" }
17+
rma-ai = { version = "0.10.0", path = "../ai" }
18+
rma-daemon = { version = "0.10.0", path = "../daemon" }
19+
rma-plugins = { version = "0.10.0", path = "../plugins" }
2020
anyhow.workspace = true
2121
clap = { workspace = true, features = ["derive", "env", "string"] }
2222
clap_complete = "4.5"

crates/daemon/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ edition.workspace = true
66
license.workspace = true
77

88
[dependencies]
9-
rma-common = { version = "0.9.0", path = "../common" }
10-
rma-parser = { version = "0.9.0", path = "../parser" }
11-
rma-analyzer = { version = "0.9.0", path = "../analyzer" }
12-
rma-indexer = { version = "0.9.0", path = "../indexer" }
9+
rma-common = { version = "0.10.0", path = "../common" }
10+
rma-parser = { version = "0.10.0", path = "../parser" }
11+
rma-analyzer = { version = "0.10.0", path = "../analyzer" }
12+
rma-indexer = { version = "0.10.0", path = "../indexer" }
1313
anyhow.workspace = true
1414
thiserror.workspace = true
1515
tracing.workspace = true

crates/indexer/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ edition.workspace = true
66
license.workspace = true
77

88
[dependencies]
9-
rma-common = { version = "0.9.0", path = "../common" }
10-
rma-parser = { version = "0.9.0", path = "../parser" }
11-
rma-analyzer = { version = "0.9.0", path = "../analyzer" }
9+
rma-common = { version = "0.10.0", path = "../common" }
10+
rma-parser = { version = "0.10.0", path = "../parser" }
11+
rma-analyzer = { version = "0.10.0", path = "../analyzer" }
1212
anyhow.workspace = true
1313
thiserror.workspace = true
1414
tracing.workspace = true

0 commit comments

Comments
 (0)