Skip to content

Commit 4ad5f3a

Browse files
author
Steven Yuan
committed
feat(codegen): add mutateClientPlugins() integration hook
1 parent 683fc7d commit 4ad5f3a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ public TypeScriptCodegenContext createContext(CreateContextDirective<TypeScriptS
102102
});
103103
});
104104

105+
directive.integrations().forEach(integration -> {
106+
LOGGER.info(() -> "Mutating plugins from TypeScriptIntegration: " + integration.getClass().getName());
107+
integration.mutateClientPlugins(runtimePlugins);
108+
});
109+
105110
ProtocolGenerator protocolGenerator = resolveProtocolGenerator(
106111
directive.integrations(),
107112
directive.model(),

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/TypeScriptIntegration.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ default List<RuntimeClientPlugin> getClientPlugins() {
6464
return Collections.emptyList();
6565
}
6666

67+
/**
68+
* Mutates in place the loaded list of plugins to apply to the generated client.
69+
*/
70+
default void mutateClientPlugins(List<RuntimeClientPlugin> plugins) {
71+
// defaults to no mutation
72+
}
73+
6774
/**
6875
* Gets a list of protocol generators to register.
6976
*

0 commit comments

Comments
 (0)