@@ -35,6 +35,10 @@ export default class GenerateTestPayload extends Command {
35
35
char : 'p' ,
36
36
description : 'destination actions directory path' ,
37
37
default : './packages/destination-actions/src/destinations'
38
+ } ) ,
39
+ browser : flags . boolean ( {
40
+ char : 'r' ,
41
+ description : 'generate payloads for browser destinations'
38
42
} )
39
43
}
40
44
@@ -43,6 +47,7 @@ export default class GenerateTestPayload extends Command {
43
47
async run ( ) {
44
48
const { flags } = this . parse ( GenerateTestPayload )
45
49
let destinationName = flags . destination
50
+ const isBrowser = ! ! flags . browser
46
51
47
52
if ( ! destinationName ) {
48
53
const integrationsGlob = `${ flags . directory } /*`
@@ -78,7 +83,10 @@ export default class GenerateTestPayload extends Command {
78
83
79
84
this . spinner . start ( `Loading destination: ${ destinationName } ` )
80
85
81
- const targetDirectory = path . join ( process . cwd ( ) , flags . directory , destinationName , 'index.ts' )
86
+ const cloudEntry = path . join ( process . cwd ( ) , flags . directory , destinationName , 'index.ts' )
87
+ const browserEntry = path . join ( process . cwd ( ) , flags . directory , destinationName , 'src' , 'index.ts' )
88
+ const targetDirectory = isBrowser ? browserEntry : cloudEntry
89
+
82
90
const destination = await loadDestination ( targetDirectory )
83
91
if ( ! destination ) {
84
92
this . error ( `Failed to load destination: ${ destinationName } ` )
0 commit comments