Summary:
Resolve#18333
CLI should ask users for params only once and waiting for response while linking plugin
Ran the `link` commands for iOS and Android and confirmed that params requested only once.
[CLI][FEATURE][local-cli/link/link.js] - Requesting link params only once for all platforms
Closes https://github.com/facebook/react-native/pull/18349
Differential Revision: D7342181
Pulled By: hramos
fbshipit-source-id: a10f0f7f2170f067d78b30e5a5221634b77da577
Summary:
Android uses the name of the package, not the config, for the `isInstalled` check. Sending both parameters to `isInstalled` so we have a consistent API.
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
A bug was uncovered in the react-native link command where Android would not unlink because the wrong parameters were being sent to `isInstalled`.
Successfully linked and unlinked `react-native-fs` on Windows and Mac. Jest tests pass.
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[CLI][BUGFIX][local-cli/link/link.js] - Fix issue with `isInstalled` check for Android
[CLI][BUGFIX][local-cli/link/unlink.js] - Fix issue with `isInstalled` check for Android
[CLI][BUGFIX][local-cli/link/ios/common/unregisterNativeModule.js] - Fix references to unregister implementations.
Closes https://github.com/facebook/react-native/pull/18207
Differential Revision: D7180885
Pulled By: hramos
fbshipit-source-id: 5f479cd9d7b1ebd8626b461e9dc1f22988e2c61f
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.
find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.
Reviewed By: TheSavior, yungsters
Differential Revision: D7007050
fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
Summary:
This commit removes special cases for linking iOS and Android platforms.
A previous commit opened up link and other commands for other platforms to provide their own behaviors. It left special cases in tact for iOS and Android. This PR removes the special case.
- Added jest tests related to the link command.
- Ran the `link` and `unlink` commands for iOS and Android and confirmed no changes.
https://github.com/facebook/react-native/pull/17745
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[CLI][FEATURE][local-cli/link/link.js] - Removes special cases for linking in iOS and Android.
Closes https://github.com/facebook/react-native/pull/17961
Differential Revision: D6975951
Pulled By: hramos
fbshipit-source-id: 8dd5da35619e2124ce4b3b18db8b694757792363
Summary:
Restoring the copyright header on some files, in order to fix an internal lint failure that is raised whenever these files are edited on open source.
Closes https://github.com/facebook/react-native/pull/17912
Differential Revision: D6938189
Pulled By: hramos
fbshipit-source-id: 6447d8ad6d7ecce0ef5f1821f63e44957bbf6d15
Summary:
This change adds hooks via the `package.json` for a platform plugin to specify hooks for generating platform configurations. This change also adds hooks to allow platform plugins to participate in `link` and `unlink` commands. The goal is to move platform-specific code for platform plugins into their own repositories / node_modules.
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
We need to be able to configure the CLI commands for plugin platforms (e.g., react-native-windows) in their own repositories.
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
- All jest tests, including new tests, pass.
- `link` and `unlink` commands are successful on iOS and Android.
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)
https://github.com/Microsoft/react-native-windows/pull/1601
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[CLI][FEATURE][local-cli/core/index.js] - Allow platform plugins to contribute to the RNConfig.
[CLI][FEATURE][local-cli/link/link.js] - Allow platform plugins to participate in the `link` command.
[CLI][FEATURE][local-cli/link/unlink.js] - Allow platform plugins to participate in the `unlink` command.
Closes https://github.com/facebook/react-native/pull/17745
Differential Revision: D6883558
Pulled By: hramos
fbshipit-source-id: ea32fe21cedd4cc02c5c0d48229f2cdb2ac8142b
Summary:
The core React Native codebase already has full support for CocoaPods. However, `react-native link` doesn’t play nicely with CocoaPods, so installing third-party libs from the RN ecosystem is really hard.
This change will allow to link projects that contains its own `.podspec` file to CocoaPods-based projects. In case `link` detect `Podfile` in `iOS` directory, it will look for related `.podspec` file in linked project directory, and add it to `Podfile`. If `Podfile` and `.podspec` files are not present, it will fall back to previous implementation.
**Test Plan**
1. Build a React Native project where the iOS part uses CocoaPods to manage its dependencies. The most common scenario here is to have React Native be a Pod dependency, among others.
2. Install a RN-related library, that contains `.podspec` file, with `react-native link` (as an example it could be: [react-native-maps](https://github.com/airbnb/react-native-maps)
3. Building the resulting iOS workspace should succeed (and there should be new entry in `Podfile`)
Closes https://github.com/facebook/react-native/pull/15460
Differential Revision: D6078649
Pulled By: hramos
fbshipit-source-id: 9651085875892fd66299563ca0e42fb2bcc00825
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