Skip to content

Commit c64f5eb

Browse files
committed
Added comment for gradle tasks, removed license.txt, modified read.me, added ts example to smithy-templates.json
1 parent 03ae9a2 commit c64f5eb

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

smithy-templates.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@
151151
".gitignore",
152152
".gitattributes"
153153
]
154+
},
155+
"smithy-typescript-quickstart": {
156+
"documentation": "Quickstart example for Smithy TypeScript",
157+
"path": "smithy-typescript-examples/quickstart-typescript",
158+
"include": [
159+
"config/",
160+
"gradle/",
161+
"gradlew",
162+
"gradlew.bat",
163+
".gitignore",
164+
".gitattributes"
165+
]
154166
}
155167
}
156168
}

smithy-typescript-examples/quickstart-typescript/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Smithy-Typescript Quickstart
22

3-
This project provides a template to get started using [Smithy Typescript](https://github.com/smithy-lang/smithy-typescript/)
3+
This project provides a template to get started using [Smithy TypeScript](https://github.com/smithy-lang/smithy-typescript/)
44
to create Typescript clients and servers.
55

66
For more information on this example, see the [Smithy Typescript Quickstart Guide](https://smithy.io/2.0/typescript/quickstart.html).
7-
w
7+
88
### Layout
99

1010
- `client/`: Code generated client that can call the server.
@@ -26,15 +26,15 @@ To run and test the server, navigate to the `server` directory and run the follo
2626
```console
2727
yarn setup && yarn start
2828
```
29-
That will start the server running on port `8888`.
29+
This command will start the server on port `8888`.
3030

31-
Once the server is running you can call the server using `curl`
31+
Once the server is running, you may call the server using `curl`:
3232

3333
```console
3434
curl -H "content-type: application/json" -d '{"coffeeType": "LATTE"}' -X POST localhost:8888/order
3535
```
3636

37-
or by running the client application in the `client` directory
37+
or, by running the client application in the `client` directory:
3838

3939
```console
4040
yarn setup && yarn start

smithy-typescript-examples/quickstart-typescript/build.gradle.kts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ allprojects {
66
mavenCentral()
77
}
88
}
9+
// Add gradle tasks
10+
// Custom clean task to remove all build artifacts and dependencies
11+
tasks.register<Delete>("clean") {
12+
delete(
13+
"server/node_modules",
14+
"server/dist",
15+
"server/ssdk",
16+
"client/node_modules",
17+
"client/sdk",
18+
)
19+
}
20+
21+
922

10-
tasks{
11-
register("clean"){
12-
exec{
13-
commandLine("bash", "-c", "rm -rf */build */dist */node_modules client/sdk server/ssdk")
14-
}
15-
}
16-
}

smithy-typescript-examples/quickstart-typescript/client/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function main() {
3232

3333
// Get the order again.
3434
const getResponse2 = await client.getOrder(getRequest);
35-
console.log("Completed Order:", getResponse2);
35+
console.log(`Completed Order:{id:${getResponse2["id"]}, coffeeType:${getResponse2["coffeeType"]}, status:${getResponse2["status"]}}`);
3636
} catch (error) {
3737
console.error("An error occurred:", error);
3838
}

smithy-typescript-examples/quickstart-typescript/license.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)