Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename .rn to .native #146

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ String getTemplateFileName() {
REACT_NATIVE {
@Override
String getTemplateFileName() {
return "runtimeConfig.rn.ts.template";
return "runtimeConfig.native.ts.template";
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void writePackageJson(
.withMember("./runtimeConfig", "./runtimeConfig.browser"));
// Add the ReactNative hook.
node = node.withMember("react-native", Node.objectNode()
.withMember("./runtimeConfig", "./runtimeConfig.rn"));
.withMember("./runtimeConfig", "./runtimeConfig.native"));

// Expand template parameters.
String template = Node.prettyPrintJson(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum TypeScriptDependency implements SymbolDependencyContainer {

AWS_SDK_STREAM_COLLECTOR_NODE("dependencies", "@aws-sdk/stream-collector-node", "^1.0.0-alpha.1", true),
AWS_SDK_STREAM_COLLECTOR_BROWSER("dependencies", "@aws-sdk/stream-collector-browser", "^1.0.0-alpha.1", true),
AWS_SDK_STREAM_COLLECTOR_RN("dependencies", "@aws-sdk/stream-collector-rn", "^1.0.0-alpha.0", true),
AWS_SDK_STREAM_COLLECTOR_RN("dependencies", "@aws-sdk/stream-collector-native", "^1.0.0-alpha.0", true),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're preferring .native vs .rn extensions we should also move from -rn to -native package names.

Similar to .browser extension and -browser package name

Copy link
Contributor Author

@trivikr trivikr Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant commit for updating package names in codegen aws/aws-sdk-js-v3@bb1e16b (part of PR aws/aws-sdk-js-v3#1025)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not apposing to it, but I don't think it's necessary either.🙂


AWS_SDK_URL_PARSER_BROWSER("dependencies", "@aws-sdk/url-parser-browser", "^1.0.0-alpha.1", true),
AWS_SDK_URL_PARSER_NODE("dependencies", "@aws-sdk/url-parser-node", "^1.0.0-alpha.1", true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"./runtimeConfig": "./runtimeConfig.browser"
},
"react-native": {
"./runtimeConfig": "./runtimeConfig.rn"
"./runtimeConfig": "./runtimeConfig.native"
},
"sideEffects": false,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FetchHttpHandler } from "@aws-sdk/fetch-http-handler";
import { Sha256 } from "@aws-crypto/sha256-js";
import { streamCollector } from "@aws-sdk/stream-collector-rn";
import { streamCollector } from "@aws-sdk/stream-collector-native";
import { parseUrl } from "@aws-sdk/url-parser-node";
import { name, version } from "./package.json";
import { ClientDefaults } from "${clientModuleName}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void addRuntimeConfigValues(

Assertions.assertTrue(manifest.hasFile("runtimeConfig.ts"));
Assertions.assertTrue(manifest.hasFile("runtimeConfig.browser.ts"));
Assertions.assertTrue(manifest.hasFile("runtimeConfig.rn.ts"));
Assertions.assertTrue(manifest.hasFile("runtimeConfig.native.ts"));
Assertions.assertTrue(manifest.hasFile("runtimeConfig.shared.ts"));

// Does the runtimeConfig.shared.ts file expand the template properties properly?
Expand All @@ -71,11 +71,11 @@ public void addRuntimeConfigValues(
containsString("import { ClientDefaults } from \"./ExampleClient\";"));
assertThat(runtimeConfigContents, containsString("syn: 'ack',"));

// Does the runtimeConfig.rn.ts file expand the browser template properties properly?
String runtimeConfigRNContents = manifest.getFileString("runtimeConfig.rn.ts").get();
assertThat(runtimeConfigRNContents,
// Does the runtimeConfig.native.ts file expand the browser template properties properly?
String runtimeConfigNativeContents = manifest.getFileString("runtimeConfig.native.ts").get();
assertThat(runtimeConfigNativeContents,
containsString("import { ClientDefaults } from \"./ExampleClient\";"));
assertThat(runtimeConfigRNContents,
assertThat(runtimeConfigNativeContents,
containsString("import { ClientDefaultValues as BrowserDefaults } from \"./runtimeConfig.browser\";"));
assertThat(runtimeConfigContents, containsString("syn: 'ack',"));
}
Expand Down