diegohaz / generact

Generate React components by replicating your own
https://git.io/generact
MIT License
1.48k stars 64 forks source link

The tool should pick up both capitalized and uncapitalized files #23

Open bl5ck opened 5 years ago

bl5ck commented 5 years ago

My component folder have 5 files:

I checked the getFiles function inside utils.js and saw that it could be tweaked a little bit to support detecting both capitalized and uncapitalized files. Any idea is highly appreciated.

diegohaz commented 5 years ago

It should copy everything if you choose to replicate SignUp. Isn't it working for you?

bl5ck commented 5 years ago

Ah, my bad wasn't detailed about it. It does copy everything, but it renamed only the SignUp and skipped signUp in file names and file content.

diegohaz commented 5 years ago

Got it. Just out of curiosity, why have you named it signUp.styles.js, and not SignUp.styles.js?

Regardless, this doesn't seem to be a common structure. And I'm afraid that it could lead to false positives. Are you aware of any article or something that recommends this architecture?

bl5ck commented 5 years ago

Actually, I decided it myself based on the willing to distinguish Component file and the others. So I didn't follow any architecture regarding that point.

antoniocapelo commented 5 years ago

I have a similar problem: My components folder has the following structure:

-/components

When running the generator, it offers me the double of the expected possible components to replicate from (I see both MyComponent and MyComponent.d as options — which I believe is wrong) and if I choose MyComponent, for example I say I want it to be called Test:

strdr4605 commented 2 years ago

@antoniocapelo, did you find a solution to your problem?

I have a structure like:

/Boilerplate/Boilerplate.scss
/Boilerplate/Boilerplate.tsx
/Boilerplate/index.ts

but the tool only generates:

/Test.scss
/Test.tsx