Skip to content

Commit edcdf7a

Browse files
Chase Coalwellkstich
authored andcommitted
adds runtime config
1 parent e9226a4 commit edcdf7a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,12 @@ private void generateClientDefaults() {
232232
writer.writeDocs("The function that will be used to convert binary data to a UTF-8 encoded string");
233233
writer.write("utf8Encoder?: __Encoder;\n");
234234

235-
writer.writeDocs("The function that will be used to populate default value in 'User-Agent' header");
235+
writer.writeDocs("The string that will be used to populate default value in 'User-Agent' header");
236236
writer.write("defaultUserAgent?: string;\n");
237237

238+
writer.writeDocs("The runtime environment");
239+
writer.write("runtime?: string;\n");
240+
238241
// Write custom configuration dependencies.
239242
for (TypeScriptIntegration integration : integrations) {
240243
integration.addConfigInterfaceFields(settings, model, symbolProvider, writer);

smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export const ClientDefaultValues: Required<ClientDefaults> = {
2222
utf8Decoder: fromUtf8,
2323
utf8Encoder: toUtf8,
2424
defaultUserAgent: defaultUserAgent(name, version),
25+
runtime: "browser",
2526
${customizations}
2627
};

smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export const ClientDefaultValues: Required<ClientDefaults> = {
2222
utf8Decoder: fromUtf8,
2323
utf8Encoder: toUtf8,
2424
defaultUserAgent: defaultUserAgent(name, version),
25+
runtime: "node",
2526
${customizations}
2627
};

0 commit comments

Comments
 (0)