@@ -25,6 +25,7 @@ import {getCachedAppInfo, setCachedAppInfo} from './local-storage.js'
2525import { canEnablePreviewMode } from './extensions/common.js'
2626import { fetchAppRemoteConfiguration } from './app/select-app.js'
2727import { patchAppConfigurationFile } from './app/patch-app-configuration-file.js'
28+ import { DevSessionStatusManager } from './dev/processes/dev-session-status-manager.js'
2829import { DeveloperPlatformClient } from '../utilities/developer-platform-client.js'
2930import { Web , isCurrentAppSchema , getAppScopesArray , AppLinkedInterface } from '../models/app/app.js'
3031import { Organization , OrganizationApp , OrganizationStore } from '../models/organization.js'
@@ -71,9 +72,9 @@ export interface DevOptions {
7172export async function dev ( commandOptions : DevOptions ) {
7273 const config = await prepareForDev ( commandOptions )
7374 await actionsBeforeSettingUpDevProcesses ( config )
74- const { processes, graphiqlUrl, previewUrl} = await setupDevProcesses ( config )
75+ const { processes, graphiqlUrl, previewUrl, devSessionStatusManager } = await setupDevProcesses ( config )
7576 await actionsBeforeLaunchingDevProcesses ( config )
76- await launchDevProcesses ( { processes, previewUrl, graphiqlUrl, config} )
77+ await launchDevProcesses ( { processes, previewUrl, graphiqlUrl, config, devSessionStatusManager } )
7778}
7879
7980async function prepareForDev ( commandOptions : DevOptions ) : Promise < DevConfig > {
@@ -117,10 +118,10 @@ async function prepareForDev(commandOptions: DevOptions): Promise<DevConfig> {
117118 await installAppDependencies ( app )
118119 }
119120
120- const graphiqlPort = commandOptions . graphiqlPort || ( await getAvailableTCPPort ( ports . graphiql ) )
121+ const graphiqlPort = commandOptions . graphiqlPort ?? ( await getAvailableTCPPort ( ports . graphiql ) )
121122 const { graphiqlKey} = commandOptions
122123
123- if ( graphiqlPort !== ( commandOptions . graphiqlPort || ports . graphiql ) ) {
124+ if ( graphiqlPort !== ( commandOptions . graphiqlPort ?? ports . graphiql ) ) {
124125 renderWarning ( {
125126 headline : [
126127 'A random port will be used for GraphiQL because' ,
@@ -224,7 +225,7 @@ export async function warnIfScopesDifferBeforeDev({
224225 scopesMessage ( getAppScopesArray ( localApp . configuration ) ) ,
225226 '\n' ,
226227 'Scopes in Partner Dashboard:' ,
227- scopesMessage ( remoteAccess ?. scopes ?. split ( ',' ) || [ ] ) ,
228+ scopesMessage ( remoteAccess ?. scopes ?. split ( ',' ) ?? [ ] ) ,
228229 ] ,
229230 nextSteps,
230231 } )
@@ -301,7 +302,7 @@ async function setupNetworkingOptions(
301302 ...frontEndOptions ,
302303 tunnelClient,
303304 } ) ,
304- getBackendPort ( ) || backendConfig ?. configuration . port || getAvailableTCPPort ( ) ,
305+ getBackendPort ( ) ?? backendConfig ?. configuration . port ?? getAvailableTCPPort ( ) ,
305306 getURLs ( remoteAppConfig ) ,
306307 ] )
307308 const proxyUrl = usingLocalhost ? `${ frontendUrl } :${ proxyPort } ` : frontendUrl
@@ -330,11 +331,13 @@ async function launchDevProcesses({
330331 previewUrl,
331332 graphiqlUrl,
332333 config,
334+ devSessionStatusManager,
333335} : {
334336 processes : DevProcesses
335337 previewUrl : string
336338 graphiqlUrl : string | undefined
337339 config : DevConfig
340+ devSessionStatusManager : DevSessionStatusManager
338341} ) {
339342 const abortController = new AbortController ( )
340343 const processesForTaskRunner : OutputProcess [ ] = processes . map ( ( process ) => {
@@ -375,6 +378,7 @@ async function launchDevProcesses({
375378 abortController,
376379 developerPreview : developerPreviewController ( apiKey , developerPlatformClient ) ,
377380 shopFqdn : config . storeFqdn ,
381+ devSessionStatusManager,
378382 } )
379383}
380384
0 commit comments