Why components/PostCell/PostCell.js instead of just components/PostCell.js?

This may be a dumb question, but why the extra nesting? This exists in other JS projects also, so it’s not just about Redwood, but wondering if Redwood could eliminate the need for that directory layer (and allow simply components/ComponentName.js)? Especially coming from a “back-end framework” this folder structure/nested-naming pattern is bothersome.

Mainly because it organizes all the code around that component. Our generators currently create the component and a test file, but eventually we’ll be creating storybook stories and readmes as well. The idea being that everything about that component is together in one place. We provide a shortcut so you only need to reference the directory itself when importing:

import PostCell from "src/components/PostCell"

I’m the same as you—I came from a Rails background where all the app code is in one place and all the tests are in another. I can see benefits to both styles now, and the Redwood one is starting to grow on me. :slight_smile:

Ah, the scaffold generator didn’t create test files, so made me think if the default should be no nesting if it’s one lone file. But makes sense now, thanks! The test file being in the same place is going to be an interesting one to get accustomed to, yes :upside_down_face:

We’ll probably be adding test files for the scaffold-generated files at some point, in case you want to actually keep them around and build on them rather than discard them.