Files
flipper/desktop/scripts/get-app-watch-folders.ts
Michel Weststrate 75b5783fd0 Clean up QPL integration
Summary:
Removed the Flipper QPL integration, see:
https://fb.workplace.com/groups/flippersupport/permalink/1200183003795689/

It complicates our build setup significantly, without actually being used anywhere for the past year. Apparently it doesn't solve a gap compared to the scuba logging we have already in place.

Reviewed By: passy

Differential Revision: D30911573

fbshipit-source-id: 836e2aba0c92c0eed9fed0dfb12bd8bdcb8c7d71
2021-09-14 02:55:01 -07:00

36 lines
1.1 KiB
TypeScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import fs from 'fs-extra';
import path from 'path';
import {getWatchFolders} from 'flipper-pkg-lib';
import {appDir, publicPluginsDir, fbPluginsDir} from './paths';
/**
* Flipper references code from below plugins directly. Such directly referenced plugins
* and their dependencies should be added as watch folders so Metro bundled can resolve them.
*/
const pluginsReferencedDirectlyFromFlipper = [
path.join(publicPluginsDir, 'navigation'),
path.join(fbPluginsDir, 'mobileconfig'),
path.join(fbPluginsDir, 'watch'),
];
export default async function getAppWatchFolders() {
const getWatchFoldersResults = await Promise.all(
[appDir, ...pluginsReferencedDirectlyFromFlipper].map((dir) =>
getWatchFolders(dir),
),
);
const watchFolders = ([] as string[]).concat(...getWatchFoldersResults);
return watchFolders
.filter((value, index, self) => self.indexOf(value) === index)
.filter(async (f) => fs.pathExists(f));
}