@@ -212,7 +212,7 @@ export class Toolkit extends CloudAssemblySourceBuilder {
212
212
/**
213
213
* Bootstrap Action
214
214
*/
215
- public async bootstrap ( environments : BootstrapEnvironments , options : BootstrapOptions ) : Promise < BootstrapResult > {
215
+ public async bootstrap ( environments : BootstrapEnvironments , options : BootstrapOptions = { } ) : Promise < BootstrapResult > {
216
216
const startTime = Date . now ( ) ;
217
217
const results : EnvironmentBootstrapResult [ ] = [ ] ;
218
218
@@ -323,7 +323,7 @@ export class Toolkit extends CloudAssemblySourceBuilder {
323
323
/**
324
324
* Diff Action
325
325
*/
326
- public async diff ( cx : ICloudAssemblySource , options : DiffOptions ) : Promise < { [ name : string ] : TemplateDiff } > {
326
+ public async diff ( cx : ICloudAssemblySource , options : DiffOptions = { } ) : Promise < { [ name : string ] : TemplateDiff } > {
327
327
const ioHelper = asIoHelper ( this . ioHost , 'diff' ) ;
328
328
const selectStacks = options . stacks ?? ALL_STACKS ;
329
329
const synthSpan = await ioHelper . span ( SPAN . SYNTH_ASSEMBLY ) . begin ( { stacks : selectStacks } ) ;
@@ -748,7 +748,7 @@ export class Toolkit extends CloudAssemblySourceBuilder {
748
748
*
749
749
* This function returns immediately, starting a watcher in the background.
750
750
*/
751
- public async watch ( cx : ICloudAssemblySource , options : WatchOptions ) : Promise < IWatcher > {
751
+ public async watch ( cx : ICloudAssemblySource , options : WatchOptions = { } ) : Promise < IWatcher > {
752
752
const ioHelper = asIoHelper ( this . ioHost , 'watch' ) ;
753
753
await using assembly = await assemblyFromSource ( ioHelper , cx , false ) ;
754
754
const rootDir = options . watchDir ?? process . cwd ( ) ;
@@ -892,7 +892,7 @@ export class Toolkit extends CloudAssemblySourceBuilder {
892
892
*
893
893
* Rolls back the selected stacks.
894
894
*/
895
- public async rollback ( cx : ICloudAssemblySource , options : RollbackOptions ) : Promise < RollbackResult > {
895
+ public async rollback ( cx : ICloudAssemblySource , options : RollbackOptions = { } ) : Promise < RollbackResult > {
896
896
const ioHelper = asIoHelper ( this . ioHost , 'rollback' ) ;
897
897
await using assembly = await assemblyFromSource ( ioHelper , cx ) ;
898
898
return await this . _rollback ( assembly , 'rollback' , options ) ;
@@ -902,9 +902,10 @@ export class Toolkit extends CloudAssemblySourceBuilder {
902
902
* Helper to allow rollback being called as part of the deploy or watch action.
903
903
*/
904
904
private async _rollback ( assembly : StackAssembly , action : 'rollback' | 'deploy' | 'watch' , options : RollbackOptions ) : Promise < RollbackResult > {
905
+ const selectStacks = options . stacks ?? ALL_STACKS ;
905
906
const ioHelper = asIoHelper ( this . ioHost , action ) ;
906
- const synthSpan = await ioHelper . span ( SPAN . SYNTH_ASSEMBLY ) . begin ( { stacks : options . stacks } ) ;
907
- const stacks = await assembly . selectStacksV2 ( options . stacks ) ;
907
+ const synthSpan = await ioHelper . span ( SPAN . SYNTH_ASSEMBLY ) . begin ( { stacks : selectStacks } ) ;
908
+ const stacks = await assembly . selectStacksV2 ( selectStacks ) ;
908
909
await this . validateStacksMetadata ( stacks , ioHelper ) ;
909
910
await synthSpan . end ( ) ;
910
911
@@ -1034,7 +1035,7 @@ export class Toolkit extends CloudAssemblySourceBuilder {
1034
1035
*
1035
1036
* Destroys the selected Stacks.
1036
1037
*/
1037
- public async destroy ( cx : ICloudAssemblySource , options : DestroyOptions ) : Promise < DestroyResult > {
1038
+ public async destroy ( cx : ICloudAssemblySource , options : DestroyOptions = { } ) : Promise < DestroyResult > {
1038
1039
const ioHelper = asIoHelper ( this . ioHost , 'destroy' ) ;
1039
1040
await using assembly = await assemblyFromSource ( ioHelper , cx ) ;
1040
1041
return await this . _destroy ( assembly , 'destroy' , options ) ;
@@ -1044,10 +1045,11 @@ export class Toolkit extends CloudAssemblySourceBuilder {
1044
1045
* Helper to allow destroy being called as part of the deploy action.
1045
1046
*/
1046
1047
private async _destroy ( assembly : StackAssembly , action : 'deploy' | 'destroy' , options : DestroyOptions ) : Promise < DestroyResult > {
1048
+ const selectStacks = options . stacks ?? ALL_STACKS ;
1047
1049
const ioHelper = asIoHelper ( this . ioHost , action ) ;
1048
- const synthSpan = await ioHelper . span ( SPAN . SYNTH_ASSEMBLY ) . begin ( { stacks : options . stacks } ) ;
1050
+ const synthSpan = await ioHelper . span ( SPAN . SYNTH_ASSEMBLY ) . begin ( { stacks : selectStacks } ) ;
1049
1051
// The stacks will have been ordered for deployment, so reverse them for deletion.
1050
- const stacks = ( await assembly . selectStacksV2 ( options . stacks ) ) . reversed ( ) ;
1052
+ const stacks = ( await assembly . selectStacksV2 ( selectStacks ) ) . reversed ( ) ;
1051
1053
await synthSpan . end ( ) ;
1052
1054
1053
1055
const ret : DestroyResult = {
0 commit comments