Skip to content

Commit 3d7b9eb

Browse files
authored
chore(lib-dynamodb): export commands folder from index.ts (#2927)
1 parent 0ccbdce commit 3d7b9eb

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddDocumentClientPlugin.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,17 @@ public void writeAdditionalFiles(
7474
writerFactory.accept(String.format("%s%s.ts", docClientPrefix, DocumentClientUtils.CLIENT_FULL_NAME),
7575
writer -> new DocumentFullClientGenerator(settings, model, symbolProvider, writer).run());
7676

77+
writerFactory.accept(String.format("%s%s/index.ts", docClientPrefix,
78+
DocumentClientUtils.CLIENT_COMMANDS_FOLDER), writer -> {
79+
for (OperationShape operation : overridenOperationsList) {
80+
String operationFileName = DocumentClientUtils.getModifiedName(
81+
symbolProvider.toSymbol(operation).getName()
82+
);
83+
writer.write("export * from './$L';", operationFileName);
84+
}
85+
});
7786
writerFactory.accept(String.format("%sindex.ts", docClientPrefix), writer -> {
78-
for (OperationShape operationOverriden: overridenOperationsList) {
79-
String operationFileName = DocumentClientUtils.getModifiedName(
80-
symbolProvider.toSymbol(operationOverriden).getName()
81-
);
82-
writer.write("export * from './$L/$L';",
83-
DocumentClientUtils.CLIENT_COMMANDS_FOLDER, operationFileName);
84-
}
87+
writer.write("export * from './commands';");
8588
writer.write("export * from './$L';", DocumentClientUtils.CLIENT_NAME);
8689
writer.write("export * from './$L';", DocumentClientUtils.CLIENT_FULL_NAME);
8790
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export * from "./BatchExecuteStatementCommand";
2+
export * from "./BatchGetCommand";
3+
export * from "./BatchWriteCommand";
4+
export * from "./DeleteCommand";
5+
export * from "./ExecuteStatementCommand";
6+
export * from "./ExecuteTransactionCommand";
7+
export * from "./GetCommand";
8+
export * from "./PutCommand";
9+
export * from "./QueryCommand";
10+
export * from "./ScanCommand";
11+
export * from "./TransactGetCommand";
12+
export * from "./TransactWriteCommand";
13+
export * from "./UpdateCommand";

lib/lib-dynamodb/src/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
export * from "./commands/BatchExecuteStatementCommand";
2-
export * from "./commands/BatchGetCommand";
3-
export * from "./commands/BatchWriteCommand";
4-
export * from "./DynamoDBDocumentClient";
5-
export * from "./commands/DeleteCommand";
61
export * from "./DynamoDBDocument";
7-
export * from "./commands/ExecuteStatementCommand";
8-
export * from "./commands/ExecuteTransactionCommand";
9-
export * from "./commands/GetCommand";
10-
export * from "./commands/PutCommand";
11-
export * from "./commands/QueryCommand";
12-
export * from "./commands/ScanCommand";
13-
export * from "./commands/TransactGetCommand";
14-
export * from "./commands/TransactWriteCommand";
15-
export * from "./commands/UpdateCommand";
2+
export * from "./DynamoDBDocumentClient";
3+
export * from "./commands";

0 commit comments

Comments
 (0)