11import { executeBundleUIStep } from './bundle-ui-step.js'
2+ import * as generateManifest from './include-assets/generate-manifest.js'
23import * as buildExtension from '../extension.js'
34import { BundleUIStep , BuildContext } from '../client-steps.js'
45import { ExtensionInstance } from '../../../models/extensions/extension-instance.js'
@@ -7,6 +8,7 @@ import * as fs from '@shopify/cli-kit/node/fs'
78
89vi . mock ( '@shopify/cli-kit/node/fs' )
910vi . mock ( '../extension.js' )
11+ vi . mock ( './include-assets/generate-manifest.js' )
1012
1113describe ( 'executeBundleUIStep' , ( ) => {
1214 let mockContext : BuildContext
@@ -55,4 +57,25 @@ describe('executeBundleUIStep', () => {
5557
5658 expect ( fs . copyFile ) . not . toHaveBeenCalled ( )
5759 } )
60+
61+ test ( 'skips manifest generation when local and bundle output directories resolve to the same path' , async ( ) => {
62+ const stepWithManifest : BundleUIStep = {
63+ id : 'bundle-ui' ,
64+ name : 'Bundle UI Extension' ,
65+ type : 'bundle_ui' ,
66+ config : { generatesAssetsManifest : true } ,
67+ }
68+ mockContext . extension . outputPath = '/test/./extension/dist/handle.js'
69+ mockContext . extension . configuration = {
70+ extension_points : [
71+ { target : 'admin.product-details.action.render' , build_manifest : { assets : { main : { filepath : 'main.js' } } } } ,
72+ ] ,
73+ } as ExtensionInstance [ 'configuration' ]
74+ vi . mocked ( buildExtension . buildUIExtension ) . mockResolvedValue ( '/test/extension/dist/handle.js' )
75+
76+ await executeBundleUIStep ( stepWithManifest , mockContext )
77+
78+ expect ( fs . copyFile ) . not . toHaveBeenCalled ( )
79+ expect ( generateManifest . createOrUpdateManifestFile ) . not . toHaveBeenCalled ( )
80+ } )
5881} )
0 commit comments