Remove remaining Node imports from core
Summary: Removed remaining path / fs imports from Flipper core. `expand-tide` needed replacement too, but noticed that it never actually rewrites paths since all use cases were already using absolute paths, so removed it instead. Reviewed By: aigoncharov Differential Revision: D33017654 fbshipit-source-id: e12f66ef68b5f9e4279411c94445a2fb87249e9a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d95b15094f
commit
accef856fc
@@ -9,7 +9,6 @@
|
||||
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import expandTilde from 'expand-tilde';
|
||||
import {getPluginSourceFolders} from './pluginPaths';
|
||||
import pmap from 'p-map';
|
||||
import pfilter from 'p-filter';
|
||||
@@ -49,7 +48,6 @@ export async function getSourcePlugins(): Promise<InstalledPluginDetails[]> {
|
||||
async function entryPointForPluginFolder(
|
||||
pluginsDir: string,
|
||||
): Promise<{[key: string]: InstalledPluginDetails}> {
|
||||
pluginsDir = expandTilde(pluginsDir);
|
||||
if (!(await fs.pathExists(pluginsDir))) {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import path from 'path';
|
||||
import {homedir} from 'os';
|
||||
import fs from 'fs-extra';
|
||||
import pFilter from 'p-filter';
|
||||
import expandTilde from 'expand-tilde';
|
||||
|
||||
const flipperDataDir = path.join(homedir(), '.flipper');
|
||||
|
||||
@@ -44,7 +43,7 @@ export async function getPluginSourceFolders(): Promise<string[]> {
|
||||
}
|
||||
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'public'));
|
||||
pluginFolders.push(path.resolve(__dirname, '..', '..', 'plugins', 'fb'));
|
||||
return pFilter(pluginFolders.map(expandTilde), (p) => fs.pathExists(p));
|
||||
return pFilter(pluginFolders, (p) => fs.pathExists(p));
|
||||
}
|
||||
|
||||
export function getPluginInstallationDir(name: string) {
|
||||
|
||||
Reference in New Issue
Block a user