winglang / winglang/wing

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

Open
#320 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🎨 sdk 👷‍♀️ contributor-experience 📚 documentation good first issue
Dominant language
TypeScript
Stars
5.4k
Forks
215
Avg merge
2h 9m
Merged PRs (30d)
27

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/wing-api-checker/src/index.ts, following the existing jsii-reflect checks for missing docstring information. Compare the traversal with the @inflight example in libs/wingsdk/src/sim/bucket.ts and verify superclass handling. Done means the checker reports Resource classes lacking an inherited or local @inflight annotation without flagging compliant classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.