47 Commits
Author SHA1 Message Date
Kacper Wiszczuk f497f5a9f1 imp: Manifest cleanup (#1162) 2020-05-08 12:31:18 +02:00
Jussi Kinnula 4743f923b2 Fix Android project's configuration manifestPath is not used… (#1160) 2020-05-08 11:18:48 +02:00
Michał Pierzchała 3061e2cf43 fix: bring back --appId flag; fix wrong appName instructions (#1155)
* docs: fix wrong appName instructions

* fixup deprecation warnings

* revert faulty appId deprecation
2020-05-08 09:56:23 +02:00
Bartosz Kaszubowski a5d837543d chore: update docs link in the Android installation error messa… (#1125) 2020-04-22 16:00:02 +02:00
Vojtech Novak bd20b37e28 fix: do not ignore androidProject.sourceDir option (#1122) 2020-04-20 21:58:16 +02:00
Kacper Wiszczuk 2d63746600 fix: split output by EOL (#1098) 2020-04-05 22:17:13 +02:00
Christian Brevik 1675af5450 fix: don't use appIdSuffix to generate run task (#1087)
* fix: don't use appidsuffix to generate run task

* fix lint
2020-03-31 20:01:23 +02:00
Trevor Cook 4c8af54e29 fix: android config returns incorrect paths (#1080)
* docs: update Android config typedef

* fix: android config returning incorrect paths
2020-03-29 17:34:04 +02:00
Michał Pierzchała 79498d598e followup: fix what #1029 broke (#1053)
* followup: fix what #1029 broke

* get rid of appName from dependencies
2020-03-16 16:47:49 +01:00
Michał Pierzchała 19ac71f02c feat(android): add appName; deprecate root, appFolder, appId (#1029)
* feat: add appName; deprecate root, appFolder, appId

* add deprecation warnings
2020-03-16 14:39:08 +01:00
Michał Pierzchała 0f80035053 chore: revert "fix: Metro Bundler crashing on run-android on Windows (#489)" (#1052) 2020-03-14 17:51:32 +01:00
grabbou a70064bfbe Revert "chore: remove extraneous properties from the run-android doc"
This reverts commit ca4a0aeb78.
2020-03-03 17:32:31 +01:00
Michał Pierzchała 5c7a7934c4 chore: update RN docs links to reactnative.dev (#1016) 2020-02-25 20:46:16 +01:00
Michał Pierzchała d74bd88f52 Revert "feat: run-android respects applicationId from build.gradle when running app " (#999)
* Revert "feat: run-android respects applicationId from build.gradle when running app  (#934)"

This reverts commit ada3e497325b5b3d0441f620d6ad276e4d773bd5.

* fix types
2020-02-21 17:44:29 +01:00
grabbou ca4a0aeb78 chore: remove extraneous properties from the run-android doc 2020-02-05 17:20:53 +01:00
19c556070f feat: run-android respects applicationId from build.gradle when running app (#934)
* Get and use LaunchPackageName in place of pacakageNameWithSuffix

Build system may alter application id for build and flavor purposes. This commit alters the system to not need a packageNameWithSuffix, but instead pull the launch package name directly from the merged manifest and use that to launch it on the device.

* cleanup getLaunchPackageName into it's own file

* Cleanup style

* Added flowtyping to getLaunchPackageName, added a jest test for it.

Also fixed some faulty RegExps as a result of testing.

* Fix grammar in comment

* Move sample files for test to __fixtures__

* Update paths to be OS-agnostic

* Tests passing, barring Windows pathing issue with snapshot

* build flavor test

* move code to platform-android

* reuse test helpers

* fix typescript

* Convert tests to typescript - part 1

* Update index.ts

Co-authored-by: Michał Pierzchała <[email protected]>
Co-authored-by: Chris Fanti <[email protected]>
2020-02-05 17:20:47 +01:00
Abdullah AttaandMichał Pierzchała b11096675d feat: better error messages with human readable outputs (#609)
* refactor: properly handle invalid template package

* refactor: error checks when getting template name

* refactor: remove duplicate exception throw

* refactor: check if assets dest exists

* refactor: add error checks when upgrading

* chore: add comment for using process.exit()

* refactor: improve error outputs in link command

* refactor: use for of loop

* refactor: check package before uninstalling

* refactor: use CLIError instead of direct exit

* refactor: handle potential android pkg name errors

* refactor: fix typos/mistakes in error outputs

* refactor: add adb & android sdk path checks

* refactor: fix imports

* refactor: improve install apk error outputs

* Apply suggestions from code review

Co-Authored-By: Michał Pierzchała <[email protected]>

* refactor: add init doc link in error output

* test: make sure all tests pass

* refactor: use try/catch around readFileSync

* refactor: do not read build.gradle twice

* refactor: clean up code in android linking

* fix: packageJson not defined in templateName

* refactor: remove unintentional --verbose flag

* refactor: make flow very happy

* refactor: remove unnecessary variable definition

* pkgjson undefined tweak

* eslint fix

* remove adb/android_home checks because we have doctor

* use mockImplementationOnce

* revert link changes, as it's going to be removed in next version

* inline fns

* revert uninstall changes as we're removing that in next version

* adjust copy

* mock existsSync once

* remove unused code

Co-authored-by: Michał Pierzchała <[email protected]>
2020-02-05 14:53:22 +01:00
KubaandMichał Pierzchała c9790ebd5f feat: launch emulator during run-android (#676)
* feat: launch android emulator in run-android

* test: fix tests due to changes

* refactor: address CR comments & improvements

* fix: refetch devices info after emualtor launch

* fix: remove redundant async/await

* fix: run emulator from android home path

Co-Authored-By: Michał Pierzchała <[email protected]>

* refactor: use interval to check if emulator is booted

* fix emulator path

* adjust wording

* moar adjustments
2019-09-11 20:38:20 +02:00
yuta mori 48626dd239 [#683] Convert commands/packageManager.ts to TS (#692)
* convert packageManager from flow to TS

* fix flow-check

* fix: remove Flow annotation

* convert packageManager-test from flow to TS

* fix eslint
2019-09-10 11:17:19 +02:00
Michał Pierzchała 16065aab86 chore: bump Flow to 0.107 (#682) 2019-09-09 19:20:10 +02:00
Kacper Wiszczuk 4870ac5581 imp: Migrate platform-ios to TypeScript (#620)
* imp: move `platform-ios` to Typescript

* imp: Move tests and fixtures

* Add missing types

* Review fixes

* More review suggestions

* adjust tsdoc

* remove flowfixmes

* fix any from process
2019-09-09 19:05:12 +02:00
thecodrr aa20ff8e43 fix: CLI stuck on "Starting JS server" on Windows (#604)
* fix: cli stuck on starting JS Server...

* chore: added comment for leaving out await
2019-08-02 12:18:45 +02:00
Kacper Wiszczuk 5e5d50dcbe imp: migrate platform-android to TypeScript (#597) 2019-08-01 17:18:13 +02:00
Michał Pierzchała 30a3023a72 fix: fallback to default terminal if wrong one passed (#601)
* fix: fallback to default terminal if wrong one passed

* less mutation
2019-08-01 09:45:47 +02:00
Drapich Piotr eac98c0260 fix: Package class name regex tweaks on Android (#563)
* Android - find package's class name regex tweaks + tests

* test tweaks
2019-07-25 11:11:31 +02:00
Michał Pierzchała 4b67ebd942 fix: use execa to spawn jetifier in a cross-platform way (#541) 2019-07-16 17:30:13 +02:00
Michał Pierzchała 12d279d401 fix: run jetifier as executable to avoid race conditions (#536) 2019-07-15 20:33:11 +02:00
Michał Pierzchała dcbbc39c3d feat: run jetifier before run-android (#526) 2019-07-12 17:48:38 +02:00
Drapich Piotr 074e742aa2 fix: better package class name regex on Android (#525) 2019-07-12 16:54:12 +02:00
thecodrr 617a014549 fix: Metro Bundler crashing on run-android on Windows (#489) 2019-07-07 10:24:33 +02:00
CallMeLaNN 7220d3ef19 fix: log-android not working. update logkitty. (#469)
* fix: log-android not working. update logkitty.

* fix registry
2019-07-04 10:02:26 +02:00
Michał Pierzchała 616eaf26de chore: fix grammar in warning (#453)
* chore: fix grammar in warning

* adjust wording
2019-07-01 21:00:26 +02:00
Michał Pierzchała f6b546e83a feat: add warnings for run-ios and run-android when manually… (#447)
* wip

* add warnings for run-ios and run-android

* memoize in place

* cleanup
2019-06-30 10:45:15 +02:00
Nathan Hunzaker fe2c761907 feat: Pass along CLI port configuration for Android (#421)
This commit operates in conjunction with a change to React Native
Android to allow the overriding of the development server port.
2019-06-09 13:10:31 +02:00
Michał Pierzchała 4053d07110 feat: remove manifest from config output (#398)
* feat: remove manifest from config output

* fix typo in the docs
2019-05-21 13:54:10 +02:00
Michał Pierzchała bae68953cd feat: improve run-android error messages; rename "installDebug" -> "task" (#372)
* chore: cleanup run-android implementation

* feat: overhaul gradle install errors

* fix copying executables by bringing back chmod

* rename 'installDebug' -> 'task'

* cleanup unused args from refactor

* use inherit and don't show null error

* simplify creating gradle args

* adjust descriptions

* use logger

* Add support for multiple tasks

* Change function name to match current functionality

* Change task to tasks
2019-05-10 15:19:52 +02:00
Mike Grabowski bca56c9f3c docs: initial documentation of plugins (#345)
* fix: typos in Autolinking & use same repo for both examples

* structure new files

* Add documentation for plugins and update naming in one place

* Update index.js

* Fix flow and update docs

* Update

* Prefix

* Updates

* Take advantage of Joi

* Update docs/plugins.md

Co-Authored-By: grabbou <[email protected]>

* Update docs/plugins.md

Co-Authored-By: grabbou <[email protected]>

* Some other tweaks

* Placeholder for dependency

* Updates

* Delete linking.md

* fix tests
2019-04-23 19:41:42 +02:00
Michał Pierzchała b306c99fda docs: update and rearrange documentation (#338)
* docs: update and rearrange documentation

* add autolinking base docs

* add init docs
2019-04-23 12:26:19 +02:00
ifsnow 90a587e583 fix: modify wrong install arguments (#337) 2019-04-19 07:57:38 +02:00
Mike Grabowski c28fb93696 Support functions in default (#333) 2019-04-18 17:48:07 +02:00
ifsnow d4c710448e fix: prevent unnecessary actions if android build failed (#325) 2019-04-18 06:35:56 +02:00
Lucas Bento 3a1eb61e62 fix: open Metro in the correct terminal (#310)
* Put `isPackagerRunning` function on `cli-tools` to share between iOS & Android

* Fix `terminal` argument not working when not being provided

* Fallback to the default terminal of the machine when starting the packager on `run-android`

* Delete `isPackagerRunning` as it was moved to `tools`

* Add `terminal` argument to `run-ios`

* Launch Metro from within the `runIOS` command

* Remove code & add `—terminal` argument

* Try using `REACT_TERMINAL` before the default terminal

* Put `isPackagerRunning` function on `cli-tools` to share between iOS & Android

* Fix `terminal` argument not working when not being provided

* Fallback to the default terminal of the machine when starting the packager on `run-android`

* Delete `isPackagerRunning` as it was moved to `tools`

* Add `terminal` argument to `run-ios`

* Launch Metro from within the `runIOS` command

* Remove code & add `—terminal` argument

* Try using `REACT_TERMINAL` before the default terminal

* Add tool function to get the default user terminal

* Fix `terminal` arg type

* Remove spread and specify entry twice instead

* Improve `args` being passed through functions

* Reduce code duplication

* Put `device` and `udid` variable up in the scope
2019-04-17 20:56:08 +02:00
ifsnow 1b8c097885 fix: prevent run-android failure when updating APK (#323)
Summary:
---------

If we run `react-native run-android` while it's already installed, it will fail with the following error.

```bash
info Installing the app on the device (cd android && adb -s emulator-5554 install app/build/outputs/apk/debug/app-x86-debug.apk
adb: failed to install app/build/outputs/apk/debug/app-x86-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install me.mycake without first uninstalling.]
```

In the development phase, I think using adb's install options below is much more efficient.

```
-r : Reinstall an existing app, keeping its data.
-d : Allow version code downgrade.
```


Test Plan:
----------

Not required.
2019-04-17 09:28:04 +02:00
Michał Pierzchała 708211a645 chore: move shared types to root; moar link styles; bye promiseWaterfall (#312)
* chore: move shared types to root; moar link styles; bye promiseWaterfall

* fix test

* add alias for global types

* bump Flow to 0.97

* add lint annotation to bin

* enable babel module resolver plugin

* import inquirer prompt type
2019-04-16 14:53:50 +02:00
Mike Grabowski 6343e2a892 feat: extract commands out to platform packages (#302)
* wip

* Finish it up

* Clean up packages

* Move files around

* Simplify regex

* Remove unused type

* Move packages around

* Fix type

* Update snapshot

* Make snapshot even smaller

* Throw unlink error
2019-04-10 14:24:20 +02:00
Michał Pierzchała 1440eb4163 feat: infer package and project name for upgrade from config (#299)
* feat: infer packageName and projectName for upgrade from config

* extract merge to tools and use it in tests

* warn if unsupported platform is being upgraded
2019-04-10 14:22:40 +02:00
Mike Grabowski 5f7dba3d6e feat: extract iOS and Android specific linking files out of the core (#290)
Summary:
---------

Historically, Android and iOS platform were hardcoded inside CLI and provided by default. Then, other packages could export additional platforms on top of it.

React Native as a platform was hardcoded in Metro configuration (default platforms, default extensions) and inside link. That means all new features were always developed with these platforms in mind, leaving others behind. We often used private APIs, which made things more complicated for 3rd party platform developers.

From this PR on, there's no longer concept of an out-of-tree platform inside of the CLI. In a follow up PR to React Native, I am going to configure iOS and Android platforms inside React Native, just like React Native Windows exposes Windows platform.

This will open room for improvements and should make it even easier for the CLI to welcome other platforms.
2019-04-05 22:02:26 +02:00