Skip to content

Commit de08d55

Browse files
authored
fix(codegen): export star from models_N (#1817)
1 parent 934fd27 commit de08d55

File tree

9 files changed

+12
-15
lines changed

9 files changed

+12
-15
lines changed

private/my-local-model-schema/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export * from "./commands";
1414
export * from "./schemas/schemas_0";
1515

1616
export * from "./models/errors";
17-
export type * from "./models/models_0";
17+
export * from "./models/models_0";
1818

1919
export { XYZServiceSyntheticServiceException } from "./models/XYZServiceSyntheticServiceException";

private/my-local-model/src/XYZServiceClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ export class XYZServiceClient extends __Client<
247247
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,
248248
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>
249249
new DefaultIdentityProviderConfig({
250-
"smithy.api#httpApiKeyAuth": config.apiKey,}),
250+
"smithy.api#httpApiKeyAuth": config.apiKey,
251+
}),
251252
})
252253
);
253254
this.middlewareStack.use(getHttpSigningPlugin(this.config));

private/my-local-model/src/endpoint/endpointResolver.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { ruleSet } from "./ruleset";
77

88
const cache = new EndpointCache({
99
size: 50,
10-
params: ["ApiKey",
11-
"endpoint"],
10+
params: ["ApiKey", "endpoint"],
1211
});
1312

1413
/**

private/my-local-model/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export type { XYZServiceExtensionConfiguration } from "./extensionConfiguration"
1313
export * from "./commands";
1414

1515
export * from "./models/errors";
16-
export type * from "./models/models_0";
16+
export * from "./models/models_0";
1717

1818
export { XYZServiceSyntheticServiceException } from "./models/XYZServiceSyntheticServiceException";

private/smithy-rpcv2-cbor-schema/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export * from "./schemas/schemas_0";
1010

1111
export * from "./models/enums";
1212
export * from "./models/errors";
13-
export type * from "./models/models_0";
13+
export * from "./models/models_0";
1414

1515
export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException";

private/smithy-rpcv2-cbor/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export * from "./commands";
99

1010
export * from "./models/enums";
1111
export * from "./models/errors";
12-
export type * from "./models/models_0";
12+
export * from "./models/models_0";
1313

1414
export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException";

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,11 @@ static TypeScriptWriter modelIndexer(Collection<Shape> shapes, SymbolProvider sy
566566

567567
for (Map.Entry<String, TreeSet<String>> entry : namespaceToShapes.entrySet()) {
568568
String namespace = entry.getKey();
569-
// todo: export symbols instead of * if switching
570-
// todo: to type+schema overload exports in the future.
571-
// TreeSet<String> types = entry.getValue();
572-
// String symbols = String.join(", ", types);
573-
569+
// server models have runtime components and should therefore be
570+
// exported as is, rather than types-only.
574571
writer.write(
575572
"""
576-
export type * from $S;""",
573+
export * from $S;""",
577574
namespace
578575
);
579576
}

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private static void identityProviderConfigProvider(TypeScriptWriter w, ClientBod
242242
}
243243
for (ConfigField configField : scheme.getConfigFields()) {
244244
if (configField.type().equals(ConfigField.Type.MAIN)) {
245-
w.writeInline("$S: config.$L,", scheme.getSchemeId().toString(), configField.name());
245+
w.write("$S: config.$L,", scheme.getSchemeId().toString(), configField.name());
246246
}
247247
}
248248
}

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void generateEndpointResolver() {
288288
ruleSetParameterFinder
289289
.getEffectiveParams()
290290
.stream()
291-
.collect(Collectors.joining("\",\n \"", "\"", "\""))
291+
.collect(Collectors.joining("\", \"", "\"", "\""))
292292
);
293293

294294
writer.writeDocs("@internal");

0 commit comments

Comments
 (0)