Is is possible to change what the "rw g" command generate

As the application grows, one might need to change what the content of what the commands generate.
Lets say for example i want to change the style of the error messages in a cell.
so that i h
wouldn’t change it every time i generate.

Currently no, but it’s something we’re thinking about!

4 Likes

That’s something I considered early on the onboarding as well.

I do appreciate the scaffolding but a schema is likely to grow and ./src/components structure feels a bit too flat. Not mentioning jsx code can get bloated fast in these scaffolded files, one of the first things I worked on was components to address this issue. Instead of a fully declared table I have a ./src/ui/Grid component which I intend to use - but i’m still experimenting with it.

I would also like to configure somewhere like the redwood.toml, the option to avoid creating stories or test files. Could also be an arg on the command itself.

Hi @viperfx.

I thought there was an existing issue for this suggestion (add option not to generate test or stories for pages, components, cells, layouts, etc) but I could not find one.

Could you add an issue and label it with the generator topic?

Also, any suggestions for the options?

--no--test
--no-story

--no--tests
--no-stories

?

I think it would definitely be a cli option, but it could be toml configured, too.

If so, what would yo want the config to look like?

[web]
  port = 8910
  apiProxyPath = "/.netlify/functions"
  [generate]
    stories = "false"
    tests = "false"

Or would you need this to be on a page or cell or component basis?

[web]
  port = 8910
  apiProxyPath = "/.netlify/functions"
  [generate]
    [cells]
      stories = "true"
      tests = "false"
    [pages]
      stories = "false"
      tests = "true"

Yea I think having it per page or cell, makes sense. I’ve created an issue here - https://github.com/redwoodjs/redwood/issues/1444 but was not able to label it myself.

Thanks for this!

I’ve gone and labeled it as well.

Cheers!