winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.6k stars 180 forks source link

chore(docs): update typescript example and fix typo #6401

Closed NathanTarbert closed 2 weeks ago

NathanTarbert commented 2 weeks ago

in this example in the TypeScript docs under "Permissions" I get an error unless the keyword "new" is included in front of the cloud.Function

There was also a typo in the same doc.

import { main, cloud, lift } from "@wingcloud/framework";

main((root) => {
  const bucket = new cloud.Bucket(root, "MyBucket");

  new cloud.Function(
    root,
    "MyFn",
    lift({ bucket })
      .grant({ bucket: ["get"] })
      .inflight(async ({ bucket }) => {
        await bucket.put("hello.txt", "Wing!");
        //           ^^^ Type error, no `put` permissions!
        return "Wing!";
      })
  );
});

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

github-actions[bot] commented 2 weeks ago

Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistence, don't hesitate to ping the relevant owner over Slack.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon
mergify[bot] commented 2 weeks ago

Thanks for contributing, @NathanTarbert! This PR will now be added to the merge queue, or immediately merged if NathanTarbert-patch-1 is up-to-date with main and the queue is empty.

monadabot commented 2 weeks ago

Congrats! :rocket: This was released in Wing 0.73.20.