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/10881267657

------

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

Signed-off-by: monabot <[email protected]>
  • Loading branch information
monadabot committed Sep 16, 2024
1 parent f8d090b commit fa62967
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the aws module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the expect module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the fs module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the http module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the math module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the sim module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
label: ui
collapsible: true
collapsed: true
link:
type: generated-index
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the ui module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
57 changes: 57 additions & 0 deletions api_versioned_docs/version-latest/04-standard-library/ui/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "ui module"
id: ui
---

The `ui` module lets you create tools for interacting with resources in the Wing Console.

Using components like `ui.Button`, `ui.Field`, or `ui.Table`, it's possible to trigger actions in Wing apps or display important information to the user.

Here's an example of a class which has a button and field showing the internal state of the resource:

```js playground example
bring cloud;
bring ui;

class WidgetService {
data: cloud.Bucket;
counter: cloud.Counter;
new() {
this.data = new cloud.Bucket();
this.counter = new cloud.Counter();

// a button lets you invoke any inflight function
new ui.Button("Add widget", inflight () => { this.addWidget(); });

// a field displays a labeled value
new ui.Field(
"Total widgets",
inflight () => { return this.countWidgets(); },
refreshRate: 5s,
);
}

inflight addWidget() {
let id = this.counter.inc();
this.data.put("widget-{id}", "my data");
}

inflight countWidgets(): str {
return "{this.data.list().length}";
}
}

new WidgetService();
```

Here is what the UI looks like in the Wing Console:

![](./widget-service-example.png)

---

```mdx-code-block
import DocCardList from '@theme/DocCardList';
<DocCardList />
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: API reference
title: API Reference
id: api-reference
description: Wing standard library API reference for the util module
keywords: [Wing sdk, sdk, Wing API Reference]
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-latest/04-winglibs/04-toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ keywords: [winglib, Wing library]
| [Wing simulator utils](/docs/winglibs/winglibs/simtools) | [@winglibs/simtools](/docs/winglibs/winglibs/simtools) | v0.0.6 | '[Wing simulator](https://www.winglang.io/docs/platforms/sim) utility library' | [sim](/docs/platforms/sim) |
| [Slack](/docs/winglibs/winglibs/slack) | [@winglibs/slack](/docs/winglibs/winglibs/slack) | v0.1.5 | A Wing library for working with [Slack](https://slack.com/) | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Amazon SNS](/docs/winglibs/winglibs/sns) | [@winglibs/sns](/docs/winglibs/winglibs/sns) | v0.1.7 | A Wing library for working with [Amazon SNS](https://aws.amazon.com/sns/) | [tf-aws](/docs/platforms/AWS/tf-aws), [awscdk](/docs/platforms/AWS/awscdk), [sim](/docs/platforms/sim) |
| [Terraform utilities](/docs/winglibs/winglibs/tf) | [@winglibs/tf](/docs/winglibs/winglibs/tf) | v0.0.9 | Terraform utilities library for Wing | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [Terraform utilities](/docs/winglibs/winglibs/tf) | [@winglibs/tf](/docs/winglibs/winglibs/tf) | v0.1.0 | Terraform utilities library for Wing | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [tsoa](/docs/winglibs/winglibs/tsoa) | [@winglibs/tsoa](/docs/winglibs/winglibs/tsoa) | v0.1.16 | A Wing library for working with [TSOA](https://tsoa-community.github.io/docs/) - An OpenAPI-compliant Web APIs using TypeScript. | [sim](/docs/platforms/sim) |
| [Vite](/docs/winglibs/winglibs/vite) | [@winglibs/vite](/docs/winglibs/winglibs/vite) | v0.2.5 | A Wing library to deploy [Vite applications](https://vitejs.dev/) to the cloud. | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws) |
| [WebSocket](/docs/winglibs/winglibs/websockets) | [@winglibs/websockets](/docs/winglibs/winglibs/websockets) | v0.3.13 | A Wing library that enables you to create WebSockets using Wing. | [sim](/docs/platforms/sim), [tf-aws](/docs/platforms/AWS/tf-aws), [awscdk](/docs/platforms/AWS/awscdk) |
Expand Down
15 changes: 12 additions & 3 deletions versioned_docs/version-latest/04-winglibs/05-winglibs/tf.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ Represents an arbitrary Terraform resource.

> `tf.Resource` can only be used when compiling your Wing program to a `tf-*` target.
It takes a `type` and `attributes` properties:
It takes a `terraformResourceType` and `attributes` properties, as well as all the properties of the `TerraformResource`
class from CDKTF.

```js
bring tf;

let role = new tf.Resource({
type: "aws_iam_role",
terraformResourceType: "aws_iam_role",
attributes: {
inline_policy: {
name: "lambda-invoke",
Expand Down Expand Up @@ -364,7 +365,15 @@ new(config: Json): Element
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code>attributes</code> | <code>Json?</code> | *No description* |
| <code>type</code> | <code>str</code> | *No description* |
| <code>connection</code> | <code>any?</code> | *No description* |
| <code>count</code> | <code>any?</code> | *No description* |
| <code>dependsOn</code> | <code>Array<ITerraformDependable>?</code> | *No description* |
| <code>forEach</code> | <code>ITerraformIterator?</code> | *No description* |
| <code>lifecycle</code> | <code>TerraformResourceLifecycle?</code> | *No description* |
| <code>provider</code> | <code>TerraformProvider?</code> | *No description* |
| <code>provisioners</code> | <code>Array<any>?</code> | *No description* |
| <code>terraformGeneratorMetadata</code> | <code>TerraformProviderGeneratorMetadata?</code> | *No description* |
| <code>terraformResourceType</code> | <code>str</code> | *No description* |
### ProviderProps (struct) <a class="wing-docs-anchor" id="@winglibs/tf.ProviderProps"></a>
Expand Down

0 comments on commit fa62967

Please sign in to comment.