storyblok-cli icon indicating copy to clipboard operation
storyblok-cli copied to clipboard

fix: generate typescript types using camel case

Open mledl opened this issue 9 months ago • 0 comments

Pull request type

Jira Link: INT-

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Other (please describe):

How to test this PR

In order to test these changes, just generate types using storyblok generate-typescript-typedefs with the --typeNamesPrefix Prefix flag. You will see that the types are now generated without violating Typescript's type naming convention when using --typeNamesPrefix flag. The issue was the usage of lodash.camelCase.

What is the new behavior?

  • Without these changes, the generated output for a component named component_name would be PrefixcomponentNameStoryblok which is clearly violating Typescript's type naming convention.
  • With these changes the types are named matching the Typescript type naming convention like PrefixComponentNameStoryblok.

Other information

We are using the --typeNamesPrefix flag to match our typing schema. Therefore, we would be really thankful to get this changes in.

mledl avatar May 16 '24 06:05 mledl