Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to customize folder naming convention #96

Closed
bureyburey opened this issue May 10, 2023 · 2 comments
Closed

allow to customize folder naming convention #96

bureyburey opened this issue May 10, 2023 · 2 comments

Comments

@bureyburey
Copy link

bureyburey commented May 10, 2023

First of all, this is a great and useful tool :)

How about adding the ability to customize the folder naming convention (snake_case/kebab-case/camelCase/PascalCase/....)

at the moment you can only control both the folder name AND the file name.

but if I were to need a kebab-case-folder-name/KebabCaseComponentName.tsx structure it cannot be controlled at the moment.

@TyIsI
Copy link
Contributor

TyIsI commented Jul 28, 2023

I'm also interested in this for the purpose of templating component names.

Example:
generate-react component --type=provider Example creates a src/providers/ExampleProvider directory that would look like this:

src/providers/ExampleProvider
src/providers/ExampleProvider/Example.context.ts
src/providers/ExampleProvider/ExampleProvider.types.ts
src/providers/ExampleProvider/ExampleProvider.tsx
src/providers/ExampleProvider/ExampleProvider.test.tsx
src/providers/ExampleProvider/ExampleProvider.stories.tsx

Example.context.ts could look like this:

import { createContext } from 'react'

import { type ExampleContextType } from './ExampleProvider.types'

export const defaultExampleContext: ExampleContextType = {}

export const ExampleContext = createContext(defaultExampleContext)

Disclaimer: Yes, it could be argued that the containing directory could simply be called Example, but for the sake of flexibility I think it would be good to be able to use a template name for the target directory.

@TyIsI
Copy link
Contributor

TyIsI commented Jul 29, 2023

@bureyburey I opened #98 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants