Lint the Wing SDK source code for invalid wing annotations
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
Summary
Compiler warning when JSII manifest has invalid wing annotations
Feature Spec
In the SDK, each resource has a preflight class and an inflight interface that get associated together to form the resource API in the Wing compiler. This association is made with a docstring annotation (as its a piece of metadata we can easily inspect using the .jsii manifest). See for example:
But since this is annotation, it's possible for it to contain an invalid value. If we could that the annotation is valid (and fail to import the library if it doesn't), then we could avoid bugs like this one: https://github.com/winglang/wing/pull/701
Use Cases
Preventing bugs in Wing libraries that are written in TypeScript
Implementation Notes
Maybe this logic could be added in wingii, or in the jsii_importer part of the compiler.
Not every class or construct in a Wing library needs to have an @inflight annotation (for example, a resource might exist without any inflight methods). But if the annotation exists, it should be valid.
Component
Compiler
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the annotated resource example in libs/wingsdk/src/cloud/bucket.ts, then inspect the wingii or jsii_importer areas mentioned in the issue. Determine where the .jsii manifest is imported and make an existing @inflight annotation reject invalid values while allowing resources without the annotation; done means invalid SDK annotations fail library import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100