From 5dbc2dd86a62d69e98858e3b1f8c92fc9c0d1fc8 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Wed, 24 Jul 2024 11:50:46 -0700 Subject: [PATCH] log postinstall steps Summary: As part of running yarn from `desktop` it runs yarn in `desktop/plugins` which triggers a postinstall script which can execute up to 2 minutes. I always found it confusing as it never showed any progress whether it got stuck or if something is running. Let's fix it. Reviewed By: lblasa Differential Revision: D60123307 fbshipit-source-id: e3230c760f57ddd43f73789fdc42009bd221974e --- desktop/plugins/postinstall.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop/plugins/postinstall.tsx b/desktop/plugins/postinstall.tsx index 143d6a35b29..8c299a9d45d 100644 --- a/desktop/plugins/postinstall.tsx +++ b/desktop/plugins/postinstall.tsx @@ -19,6 +19,7 @@ const rootDir = path.resolve(__dirname, '..'); const fbPluginsDir = path.join(__dirname, 'fb'); async function postinstall(): Promise { + console.log('* Looking up plugins'); const [publicPackages, fbPackages, pluginsPackageJson] = await Promise.all([ fs.readdir(publicPluginsDir), fs.readdir(fbPluginsDir).catch(() => [] as string[]), @@ -92,15 +93,18 @@ async function postinstall(): Promise { } return 1; } + console.log("* Installing public plugins' dependencies..."); await exec('yarn install --mutex network:30330', { cwd: publicPluginsDir, }); if (await fs.pathExists(fbPluginsDir)) { + console.log("* Installing internal plugins' dependencies..."); await exec('yarn install --mutex network:30330', { cwd: fbPluginsDir, }); } const peerDependenciesArray = Object.keys(peerDependencies); + console.log('* Removing peer dependencies from node_modules...'); await Promise.all([ removeInstalledModules(modulesDir, peerDependenciesArray), removeInstalledModules(