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

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

Open
bl5ck opened this issue Nov 24, 2018 · 6 comments
Open

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

bl5ck opened this issue Nov 24, 2018 · 6 comments

Comments

@bl5ck
Copy link

bl5ck commented Nov 24, 2018

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 and index.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.

@diegohaz
Copy link
Owner

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

@bl5ck
Copy link
Author

bl5ck commented Nov 24, 2018

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
Copy link
Owner

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
Copy link
Author

bl5ck commented Nov 24, 2018

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
Copy link

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...

@strdr4605
Copy link

strdr4605 commented Jul 13, 2022

@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

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

4 participants