@@ -26,8 +26,8 @@ import type { StackAssembly } from '../api/cloud-assembly/private';
26
26
import { ALL_STACKS , CloudAssemblySourceBuilder , IdentityCloudAssemblySource } from '../api/cloud-assembly/private' ;
27
27
import type { IIoHost , IoMessageLevel } from '../api/io' ;
28
28
import { Timer , IO , asSdkLogger , withoutColor , withoutEmojis , withTrimmedWhitespace } from '../api/io/private' ;
29
- import type { ActionAwareIoHost } from '../api/shared-private' ;
30
- import { withAction } from '../api/shared-private' ;
29
+ import type { IoHelper } from '../api/shared-private' ;
30
+ import { asIoHelper } from '../api/shared-private' ;
31
31
import type { ToolkitAction } from '../api/shared-public' ;
32
32
import { ToolkitError } from '../api/shared-public' ;
33
33
import { obscureTemplate , serializeStructure , validateSnsTopicArn , formatTime , formatErrorMessage } from '../private/util' ;
@@ -130,7 +130,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
130
130
if ( ! this . _sdkProvider ) {
131
131
this . _sdkProvider = await SdkProvider . withAwsCliCompatibleDefaults ( {
132
132
...this . props . sdkConfig ,
133
- logger : asSdkLogger ( withAction ( this . ioHost , action ) ) ,
133
+ logger : asSdkLogger ( asIoHelper ( this . ioHost , action ) ) ,
134
134
} ) ;
135
135
}
136
136
@@ -142,7 +142,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
142
142
*/
143
143
protected override async sourceBuilderServices ( ) : Promise < ToolkitServices > {
144
144
return {
145
- ioHost : withAction ( this . ioHost , 'assembly' ) ,
145
+ ioHost : asIoHelper ( this . ioHost , 'assembly' ) ,
146
146
sdkProvider : await this . sdkProvider ( 'assembly' ) ,
147
147
} ;
148
148
}
@@ -151,7 +151,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
151
151
* Bootstrap Action
152
152
*/
153
153
public async bootstrap ( environments : BootstrapEnvironments , options : BootstrapOptions ) : Promise < void > {
154
- const ioHost = withAction ( this . ioHost , 'bootstrap' ) ;
154
+ const ioHost = asIoHelper ( this . ioHost , 'bootstrap' ) ;
155
155
const bootstrapEnvironments = await environments . getEnvironments ( ) ;
156
156
const source = options . source ?? BootstrapSource . default ( ) ;
157
157
const parameters = options . parameters ;
@@ -197,7 +197,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
197
197
* Synth Action
198
198
*/
199
199
public async synth ( cx : ICloudAssemblySource , options : SynthOptions = { } ) : Promise < ICloudAssemblySource > {
200
- const ioHost = withAction ( this . ioHost , 'synth' ) ;
200
+ const ioHost = asIoHelper ( this . ioHost , 'synth' ) ;
201
201
const synthTimer = Timer . start ( ) ;
202
202
const assembly = await assemblyFromSource ( cx ) ;
203
203
const stacks = assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
@@ -242,7 +242,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
242
242
* List selected stacks and their dependencies
243
243
*/
244
244
public async list ( cx : ICloudAssemblySource , options : ListOptions = { } ) : Promise < StackDetails [ ] > {
245
- const ioHost = withAction ( this . ioHost , 'list' ) ;
245
+ const ioHost = asIoHelper ( this . ioHost , 'list' ) ;
246
246
const synthTimer = Timer . start ( ) ;
247
247
const assembly = await assemblyFromSource ( cx ) ;
248
248
const stackCollection = await assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
@@ -269,7 +269,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
269
269
* Helper to allow deploy being called as part of the watch action.
270
270
*/
271
271
private async _deploy ( assembly : StackAssembly , action : 'deploy' | 'watch' , options : ExtendedDeployOptions = { } ) {
272
- const ioHost = withAction ( this . ioHost , action ) ;
272
+ const ioHost = asIoHelper ( this . ioHost , action ) ;
273
273
const synthTimer = Timer . start ( ) ;
274
274
const stackCollection = assembly . selectStacksV2 ( options . stacks ?? ALL_STACKS ) ;
275
275
await this . validateStacksMetadata ( stackCollection , ioHost ) ;
@@ -571,7 +571,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
571
571
*/
572
572
public async watch ( cx : ICloudAssemblySource , options : WatchOptions ) : Promise < void > {
573
573
const assembly = await assemblyFromSource ( cx , false ) ;
574
- const ioHost = withAction ( this . ioHost , 'watch' ) ;
574
+ const ioHost = asIoHelper ( this . ioHost , 'watch' ) ;
575
575
const rootDir = options . watchDir ?? process . cwd ( ) ;
576
576
577
577
if ( options . include === undefined && options . exclude === undefined ) {
@@ -694,7 +694,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
694
694
* Helper to allow rollback being called as part of the deploy or watch action.
695
695
*/
696
696
private async _rollback ( assembly : StackAssembly , action : 'rollback' | 'deploy' | 'watch' , options : RollbackOptions ) : Promise < void > {
697
- const ioHost = withAction ( this . ioHost , action ) ;
697
+ const ioHost = asIoHelper ( this . ioHost , action ) ;
698
698
const synthTimer = Timer . start ( ) ;
699
699
const stacks = assembly . selectStacksV2 ( options . stacks ) ;
700
700
await this . validateStacksMetadata ( stacks , ioHost ) ;
@@ -752,7 +752,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
752
752
* Helper to allow destroy being called as part of the deploy action.
753
753
*/
754
754
private async _destroy ( assembly : StackAssembly , action : 'deploy' | 'destroy' , options : DestroyOptions ) : Promise < void > {
755
- const ioHost = withAction ( this . ioHost , action ) ;
755
+ const ioHost = asIoHelper ( this . ioHost , action ) ;
756
756
const synthTimer = Timer . start ( ) ;
757
757
// The stacks will have been ordered for deployment, so reverse them for deletion.
758
758
const stacks = await assembly . selectStacksV2 ( options . stacks ) . reversed ( ) ;
@@ -794,7 +794,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab
794
794
/**
795
795
* Validate the stacks for errors and warnings according to the CLI's current settings
796
796
*/
797
- private async validateStacksMetadata ( stacks : StackCollection , ioHost : ActionAwareIoHost ) {
797
+ private async validateStacksMetadata ( stacks : StackCollection , ioHost : IoHelper ) {
798
798
const builder = ( level : IoMessageLevel ) => {
799
799
switch ( level ) {
800
800
case 'error' : return IO . CDK_ASSEMBLY_E9999 ;
0 commit comments