message: fix: adapt dep search to reduced data format
diff: @@ -23,6 +23,7 @@ export default function indexRouteFactory(application) {
  async function watch(context, application) {
  const stream = new PassThrough();
  const send = (type, data) => stream.write(sse(type, data));
  +
  const heartbeat = setInterval(() => {
  send('heartbeat', Date.now());
  }, 1000);
  @@ -83,12 +84,20 @@ function affected(file, patterns, previous) {
  return [match.id];
  }
  - return [match.id, ...deps(match, 'dependents'), ...deps(match, 'demoDependents')];
  + const dependents = [
  + ...deps(match, patterns, 'dependents'),
  + ...deps(match, patterns, 'demoDependents')
  + ];
  +
  + return [match.id, ...dependents];
  }
  -function deps(p, key) {
  - return values(p[key])
  - .reduce((d, p) => [...d, p.id, ...deps(p, key)], []);
  +function deps(pattern, patterns, key) {
  + return pattern[key]
  + .reduce((d, p) => {
  + const match = find(patterns, p);
  + return [...d, p, ...deps(match, patterns, key)];
  + }, []);
  }
  function find(tree, id, depth = 1) {
  