Hi team, I just listened to your podcast episode from js-party and decided to check things out.
The tutorial was great and really well thought out! I have some feedback from my experience and wanted to share it.
+1 for support. - #234prettier.config.js for some reason does not offer code completion (at least not for my config of VSCode).... sort of annoying when I want to make changes. Is there a strong reason to use prettier.config.js instead of .prettierrc as part of the CLI generation? yarn rw g scaffold post, I would love an option to have them generate in ./web/src/components/post/*/** to keep things organized better as my list of components grows.yarn rw g cell BlogPosts should have option for me to specify I want it to end up in a parent folder named components/blog/BlogPosts) #340yarn rw g scaffold --help produces the same help output as yarn rw g --help instead of providing me help just for scaffold)https://redwoodjs.com/tutorial/saving-data - docs show type, actual is an input.export const schema = gql`
type Contact {
id: Int!
name: String!
email: String!
message: String!
createdAt: DateTime!
}
type Query {
contacts: [Contact]
}
- input ContactInput {
+ type ContactInput {
name: String
email: String
message: String
}
`
I agree with 4. Scaffolding generates quite a mess in the folder structure as it currently stands.
An additional comment that I'm not sure has been addressed and I may have just missed it. Lets say I edit a schema file and add new fields to the entity, then run the mutation and save to the database. Is there a way to update all the scaffold code to include these new fields, including the admin pages it generates, or is the only way manually?
Is there a way to update all the scaffold code to include these new fields, including the admin pages it generates, or is the only way manually?
We aren't planning on having that level of intelligence in the scaffold generator any time soon. You can always run the scaffold command again with --force: it will re-introspect the schema file and recreate all of the files (sdl, service, components, etc.) so be careful if you made changes to any of them that you want to keep. At some point we'll have something like a --prompt flag that will ask you for each and every file if you want to overwrite it or skip it, but no promises on a release date for that.
- Docs show code that differs from actual code when generating the sdl for contact - https://redwoodjs.com/tutorial/saving-data - docs show type, actual is an input.
Note: I was not sure if the docs were wrong, or if I was supposed to update my code to match the code example in the docs. #305
This has been updated in the tutorial, thanks!
- As I tried to access the CLI docs, it appears there is not detailed help per command, which could be useful if there are/will be command specific flags. (e.x. yarn rw g scaffold --help produces the same help output as yarn rw g --help instead of providing me help just for scaffold)
Note: I am lazy and did not pivot out of the tutorial to attempt to find published docs to see if there are indeed additional CLI flags available.
This topic is in progress here #322 (and could use some help!)
- prettier.config.js for some reason does not offer code completion (at least not for my config of VSCode).... sort of annoying when I want to make changes. Is there a strong reason to use prettier.config.js instead of .prettierrc as part of the CLI generation?
I renamed the file and it still did not auto-complete, I'm not sure what the mechanism would be that offers completion? Is it an vscode-extension?
@axtscz I've added #341 in response to your suggestion
@peterp - I don't know for certain, but I think the built-in json-schema capability for VSCode may be what provides code completions.
This is the extension that I am using: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
This is what the experience is like:

I think we've taken most of the things that we could out of this issue and made them into separate issues.
Most helpful comment
I agree with 4. Scaffolding generates quite a mess in the folder structure as it currently stands.