@@ -185,6 +185,7 @@ describe('DevupUINextPlugin', () => {
185185 loader : '@devup-ui/next-plugin/css-loader' ,
186186 options : {
187187 watch : false ,
188+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
188189 sheetFile : join ( 'df' , 'sheet.json' ) ,
189190 classMapFile : join ( 'df' , 'classMap.json' ) ,
190191 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -210,6 +211,7 @@ describe('DevupUINextPlugin', () => {
210211 options : {
211212 package : '@devup-ui/react' ,
212213 cssDir : resolve ( 'df' , 'devup-ui' ) ,
214+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
213215 sheetFile : join ( 'df' , 'sheet.json' ) ,
214216 classMapFile : join ( 'df' , 'classMap.json' ) ,
215217 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -267,6 +269,7 @@ describe('DevupUINextPlugin', () => {
267269 loader : '@devup-ui/next-plugin/css-loader' ,
268270 options : {
269271 watch : false ,
272+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
270273 sheetFile : join ( 'df' , 'sheet.json' ) ,
271274 classMapFile : join ( 'df' , 'classMap.json' ) ,
272275 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -304,6 +307,7 @@ describe('DevupUINextPlugin', () => {
304307 options : {
305308 package : '@devup-ui/react' ,
306309 cssDir : resolve ( 'df' , 'devup-ui' ) ,
310+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
307311 sheetFile : join ( 'df' , 'sheet.json' ) ,
308312 classMapFile : join ( 'df' , 'classMap.json' ) ,
309313 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -357,6 +361,7 @@ describe('DevupUINextPlugin', () => {
357361 loader : '@devup-ui/next-plugin/css-loader' ,
358362 options : {
359363 watch : false ,
364+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
360365 sheetFile : join ( 'df' , 'sheet.json' ) ,
361366 classMapFile : join ( 'df' , 'classMap.json' ) ,
362367 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -394,6 +399,7 @@ describe('DevupUINextPlugin', () => {
394399 options : {
395400 package : '@devup-ui/react' ,
396401 cssDir : resolve ( 'df' , 'devup-ui' ) ,
402+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
397403 sheetFile : join ( 'df' , 'sheet.json' ) ,
398404 classMapFile : join ( 'df' , 'classMap.json' ) ,
399405 fileMapFile : join ( 'df' , 'fileMap.json' ) ,
@@ -431,7 +437,7 @@ describe('DevupUINextPlugin', () => {
431437 '*' ,
432438 )
433439 } )
434- it ( 'should not start coordinator in production mode' , ( ) => {
440+ it ( 'should start coordinator even in production mode' , ( ) => {
435441 ; ( process . env as any ) . NODE_ENV = 'production'
436442 process . env . TURBOPACK = '1'
437443 existsSyncSpy
@@ -445,7 +451,20 @@ describe('DevupUINextPlugin', () => {
445451 rules : expect . any ( Object ) ,
446452 } ,
447453 } )
448- expect ( startCoordinatorSpy ) . not . toHaveBeenCalled ( )
454+ expect ( startCoordinatorSpy ) . toHaveBeenCalledWith ( {
455+ package : '@devup-ui/react' ,
456+ cssDir : resolve ( 'df' , 'devup-ui' ) ,
457+ singleCss : false ,
458+ sheetFile : join ( 'df' , 'sheet.json' ) ,
459+ classMapFile : join ( 'df' , 'classMap.json' ) ,
460+ fileMapFile : join ( 'df' , 'fileMap.json' ) ,
461+ importAliases : {
462+ '@emotion/styled' : 'styled' ,
463+ '@vanilla-extract/css' : null ,
464+ 'styled-components' : 'styled' ,
465+ } ,
466+ coordinatorPortFile : join ( 'df' , 'coordinator.port' ) ,
467+ } )
449468 } )
450469 it ( 'should create theme.d.ts file' , async ( ) => {
451470 process . env . TURBOPACK = '1'
@@ -567,8 +586,8 @@ describe('DevupUINextPlugin', () => {
567586 expect ( importFileMapSpy ) . toHaveBeenCalledWith ( prevFileMap )
568587 expect ( registerThemeSpy ) . toHaveBeenCalledWith ( { } )
569588
570- // In non-dev mode, coordinator is not started, so no port file cleanup
571- expect ( unlinkSyncSpy ) . not . toHaveBeenCalled ( )
589+ // Verify stale port file was deleted before starting coordinator
590+ expect ( unlinkSyncSpy ) . toHaveBeenCalledWith ( join ( 'df' , 'coordinator.port' ) )
572591 } )
573592 it ( 'should handle missing state files gracefully on first run' , ( ) => {
574593 process . env . TURBOPACK = '1'
0 commit comments