From 6d651b809d24cdc91341d4a82bfcfdbac29ea2e0 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Wed, 8 Jan 2025 19:07:11 +0000 Subject: [PATCH] fix(ng-dev): improve logging output for updating aspect files Improve logging and use spinner instead of just outputting the bazel outputs. --- ng-dev/release/publish/external-commands.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ng-dev/release/publish/external-commands.ts b/ng-dev/release/publish/external-commands.ts index b977867b4..3efa27b75 100644 --- a/ng-dev/release/publish/external-commands.ts +++ b/ng-dev/release/publish/external-commands.ts @@ -263,15 +263,19 @@ export abstract class ExternalCommands { * to refresh Aspect lock files. */ static async invokeBazelUpdateAspectLockFiles(projectDir: string): Promise { + const spinner = new Spinner('Updating Aspect lock files'); + try { - // Note: No progress indicator needed as that is the responsibility of the command. - // TODO: Consider using an Ora spinner instead to ensure minimal console output. - await ChildProcess.spawn(getBazelBin(), ['run', '@npm2//:sync'], {cwd: projectDir}); + await ChildProcess.spawn(getBazelBin(), ['run', '@npm2//:sync'], { + cwd: projectDir, + mode: 'silent', + }); } catch (e) { // Note: Gracefully handling these errors because `sync` command // alway exits with a non-zero exit code. + Log.debug(e); } - Log.info(green(' ✓ Updated Aspect `rules_js` lock files.')); + spinner.success(green(' Updated Aspect `rules_js` lock files.')); } }