Skip to content

Commit 807bceb

Browse files
committed
Fix rogue model_1 import
ModuleNameDelegator.wrtieModelIndex would traverse all `model.shapes()` causing more models to be "visited" by ModuleNameDelegator.
1 parent f788a3e commit 807bceb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import software.amazon.smithy.model.shapes.ServiceShape;
4747
import software.amazon.smithy.model.shapes.ShapeId;
4848
import software.amazon.smithy.model.traits.PaginatedTrait;
49+
import software.amazon.smithy.model.transform.ModelTransformer;
4950
import software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;
5051
import software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;
5152
import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;
@@ -374,7 +375,12 @@ public void customizeBeforeIntegrations(CustomizeDirective<TypeScriptCodegenCont
374375
});
375376

376377
// TODO: do all of these parts below are before/after?
377-
SymbolVisitor.writeModelIndex(directive.model(), directive.symbolProvider(), directive.fileManifest());
378+
379+
// TODO: Do nonTraits need to be used in any other part of the logic?
380+
// Like CodegenVisitor did it before visiting structures etc.
381+
Model nonTraits = ModelTransformer.create().getModelWithoutTraitShapes(directive.model());
382+
SymbolVisitor.writeModelIndex(nonTraits, directive.symbolProvider(), directive.fileManifest());
383+
// SymbolVisitor.writeModelIndex(directive.model(), directive.symbolProvider(), directive.fileManifest());
378384

379385
// Generate the client Node and Browser configuration files. These
380386
// files are switched between in package.json based on the targeted

0 commit comments

Comments
 (0)