-
Notifications
You must be signed in to change notification settings - Fork 108
feat: output filename #1725
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
feat: output filename #1725
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 演练这个拉取请求引入了对 Mako 构建系统的配置和文件生成逻辑的一系列增强。主要变更包括在输出配置中添加可选的文件名字段,修改 Chunk 命名方法,并在生成过程中支持自定义文件名模板。这些更改提供了更灵活的文件输出和命名机制,同时保持了现有系统的核心功能。 变更
可能相关的 PRs
建议的审阅者
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request introduces a new feature that allows specifying an output filename in the configuration. It modifies several components to accommodate this change, including the addition of a Changes
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1725 +/- ##
==========================================
+ Coverage 54.77% 54.83% +0.05%
==========================================
Files 181 181
Lines 17981 18021 +40
==========================================
+ Hits 9849 9881 +32
- Misses 8132 8140 +8 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
crates/mako/src/generate/chunk.rs (1)
Line range hint
76-115: 建议改进错误处理和命名规范
name方法中存在以下问题:
parse_path的错误处理使用了unwrap(),建议使用Result处理错误- 文件名中的特殊字符替换可以抽取为单独的函数
- 命名规则的常量应该提取出来
建议如下重构:
const SPECIAL_CHARS: [char; 3] = ['.', '?', '@']; const SPECIAL_SEGMENTS: &[(&str, &str)] = &[ ("pd_", ".."), ("ps_", ""), ]; impl Chunk { fn sanitize_path_segment(segment: &str) -> String { segment.replace(SPECIAL_CHARS, "_") } pub fn name(&self) -> Result<String, ChunkError> { match &self.chunk_type { ChunkType::Runtime => Ok("runtime".into()), ChunkType::Entry(_, name, _) => Ok(name.clone()), ChunkType::Async | ChunkType::Sync | ChunkType::Worker(_) => { let (path, search, ..) = parse_path(&self.id.id) .map_err(|e| ChunkError::PathParsing(e))?; // ... rest of the implementation } } } }
🧹 Nitpick comments (5)
e2e/fixtures/config.output.filename/expect.js (1)
8-10: 建议优化测试用例的健壮性当前测试仅验证了文件名的基本格式,建议增加以下测试场景:
- 验证不同的 name 值
- 验证 hash 的长度和格式
- 验证生成的文件内容是否正确
const {files} = parseBuildResult(__dirname); let filename = Object.keys(files)[0] - -expect(filename).toMatch(/index\.umd\..+\.js/) + +describe('output filename', () => { + it('should match the expected pattern', () => { + expect(filename).toMatch(/index\.umd\..+\.js/); + expect(filename.split('.')[2]).toMatch(/^[a-f0-9]{8}$/); + }); + + it('should contain valid file content', () => { + expect(files[filename]).toBeTruthy(); + }); +});crates/mako/src/generate/chunk_pot.rs (1)
29-29: 建议为新字段添加文档注释新增的
chunk_name字段看起来没有问题,但建议添加文档注释说明其用途和与filename选项的关系。添加如下文档注释:
+ /// 代表块的名称,用于生成输出文件名 + /// 当启用 filename 选项时会被用作模板变量 pub chunk_name: String,crates/mako/src/generate/generate_chunks.rs (3)
36-40: 结构体字段需要添加文档注释新增的字段
chunk_name和file_name_template实现良好,但建议为这些字段添加文档注释以提高代码可维护性。建议添加如下文档注释:
#[derive(Clone)] pub struct ChunkFile { pub raw_hash: u64, pub content: Vec<u8>, pub source_map: Option<Vec<u8>>, pub hash: Option<String>, + /// 块的名称,用于文件名模板中的 [name] 占位符 pub chunk_name: String, pub file_name: String, pub chunk_id: String, pub file_type: ChunkFileType, + /// 可选的文件名模板,支持 [name]、[id]、[hash] 和 [contenthash] 占位符 pub file_name_template: Option<String>, }
301-342: 建议重构复杂的占位符替换逻辑当前函数职责过重,嵌套层级较深,建议拆分为更小的函数以提高可维护性。
建议将内部逻辑拆分为独立函数:
fn find_and_replace_placeholder( content: &mut Vec<u8>, placeholder: &str, replacer: &str, ) -> Result<()> { let position = content .windows(placeholder.len()) .position(|w| w == placeholder.as_bytes()) .ok_or_else(|| anyhow!("Placeholder '{}' not found", placeholder))?; content.splice( position..position + replacer.len(), replacer.as_bytes().to_vec(), ); Ok(()) } fn replace_chunks_placeholder( chunk_files: &mut [ChunkFile], chunks_hash_placeholder: &ChunksHashPlaceholder, chunks_hash_replacer: &ChunksHashReplacer, ) -> Result<()> { for (chunk_id, placeholder) in chunks_hash_placeholder { let replacer = chunks_hash_replacer .get(chunk_id) .ok_or_else(|| anyhow!( "Replacer not found for chunk '{}' with placeholder '{}'", chunk_id, placeholder ))?; for cf in chunk_files .iter_mut() .filter(|cf| matches!(cf.file_type, ChunkFileType::JS)) { if cf.content.is_empty() { warn!("Chunk content of \"{}\" is empty.", cf.chunk_id); continue; } find_and_replace_placeholder(&mut cf.content, placeholder, replacer)?; } } Ok(()) }
438-458: 建议增加更多测试用例当前测试仅覆盖了基本场景,建议添加以下测试场景:
- 无模板时的默认行为
- 模板中包含无效占位符
- 不同文件类型的处理
- hash 为 None 的情况
#[test] fn test_template_edge_cases() { let base_chunk_file = ChunkFile { raw_hash: 0, content: vec![], source_map: None, hash: Some("hash999".to_string()), chunk_name: "chunk".to_string(), file_name: "index.js".to_string(), chunk_id: "c_id".to_string(), file_type: ChunkFileType::JS, file_name_template: None, }; // 测试无模板时的默认行为 assert_eq!(base_chunk_file.disk_name(), "index.js"); // 测试无效占位符 let mut cf = base_chunk_file.clone(); cf.file_name_template = Some("[invalid].[name].js".to_string()); assert_eq!(cf.disk_name(), "[invalid].chunk.js"); // 测试 hash 为 None 的情况 let mut cf = base_chunk_file.clone(); cf.hash = None; cf.file_name_template = Some("[name].[hash].js".to_string()); assert_eq!(cf.disk_name(), "chunk.notHashed.js"); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
crates/mako/src/config/output.rs(1 hunks)crates/mako/src/generate/chunk.rs(3 hunks)crates/mako/src/generate/chunk_pot.rs(2 hunks)crates/mako/src/generate/chunk_pot/ast_impl.rs(4 hunks)crates/mako/src/generate/chunk_pot/str_impl.rs(2 hunks)crates/mako/src/generate/generate_chunks.rs(5 hunks)e2e/fixtures/config.output.filename/expect.js(1 hunks)e2e/fixtures/config.output.filename/mako.config.json(1 hunks)e2e/fixtures/config.output.filename/src/index.tsx(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- e2e/fixtures/config.output.filename/src/index.tsx
- e2e/fixtures/config.output.filename/mako.config.json
🔇 Additional comments (9)
crates/mako/src/generate/chunk.rs (1)
120-122:
建议处理 name() 方法可能的错误
filename 方法直接使用了 name() 的结果,没有处理潜在的错误。
pub fn filename(&self) -> String {
- format!("{}.js", self.name())
+ format!("{}.js", self.name().unwrap_or_else(|e| {
+ log::error!("Failed to generate chunk name: {}", e);
+ "unknown".to_string()
+ }))
}Likely invalid or redundant comment.
crates/mako/src/generate/chunk_pot.rs (1)
45-45: 字段初始化逻辑正确
在 from 方法中使用 chunk.name() 初始化 chunk_name 字段的实现是正确的。
crates/mako/src/generate/chunk_pot/ast_impl.rs (4)
136-137: CSS 块文件添加了必要的文件名支持
render_css_chunk 函数中正确添加了 chunk_name 和 file_name_template 字段。将 file_name_template 设置为 None 是合理的,因为 CSS 块不需要自定义文件名模板。
186-186: JS 块文件添加了必要的文件名支持
render_normal_js_chunk 函数中正确添加了 chunk_name 和 file_name_template 字段。将 file_name_template 设置为 None 是合理的,因为普通 JS 块不需要自定义文件名模板。
Also applies to: 189-189
229-230: 入口块文件正确使用配置的文件名模板
render_entry_js_chunk 函数中正确设置了 chunk_name 和 file_name_template,并且适当地使用了配置中的 filename 选项。
333-333: 请验证哈希计算的更改
移除了条件检查直接计算哈希的改动可能会影响性能,建议验证此更改的必要性和影响。
crates/mako/src/generate/chunk_pot/str_impl.rs (2)
106-107: 入口块的字符串实现正确支持文件名选项
render_entry_js_chunk 的字符串实现中正确添加了文件名相关字段,与 AST 实现保持一致。
157-158: 普通块的字符串实现正确支持文件名选项
render_normal_js_chunk 的字符串实现中正确添加了文件名相关字段,与 AST 实现保持一致。
crates/mako/src/generate/generate_chunks.rs (1)
44-48: 磁盘文件名生成逻辑合理
方法实现简洁明了,通过 Option 优雅地处理了模板存在与否的情况。
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/codecov.yml (1)
52-52: 将 fail_ci_if_error 设置为 false 是个明智的选择这个改动可以防止因 Codecov 服务临时性问题而导致 CI 流程失败,提高了 CI 的可靠性。不过请确保团队定期手动检查代码覆盖率报告,以便及时发现覆盖率相关问题。
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
crates/mako/src/generate/generate_chunks.rs (2)
301-342: 建议重构以提高代码可读性!当前的
replace_chunks_placeholder函数包含了较多的嵌套操作和复杂的错误处理逻辑。建议将其拆分为更小的函数以提高可维护性。建议将内部逻辑抽取为独立函数:
+ fn replace_single_chunk_placeholder( + chunk_files: &mut [ChunkFile], + chunk_id: &str, + placeholder: &str, + replacer: &str, + ) -> Result<()> { + chunk_files + .iter_mut() + .filter(|cf| matches!(cf.file_type, ChunkFileType::JS)) + .try_for_each(|cf| { + if cf.content.is_empty() { + warn!("Chunk content of \"{}\" is empty.", cf.chunk_id); + } + + let position = cf + .content + .windows(placeholder.len()) + .position(|w| w == placeholder.as_bytes()); + + position.map_or( + Err(anyhow!( + "Generate \"{}\" failed, placeholder \"{}\" for \"{}\" not existed in chunk file.", + cf.chunk_id, + placeholder, + chunk_id + )), + |pos| { + cf.content.splice( + pos..pos + replacer.len(), + replacer.as_bytes().to_vec(), + ); + Ok(()) + }, + ) + }) + } fn replace_chunks_placeholder( chunk_files: &mut [ChunkFile], chunks_hash_placeholder: &ChunksHashPlaceholder, chunks_hash_replacer: &ChunksHashReplacer, ) -> Result<()> { chunks_hash_placeholder.iter().try_for_each(|(chunk_id, placeholder)| { chunks_hash_replacer .get(chunk_id) .map_or( Err(anyhow!( "Generate \"{}\" failed, replacer not found for placeholder \"{}\".", chunk_id, placeholder )), |replacer| replace_single_chunk_placeholder(chunk_files, chunk_id, placeholder, replacer), ) }) }
438-458: 建议增加更多测试用例!当前的测试虽然覆盖了基本功能,但建议添加以下测试场景:
- 空模板的处理
- 无效占位符的处理
- 缺少 hash 值时的处理
- 特殊字符在文件名中的处理
建议添加如下测试用例:
#[test] fn test_template_edge_cases() { let base_chunk_file = ChunkFile { raw_hash: 0, content: vec![], source_map: None, hash: Some("hash999".to_string()), chunk_name: "chunk".to_string(), file_name: "index.js".to_string(), chunk_id: "c_id".to_string(), file_type: ChunkFileType::JS, file_name_template: None, }; // 测试空模板 let mut chunk_file = base_chunk_file.clone(); chunk_file.file_name_template = Some("".to_string()); assert_eq!(chunk_file.disk_name(), ""); // 测试无效占位符 let mut chunk_file = base_chunk_file.clone(); chunk_file.file_name_template = Some("[invalid].js".to_string()); assert_eq!(chunk_file.disk_name(), "[invalid].js"); // 测试缺少 hash 值 let mut chunk_file = base_chunk_file.clone(); chunk_file.hash = None; chunk_file.file_name_template = Some("[name].[hash].js".to_string()); assert_eq!(chunk_file.disk_name(), "chunk.notHashed.js"); // 测试特殊字符 let mut chunk_file = base_chunk_file; chunk_file.chunk_name = "special@#$".to_string(); chunk_file.file_name_template = Some("[name].[hash].js".to_string()); assert_eq!(chunk_file.disk_name(), "special@#$.hash999.js"); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/mako/src/generate/generate_chunks.rs(5 hunks)
🔇 Additional comments (3)
crates/mako/src/generate/generate_chunks.rs (3)
36-40: 结构体字段添加合理!
新增的 chunk_name 和 file_name_template 字段设计合理,类型选择恰当。chunk_name 作为必填字段而 file_name_template 作为可选字段的设计符合实际使用场景。
45-48: 方法重构清晰简洁!
disk_name 方法的重构采用了优雅的模板优先策略,当没有模板时回退到默认实现。这种设计既保持了向后兼容性,又提供了新功能的扩展。
70-78: 🛠️ Refactor suggestion
建议增加模板验证和错误处理!
当前的模板渲染实现虽然简单直接,但建议增加以下改进:
- 添加模板格式的验证
- 对无效模板提供友好的错误提示
建议按如下方式改进:
fn render_tmpl(&self, tpl: &str) -> String {
let hash_string = self.hash.as_deref().unwrap_or("notHashed");
+ // 验证模板中是否包含有效的占位符
+ if !tpl.contains("[name]") && !tpl.contains("[id]") &&
+ !tpl.contains("[hash]") && !tpl.contains("[contenthash]") &&
+ !tpl.contains("[file]") {
+ warn!("模板 '{}' 中未包含任何有效的占位符", tpl);
+ }
+
tpl.replace("[name]", self.chunk_name.as_str())
.replace("[id]", self.chunk_id.as_str())
.replace("[file]", self.file_name.as_str())
.replace("[hash]", hash_string)
.replace("[contenthash]", hash_string)
}Likely invalid or redundant comment.
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
codecov.yml(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
codecov.yml
[error] 6-6: syntax error: could not find expected ':'
(syntax)
codecov.yml
Outdated
| target: auto | ||
| thre |
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.
修复 YAML 语法错误和不完整的配置
thre 配置项似乎不完整,这会导致 YAML 解析错误。这可能是想要配置 threshold(阈值)。
建议按照以下方式修改:
project:
target: auto
- thre
+ threshold: null # 或设置具体的阈值,例如 80📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| target: auto | |
| thre | |
| target: auto | |
| threshold: null # 或设置具体的阈值,例如 80 |
cd3654b to
faf3f67
Compare
faf3f67 to
0d3594f
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
codecov.yml (1)
4-4: 建议添加文件末尾的换行符根据 YAML 规范和最佳实践,文件应以换行符结束。
coverage: status: project: off - patch: off + patch: off +🧰 Tools
🪛 yamllint (1.35.1)
[error] 4-4: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
codecov.yml(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
codecov.yml
[error] 4-4: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
codecov.yml (1)
1-4: 请确认是否有意禁用所有覆盖率报告
当前配置完全禁用了项目和补丁的覆盖率报告。这可能会影响代码质量监控。建议仔细考虑以下替代方案:
coverage:
status:
- project: off
- patch: off
+ project:
+ default:
+ target: auto
+ threshold: 1%
+ patch:
+ default:
+ target: 80%✅ Verification successful
建议保持当前的覆盖率配置禁用状态
根据代码库分析,当前禁用覆盖率报告是合理的:
- 项目主要使用 Rust 开发,已经在
Code Coverage工作流中通过grcov和codecov-action单独配置了 Rust 代码的覆盖率报告。 - JavaScript/TypeScript 测试较少,主要是端到端测试(E2E)和热更新(HMR)测试,这类测试不适合使用代码覆盖率指标。
- 现有的测试策略更注重功能验证而非代码覆盖率。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 描述:检查仓库中的测试文件,确认是否确实不需要覆盖率报告
# 搜索测试文件
echo "查找测试文件..."
fd -e test.ts -e test.js -e spec.ts -e spec.js
# 检查是否有 CI 配置使用覆盖率
echo "检查 CI 配置..."
fd -t f ".github/workflows" -x cat {}
Length of output: 622
Script:
#!/bin/bash
# 检查测试文件内容和 CI 配置
echo "检查测试文件内容..."
cat packages/rsc/src/index.test.ts
echo -e "\n检查 CI 工作流配置..."
fd . '.github/workflows' --full-path --type f --exec cat {}
echo -e "\n检查 package.json 中的测试脚本..."
fd package.json --type f --exec cat {} | grep -A 5 -B 5 '"test":'
Length of output: 18455
🧰 Tools
🪛 yamllint (1.35.1)
[error] 4-4: no new line character at the end of file
(new-line-at-end-of-file)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
packages/bundler-mako/package.json(1 hunks)packages/mako/npm/darwin-arm64/package.json(1 hunks)packages/mako/npm/darwin-x64/package.json(1 hunks)packages/mako/npm/linux-arm64-gnu/package.json(1 hunks)packages/mako/npm/linux-arm64-musl/package.json(1 hunks)packages/mako/npm/linux-x64-gnu/package.json(1 hunks)packages/mako/npm/linux-x64-musl/package.json(1 hunks)packages/mako/npm/win32-ia32-msvc/package.json(1 hunks)packages/mako/npm/win32-x64-msvc/package.json(1 hunks)packages/mako/package.json(2 hunks)
✅ Files skipped from review due to trivial changes (9)
- packages/mako/npm/darwin-arm64/package.json
- packages/mako/npm/linux-arm64-musl/package.json
- packages/mako/npm/darwin-x64/package.json
- packages/mako/npm/win32-ia32-msvc/package.json
- packages/mako/npm/linux-x64-musl/package.json
- packages/bundler-mako/package.json
- packages/mako/npm/win32-x64-msvc/package.json
- packages/mako/npm/linux-x64-gnu/package.json
- packages/mako/npm/linux-arm64-gnu/package.json
🔇 Additional comments (1)
packages/mako/package.json (1)
3-3: 版本号更新符合语义化版本规范
版本号从 0.9.9 更新到 0.9.10-canary.20241218.1 合理反映了新功能的添加(filename 输出支持)。使用 canary 标签进行预发布也是一个谨慎的做法。
| "@umijs/mako-darwin-arm64": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-linux-arm64-gnu": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-linux-arm64-musl": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-win32-ia32-msvc": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-darwin-x64": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-win32-x64-msvc": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-linux-x64-gnu": "0.9.10-canary.20241218.1", | ||
| "@umijs/mako-linux-x64-musl": "0.9.10-canary.20241218.1" |
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.
💡 Codebase verification
版本一致性验证需要注意
从验证结果来看,虽然 packages/mako/package.json 中的可选依赖声明都使用了相同的版本 0.9.10-canary.20241218.1,但实际的 npm 包中存在一些不一致:
win32-arm64-msvc、linux-arm-gnueabihf和darwin-universal包的实际版本仍然是0.0.0- 其他平台的包版本已经正确更新到
0.9.10-canary.20241218.1
建议:
- 确保所有平台的 npm 包都已经正确发布并更新到最新版本
- 特别关注
win32-arm64-msvc、linux-arm-gnueabihf和darwin-universal这几个平台的包是否需要更新
🔗 Analysis chain
可选依赖版本保持一致性
所有平台特定的可选依赖包版本都已同步更新到 0.9.10-canary.20241218.1,保持了版本的一致性。
运行以下脚本验证所有相关包的版本一致性:
Let's analyze the output more carefully. I can see that there are some platform-specific packages that have version "0.0.0", which is inconsistent with the versions shown in package.json dependencies. Let me verify this further.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: 验证所有 @umijs/mako 相关包的版本一致性
# 检查所有相关包的 package.json 中的版本号
fd -t f "package.json" -x grep -H "\"version\":" {} \;
Length of output: 3789
Script:
#!/bin/bash
# Check the actual content of package.json to verify the dependencies
cat ./packages/mako/package.json | grep -A 10 "optionalDependencies"
Length of output: 641
* fix: env_replacer should not replace user defined variable in scope (#1577) * fix: env_replacer should not replace user defined variable in scope * test: add test cases for env_replacer * chore: code style * release: @umijs/mako@0.8.11 * chore: bundler-mako@0.8.11 * docs: add changelog for v0.8.11 * fix(tree-shaking): detect export var side effects (#1579) * test: ✅ add a failure test * fix: 🐛 add is pure detection in export var decl * fix: bad output when chunk_loading_global containing quotation mark (#1582) * chore: ➕ add a subdot cli tool script (#1585) * fix(win): copy don't work under windows (#1587) * fix(win): module id should be win_pathed (#1588) * feat(tree-shaking): optimize import namespace used all exports to partial used of source modules (#1584) * test: ✅ add failure test case * feat: ✨ add collect prop explicit field * feat: ✨ collect explicit member prop access to optizmize used export in dep module replace USE ALL export to partial used exports * fix: dedestructuring before collect ExplicitProps * test: ✅ add back trace env var * test: ✅ update test case * fix: 🐛 add globals and helpers --------- Co-authored-by: Jinbao1001 <nodewebli@gmail.com> * fix: merge mako config (#1578) * fix: merge mako config * fix: merge mako config * fix:clear deps should not panic when module not found (#1581) * fix:clear deps should not panic when module not found * chore: use tracing warn * fix: delete log * Revert "fix: merge mako config (#1578)" (#1589) This reverts commit c08821d. * fix: watch too many file error (#1550) * fix: watch too many file error * chore: delete print * chore: delete log * release: @umijs/mako@0.8.8-rc.1 * fix: conflict * feat: support numeric module Id (#1561) * feat: moduleIdStrategy support numberous * fix: typos * fix: typos * fix: change name * fix: typos * release: @umijs/mako@0.8.12 * chore: fix typo and doc (#1591) * fix: chunk_loading_global (#1590) * fix: bad entry output when chunk_loading_global containing singe quote * test: add test cases for chunk_loading_global * docs: update * chore: update lock * chore: remove useless dependencies (#1595) * refactor: 🔥 rm ci warn logs (#1596) * fix: devServer put static serve proxy after umi proxy middleware (#1558) * fix: fix umi load html file failed, * test: add umi devServer test case * fix: typo * fix: hmr on hyper-static-file error * fix: import expect.mjs error on github workflow. * fix: import expect.mjs error on github workflow. * fix: 🐛 expect for error case * fix: 🐛 dev.hmr dont stop * fix: 🐛 add OKAM env * fix: 🐛 wait for mako server * fix: 🐛 kill by children process * test: ✅ add umi.css * refactor: 🎨 unify expect file * feat: export killMakoDevServer from test-hmr.mjs, make it public for all test case * test: ✅ unify expect file * chore: ➕ use express-http-proxy for static proxy * feat: ✨ better mako static proxy * test: ✅ support umi dev test with local mako * chore: ⬆️ update pnpm-lock * chore: 🎨 * fix: 🐛 ignore children process killed error --------- Co-authored-by: huanyu.why <huanyu.why@antgroup.com> Co-authored-by: pshu <pishu.spf@antfin.com> * fix(tree-shaking): object spread transform should go before deconstructing (#1598) * fix: 🐛 deconstructing needs object spread transform first * test: ✅ add guardian syntax * release: @umijs/mako@0.8.13-canary.20240918.1 * chore: bundler-mako@0.8.13-canary.20240918.1 * chore: 🎨 thread name after mako (#1601) * refactor: 🎨 rayon is not friendly to js users * chore: ✏️ rename tokio worker with mako * revert: import namespace optimize (#1606) * Revert "fix(tree-shaking): object spread transform should go before deconstructing (#1598)" This reverts commit 9434d99. * Revert "feat(tree-shaking): optimize import namespace used all exports to partial used of source modules (#1584)" This reverts commit 81a52f8. * chore: 🔧 update mako clean script * release: @umijs/mako@0.8.13 * chore: bundler-mako@0.8.13 * docs: change log 0923 (#1607) * docs: 📝 change log * docs: 📝 change log 0923 * chore: ✏️ * fix: 🐛 turn off express-http-proxy's keep alive (#1612) * fix: 🐛 turn off express-http-proxy's keep alive * refactor: 🔥 remove timeout config * release: @umijs/mako@0.8.14 * chore: bundler-mako@0.8.14 * refactor: napi threadsafe function (#1608) * refactor: napi threadsafe function * chore: update binding typings * refactor: code pieces * fix: catch napi tsfn promise rejection * chore: update binding typings * docs: 📝 change log 20240925 (#1613) * feat: disable webp to base64 (#1602) * feat: init * fix: context * fix: no use * fix: typos * fix: typos * fix: typos * fix: typos * fix(bundler-mako): experimental config should be merged deeply (#1617) * refactor: config codes organization (#1618) * refactor: config codes organization * fix: typos * refactor: config parse error * fix: clickToComponent don't work (#1620) * fix: duplicate_package_checker panic when no package.json is supplied (#1621) * fix: file_stem index out of bound (#1623) * feat: add resolve_id plugin hook (#1625) * feat: add resolve_id plugin hook * chore: update docs * feat: add external * release: @umijs/mako@0.8.15 * chore: bundler-mako@0.8.15 * docs: changelog for 0.8.15 * chore: update the release instruction (#1627) * refactor: code-splitting config (#1629) * feat: add loadInclude plugin hook (#1630) * feat: add { isEntry } for resolve_id plugin hook (#1631) * feat/upgrade swc (#1444) * 🚧 * 🚧 a basic working version * chore: 🚨 lint happy * refactor: 🎨 adjust to new swc * refactor: 🎨 remove deprecated methods * chore: 🚨 lint happy * feat: ✨ update swc emotion * chore: 🔧 remove useless profile in sub crate * chore: 🔧 add back emotion plugin * refactor: 🎨 add back merge source map * test: ✅ hot update js file served by hyper static, it use text/javascript * chore: 🔧 lock update * chore: 🔧 clean up swc core feature * refactor: 🎨 fix breaking change of ctxt of span * fix: 🐛 ctxt apply mark * refactor: 🎨 use DUMMY CTXT instead of SyntaxContext::empty() * chore: ⬆️ temperal use mdxjs from kdy branch * feat: ✨ re-enable mdxjs * feat: ✨ swc_core 0.100.1 * chore: 🙈 ignore fmt in fixtures * chore: 🚨 lint happy * chore: ⬆️ swc_common * chore: ✏️ typo * release: @umijs/mako@0.8.1-canary.20240812.1 * chore: bundler-mako@0.8.1-canary.20240812.1 * chore: ⬆️ swc_core 0.100.6 * release: @umijs/mako@0.8.1-canary.20240814.2 * chore: bundler-mako@0.8.1-canary.20240814.2 * chore: 🚨 lint happy * chore: 🔧 CI build bindings * chore: 🔧 fix build docker * refactor: 🔥 remove aarch64-unknown-linux-gnu * chore: 🔧 create tar * chore: 🙈 * release: @umijs/mako@0.8.3-canary.20240820.1 * chore: bundler-mako@0.8.3-canary.20240820.1 * chore: 🔧 wrong donwload param * chore: 🔧 upload download actions should be same version * chore: 🔧 try codecov in ci * refactor: 🔥 remove unnecessary target * refactor: 🎨 use swc comments * fix: 🐛 after upgrade to swc_core it should remove paren before minifiy * refactor: 🎨 move dummy ctxt defintion to ast mod * chore: 🚨 lint happy * release: @umijs/mako@0.8.8-canary.20240902.1 * chore: bundler-mako@0.8.8-canary.20240902.1 * release: @umijs/mako@0.8.8-canary.20240903.3 * chore: bundler-mako@0.8.8-canary.20240903.3 * refactor: 🎨 use VisitMut + Fold code style * chore: ⬆️ update pnpm-lock * chore: 🙈 * revert: ⏪ delete musl bindin * release: @umijs/mako@0.8.9-canary.20240909.1 * chore: bundler-mako@0.8.9-canary.20240909.1 * release: @umijs/mako@0.8.11-canary.20240910.1 * chore: bundler-mako@0.8.11-canary.20240910.1 * fix: 🐛 use chars() instead of bytes() * fix: 🐛 unescape html entity by html escape crate * release: @umijs/mako@0.8.14-canary.20240924.1 * chore: bundler-mako@0.8.14-canary.20240924.1 * release: @umijs/mako@0.8.15-canary.20240927.1 * chore: bundler-mako@0.8.15-canary.20240927.1 * fix: hash not stable (&revert import * as optimize) (#1610) * Revert "revert: import namespace optimize (#1606)" This reverts commit a485358. * fix: hash not stable * fix: deps sort not stable * fix: deps sort not stable * fix: deps sort not stable * fix: delete binding * fix: var name * chore: iter to into * fix: format * release: @umijs/mako@0.9.0 * chore: bundler-mako@0.9.0 * docs: 📝 changelog 0.9.0 * fix: duplicate_package_checker panic when package.json has no version field (#1634) * feat: magic comment chunk name (#1628) * refactor: code-splitting config * feat: support magic comment chunk name basically * fix: magic comment chunk name for webworker * refactor: use ImportOptions to represent option from magic comments * fix: dep replacer when magic comments chunk name existed * test: update test cases for magic comments chunk name * fix: dep replacer when dynamic import depencies is missing * chore: remove useless codes * refactor: code styles * docs: add todo for ChunkId * test: fix visitors::dynamic_import::tests::test_dynamic_import * test: fix test::hmr * fix: dep replacer when dynamic import css modules or moduleIdStrategy is hashed * chore: remove meaning less changes * test: enable magic comment chunk name in fixtures/umi * docs: add docs for magic comment chunk name * feat: support webpackIgnore and makoIgnore magic comment (#1636) * feat: support webpackIgnore and makoIgnore magic comment * chore: fmt * chore: rename magic_comment_chunk_name to magic_comment * chore: fix typo * feat: add transform plugin hook (#1637) * feat: add transform plugin hook * docs: add docs * chore: fmt * chore: perf * feat: add transformInclude plugin hook (#1639) * feat: add transformInclude plugin hook * chore: fmt * Fix: import namespace optimize panic with nested for of stmt (#1640) * test: ✅ add import namespace optimize panic test case * fix: 🐛 fix nested for of stmt panic * release: @umijs/mako@0.9.2-canary.20241016.1 * chore: bundler-mako@0.9.2-canary.20241016.1 * release: @umijs/mako@0.9.2 * chore: bundler-mako@0.9.2 * docs: 📝 changelog 0.9.2 * feat: add buildEnd plugin hook (#1644) * feat: add enforce plugin hook (#1646) * feat: add enforce plugin hook * chore: code style * chore: code style * chore: fix lint * chore: 🎨 add missing binding type * release: @umijs/mako@0.9.3-canary.20241016.1 * chore: bundler-mako@0.9.3-canary.20241016.1 * feat: add writeBundle plugin hook (#1650) * feat: add watch_changes plugin hook (#1651) * feat: add watch_changes plugin hook * chore: fix lint * chore: fix ts define * fix: mako on windows don't work (#1652) * fix: devtool sourcemap explosion in windows (#1653) * chore: remove dead code * fix: should not re-group when span changed (#1654) * fix: umd should be import as cjs (#1642) * fix: umd should be import as cjs * refactor: 🎨 just short circuit typeof define to prevent define takes effect * revert: ⏪ binding.d.ts --------- Co-authored-by: pshu <pishu.spf@antfin.com> * fix: 🐛 add process.env.SOCKET_SERVER define to prevent process polyfilll (#1655) * release: @umijs/mako@0.9.3-canary.20241023.1 * chore: bundler-mako@0.9.3-canary.20241023.1 * release: @umijs/mako@0.9.3 * chore: bundler-mako@0.9.3 * docs: changelog for 0.9.3 * fix: hmr with magic comment chunk name (#1663) * feat: enable magicComment features by default (#1667) * feat(bundler-mako): add moduleIdStrategy to supportMakoConfigKeys (#1664) * fix: async module in circular dependence (#1659) * test: ✅ add test async module in circular dependencies * refactor: 🎨 handle async polution by traversal * refactor: 🎨 use default over expect * feat: compatible codeSplitting config with umi (#1669) * feat: compatible codeSplitting config with umi * test: fix e2e code-splitting.granular * fix: umi codeSplitting: depPerChunk * Feat/benchmark workflows (#1671) * feat: benchmark-workflows * fix: 修改Github Secrets * release: @umijs/mako@0.9.4 * chore: bundler-mako@0.9.4 * docs: 📝 changelog 0.9.4 * chore: Optional parameters (#1679) * chore: Optional parameters * Update index.ts * fix: skip module should skip async module (#1662) * release: @umijs/mako@0.9.5 * chore: bundler-mako@0.9.5 * docs: update changelog * docs: update changelog * feat(ssu): handle dependence changing while watching (#1690) * refactor: 🎨 add after update aspect for rebuild cached modules * refactor: 🎨 add next_build aspect in build_my_modify * feat: ✨ 区分 ssu firstbuild 和 updating 两者状态 * fix: pnpm workspace watch too many files (#1684) * fix: ✅ ts annotated declare variable treat as top level variable (#1682) * test: ✅ add ts declare annotated variable as top level * refactor: 🎨 mv clean syntax context to visitors folder * fix: 🐛 strip ts/tsx first, then do normal transform * feat: move ensure runtime to entry (#1660) * feat: ✨ add ensure2 replace in dynamic replace * feat: ✨ ensure 2 runtime * feat: ✨ add experimental centralEnsure config * refactor: 🎨 add struct ReslvedReplaceInfo * feat: ✨ add central ensure plugin * refactor: 🎨 extract module ensure map * refactor: 🎨 add back chunk id in replace info * refactor: 🎨 fix case one source with different import type * refactor: 🎨 extract hmr runtime update code aspect * release: @umijs/mako@0.9.6-canary.20241107.1 * chore: bundler-mako@0.9.6-canary.20241107.1 * feat: keep unresolved nodejs require (#1689) * fix: regexpr for nodejs intenal modules igonre * feat: not replace unresolved nodejs require to __mako_require__ * fix: define util require should be __mako_require__ * feat: add expreriental.keep_unresolved_node_require * feat: add expreriental.ignore_non_literal_require * chore: 🔥 remove unused fn * release: @umijs/mako@0.9.6 * chore: bundler-mako@0.9.6 * docs: changelog for 0.9.6 * fix(SSU): 🐛 in case external not avaible to all entries (#1698) * fix(SSU): 🐛 in case external not avaible to all entries * refactor: 🎨 explict ignore the error * fix: devserver response header add cacheControl no-cache (#1692) * fix: add no-cache * feat: add cross origin * fix: resonse header add cors and no_cache for all branch (#1699) * fix: judge devServer instead of writeToDisk * fix: add branch header * refactor: 🎨 static file with 0 ages --------- Co-authored-by: pshu <pishu.spf@antfin.com> * release: @umijs/mako@0.9.7 * chore: bundler-mako@0.9.7 * docs: 📝 update changelog for 0.9.7 * chore: ✏️ remove some if (#1706) * fix: optimization.concatenateModules dts lost (#1708) * refactor: 🔥 enter ensure 使用 chunk sync dep 减少首屏 chunk 数量 (#1707) * fix: 🐛 typing of stats (#1712) * fix: 🐛 detect circular deps output file content (#1715) * chore: update @umijs/mako typings * feat: ensure esm imports exists when mode is production (#1709) * feat: ensure esm imports exists when mode is production * release: @umijs/mako@0.9.8 * chore: bundler-mako@0.9.8 * docs: update docs * fix: node ignores (#1716) * feat: supports publicPath: auto (#1717) * feat: auto resolve entry file extension (#1718) * feat: auto resolve entry file extension * fix: remove useless clone * Fix/context module source with first empty quasis (#1719) * test: ✅ add first empty quasis template string module source case * fix: 🐛 first emtpy quasis case * fix: inline css config deserialize (#1720) * fix: node ignore should support node: prefixed only built-in modules (#1721) * release: @umijs/mako@0.9.9 * docs: suggest using volta to manage node and pnpm's version * chore: bundler-mako@0.9.9 * docs: update CHANGELOG.md * feat: supports umd export (#1723) * feat: supports umd export * fix: umd config binding typing * fix: typos * fix: umd export * chore: update typings * fix: replace the "typeof __webpack_require__" content (#1688) * fix: replace the "typeof __webpack_require__" content * fix: add some other webpack string name * fix: 增加对typeof 表达式的处理 * fix: delete log * fix: rename --------- Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com> * fix: umd config deserialization (#1726) * feat: support case sensitive (#1714) * feat: add CaseSensitivePlugin * FIX: update path check * fix: clippy error * fix: 调整判断 * fix: 修复目录读取 * fix: 修改参数名称 * fix: 调整测试方式添加e2e断言,并增加配置项只有mac系统下才需要开启相关配置 * fix: 删除过滤条件 * fix: 删除多余测试文件,增加更新内容 * fix: 删除多余log * fix: 测试执行 * fix: 添加测试系统 * fix: 调整顺序 * fix: 添加测试系统 * fix: 非mac环境断言 * fix: 引用遗漏 * fix: 断言 * fix: 删除默认 * fix: 默认配置 * fix: 测试覆盖 * Revert "fix: 测试覆盖" This reverts commit b0a2e66. --------- Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com> * refactor: 🔥 remove unecessary transform (#1727) * feat: output filename (#1725) * refactor: 🎨 add file name template and chunk name in ChunkFile struct * feat: ✨ add config to output#filename * feat: ✨ render filename when output#filename configed * feat: ✨ calc hash in ast impl for entry * test: ✅ add test case * test: ✅ add ut * chore: 🔧 disable codecov error * refactor: 🎨 remove clone * fix: 🐛 hash when necessary * chore: 🔧 add codecov.yml * release: @umijs/mako@0.9.10-canary.20241218.1 * chore: ⬆️ update pnpm-lock * feat: native plugin init (#1691) * feat: init rust plugin * chore: delete print * Rename cargo.toml to Cargo.toml * chore: update * fix: type * fix: plugin options string * fix: cfg test * release: @umijs/mako@0.10.0 * chore: bundler-mako@0.10.0 * docs: 📝 changelog 2024.12.20 * chore: 🔧 for quick setup dep to debug (#1733) * fix: support optional chaining in environment variable (#1730) * fix: support optional chaining in environment variable * test(): add edge cases for optional chaining in env_replacer * refactor: 🎨 no need to resolve empty url in css (#1732) * refactor: 🎨 no need to resolve empty url in css * refactor: 🎨 add test case * feat: support unplugin context (#1728) * feat: support plugin context * fix: napi context * chore: revert changes * chore: improve * feat: add error * feat: warn and error support object * feat: support emit_file * ci: fix test * chore: improve * chore: update test * chore: format * chore: don't support add watch file * feat: load and transform adapter, and add unplugin-replace example * chore: test unplugin-icons * chore: update pnpm-lock.yaml * docs: improve --------- Co-authored-by: xusd320 <xusd320@gmail.com> * fix: legacy octal escape is not permitted in strict mode (#1736) * fix: legacy octal escape is not permitted in strict mode * fix: e2e inline css * release: @umijs/mako@0.11.0 * chore: bundler-mako@0.11.0 * fix: pnpm lock * docs: 📝 changelog 2024.12.26 * Revert "feat: support unplugin context (#1728)" (#1737) This reverts commit 3dd6d9d. * release: @umijs/mako@0.11.1 * chore: bundler-mako@0.11.1 * feat: support unplugin context (#1741) * feat: support plugin context * fix: napi context * chore: revert changes * chore: improve * feat: add error * feat: warn and error support object * feat: support emit_file * ci: fix test * chore: improve * chore: update test * chore: format * chore: don't support add watch file * feat: load and transform adapter, and add unplugin-replace example * chore: test unplugin-icons * chore: update pnpm-lock.yaml * docs: improve --------- Co-authored-by: xusd320 <xusd320@gmail.com> * fix: #1007 (#1738) support BinaryExpression Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com> * fix: win path problem with context module and require context (#1742) * chore(mako): add debug notice for local builds (#1743) * fix: normalize Windows paths in ModuleId constructors (#1744) * fix: normalize Windows paths in Compiler output path handling (#1745) * fix: typos * release: @umijs/mako@0.11.2 * chore: bundler-mako@0.11.2 * docs: update CHANGELOG.md * feat(create-mako): refactor create-mako (#1751) * chore: add issue and pull request templates for better contribution guidelines (#1753) * fix: ensure parent directories are created when writing to disk in MemoryChunkFileCache (#1755) * chore: release @umijs/tools * release: @umijs/mako@0.11.3 * chore: update the release introduction * ci: fix ci (#1758) * chore: upgrade @umijs/tools and do github release and changelog generate and translation by script * docs: changelog for 0.11.3 * chore: add check-ecosystem-usages script (#1759) * fix: analyze don't work in safari (#1761) * fix(mako): cli delay exit (#1762) * dep: @umijs/tools@0.1.23 * fix: load wasm (#1705) * fix: 修复load .wasm文件对importObject的处理 * fix: 删除没必要的输出 * fix: 修改生成的成员表达式js代码 * fix: 变量重命名 * fix: 修复代码lint报错 * test: 补充wasm_runtime测试用例 * chore: 补充import js方式的示例 * chore: 修改import js示例wasm产物格式 * chore: wasmparser依赖包在配置文件的位置 * chore: 删除多余的.wasm load逻辑 --------- Co-authored-by: xusd320 <xusd320@gmail.com> * fix: chunk groups' order when building mpa (#1763) * feat(copy): support advanced copy configuration with custom target paths (#1711) * feat(copy): support advanced copy configuration with custom target paths - Add CopyConfig enum to support both basic and advanced copy modes - Basic mode: maintains backward compatibility with string[] format - Advanced mode: supports {from: string, to: string} format for custom paths - Update copy plugin to handle both configuration formats - Ensure target directories are created automatically Example config: { 'copy': [ 'public', // basic mode { 'from': 'assets', 'to': 'static' } // advanced mode ] } * fix(copy): prevent path traversal in copy plugin Add path canonicalization and validation to ensure target paths remain within the destination directory * chore: Update `copy` config type in Mako bundler - Updated the type of the `copy` property in the `BuildParams` interface to support both `string` and `{ from: string; to: string }`. - Ensured the `copy` configuration is properly validated to handle both types. * docs: Update `copy` config type in documentation - Updated the `copy` property type in the configuration documentation to reflect the change from `string[]` to `(string | { from: string; to: string })[]`. - Clarified that the `copy` configuration can now accept both strings and objects with `from` and `to` properties. * test(copy): add e2e tests for copy plugin from/to pattern - Update config.copy test fixtures to cover from/to pattern - Add assertions for copied files in new location - Adjust copy plugin path validation * fix(copy): improve path validation and cleanup for copy plugin - Add directory cleanup when path validation fails - Use canonicalized paths for more reliable path validation - Add concatenateModules option type to BuildParams * fix: ci (#1768) * release: @umijs/mako@0.11.4 * chore: bump version * docs: 📝 changelog 2025.02.12 * chore: update changelog 2025.02.12 * fix: plugin context gc (#1769) * fix: mako已经支持了scss 但是没有支持module.scss文件 (#1770) Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com> * feat: add module federation plugin (#1764) * feat: support module federation * feat: mf exposes to remote entries * chore: code styles * feat: mf container entry impl * fix: mf container entry * fix: mf runtime initOptions * feat: add containter references * feat: impl mf remote * feat: improve mf exposes * fix: mf exposes runtime factory * fix: mf plugin execution order * chore: update mf demo * feat: generate mf manifest in rust * fix: remote stats.json * refactor: code styles * chore: add some FIXME * refactor: mf plugin mods files * refactor: mf plugin mods files * chore: remove dead code * --wip-- [skip ci] * fix: remote stats.json * fix: typos * chore: simpify mf runtime codes fmt * refactor: mf containter plugin * feat: mf shared workaround * feat: mf shared workaround * fix: runtime template and remove some useless codes * fix: mf dev server * fix: mf shared config * feat: supports chunk group exclude * feat: mf patch code splitting * feat: mf shared manifest * feat: add config hash for mf shared module * chore: update mako typings * chore: code styles * chore: fix typo * chore: code styles * perf: improve performance * chore: code styles * chore: rename types * feat: add options to disable mf manifest * feat: entry config should be defined as BTreeMap * fix: mf shared consume and supports eager config * fix: mf shared eager * fix: not generate chunk for mf remote module * fix: typos * feat: add entry filename supports * chore: remove meaning less changes * fix: entry filename and mf config * release: @umijs/mako@0.11.4-canary.20250206.0 * fix: ignore shared dep when it is been external * Revert "release: @umijs/mako@0.11.4-canary.20250206.0" This reverts commit d3105d9. * release: @umijs/mako@0.11.4-canary.20250207.0 * fix: skip serialize mf manifest remoteEntry if none * fix: mf manifest remoteEntry address * Revert "release: @umijs/mako@0.11.4-canary.20250207.0" This reverts commit 6179982. * fix: typo * fix: mako mf manifest publicPath * fix: mf manifest panic * fix: mf typings * test: add e2e test for mf * fix: typo * chore: update README * fix: update mf bingding typings * fix: typings * fix: should not generate mf remotes runtime when remotes is empty * chore: remote wrong comment * feat: add chunk matcher for mf * fix: mf binding typings * chore: remove debug print statements * docs: update moduleFederation configuration docs * fix: mf config docs * chore: update CONTRIBUTING.md * release: @umijs/mako@0.11.5 * chore: update CHANGELOG.md and versions * feat: support to disable camel2DashComponentName of transformImport (#1773) * feat: support to disable camel2DashComponentName of transformImport * fix: typings * fix: 修复sass/less-loader的路径解析 (#1771) * fix: 支持webpack中sass-loader的路径解析 * chore: 调整目录 * chore: 移除注释等 * chore: 引入loader-runner * chore: sass-loader * chore: 修改loader返回空值处理 * test: 设置loader resolver的别名 * chore: update lock * fix: loader options * refactor: 提取插件代码 * fix: getResolve * fix: 修复runLoaders中的错误处理逻辑 * release: @umijs/mako@0.11.6 * fix: pnpm-lock * chore: update changelog for v0.11.6 * chore: update changelog for v0.11.6 * chore: update changelog for v0.11.6 * fix: watch less and sass dependencies (#1779) * chore: stash * chore: stash * feat: LessModuleGraph * feat: less-import-plugin * chore: 删除多余代码 * fix: 兼容url() * chore: plugin * feat: add beforeRebuild hook * ci: clippy format * fix: paths去重 * fix: rename _path * chore: rust层增加临时过滤文件方式 * chore: 提取createParallelLoader * refactor: before_rebuild hook (#1785) * refactor: before_rebuild hook -n * fix: typos * feat: postcss-loader (#1787) * feat: 支持postcss-loader * chore: 合并postcss到options传给render * chore: 更新.gitignore以排除less.postcss的node_modules目录 * feat: 添加PostCSS插件支持并更新相关类型定义 * refactor: 简化Less和Sass插件中的选项传递 * docs: 添加postcss支持的配置说明 * feat: 添加对PostCSS的支持,更新相关插件以集成postLoaders * feat: 更新Less和Sass插件以移除postLoaders,增强PostCSS支持 * test: 补充postcss测试用例 * fix: use transpiled hmr runtime (#1813) * fix: use transpiled hmr runtime (#1814) * release: @umijs/mako@0.11.7 * fix: package-lock.json * fix: use transpiled hmr runtime entry (#1815) * fix: disable parallel sassLoader because sassOptions.function cann't be shared cross workers (#1816) * release: @umijs/mako@0.11.8 * fix: package-lock.json * fix: package-lock.json * fix: typos * chore: update changelog for v0.11.8 * fix: less,sass,postcss loader panic (#1818) * release: @umijs/mako@0.11.9 * fix: package-lock.json * chore: update changelog for v0.11.9 * fix: worker threads panic on linux (#1823) * release: @umijs/mako@0.11.10 * fix: package-lock.json * chore: update changelog for v0.11.10 * fix: dev支持inline-source-map (#1859) Co-authored-by: dongqing.mdq <dongqing.mdq@antgroup.com> * release: @umijs/mako@0.11.11 * fix: package-lock.json * chore: update changelog for v0.11.11 * Update PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * fix: less resolve alias (#1906) * docs: update README.md (#1907) * Update README.md * Apply suggestions from code review Co-authored-by: Peach <scdzwyxst@gmail.com> * Update README.md * Update README.md --------- Co-authored-by: Peach <scdzwyxst@gmail.com> * Update README.md * Update README.md * release: @umijs/mako@0.11.12 * feat: update pnpm log * chore: update changelog for v0.11.12 * fix: panic on docker linux (#1909) * doc: add openomy (#1910) * release: @umijs/mako@0.11.13 * chore: update changelog for v0.11.13 * chore: remove codecov * chore: update examples/multiple-entries-heavy * feat: support inline-source-map devtool option (#1965) Co-authored-by: hanzebang.hzb <hanzebang.hzb@antgroup.com> * chore: truncate old codes --------- Co-authored-by: pshu <pishu.spf@antfin.com> Co-authored-by: chencheng (云谦) <sorrycc@gmail.com> Co-authored-by: Jinbao1001 <nodewebli@gmail.com> Co-authored-by: money <hualigushi@163.com> Co-authored-by: eisonhower <why490078184@gmail.com> Co-authored-by: huanyu.why <huanyu.why@antgroup.com> Co-authored-by: PeachScript <scdzwyxst@gmail.com> Co-authored-by: Wu-kung <1434246346@qq.com> Co-authored-by: 聪小陈 <xiaohuoni@users.noreply.github.com> Co-authored-by: akitaSummer <akitasummer@outlook.com> Co-authored-by: Shi Kuan <shikuan1992@gmail.com> Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com> Co-authored-by: yezao <75713784+yezaoshu@users.noreply.github.com> Co-authored-by: 御风 <18012261618@126.com> Co-authored-by: bqxbqx <132878537+BQXBQX@users.noreply.github.com> Co-authored-by: miaodongqing <dongqing_miao@163.com> Co-authored-by: dongqing.mdq <dongqing.mdq@antgroup.com> Co-authored-by: kiner-tang(星河) <1127031143@qq.com> Co-authored-by: hanzebang <46307343+hanzebang@users.noreply.github.com> Co-authored-by: hanzebang.hzb <hanzebang.hzb@antgroup.com>
a simple support for
filenamein output configSummary by CodeRabbit
新功能
OutputConfig结构中添加了可选字段filename。Chunk结构中添加了新的filename方法,并重命名了现有的filename方法为name。ChunkPot结构中添加了新的chunk_name字段。ChunkFile结构中添加了chunk_name和file_name_template字段。mako.config.json,定义了动态生成的输出文件名模板。expect.js,用于验证构建过程中的输出文件名。样式
src/index.tsx中添加了简单的日志输出功能。其他
codecov.yml中添加了新的覆盖率配置。package.json文件中的版本号,统一从0.9.9更新至0.9.10-canary.20241218.1。