Skip to content

Commit

Permalink
log postinstall steps
Browse files Browse the repository at this point in the history
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
  • Loading branch information
antonk52 authored and facebook-github-bot committed Jul 24, 2024
1 parent ebdc89f commit 5dbc2dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions desktop/plugins/postinstall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const rootDir = path.resolve(__dirname, '..');
const fbPluginsDir = path.join(__dirname, 'fb');

async function postinstall(): Promise<number> {
console.log('* Looking up plugins');
const [publicPackages, fbPackages, pluginsPackageJson] = await Promise.all([
fs.readdir(publicPluginsDir),
fs.readdir(fbPluginsDir).catch(() => [] as string[]),
Expand Down Expand Up @@ -92,15 +93,18 @@ async function postinstall(): Promise<number> {
}
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(
Expand Down

0 comments on commit 5dbc2dd

Please sign in to comment.