Open maxemann96 opened 2 years ago
Hi @maxemann96, thanks for the issue. Am I correct in thinking here that the issue you are having is the names still having hyphens in front of their names? Or is there another problem with the generated typescript code? Thanks!
Thanks for your answer. Typescript doesn't like the hyphens in front of the names. Removing the hyphens from my code fixed the issue for me, but I'm not using these flags in my environment to define some Java heap space constraints. I think removing the hyphens made the code possible unusable for people which are relying on specifying the heap space constraints, but I don't know if this can be fixed.
Should be an "easy" fix by checking if the key name is a valid JS/TS variable name, and if not wrapping it in quotes?
Added to epic https://github.com/pulumi/home/issues/3431
Re-opening as incorrectly identified as a fix for the v1.5.0 release.
This issue has been addressed in PR #143 and shipped in release v1.5.0.
What happened?
The following invalid typescript code is produced (Stripped the other invalid generated code as the error is always the same).
Steps to reproduce
Get the strimzi crds and generate the typescript code for example with
crd2pulumi --nodejs --nodejsPath=crds/nodejs/ crds/k8s/*.yaml
. The following excerpt automatically downloads the crds:Expected Behavior
Valid typescript code
Actual Behavior
Invalid typescript code
Output of
pulumi about
The warning can be ignored since it is a npm workspace setup.
Additional context
No response
Contributing
Vote on this issue by adding a đź‘Ť reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).