generact
generact copied to clipboard
The tool should pick up both capitalized and uncapitalized files
My component folder have 5 files:
- index.js
- SignUp.js
- signUp.styles.js
- signUp.duck.js
- signUp.saga.js
and the cli only picks up
SignUp.js
andindex.js
(please correct me if I'm wrong, thanks).
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.
It should copy everything if you choose to replicate SignUp
. Isn't it working for you?
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.
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?
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.
I have a similar problem: My components folder has the following structure:
-/components
-
/my-component
-
index.tsx
(which exports the main component) -
MyComponent.tsx
(the component itself) -
MyComponent.d.tsx
(types for the component)
-
-
/other-component
- ....
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
:
- it asks me if I want to generate it into
src/components/my-component
- after correcting it to the parent folder, it just creates a single
Test.tsx
component, inside/components
not creating a new folder and not creating the rest of the files...
@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