arminbro / generate-react-cli

A simple React CLI to generate components instantly and more.

Home Page:https://www.npmjs.com/package/generate-react-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only Pascal casing seems to work for custom templates

LokeSonne opened this issue · 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.

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

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.

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