Skip to content

Commit

Permalink
feat(type-safe-api): websocket apis for typescript (#731)
Browse files Browse the repository at this point in the history
Add a new `TypeSafeWebSocketApiProject` which can be used to build WebSocket APIs in a similar
manner to REST APIs.

This includes:

* Modelling an API in Smithy or OpenAPI
* Generated CDK infrastructure (WebSocket API and Lambda functions)
* Generated runtimes containing lambda handler wrappers, and server SDK to send messages to clients
* Generated handler stubs with the `@handler` trait
* Generated client and react hooks libraries for use client side
* Integration with infrastructure and website projects
* WebSocket API explorer
* WebSocket API CDK construct with validation schemas as custom resource to scale for larger apis

Only TypeScript is supported currently, but refactoring work has been done to make Python and Java
support more straightforward.

Note the new Java project in `internal/smithy-async-transformer` - this allows us to perform a
transform on users' Smithy models to augment operations with additional traits required for OpenAPI
generation.
  • Loading branch information
cogwirrel authored Mar 27, 2024
1 parent 8eccfac commit 9f34193
Show file tree
Hide file tree
Showing 261 changed files with 97,249 additions and 4,096 deletions.
9 changes: 8 additions & 1 deletion .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CloudscapeReactTsWebsiteProject } from "./projenrc/projects/cloudscape-
import { DocsProject } from "./projenrc/projects/docs-project";
import { IdentityProject } from "./projenrc/projects/identity-project";
import { InfrastructureProject } from "./projenrc/projects/infrastructure-project";
import { SmithyAsyncTransformerProject } from "./projenrc/projects/internal/smithy-async-transformer";
import { MonorepoProject } from "./projenrc/projects/monorepo-project";
import { PDKMonorepoProject } from "./projenrc/projects/pdk-monorepo-project";
import { PDKNagProject } from "./projenrc/projects/pdk-nag-project";
Expand All @@ -21,6 +22,9 @@ const monorepoProject = new PDKMonorepoProject();

new PDKNagProject(monorepoProject);

// internal packages
new SmithyAsyncTransformerProject(monorepoProject);

// public packages
new MonorepoProject(monorepoProject);
new StaticWebsiteProject(monorepoProject);
Expand Down
11 changes: 11 additions & 0 deletions internal/smithy-async-transformer/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions internal/smithy-async-transformer/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions internal/smithy-async-transformer/.projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions internal/smithy-async-transformer/.projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions internal/smithy-async-transformer/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f34193

Please sign in to comment.