Skip to content

Commit

Permalink
feat(docs): update docs
Browse files Browse the repository at this point in the history
Updates the Wing docs. See details in [workflow run].

[Workflow Run]: https://github.com/winglang/docsite/actions/runs/12048496740

------

*Automatically created via the "update-docs" workflow*

Signed-off-by: monabot <[email protected]>
  • Loading branch information
monadabot committed Nov 27, 2024
1 parent 8776634 commit 95cf9a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion typescript_versioned_docs/version-latest/00-index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TypeScript For Wing
id: 'intro'
id: intro
---

Wing's CLI has experimental support for TypeScript.
Expand Down
38 changes: 0 additions & 38 deletions versioned_docs/version-latest/01-start-here/02-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,6 @@ queue.setConsumer(inflight (message: str) => {
});
```

<!-- :::info
<details>
<summary>Experimental TypeScript Support</summary>
If you'd like to use TypeScript instead of winglang, you can add the `--language ts` flag when creating a new project:
```sh
wing new empty --language ts
```
Then modify `main.ts` to have the following, equivalent to the above winglang code:
```ts
import { main, cloud, lift } from "@wingcloud/framework";
main((root) => {
const bucket = new cloud.Bucket(root, "Bucket");
const counter = new cloud.Counter(root, "Counter");
const queue = new cloud.Queue(root, "Queue");
queue.setConsumer(
lift({ bucket, counter }).inflight(async ({ bucket, counter }, message) => {
const index = await counter.inc();
await bucket.put(`wing-${index}.txt`, `Hello, ${message}`);
console.log(`file wing-${index}.txt created`);
})
);
});
```
The rest of the starting guide will be the same!
See [here](../09-typescript/index.md) for more information on using TypeScript with Wing.
</details>
::: -->

Here we defined a queue and a counter. Every time a message is added to the queue, a handler is triggered and creates a file named `wing-{counter-index}.txt` with the content `"Hello, {message}!"`, and the counter is incremented by 1.

Now that we've written this program, let's run and test it using the **Wing Console**.

0 comments on commit 95cf9a2

Please sign in to comment.