Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
43 lines
1.2 KiB
Plaintext
Executable File
43 lines
1.2 KiB
Plaintext
Executable File
#!/usr/bin/env nu
|
|
|
|
# Fix circular dependencies in foundation crates
|
|
def main [] {
|
|
print "🔧 Fixing circular dependencies in foundation crates..."
|
|
|
|
let foundation_crates = ["client", "server", "core-lib", "core-types", "components", "pages", "tools", "utils"]
|
|
|
|
for $crate_name in $foundation_crates {
|
|
fix_crate_deps $crate_name
|
|
}
|
|
|
|
print "✅ All circular dependencies fixed!"
|
|
}
|
|
|
|
def fix_crate_deps [crate_name: string] {
|
|
let crate_path = $"foundation/crates/($crate_name)"
|
|
let cargo_toml = $"($crate_path)/Cargo.toml"
|
|
|
|
if not ($cargo_toml | path exists) {
|
|
print $" ⚠️ ($cargo_toml) not found, skipping..."
|
|
return
|
|
}
|
|
|
|
print $" 🔧 Fixing ($crate_name)..."
|
|
|
|
# Read the Cargo.toml file
|
|
let content = (open $cargo_toml)
|
|
|
|
# Remove self-dependencies
|
|
let fixed_content = (
|
|
$content
|
|
| reject --ignore-errors dependencies.($crate_name)
|
|
| reject --ignore-errors build-dependencies.($crate_name)
|
|
| reject --ignore-errors dev-dependencies.($crate_name)
|
|
)
|
|
|
|
# Save the fixed Cargo.toml
|
|
$fixed_content | to toml | save --force $cargo_toml
|
|
|
|
print $" ✓ Fixed ($crate_name)"
|
|
}
|