-
Notifications
You must be signed in to change notification settings - Fork 104
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
Conversation
@@ -110,6 +110,20 @@ public static TypeScriptSettings from(Model model, ObjectNode config, ArtifactTy | |||
return settings; | |||
} | |||
|
|||
private String getDefaultDescription() { | |||
String defaultDescription = getPackageName(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Description of changes:
Update default
package.json
description based on artifact typeFor example if the package name is
ExamplePackage
, the following package description can be:ExamplePackage client
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.