jsii icon indicating copy to clipboard operation
jsii copied to clipboard

Type names must be PascalCased. Rename "A1B" to "A1b"

Open mpicard opened this issue 1 year ago • 2 comments

Describe the bug

When terraform modules contain a number followed by a single letter (eg. a1b, k8s, another2e, etc) an error is throw when executing cdktf get:

Type names must be PascalCased. Rename "A1B" to "A1b"

Expected Behavior

When executing cdktf get, the toPascalCase must handle this edge case and capitalise the single letter after the number (e.g. A1B, K8S) and the command must compile the modules and exit 0.

Current Behavior

When executing cdktf get the following is thrown:

Type names must be PascalCased. Rename "A1B" to "A1b"

Reproduction Steps

  • Create a cdktf project with template Python
  • Add a terraformModule to cdktf.json with a name that ends with a number and 1 letter.
  • run cdktf get

Possible Solution

the function cokemaker.toPascalCase should capitalise that last letter in all cases

Additional Information/Context

No response

SDK version used

0.15.5

Environment details (OS name and version, etc.)

MacOS 12.6.5

mpicard avatar Apr 12 '23 09:04 mpicard

https://github.com/sindresorhus/camelcase/issues/107

mpicard avatar Apr 12 '23 09:04 mpicard

https://github.com/sindresorhus/camelcase/pull/106

mpicard avatar Apr 12 '23 09:04 mpicard