winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.98k stars 196 forks source link

Struct with camelCase fields are not jsified properly #1632

Closed Chriscbr closed 1 year ago

Chriscbr commented 1 year ago

Community Note

Please vote by adding a 👍 reaction to the issue to help us prioritize. If you are interested to work on this issue, please leave a comment.

I tried this:

// wing
bring "@cdktf/provider-aws" as aws;

new aws.s3Bucket.S3Bucket(
  versioning: aws.s3Bucket.S3BucketVersioning {
    enabled: true,
    mfa_delete: true,
  },
) as "Bucket";

I expected this:

Preflight JS code should look like:

new aws.s3Bucket.S3Bucket(this, "Bucket", { versioning: {
  "enabled": true,
  "mfaDelete": true
}});

Instead, this happened:

Preflight JS code looks like:

new aws.s3Bucket.S3Bucket(this, "Bucket", { versioning: {
  "enabled": true,
  "mfa_delete": true
}});

Component:

Compiler

Wing Version:

No response

Node.js Version:

No response

Platform(s):

No response

Anything else?

No response

marciocadev commented 1 year ago

@Chriscbr I think it's a problem in jsify on ExprKind::StructLiteral and maybe on ExprKind::MapLiteral too

I will open a PR to StructLiteral now

staycoolcall911 commented 1 year ago

Related #1049

monadabot commented 1 year ago

Congrats! :rocket: This was released in Wing 0.9.2.