-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: improve building process and simplify it #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@hulxv could you review this and discard or merge anything you want? |
Need more work. I think it cannot be merged now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the building process to improve code organization and simplify the architecture. The key changes focus on moving from a CLI tool called "metassr-cli" to "metassr", introducing better configuration patterns, and creating more modular build services with improved error handling.
- Renames CLI binary from metassr-cli to metassr and updates package scripts accordingly
- Introduces comprehensive configuration builders for both client and server builds with better validation
- Refactors build architecture with dedicated service classes for caching, bundling, and target generation
Reviewed Changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/web-app/package.json | Updates CLI references from metassr-cli to metassr and adds @rspack/core dependency |
metassr-cli/src/main.rs | Adds root parameter to Builder::new() call |
metassr-cli/src/cli/builder.rs | Refactors Builder to use new configuration pattern with separate client and server configs |
crates/metassr-fs-analyzer/src/src_dir.rs | Adds Pages collection with hashing and new page data structures |
crates/metassr-bundler/src/bundle.js | Updates bundling configuration with improved error handling and modern JS features |
crates/metassr-build/src/server/ | Major refactoring introducing config, cache, generation, and target service modules |
crates/metassr-build/src/client/ | Complete rewrite with new config, cache, bundling, and target management services |
Comments suppressed due to low confidence (1)
crates/metassr-fs-analyzer/src/src_dir.rs:1
- This unsafe transmute is dangerous and incorrect. It attempts to transmute between completely different types that don't have the same memory layout. This will cause undefined behavior. Consider using proper type conversion or adapter patterns instead.
use super::DirectoryAnalyzer;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// Note: This is a simplification for compatibility | ||
let cache_service = unsafe { | ||
std::mem::transmute::<&'a mut metassr_utils::cache_dir::CacheDir, &'a mut ServerCacheService>(cache) | ||
}; |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unsafe transmute between unrelated types is dangerous and will cause undefined behavior. The types have completely different memory layouts and cannot be safely transmuted. Use proper type conversion or create an adapter interface instead.
Copilot uses AI. Check for mistakes.
there are a lot of complex operations in the building process and a lot of code needs to be improved.