Skip to content

Commit

Permalink
temp: update readme except everything after overview
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Yuan committed Nov 6, 2023
1 parent 564e6ef commit d2bf143
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,19 @@
# <img alt="Smithy" src="https://github.com/smithy-lang/smithy/blob/main/docs/_static/favicon.png?raw=true" width="28"> Smithy Go

> **WARNING: All interfaces are subject to change.**
> **WARNING: All interfaces and supported Go versions are subject to change.**
[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml)

`smithy-go` includes the reference implementations of the [Smithy](https://smithy.io/) code generators for [Go](https://go.dev/).

## Can I use this?
For Client SDK code generation, the `go-client-codegen` plugin provides a framework for generating extensible Go clients. See [the section on generating a client to see how to get started](#generating-a-client), or [the `go-client-codegen` documentation](#client-sdk-code-generation-go-client-codegen-plugin).

In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java),
such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html),
in order to generate transport mechanisms and serialization/deserialization
code ("serde") accordingly.
> Note: The minimum Go version supported is Go 1.19.
The code generator does not currently support any protocols out of the box,
therefore the useability of this project on its own is currently limited.
Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html)
exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are
tracking the movement of those out of the SDK into smithy-go in
[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no
timeline for doing so.

## License

This project is licensed under the Apache-2.0 License.
## Generating a client

TODO

# <img alt="Smithy" src="https://github.com/smithy-lang/smithy/blob/main/docs/_static/favicon.png?raw=true" width="28"> Smithy TypeScript

> **WARNING: Smithy TypeScript is currently in [Developer Preview](https://aws.amazon.com/blogs/devops/smithy-server-and-client-generator-for-typescript). All interfaces and supported JavaScript platforms are subject to change.**
`smithy-typescript` includes the reference implementations of the [Smithy](https://smithy.io/) code generators for [TypeScript](https://www.typescriptlang.org/).

For Client SDK code generation, the `typescript-client-codegen` plugin provides a framework for generating extensible TypeScript clients that can support multiple JavaScript platforms, including Node.js, Browser, and React-Native. See [the section on generating a client to see how to get started](#generating-a-client), or [the `typescript-client-codegen` documentation](#client-sdk-code-generation-typescript-client-codegen-plugin).

> Note: Node.js support includes versions >= 14, and is subject to change.
For Server SDK code generation, the `typescript-server-codegen` plugin provides a framework for generating server scaffolding at a higher level of abstraction and with type safety. More documentation can be found at in [the `typescript-server-codegen` documentation](#server-sdk-code-generation-typescript-server-codegen-plugin), or [smithy.io](https://smithy.io/2.0/ts-ssdk/index.html).

## Generating a client

The Smithy TypeScript `typescript-client-codegen` code generator in this repository generates TypeScript clients from Smithy models, and can be built with both the idiomatic [Smithy CLI](#using-smithy-typescript-with-the-smithy-cli) or through [Gradle](#using-smithy-typescript-with-gradle).

> The Smithy CLI is a prerequisite for this section when using the `smithy init` commands. See [the installation guide](https://smithy.io/2.0/guides/smithy-cli/cli_installation.html) for how to install the Smithy CLI. If installing the Smithy CLI is not preferred, the templates used can be found in the [Smithy Examples repository](https://github.com/smithy-lang/smithy-examples).
Expand Down Expand Up @@ -205,7 +178,7 @@ See [the Smithy documentation](https://smithy.io/2.0/guides/building-models/grad

By default, the Smithy TypeScript code generators provide the code generation framework to generate TypeScript artifacts (e.g. types, interfaces, implementations) of specified Smithy models. However there are implementations for code generation and TypeScript that either need to be implemented or consumed from third-party packages:

- Protocols: Protocols define how operation shapes (for clients and servers, these are usually inputs and outputs) are serialized and deserialized on the wire. This behavior can be defined in Smithy through [protocol traits](https://smithy.io/2.0/spec/protocol-traits.html) with corresponding implementations of [the `ProtocolGenerator` interface](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/ProtocolGenerator.java). For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, implements the [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) in the `software.amazon.smithy.typescript:smithy-aws-typescript-codegen` package. See [the section on protocol generator implementations for more details](#protocol-generator-implementations).
- Protocols: Protocols define how operation shapes (for clients and servers, these are usually inputs and outputs) are serialized and deserialized on the wire. This behavior can be defined in Smithy through [protocol traits](https://smithy.io/2.0/spec/protocol-traits.html) with corresponding implementations of [the `ProtocolGenerator` interface](codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java). For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, implements the [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) in the `software.amazon.smithy.typescript:smithy-aws-typescript-codegen` package. There is [an open issue](https://github.com/aws/smithy-go/issues/458) tracking the movement of these AWS protocols implementations out of the SDK into smithy-go, but there is no currently no timeline fod doing so. See [the section on protocol generator implementations for more details](#protocol-generator-implementations).
- Publishing: There is no idiomatic utility to publish generated artifacts since package distribution can vary depending on different technical requirements. For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, has custom tooling to manage versioning, change logs, and publishing in a monorepo. See [the section on publishing client packages for more details](#publishing-a-client-sdk-package).
- Endpoint resolution (clients): Endpoint resolution is not implemented by default due to a variety of different implementations. In most cases, providing a default provider in the runtime config for the client config `endpoint` property should suffice. More complex use cases include [the `@smithy.rules#endpointRuleSet` trait](https://smithy.io/2.0/additional-specs/rules-engine/specification.html#smithy-rules-endpointruleset-trait) which provides [a complete DSL for endpoint resolution](https://smithy.io/2.0/additional-specs/rules-engine/index.html). See [the section on handling endpoint resolution for more details](#handling-endpoint-resolution).
- Operation handler implementations (servers): The server code generator provides the scaffolding for operations. The operation handlers defining the business logic of the Smithy service need to be implemented manually.
Expand Down

0 comments on commit d2bf143

Please sign in to comment.