-
Notifications
You must be signed in to change notification settings - Fork 24
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
Watchman and symlinks #19
Comments
That does not align with my experience. Project structure:
import path from 'node:path';
import { watch } from 'turbowatch';
void watch({
project: path.resolve(__dirname, '../..'),
triggers: [
{
expression: [
'anyof',
['allof', ['dirname', 'node_modules'], ['match', '*', 'basename']],
['match', '*.ts', 'basename'],
['match', '*.graphql', 'basename'],
],
interruptible: true,
name: 'start-server',
onChange: async ({ spawn }) => {
await spawn`tsx ./src/bin/wait.ts`;
await spawn`tsx ./src/bin/server.ts`;
},
},
],
}); I am doing: touch apps/contra-api/node_modules/got/readme.md and expect that watchman detects the change, but it does not. The root of the project is |
Dot dirs need a special flag. |
Wish this would have been documented. Would have saved many hours of debugging. As far as I can tell, there is no way to pass this as configuration using Node.js interface though? |
They say make it a sibling to glob. Should just be part of the query. I'd have to check my code. |
Unfortunately, no luck. {
expression: [
'anyof',
[
'allof',
[ 'dirname', 'node_modules' ],
[ 'match', '*', 'basename' ]
],
[ 'match', '*.ts', 'basename' ]
],
fields: [ 'name', 'size', 'mtime_ms', 'exists', 'type' ],
glob: [ '**/*' ],
glob_includedotfiles: true,
relative_root: 'apps/contra-api'
} Fails in the same setup as described above. |
Closing this as Watchman team confirmed that it isn't a feature that is currently supported. |
Will give this a shot. Now that #22 merged, this could be additional as a fallback backend. |
I saw your post on watchman and symlinks here: facebook/watchman#105 (comment)
What exactly was the issue you ran into? I am using watchman for a pnpm monorepo just fine.
The symlinks issue is only an issue if you are symlinking outside the monorepo root. And this can be resolved by just manually resolving the symlinks.
If you want to only watch a few packages, and they are "workspace packages" (not third party and source code is in the monorepo, e.g.
root/packages/a/node_modules/b -> root/packages/b
), you can:a. traverse the dependency graph to include all workspace packages abs paths
b. ...or read the node_modules dir for symlinks and resolve them
I can't remember if watchman will detect the creation of new symlinks if that is what you are looking for.
The text was updated successfully, but these errors were encountered: