-
Notifications
You must be signed in to change notification settings - Fork 105
Merge ssdk into main #315
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
Merge ssdk into main #315
Conversation
This adds the ability to disable generating clients. This is useful if the customer only wants to generate types for shapes, and will enable generating a server only.
This adds methods to the ProtocolGenerator interface to enable generating serializers for responses and deserializers for requests. Making these separate methods allows the CodegenVisitor to make sure everything that needs to get called gets called.
This adds support for error serialization. A new interface was needed to write error headers specifically. This also fixes an issue where the response serializers were looking at the wrong http bindings.
HttpRequest implements Endpoint, it does not contain one as a member.
I don't think response serialization will need to know about the endpoint, but I'm keeping the serializer context around in case it is useful in the future.
These might not actually work as-is, this will need to be verified. In the meantime it at leasts unblocks generation.
The serde functions were not being exported, and their names were aggressively protocol-specific. This re-exports the protocol-specific serde module under its own name, so that the functions themselves do not have to have the protocol name.
This adds an empty enpoint to response serialization. It should never be used, hopefully. It may be better to replace this with as assertions later on.
* Make the order for framework errors stable * Generate convenience types for operation errors It's distinctly unpleasant to throw a constructed object that has to include matching values of name, $fault, etc to an interface. This generates convenience classes for services that allow errors to be thrown in a more user-friendly fashion.
This lets service developers choose between a single lambda function per operation, or one lambda function that handles all operations, depending on their preferences.
This adds the typescript libraries needed to support the SSDK as well as the library that provides apigateway support.
This updates the node dependencies for the ssdk libs to node 14, which is the most recent version supported by Lambda.
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.
You gonna squash some/all of these?
Was not planning to squash, but I suppose we could. I'm 0 on it so vote here with reactions |
This makes it much friendlier with IDEs, both in terms of finding jest symbols and running tests from within the IDE. tsconfig.cjs.json is not what a TypeScript language service looks for by default, and we aren't bailed out by its presence in a parent workspace since these are standalone libraries.
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.
TypeScript part looks good to me, just have a view feedbacks/questions
...pescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenVisitor.java
Outdated
Show resolved
Hide resolved
if (settings.generateClient()) { | ||
// For now these are only generated for clients. | ||
// TODO: generate ssdk config |
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.
Since client and server SDK's plugins are divergent, why not adding a flag like isServerSdkIntegration
into the TypeScriptIntegration
interface or extend to a new interface like TypeScriptServerIntegration
? Then 2 different codegen plugins can be applied separately.
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.
Something like that would be a great idea. I've got a PR that splits client/server up further where we could add something like that: #314
...-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerCommandGenerator.java
Show resolved
Hide resolved
...-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerCommandGenerator.java
Outdated
Show resolved
Hide resolved
smithy-typescript-ssdk-libs/server-common/src/httpbinding/mux.ts
Outdated
Show resolved
Hide resolved
smithy-typescript-ssdk-libs/server-apigateway/tsconfig.cjs.json
Outdated
Show resolved
Hide resolved
...pt-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java
Outdated
Show resolved
Hide resolved
c14dce2
to
066d60f
Compare
This takes the contents of the ssdk branch and updates it with main so that we can merge all the ssdk changes into main.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.