Summary:
Splits `ConfigT` into `ConfigT` (core + packager configuration) and `RNConfig` (RN CLI configuration).
Also guarantees that all values on `ConfigT` have a default when loading user configuration.
Reviewed By: jeanlauliac
Differential Revision: D4985965
fbshipit-source-id: bf036e22d6809e49746a9c3aa240ec403a085342
Summary:
This PR allows anyone to publish templates for React Native.
It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
https://github.com/mkonicek/AppTemplateFeedback/issues/1
I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).
(GitHub: https://github.com/mkonicek/react-native-template-demo)
With this PR anyone can then use that template:
`react-native init MyApp --template demo`
The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.
Use a template called `react-native-template-demo` from npm:
`react-native init MyApp --template demo`
Use a local template:
`react-native init MyApp --template file:///path_to/react-native-template-dem
Closes https://github.com/facebook/react-native/pull/12548
Differential Revision: D4620567
Pulled By: mkonicek
fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a
Summary:
Seeing as [Windows is a supported platform](72157cf991/packager/defaults.js (L22)) until platforms can better manager their own CLI and packager needs.
Linking 3rd party libraries should be supported first, because then I'd like to do a follow up PR with grabbou to identify how we can effectively move RNPM functionality out of react-native core and eventually housed in each external platform's repo. The goal would be working with cpojer and hopefully andrewimm to help keep external platform needs in their respective repos, for rnpm/packager _et al._ Seeing as this is a major discussion point, I've made this PR first. Making small steps towards this goal, seems to be the approved methodology from all.
Additionally, I have a merged PR that makes an excellent place for documenting the CLI when it advances, as preparatio
Closes https://github.com/facebook/react-native/pull/11282
Differential Revision: D4311391
fbshipit-source-id: be9a836344be4aed6c4732b0ce4947c2a16b6dad
Summary:
An attempt to address https://github.com/facebook/react-native/issues/9156.
cc grabbou Kureev
**Test plan (required)**
1. Added the following to the `package.json` of a `react-native-plugin`
```
"rnpm": {
"commands": {
"preunlink": "node node_modules/react-native-plugin/scripts/preunlink"
"postunlink": "node node_modules/react-native-plugin/scripts/postunlink"
}
}
```
2. Added files, `scripts/preunlink.js` and `scripts/postunlink.js` to the plugin. Each of them simply logs a string to the console.
3. Ran `react-native unlink react-native-plugin` to verify that those logs get printed.
Closes https://github.com/facebook/react-native/pull/9157
Differential Revision: D3749434
fbshipit-source-id: 40b94c9026db4f11e8f5be4a417a0670e8069be6
Summary:
This commit removes `rnpm` folder that we left during initial merge to keep the diff cleaner. The `core`, `link` and `install` have now the same directory structure as any other command to make development more natural for all of us.
From most notable differences:
1) the `src` folder is now gone. The new structure should make it easier for people to work with the stuff and also move us closer to 100% rnpm integration,
2) There's also no `package.json` present in any of the `rnpm` packages, since they are no longer standalone modules,
3) There's no `bugs.url` in link.js since main package.json of React doesn't specify it. Decided to hardcode it to facebook/react-native since it's really unlikely to change. If one would prefer to use pkg.bugs.url as before, a separate PR modifying package.json should be sent.
Closes https://github.com/facebook/react-native/pull/9509
Differential Revision: D3751115
fbshipit-source-id: 74ae8330f7634df0887ad676808f47eee4b8de85