11import { createExtensionSpecification } from '../specification.js'
22import { BaseSchemaWithHandle } from '../schemas.js'
33import { zod } from '@shopify/cli-kit/node/schema'
4- import { glob } from '@shopify/cli-kit/node/fs'
54import { joinPath , relativePath } from '@shopify/cli-kit/node/path'
65
76const ChannelSpecificationSchema = BaseSchemaWithHandle . extend ( {
@@ -16,24 +15,12 @@ const FILE_EXTENSIONS = ['json', 'toml', 'yaml', 'yml']
1615// Generate glob patterns for all supported file types
1716const getGlobPatterns = ( ) => FILE_EXTENSIONS . map ( ( ext ) => joinPath ( SUBDIRECTORY_NAME , '**' , `*.${ ext } ` ) )
1817
19- async function getSpecificationFiles ( directory : string ) : Promise < string [ ] > {
20- const patterns = getGlobPatterns ( )
21-
22- const files = await glob ( patterns , {
23- absolute : true ,
24- cwd : directory ,
25- } )
26-
27- return files . map ( ( file ) => relativePath ( directory , file ) )
28- }
29-
3018const channelSpecificationSpec = createExtensionSpecification ( {
3119 identifier : 'channel_config' ,
3220 schema : ChannelSpecificationSchema ,
3321 buildConfig : { mode : 'copy_files' , filePatterns : getGlobPatterns ( ) } ,
3422 appModuleFeatures : ( ) => [ ] ,
3523 deployConfig : async ( config , directory ) => {
36- const specifications = await getSpecificationFiles ( directory )
3724 return {
3825 handle : config . handle ,
3926 name : config . name ,
0 commit comments