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

Make 'GRC' more configurable (multi-configuration). #10

Closed
tmicka23 opened this issue Apr 16, 2020 · 2 comments
Closed

Make 'GRC' more configurable (multi-configuration). #10

tmicka23 opened this issue Apr 16, 2020 · 2 comments

Comments

@tmicka23
Copy link

Is your feature request related to a problem? Please describe.

Hi, thank you for this superb and very practical library.
I would like to suggest an improvement.
currently in version 4.0.2, I can do generate-react component <MyComponent>
which makes MyApp / src / components / <Mycomponent> / <Mycomponent>.js + <Mycomponent>.css + <Mycomponent>.test.js

Describe the solution you'd like

I would like to have the possibility of creating a 2nd (or more) configuration like generate-react page Home which does MyApp / src / pages / Home / Home.js + Home.css + Home.test.js

Describe alternatives you've considered

see this example configuration file

{
  "component": {
    "path": "src/components",
    "css": {
      "preprocessor": "css",
      "module": true,
      "withStyle": true
    },
    "test": {
      "library": "None",
      "withTest": true
    },
    "withStory": false,
    "withLazy": false
  },
  "page": {
    "path": "src/pages",
    "css": {
      "preprocessor": "css",
      "module": true,
      "withStyle": true
    },
    "test": {
      "library": "None",
      "withTest": true
    },
    "withStory": false,
    "withLazy": false
  },
  "usesTypeScript": false
}

Thanks for read my issue. thanks for this project !

@arminbro
Copy link
Owner

@tmicka23 thanks for the suggestion! The funny thing is that my buddy suggested the same thing like a week ago. 😄

I think this feature request makes sense and will improve on generating pages with their own default configurations in place.

The plan is to add a new page command that will have its own configuration rules that you can set up just like you did for the component command. You will also be able to pass the same options to the page command that you are already familiar with in the component command.

Once this new feature is published, the next time you run the new version of generate-react-cli, it will ask a few questions so it can update your generate-react-cli.json config file with the new page configuration rules.

Give me a couple of days and I should have this feature ready and published.

Thanks again for the request.
Armin

@arminbro
Copy link
Owner

@tmicka23 I just released a new version of Generate React CLI (v4.1.0) that now has a new page command.

As an example, you should now be able to run npx generate-react-cli page HomePage and it will generate a new HomePage component using its own config rules from the generate-react-cli.json config file.

If you find something not working correctly or as you expected, please don't hesitate to reach out and file/report a bug so I can take care of it.

Thanks
Armin

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

2 participants