Skip to content
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: add watch.ignorePaths config #1179

Merged
merged 1 commit into from
May 20, 2024
Merged

feat: add watch.ignorePaths config #1179

merged 1 commit into from
May 20, 2024

Conversation

sorrycc
Copy link
Member

@sorrycc sorrycc commented May 20, 2024

背景

dumi 的场景,

foo/node_modules
node_modules
src
package.json

在 root 启,然后 foo/node_modules 也进了 watch,并且其中有目录之间因为 link 导致的循环依赖,报错如下。

Error watching files: File system loop found: /Users/.../work/dumi/suites/theme-mobile/node_modules/dumi/suites/theme-mobile/node_modules/dumi points to an ancestor /Users/.../work/dumi/suites/theme-mobile/node_modules/dumi

尝试的解法

  • watch + RecursiveMode::Recursive 时加 node_moduels 的 ignore,但是看了下,无法干涉,是否递归的属性是传给 notify crate 的底层库的。

当前解

提供额外配置项,但缺点是需要用户感知。

可能的其他解

把 watch 挪到 node 层实现。

Summary by CodeRabbit

  • 新功能

    • BuildParams结构体中添加了一个新字段watch,其中包括一个可选的ignoredPaths字符串数组。
    • Config结构体现在包括一个WatchConfig类型的watch字段,以及现有字段。
    • mako.config.json文件中添加了一个新的watch配置选项,包括ignorePaths设置。
    • packages/mako/binding.d.ts文件中的BuildParams接口中添加了一个新的watch属性,其中包括一个可选的ignoredPaths字符串数组。
  • 文档

    • docs/config.md文件中添加了一个新的配置选项watch,具体为ignorePaths

Copy link
Contributor

coderabbitai bot commented May 20, 2024

概述更改

Walkthrough

整体变更概述:在多个文件中,添加了关于文件监视的新配置选项,包括忽略特定路径的设置。

Changes

文件路径 变更概述
crates/binding/src/lib.rs 添加了 BuildParams 结构体中的新字段 watch,包含一个可选的 ignoredPaths 字符串数组。
crates/mako/src/config/config.rs 更新了 config.rs 文件,添加了 WatchConfig 结构体和 Config 结构体中的 watch 字段。
crates/mako/src/dev/watch.rs 重构了 watch.rs 中的 refresh_watch 方法,优化了代码,扩展了 ignore_list,调整了目录处理逻辑。
docs/config.md docs/config.md 文件中,添加了一个新的配置选项 watch,包含 ignorePaths
examples/dead-simple/mako.config.json mako.config.json 文件中,添加了一个新的 watch 配置,包含了路径 "bar"。
packages/mako/binding.d.ts packages/mako/binding.d.ts 中的 BuildParams 接口中,添加了一个新的 watch 属性。

Poem

兔子编码忙忙碌,文件监视添新愉。
配置更新映新光,路径忽略任我行。 🐇📁✨

Note

Pull Request Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://coderabbit.ai


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sorrycc sorrycc merged commit e2827cd into master May 20, 2024
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the sorrycc-ajo2 branch May 20, 2024 10:00
stormslowly pushed a commit that referenced this pull request May 20, 2024
sorrycc added a commit that referenced this pull request May 27, 2024
* feat: ✨ add [d]ynamic [r]equire runtime function

* refactor: 🎨 dynamic import require process with interop

* test: ✅ add test case

* test: ✅ import context module adjust to dynamic import

* release: @umijs/[email protected]

* chore: ⬆️ mako 0.4.18-canary.20240517.1

* chore: ⬆️ update pnpm-lock

* typo

* fix: fix "too many files open" error when watching with-antd example (#1022)

* fix: fix "too many files open" error when watching with-antd example

* fix: include dist dictionary of root's parent dictionary when watching

---------

Co-authored-by: zp365238 <[email protected]>
Co-authored-by: pshu <[email protected]>

* chore: 🔧 adjust puffin for easy profile for both long time compiling and watch mode (#1168)

* chore: 🔧 adjust puffin for easy profile for long time compiling

* refactor: 🎨 move profile logic to profile app

* fix: decorator visitor should run before preset env (#1176)

* test: ✅ add runtime assert in decorator and target to chrome 40

* fix: 🐛 move decorator before preset_env

* add comment on decorators

* feat: add watch.ignorePaths config (#1179)

* release: @umijs/[email protected]

* chore: ⬆️ v0.4.18-canary.20240520.1

* chore: ⬆️ update pnpm-lock

---------

Co-authored-by: zhangpanweb <[email protected]>
Co-authored-by: zp365238 <[email protected]>
Co-authored-by: chencheng (云谦) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant