Open wharacembell opened 1 month ago
This looks like it mostly duplicates the functionality of watchexec
.
https://github.com/termux/termux-packages/blob/eb8c502731063bbfb903b41df82c1c896de99878/packages/watchexec/build.sh#L1-L6
Yes it is like it but not the same. Since the project i am using (react native expo) uses watchman by default and i dont think there is a way to use watchexec instead
This is not yet tested but you can modify
/node_modules/metro-file-map/src/watchers/NodeWatchers.js
to skip node_modules.
I got past this limitation on Termux by doing that.
_watchdir = (dir) => {
if (this.watched[dir]) {
return false;
}
if (!/.git|node_modules/.test(dir)){
const watcher = fs.watch(
dir,
{
persistent: true,
},
(event, filename) => this._normalizeChange(dir, event, filename)
);
this.watched[dir] = watcher;
watcher.on("error", this._checkedEmitError);
}
if (this.root !== dir) {
this._register(dir, "d");
}
return true;
};
Thanks. It works in both expo go and expo dev build.
But i remember reading that metro needs to watch all files in order to work properly, as i tried to add the node_modules to metro ignore file but it didn't work then. Or does this just prevent metro from tracking changes in the directory but reads the directory as normal.
Why is it worth to add this package?
Watchman is used to watch files and track changes made to those file. Since on termux we can't change the maximum limit of files tracked by inotify this would be of help
Home page URL
https://facebook.github.io/watchman/
Source code URL
https://github.com/facebook/watchman/
Packaging policy acknowledgement
[X] The project is actively developed.
[X] The project has existing packages and is "well known".
[X] Licensed under an open source license.
[X] Not available through a language package manager: pip, npm, cpan, cargo, etc.
[X] Not taking up too much disk space (< 100MiB per architecture, exceptions can be made)
[X] Not duplicating the functionality of existing packages.
[X] Not serving hacking, malware, phishing, spamming, spying, ddos functionality.
[X] I certify that I have read Termux Packaging Policy and understand that my request will be denied if it is found lacking.
Additional information
Install rust Download source code
Run ./install-system-packages.sh
If i try to skip it and run ./autogen.sh