From cae67c8d75f676b2eeadf17915deb1e525d4faf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isaac=20Rold=C3=A1n?= Date: Tue, 10 Dec 2024 17:54:59 +0100 Subject: [PATCH] Group app config updates during a dev session --- .../cli/services/dev/processes/dev-session.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/app/src/cli/services/dev/processes/dev-session.ts b/packages/app/src/cli/services/dev/processes/dev-session.ts index c360ae8cd6..83dd54392d 100644 --- a/packages/app/src/cli/services/dev/processes/dev-session.ts +++ b/packages/app/src/cli/services/dev/processes/dev-session.ts @@ -109,11 +109,20 @@ export const pushUpdatesForDevSession: DevProcessFunction = a // Remove aborted controllers from array: bundleControllers = bundleControllers.filter((controller) => !controller.signal.aborted) - // For each extension event, print a message to the terminal + const appConfigEvents = event.extensionEvents.filter((eve) => eve.extension.isAppConfigExtension) + const nonAppConfigEvents = event.extensionEvents.filter((eve) => !eve.extension.isAppConfigExtension) + + if (appConfigEvents.length) { + const outputPrefix = 'app-config' + const message = `App config updated` + await useConcurrentOutputContext({outputPrefix, stripAnsi: false}, () => processOptions.stdout.write(message)) + } + + // For each (non app config) extension event, print a message to the terminal // eslint-disable-next-line @typescript-eslint/no-misused-promises - event.extensionEvents.forEach(async (eve) => { - const outputPrefix = eve.extension.isAppConfigExtension ? 'app-config' : eve.extension.handle - const message = `${eve.extension.isAppConfigExtension ? 'App config' : 'Extension'} ${eve.type}` + nonAppConfigEvents.forEach(async (eve) => { + const outputPrefix = eve.extension.handle + const message = `Extension ${eve.type}` await useConcurrentOutputContext({outputPrefix, stripAnsi: false}, () => processOptions.stdout.write(message)) })