winglang/wing

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

Open

#320 aperta il 24 ott 2022

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)TypeScript (214 fork)github user discovery
good first issue🎨 sdk👷‍♀️ contributor-experience📚 documentation

Metriche repository

Star
 (5385 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor