How to use the sane.WatchmanWatcher function in sane

To help you get started, we’ve selected a few sane examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jessieeeee / SimpleOne / node_modules / metro-bundler / node_modules / jest-haste-map / build / index.js View on Github external
_watch(
  hasteMap,
  hasteFS,
  moduleMap)
  {
    if (!this._options.watch) {
      return Promise.resolve();
    }

    // In watch mode, we'll only warn about module collisions and we'll retain
    // all files, even changes to node_modules.
    this._options.throwOnModuleCollision = false;
    this._options.retainAllFiles = true;

    const Watcher = canUseWatchman && this._options.useWatchman ?
    sane.WatchmanWatcher :
    sane.NodeWatcher;
    const extensions = this._options.extensions;
    const ignorePattern = this._options.ignorePattern;
    let changeQueue = Promise.resolve();
    let eventsQueue = [];
    // We only need to copy the entire haste map once on every "frame".
    let mustCopy = true;

    const createWatcher = root => {
      const watcher = new Watcher(root, {
        dot: false,
        glob: extensions.map(extension => '**/*.' + extension),
        ignored: ignorePattern });


      return new Promise((resolve, reject) => {
github leecade / react-native-swiper / examples / node_modules / react-native / packager / react-packager / src / FileWatcher / index.js View on Github external
exec('which watchman', function(err, out) {
    if (err || out.length === 0) {
      resolve(sane.NodeWatcher);
    } else {
      resolve(sane.WatchmanWatcher);
    }
  });
});
github GertjanReynaert / react-native-universal / node_modules / react-native / packager / react-packager / src / FileWatcher / index.js View on Github external
exec('which watchman', function(err, out) {
    if (err || out.length === 0) {
      resolve(sane.NodeWatcher);
    } else {
      resolve(sane.WatchmanWatcher);
    }
  });
});
github facebook / metro / react-packager / src / DependencyResolver / FileWatcher / index.js View on Github external
exec('which watchman', function(err, out) {
    if (err || out.length === 0) {
      resolve(sane.NodeWatcher);
    } else {
      resolve(sane.WatchmanWatcher);
    }
  });
});
github facebook / metro / react-packager / src / node-haste / FileWatcher / index.js View on Github external
function timeoutMessage(Watcher) {
  const lines = [
    'Watcher took too long to load (' + Watcher.name + ')',
  ];
  if (Watcher === sane.WatchmanWatcher) {
    lines.push(
      'Try running `watchman version` from your terminal',
      'https://facebook.github.io/watchman/docs/troubleshooting.html',
    );
  }
  return lines.join('\n');
}
github facebook / metro / react-packager / src / node-haste / FileWatcher / index.js View on Github external
const detectWatcherClass = () => {
  try {
    execSync('watchman version', {stdio: 'ignore'});
    return sane.WatchmanWatcher;
  } catch (e) {}
  return sane.NodeWatcher;
};
github facebook / metro / react-packager / src / node-haste / FileWatcher / index.js View on Github external
static canUseWatchman() {
    return WatcherClass == sane.WatchmanWatcher;
  }
}
github facebook / metro / react-packager / src / DependencyResolver / FileWatcher / index.js View on Github external
      Watcher => Watcher === sane.WatchmanWatcher
    ) : Promise.resolve(false);

sane

Sane aims to be fast, small, and reliable file system watcher.

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis