winglang/wing

wing-api-checker rule that every resource has an @inflight annotation

Open

#320 建立於 2022年10月24日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)TypeScript (214 fork)github user discovery
good first issue🎨 sdk👷‍♀️ contributor-experience📚 documentation

倉庫指標

Star
 (5,385 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

We'd like to update wing-api-checker to perform a check that if a class extends Resource then it (or one of its superclasses) has a docstring annotation for @inflight. This annotation is needed so that the Wing compiler can infer the type information of the inflight methods of the resource and associate it with the resource.

For example, here is one such annotation:

https://github.com/winglang/wing/blob/c07ec23a7179f5a6c56018ff83fdb8071e3d79a7/libs/wingsdk/src/sim/bucket.ts#L9-L13

The wing-api-checker uses jsii-reflect to traverse the type information of the SDK's APIs. There is limited documentation online for it, but you can take a look at the existing wing-api-checker code to see how its used to check for other missing docstring information: https://github.com/winglang/wing/blob/b8bcf153624e82c18499d98c521221e089e8d449/apps/wing-api-checker/src/index.ts#L59-L61

貢獻者指南