@@ -189,7 +189,7 @@ public function testSynchronizeNewPackage()
189189 ],
190190 ],
191191 ],
192- 'entrypoints ' => ['admin.js ' ],
192+ 'entrypoints ' => ['admin.js ' , ' @symfony/new-package/entry.js ' ],
193193 ],
194194 json_decode (file_get_contents ($ this ->tempDir .'/assets/controllers.json ' ), true )
195195 );
@@ -323,11 +323,14 @@ public function testSynchronizeAssetMapperNewPackage()
323323 file_put_contents ($ this ->tempDir .'/importmap.php ' , '<?php return []; ' );
324324
325325 $ fileModulePath = $ this ->tempDir .'/vendor/symfony/new-package/assets/dist/loader.js ' ;
326- $ this ->scriptExecutor ->expects ($ this ->exactly (2 ))
326+ $ entrypointPath = $ this ->tempDir .'/vendor/symfony/new-package/assets/entry.js ' ;
327+
328+ $ this ->scriptExecutor ->expects ($ this ->exactly (3 ))
327329 ->method ('execute ' )
328330 ->withConsecutive (
329331 ['symfony-cmd ' , 'importmap:require ' , ['@hotcake/foo@^1.9.0 ' ]],
330- ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]]
332+ ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]],
333+ ['symfony-cmd ' , 'importmap:require ' , ['--entrypoint ' ,'@symfony/new-package/entry.js ' , '--path= ' .$ entrypointPath ]]
331334 );
332335
333336 $ this ->synchronizer ->synchronize ([
@@ -382,7 +385,7 @@ public function testSynchronizeAssetMapperNewPackage()
382385 ],
383386 ],
384387 ],
385- 'entrypoints ' => ['admin.js ' ],
388+ 'entrypoints ' => ['admin.js ' , ' @symfony/new-package/entry.js ' ],
386389 ],
387390 json_decode (file_get_contents ($ this ->tempDir .'/assets/controllers.json ' ), true )
388391 );
@@ -399,11 +402,14 @@ public function testSynchronizeAssetMapperUpgradesPackageIfNeeded()
399402 file_put_contents ($ this ->tempDir .'/importmap.php ' , sprintf ('<?php return %s; ' , var_export ($ importMap , true )));
400403
401404 $ fileModulePath = $ this ->tempDir .'/vendor/symfony/new-package/assets/dist/loader.js ' ;
402- $ this ->scriptExecutor ->expects ($ this ->exactly (2 ))
405+ $ entrypointPath = $ this ->tempDir .'/vendor/symfony/new-package/assets/entry.js ' ;
406+
407+ $ this ->scriptExecutor ->expects ($ this ->exactly (3 ))
403408 ->method ('execute ' )
404409 ->withConsecutive (
405410 ['symfony-cmd ' , 'importmap:require ' , ['@hotcake/foo@^1.9.0 ' ]],
406- ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]]
411+ ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]],
412+ ['symfony-cmd ' , 'importmap:require ' , ['--entrypoint ' ,'@symfony/new-package/entry.js ' , '--path= ' .$ entrypointPath ]]
407413 );
408414
409415 $ this ->synchronizer ->synchronize ([
@@ -425,10 +431,13 @@ public function testSynchronizeAssetMapperSkipsUpgradeIfAlreadySatisfied()
425431 file_put_contents ($ this ->tempDir .'/importmap.php ' , sprintf ('<?php return %s; ' , var_export ($ importMap , true )));
426432
427433 $ fileModulePath = $ this ->tempDir .'/vendor/symfony/new-package/assets/dist/loader.js ' ;
428- $ this ->scriptExecutor ->expects ($ this ->once ())
434+ $ entrypointPath = $ this ->tempDir .'/vendor/symfony/new-package/assets/entry.js ' ;
435+
436+ $ this ->scriptExecutor ->expects ($ this ->exactly (2 ))
429437 ->method ('execute ' )
430438 ->withConsecutive (
431- ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]]
439+ ['symfony-cmd ' , 'importmap:require ' , ['@symfony/new-package ' , '--path= ' .$ fileModulePath ]],
440+ ['symfony-cmd ' , 'importmap:require ' , ['--entrypoint ' ,'@symfony/new-package/entry.js ' , '--path= ' .$ entrypointPath ]]
432441 );
433442
434443 $ this ->synchronizer ->synchronize ([
0 commit comments