Addition to the cell generator

I’m sorry to be late to the game, but I would like to suggest an addition to the generators

Specifically, the Cell generator – I’d love to be able to specify a folder to generate Cells into

It would be great if it was in the redwood.toml file so I didn’t have to remember to type it all the time

Right now I am prefixing everything to keep it straight in my head (since Cell is a suffix I can’t sort on it)

ex:

You already can! Just include the path in the “name” parameter:

yarn rw g cell admin/posts

Hey @rob !

When I tried to run the command you suggested I got this error in my terminal :

Should I open an issue in GitHub or am I missing something ? It seems the template is using the entire string admin/posts as props for the Success component. I’ll be glad to contribute if necessary :smiley:

On the same note, I noticed that when I ran the following command :

yarn rw g component ui/button

The Redwood CLI generated this output :

  ✔ Generating component files...
    ✔ Successfully wrote file `./web/src/components/UiButton/UiButton.test.js`
    ✔ Successfully wrote file `./web/src/components/UiButton/UiButton.stories.js`
    ✔ Successfully wrote file `./web/src/components/UiButton/UiButton.js`

Is this the intended behavior as well ?

Thanks :slight_smile:

Hello @Francois and thanks for your offer to jump in and help :raised_hands:

The support for specifying the directory is a little inconsistent, but we would want it everywhere! For the cell you generated, did the file end up in the expected “admin” folder? Either way, it should definitely not put admin/posts in the success component like that. A PR for that would be super welcome, if you want to. No pressure :slight_smile:

1 Like

Alright ! I’ll be glad to finally contribute to Redwood.

I’m planning to read the contribution guide and investigate the issue tonight (alas, boring dayjob…). I’ll start a PR afterwards.

Edit :
Since there is an error, neither the folder nor the files are generated after running yarn rw g cell admin/posts

2 Likes

Whoops! Maybe that isn’t working as intended for cells. :grimacing: It works for scaffolds okay, I just used that the other day.

I created an issue to track my progress on the PR.

1 Like