diegohaz / generact

Generate React components by replicating your own
https://git.io/generact
MIT License
1.48k stars 64 forks source link

Edit contents on .json files #4

Closed diegohaz closed 7 years ago

diegohaz commented 7 years ago

react-static-boilerplate has a package.json inside component folder. We need to change that as well as we do with .css, .js etc.

dmitrika commented 7 years ago

Hey, I'm going to help you with this issue.

{
  "name": "Button",
  "version": "0.0.0",
  "private": true,
  "main": "./Button.js"
}

In this case we copy whole package.json content and change only name and main values?

diegohaz commented 7 years ago

@dmitrika I guess that just adding json to this line solves the issue: https://github.com/diegohaz/generact/blob/master/src/utils.js#L40

We should have a new fixture and test case on https://github.com/diegohaz/generact/tree/master/test to ensure that.

File contents are replaced by replaceContents here: https://github.com/diegohaz/generact/blob/master/src/utils.js#L60-L67

dmitrika commented 7 years ago

Upd. Thank you for intro, will dig it.