-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support bring cloud
#242
Conversation
Merge jsii resource clients into generate wing resources. Handle JSII Void return types as no return type in wing.
* Added support fro `struct`s in parser/type_checker/jsification. * Import constructors (including skipping scope/id on resources). * Pass "self" argument to imported class methods.
* refactor: moved jsii importing logic into submodule under a new type_check module. * resolve namespaced custom types in type checker. * corretly handle parent resource in resource type checking. * JSII imported handles references to other JSII types (not only primitives).
* Also added support for multiple struct inheritance in when importing JSII props. * Support importing wingsdk `Duration` types.
also: Cleaned up method_call vs function_call in grammar/ast Fixed return type parsing
* Updated sdk_capture tests to use explicit Props ars used by sdk resources. * Support type annotation in container literals. * Added map literals support. * de-dup captured method names in capture mechanism. * removed auto capturing of everything looking like a mehtod call on an anything object (AKA wingsdk support hack).
@MarkMcCulloh can you look at why the build's failing? |
@yoav-steinberg 2 small things:
|
jk wingc tests are still failing 🙂 @yoav-steinberg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incredibly exciting!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work Yoav! 🤩
Co-authored-by: Chris Rybicki <chrisr@monada.co>
@MarkMcCulloh tests failing is a tooling problem. The tests are actually passing:
NX is reporting it a failure despite Rust passing its tests. Maybe it does not like the "running 0 tests" part? |
@3p3r No there's an actual wingc test failure. The output is confusing though because multiple test projects are running in parallel. Better test reporting is something I can look into.
It's failing because inflight.w has |
Also: * Fix inflight.w example based on real imported cloud.Bucket type. * Removed skipping type checking on `new` expressions when the type is resolved to an `Anything`, we don't expect custom types to be `Anything`'s anymore.
This was there because we didn't really know the type of the `new` expression. Now the type is available through a the `Expr.evaluated_type`.
Tests should pass now. |
Co-authored-by: Elad Ben-Israel <elad.benisrael@gmail.com>
Bsically #154:
This enables
bring cloud
command. Its the basis for bringing any JSII into wing but currently includes some hard coded hack which make it wingsdk.cloud only. To get this working there was lots of other work done on grammar, compiler features, code structure. I'll try to summarize:/type_check
, and added ajsii_importer.rs
module that uses wingii.bring cloud
hack that treated all AST method calls under ananything
typed object as a capture. Now we can detect these as real method calls of the imported JSII type.bring cloud
by importing the wingsdk JSII types into our type system during the type-checking-inference stage.cloud
).