arminbro / generate-react-cli

A simple React CLI to generate components instantly and more.

Home Page:https://www.npmjs.com/package/generate-react-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to generate from relative paths flag

yutro opened this issue · comments

it would be nice to allow relative paths flag

example

{
  "usesTypeScript": true,
  "usesStyledComponents": true,
  "testLibrary": "Testing Library",
  "component": {
    "util": {
      "path": "utils",
      "withStyle": false,
      "withTest": true,
      "withStory": true,
      "withLazy": true
    }
  }
}

and then let's say you are in src/feature/A
running this command npx generate-react-cli component strBuilder --type=util -someFlagSaysRelative

and it would generate everything relative to CWD

commented

The current workaround would be to call GRC like this:

npx generate-react-cli component --type=util --path=$(pwd)/strBuilder --flat strBuilder

Though I'd potentially be interested in creating a PR for this.