generate-react-cli icon indicating copy to clipboard operation
generate-react-cli copied to clipboard

Only Pascal casing seems to work for custom templates

Open LokeSonne opened this issue 3 years ago • 1 comments

Describe the bug When I try to use anything other than Pascal-case for the files in my custom templates, they are not replaced.

To Reproduce Steps to reproduce the behavior:

  1. Create a custom template for component
  2. name it template-name.tsx
  3. Add the custom template in generate-react-cli.json "component": { "default": { "customTemplates": { "component": "./templates/template-name.tsx" },
  4. Run the cli, e.g. npx generate-react-cli component MyComponent
  5. The component file in the created component has not been changed from template.name.tsx Expected behavior The filename should be my-component.tsx but is template-name.tsx

Machine (please complete the following information):

  • OS: [e.g. macOS Mojave]
  • Node Version [e.g. v10.16.1]

Additional context Add any other context about the problem here.

Screenshots If applicable, add screenshots to help explain your problem.

LokeSonne avatar Mar 07 '22 10:03 LokeSonne

This and also the folder name should respect the same case sensitivity as the command for example:

npx generate-react-cli component demo should generate a folder called demo not Demo

edustefsb avatar Apr 04 '22 12:04 edustefsb

This and also the folder name should respect the same case sensitivity as the command for example:

npx generate-react-cli component demo should generate a folder called demo not Demo

Nope, it still doesn't work that way.

ahmet-cetinkaya avatar Aug 11 '22 13:08 ahmet-cetinkaya

We now support any component filename format. Please check the PR above ☝️for more details.

arminbro avatar Aug 27 '22 20:08 arminbro