Skip to content

Commit

Permalink
Merge pull request #5073 from Shopify/12-10-group_app_config_updates_…
Browse files Browse the repository at this point in the history
…during_a_dev_session

Group app config updates during a dev session
  • Loading branch information
isaacroldan authored Dec 16, 2024
2 parents 1d5dff4 + cae67c8 commit 228e0a4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/app/src/cli/services/dev/processes/dev-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,20 @@ export const pushUpdatesForDevSession: DevProcessFunction<DevSessionOptions> = 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))
})

Expand Down

0 comments on commit 228e0a4

Please sign in to comment.