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

All the files in the project are indexed by chokidar before resolving triggers #57

Open
Tofandel opened this issue Oct 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Tofandel
Copy link

Tofandel commented Oct 14, 2024

I want to run turbowatch at the root of a huge project (including workspaces tons of node modules and non js files etc)

I'm using triggers to indicate I only want to match a few directories in the list

  project: path.resolve('../'),
  triggers: [
    {
      // Expression match files based on name.
      // https://github.com/gajus/turbowatch#expressions
      expression: [
        'anyof',
        ['match', 'src/**/*.php', 'wholename'],
        ['match', 'web/app/**/*.php', 'wholename'],
      ],
    }
  ]

But chokidar tries to index the whole structure nonetheless, resulting in the build never actually starting because chokidar chokes on the amount of files to scan (more than 2 million)

https://github.com/gajus/turbowatch/blame/main/src/backends/ChokidarWatcher.ts#L26-L29

This results in this logs

{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 25,259 files...","sequence":"3","time":1728917234785,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 135,285 files...","sequence":"4","time":1728917239601,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 171,282 files...","sequence":"5","time":1728917244619,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 196,769 files...","sequence":"6","time":1728917249724,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 227,009 files...","sequence":"7","time":1728917254756,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 250,882 files...","sequence":"8","time":1728917259786,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 273,339 files...","sequence":"9","time":1728917264786,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 295,188 files...","sequence":"10","time":1728917268474,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 315,869 files...","sequence":"11","time":1728917273507,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 336,758 files...","sequence":"12","time":1728917278537,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 356,869 files...","sequence":"13","time":1728917283554,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 374,976 files...","sequence":"14","time":1728917288555,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 388,824 files...","sequence":"15","time":1728917293564,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 405,912 files...","sequence":"16","time":1728917297224,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 423,716 files...","sequence":"17","time":1728917302241,"version":"2.0.0"}
{"context":{"package":"turbowatch","namespace":"ChokidarWatcher","logLevel":10},"message":"indexed 440,735 files...","sequence":"18","time":1728917307242,"version":"2.0.0"}

And no build ever starting

@Tofandel Tofandel added the bug Something isn't working label Oct 14, 2024
@Tofandel
Copy link
Author

Tofandel commented Oct 14, 2024

As a workaround I created a directory and inside created symlinks to ../src and ../web/app/custom-plugins and set the project to that and match *.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant