Skip to content

Commit

Permalink
feat(docs): update docs (#512)
Browse files Browse the repository at this point in the history
feat(docs): update docs

Updates the Wing docs. See details in [workflow run].

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

------

*Automatically created via the "update-docs" workflow*
  • Loading branch information
monadabot authored Jul 6, 2023
1 parent c5251e8 commit e1d5a93
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ wing --version
This extension adds syntax highlighting and other conveniences for the Wing language in [VSCode]. You don't *have*
to use it, but it's great. It's available through the VSCode Marketplace [here](https://marketplace.visualstudio.com/items?itemName=Monada.vscode-wing).

## Wing Console

The Wing Console is a web application that provides a developer-friendly interface for viewing, exploring, and interacting with your Wing applications running on the local cloud simulator.

The Wing Console is included as part of the Wing CLI package. There is no need to install it separately. Once the Wing CLI is successfully installed, you can directly access the Wing Console and begin utilizing its features.

[AWS account]: https://portal.aws.amazon.com/billing/signup
[AWS CLI]: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
[AWS credentials]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Expand Down
7 changes: 0 additions & 7 deletions versioned_docs/version-latest/01-start-here/04-run-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ The Wing Console is a web application that provides a developer-friendly interfa

## Opening your app in the console

:::info

Make sure you have [installed](./installation#wing-console) the Wing Console on your system
before getting started with this step.

:::

Use the Wing CLI to start the console with our newly created Wing source file:

```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ description: "Wing's two execution phases: preflight and inflight"
keywords: [Inflights, Inflight functions, Preflight, Preflight code]
---

Wing has two execution phases:
One of the main differences between Wing and other languages is that it unifies both infrastructure definitions and application logic under the same programming model.
This is enabled by the concepts of the *preflight* and *inflight* execution phases:

- **preflight**: code that runs once, at compile time, to generate the infrastructure configuration of your cloud application. For example, setting up databases, queues, storage buckets, API endpoints, etc.
- **inflight**: code that runs at runtime to perform your application logic. For example, handling API requests, processing queue messages, etc. Inflight code can be executed on compute platforms in the cloud, such as function services (lambda), containers, VMs or physical servers.

One of the main differences between Wing and other languages is that it unifies both execution phases under the same programming model, through the concepts of preflight code and inflight code.
- **Preflight**: Code that runs once, at compile time, and generates the infrastructure configuration of your cloud application. For example, setting up databases, queues, storage buckets, API endpoints, etc.
- **Inflight**: Code that runs at runtime and implements your application's behavior. For example, handling API requests, processing queue messages, etc. Inflight code can be executed on various compute platforms in the cloud, such as function services (such as AWS Lambda or Azure Functions), containers (such as ECS or Kubernetes), VMs or even physical servers.

## Preflight code

Preflight code is code that runs once, at compile time, to generate the app's infrastructure configuration.
Your preflight code runs once, at compile time, and defines your application's infrastructure configuration. This configuration is then consumed by an infrastructure provisioning engine such as Terraform, CloudFormation, Pulumi or Kubernetes.

For example, this code snippet defines a storage bucket using a class from the standard library:

Expand Down
11 changes: 10 additions & 1 deletion versioned_docs/version-latest/02-concepts/03-compile-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,13 @@ if util.env("WING_TARGET") == "sim" {
}
```

In this example, we're creating a verbose logger service only when the `WING_TARGET` environment variable is set to "sim". The `onStart` function of this service lists the files in the bucket and logs them every 10 seconds.
In this example, we're creating a verbose logger service only when the `WING_TARGET` environment variable is set to "sim". The `onStart` function of this service lists the files in the bucket and logs them every 10 seconds.

## Compiler plugins

Compiler plugins serve to extend the capabilities of the Wing compiler. They offer customization for the compilation output, such as infrastructure definitions. For instance, a compiler plugin can be employed to enforce a specific tagging convention on all resources within the resulting infrastructure.

Learn more about compiler plugins [here](https://www.winglang.io/docs/tools/compiler-plugins)



Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ The AWS implementation of `cloud.Api` uses [Amazon API Gateway](https://aws.amaz
## API Reference
The full list of APIs for `cloud.Api` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Api` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ The Google Cloud implementation of `cloud.Bucket` uses [Google Cloud Storage](ht

## API Reference

The full list of APIs for `cloud.Bucket` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Bucket` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ The AWS implementation of `cloud.Counter` uses [Amazon DynamoDB](https://aws.ama

## API Reference

The full list of APIs for `cloud.Counter` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Counter` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ The Azure implementation of `cloud.Function` uses [Azure Function](https://azure

## API Reference

The full list of APIs for `cloud.Function` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Function` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ The AWS implementation of `cloud.Queue` uses [Amazon Simple Queue Service](https

## API Reference

The full list of APIs for `cloud.Queue` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Queue` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ See [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/).

## API Reference

The full list of APIs for `cloud.Schedule` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Schedule` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ See [AWS documentation](https://docs.aws.amazon.com/secretsmanager/latest/usergu

## API Reference

The full list of APIs for `cloud.Secret` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Secret` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ Within the context of the simulator, services are just spawned processes ran wit

## API Reference

The full list of APIs for `cloud.Service` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Service` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ AWS implementations of `cloud.Topic` use [AWS SNS](https://docs.aws.amazon.com/s

## API Reference

The full list of APIs for `cloud.Topic` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Topic` is available in the [API Reference](./api-reference).
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ AWS implementations of `cloud.Website` uses [Amazon S3](https://aws.amazon.com/s

## API Reference

The full list of APIs for `cloud.Website` is available in the [API Reference](../api-reference).
The full list of APIs for `cloud.Website` is available in the [API Reference](./api-reference).
7 changes: 4 additions & 3 deletions versioned_docs/version-latest/06-tools/01-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $ wing <command> <options>
## Run: `wing run` / `wing it`

You can use the `run` command (or `it`) when you want to interact with your Wing program in the
[Wing Console](/start-here/local).
[Wing Console](/docs/start-here/local).

Usage:

Expand Down Expand Up @@ -70,7 +70,7 @@ $ wing compile --target sim ENTRYPOINT.w

The output will be under `target/ENTRYPOINT.wsim` and can be opened in one two ways:

* Interactively using [Wing Console](/start-here/local) using `wing it target/hello.wsim`.
* Interactively using [Wing Console](/docs/start-here/local) using `wing it target/hello.wsim`.


### `tf-aws` Target
Expand All @@ -86,7 +86,8 @@ $ wing compile --target tf-aws ENTRYPOINT.w
The output includes both a Terraform configuration file (under `target/cdktf.out/stacks/root`) and
JavaScript bundles that include inflight code that executes on compute platform such as AWS Lambda.

You can deploy your stack to AWS using Terraform ([instructions](/start-here/aws)).
You can deploy your stack to AWS using Terraform ([instructions](/docs/start-here/aws)).



### `tf-azure` Target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import FileCodeBlock from './FileCodeBlock';
import helloWPath from '!file-loader!../examples/function-upload-to-bucket/wing/hello.w';

import getExamplePlatforms from '../examples/getExamplePlatforms';
import getExampleWingFile from '../examples/getExampleWingFile';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

// Also js files are js.txt files until we find a way to make Docusaurus not minify them

import pulumiIndexPath from '!file-loader!./pulumi/index.js.txt';
import pulumiMainPath from '!file-loader!./pulumi/main.ts';
import pulumiPulumiPath from '!file-loader!./pulumi/pulumi.yaml';

import pulumiIndexPath from '!file-loader?outputPath=docs!./pulumi/index.js.txt';
import pulumiMainPath from '!file-loader?outputPath=docs!./pulumi/main.ts';
import pulumiPulumiPath from '!file-loader?outputPath=docs!./pulumi/pulumi.yaml';
import terraformIndexPath from '!file-loader!./terraform/index.js.txt';
import terraformMainPath from '!file-loader!./terraform/main.tf';

import terraformIndexPath from '!file-loader?outputPath=docs!./terraform/index.js.txt';
import cdkHelloPath from '!file-loader!./aws-cdk/hello.js.txt';
import cdkIndexPath from '!file-loader!./aws-cdk/index.js.txt';

import terraformMainPath from '!file-loader?outputPath=docs!./terraform/main.tf';
import cdktfIndexPath from '!file-loader!./cdktf/index.js.txt';
import cdktfMainPath from '!file-loader!./cdktf/main.ts';

import cdkHelloPath from '!file-loader?outputPath=docs!./aws-cdk/hello.js.txt';
import cdkIndexPath from '!file-loader?outputPath=docs!./aws-cdk/index.js.txt';

import cdktfIndexPath from '!file-loader?outputPath=docs!./cdktf/index.js.txt';
import cdktfMainPath from '!file-loader?outputPath=docs!./cdktf/main.ts';

import cloudformationIndexPath from '!file-loader?outputPath=docs!./cloudformation/index.js.txt';
import cloudformationTemplatePath from '!file-loader?outputPath=docs!./cloudformation/template.yaml';
import cloudformationIndexPath from '!file-loader!./cloudformation/index.js.txt';
import cloudformationTemplatePath from '!file-loader!./cloudformation/template.yaml';

const allPlatforms = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// We cannot parse the folder structure at runtime because of Docusaurus and webpack limitations

import wingHelloPath from '!file-loader?outputPath=docs!./wing/hello.w';
import wingHelloPath from '!file-loader!./wing/hello.w';

export default { name: "hello.js", path: wingHelloPath };

1 comment on commit e1d5a93

@vercel
Copy link

@vercel vercel bot commented on e1d5a93 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.