Skip to content

Update default package description based on artifact type #582

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

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

AndrewFossAWS
Copy link
Contributor

@AndrewFossAWS AndrewFossAWS commented Aug 17, 2022

Description of changes:
Update default package.json description based on artifact type

For example if the package name is ExamplePackage, the following package description can be:

  • Client -> ExamplePackage client
  • SSDK -> ExamplePackage server

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AndrewFossAWS AndrewFossAWS requested a review from a team as a code owner August 17, 2022 22:24
@AndrewFossAWS AndrewFossAWS changed the title Update default package description base on artifact type Update default package description based on artifact type Aug 17, 2022
@@ -110,6 +110,20 @@ public static TypeScriptSettings from(Model model, ObjectNode config, ArtifactTy
return settings;
}

private String getDefaultDescription() {
String defaultDescription = getPackageName();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is no longer coming from settings or further up to config, are we sure it's correct? I don't see a test change to know for sure.

Copy link
Contributor Author

@AndrewFossAWS AndrewFossAWS Aug 18, 2022

Choose a reason for hiding this comment

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

Based on the current code, the package name is currently passed in via PluginContext.getSettings() in CodegenVisitor.

I also verified the change by generating the server code in the Smithy TS SSDK Demo repo and seeing server in the description in package.json

Copy link
Contributor

Choose a reason for hiding this comment

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

line 93 sets the packageName on settings from config, and getDefaultDescription instance method is actually picking up that value, so @kstich I think it is what you expected. But to Kevin's point, you can add tests that assert the behavior for client and server cases.

@AndrewFossAWS AndrewFossAWS merged commit 41e6c0c into main Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants