shellscape / jsx-email

Build emails with a delightful DX
https://jsx.email
MIT License
902 stars 28 forks source link

fix(cli): add spaces for camel case template names in preview #54

Closed co-sic closed 8 months ago

co-sic commented 8 months ago

Component / Package Name:

This PR contains:

Are tests included?

Breaking Changes?

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

Currently in the preview sidebar the template names are displayed as one string with only the first letter uppercase. This does not work well for camelCase names, since you can't distinguish the words anymore. E.g.: NewCustomerWithNewAccount -> Newcustomerwithnewaccount which is hard to read. With this fix it will display as: "New Customer With New Account".

co-sic commented 8 months ago

@shellscape we could also remove the titleize dependency. It is only used in this place and the whole package is also just one regex replace. Not sure how you feel about such dependencies, but feels a little unecessary to use a package for that.

https://github.com/sindresorhus/titleize/blob/main/index.js

shellscape commented 8 months ago

I'm good to leave titleize in there for now. There's a refactor coming where the CLI will be bundled and it won't matter much.

thanks!