-
Notifications
You must be signed in to change notification settings - Fork 79
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
fix: watch files change of module_graph in node_modules #1385
Conversation
Walkthrough这次更新主要涉及两个方面:首先,在 Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- crates/mako/src/dev/watch.rs (5 hunks)
Additional comments not posted (6)
crates/mako/src/dev/watch.rs (6)
23-26
: LGTM!
IgnoreListArgs
结构体定义合理,代码没有问题。
47-53
: LGTM!
watch
函数调用get_ignore_list
时传递了不同的IgnoreListArgs
参数,逻辑看起来是正确的。
71-77
: LGTM!
watch
函数调用get_ignore_list
时传递了不同的IgnoreListArgs
参数,逻辑看起来是正确的。
81-87
: LGTM!
watch
函数调用get_ignore_list
时传递了不同的IgnoreListArgs
参数,逻辑看起来是正确的。
81-87
: LGTM!
watch_dir_recursive
函数调用get_ignore_list
时传递了不同的IgnoreListArgs
参数,逻辑看起来是正确的。
Line range hint
119-136
:
请验证返回值的正确性。当
with_node_modules
为 true 时,返回值可能存在问题。请确保返回的ignore_list
是正确的。Verification successful
请验证返回值的正确性。
经过验证,当
with_node_modules
为 true 时,ignore_list
的返回值在should_ignore_watch
函数中被正确处理。该函数检查路径前缀,确保忽略列表中的项目被正确应用。
- crates/mako/src/dev/watch.rs,
get_ignore_list
函数- crates/mako/src/dev/watch.rs,
should_ignore_watch
函数Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the return value when `with_node_modules` is true. # Test: Search for the function usage. Expect: Correct handling of `ignore_list`. rg --type rust $'get_ignore_list'Length of output: 395
Script:
#!/bin/bash # Extract the lines around each usage of the `get_ignore_list` function to verify the handling of the `ignore_list`. rg --type rust -A 5 -B 5 $'get_ignore_list' crates/mako/src/dev/watch.rsLength of output: 1511
Script:
#!/bin/bash # Extract the implementation of `watch_dir_recursive` and `watch_file_or_dir` to verify the handling of `ignore_list`. rg --type rust -A 20 -B 5 $'fn watch_dir_recursive' crates/mako/src/dev/watch.rs rg --type rust -A 20 -B 5 $'fn watch_file_or_dir' crates/mako/src/dev/watch.rsLength of output: 1720
Script:
#!/bin/bash # Extract the implementation of `should_ignore_watch` to verify the handling of `ignore_list`. rg --type rust -A 20 -B 5 $'fn should_ignore_watch' crates/mako/src/dev/watch.rsLength of output: 987
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- crates/mako/src/dev/watch.rs (4 hunks)
- packages/mako/binding.d.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/mako/binding.d.ts
Files skipped from review as they are similar to previous changes (1)
- crates/mako/src/dev/watch.rs
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/mako/binding.d.ts (1 hunks)
Additional comments not posted (1)
packages/mako/binding.d.ts (1)
6-6
: 将name
属性设为必填项。此更改确保所有
JsHooks
对象将具有name
属性,这可能对于钩子的正常功能至关重要。请确认所有使用
JsHooks
接口的代码是否已更新以适应这一更改。
This reverts commit 3a74d28.
Summary by CodeRabbit
新功能
IgnoreListArgs
,用于更灵活地控制目录监视和忽略。改进
IgnoreListArgs
结构体指定忽略的目录(如输出目录和node_modules
)。TransformOutput
接口。JsHooks
接口中的name
属性不再是可选项。