Commit Graph
1208 Commits
Author SHA1 Message Date
Mike Grabowski eead4d57d9 Publish
- @react-native-community/[email protected]
@react-native-community/[email protected]
2019-02-27 23:02:25 +01:00
Mike Grabowski 36e7ace15c fix: let server to communicate with the browser (#194)
Summary:
---------

Spotted after merging #193 - `localhost` was hardcoded here.

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

Turn on Chrome Debugger w/o this PR and see `Unauthorized` error in the console.
2019-02-27 22:57:09 +01:00
Mike Grabowski 49a5fba760 Publish
- @react-native-community/[email protected]
@react-native-community/[email protected]
2019-02-27 21:00:22 +01:00
Federico de86d0b586 fix: server should listening for all incoming requests by default (#193)
* fix: server should listening for all incoming requests by default

* Update server.js
2019-02-27 20:57:50 +01:00
Kacper Wiszczuk ec87ccb938 fix: fix link all (#188)
Summary:
---------

Fix `linkAll` to link root assets.

@sijad can you test link with those changes?
2019-02-22 22:50:42 +01:00
Michał Pierzchała 762c1fdf0c Publish
- @react-native-community/[email protected]
@react-native-community/[email protected]
2019-02-22 17:23:39 +01:00
Michał Pierzchała 06036f5473 feat: improve upgrade to use rn-diff-purge (#176)
Summary:
---------

Upgrading experience is a bit harsh for React Native. We either need to install global `react-native-git-upgrade` and try that, or patch projects manually using tools like [`rn-diff-purge`](https://github.com/pvinis/rn-diff-purge).

Since `rn-diff-purge` gets some recognition in RN core and website and it has an automated path of applying patches, I thought that it would be nice to use it in our `upgrade` command.

What the command does now:

1. Determine version to upgrade and run some validation checks
1. Fetch patch between current version and specified from [`rn-diff-purge`](https://github.com/pvinis/rn-diff-purge#version-changes) and rename diff app to current project name
	1. If the patch is empty, install RN and its peer deps
	1. Exit with success
1. Prepare for 3-way merge by creating temporary patch file and adding new git remote
1. Apply patch with a fallback to 3-way merge, exclude `package.json` because it will always be failing
1. Install RN and its peer deps
1. Cleanup temporary files and git remote
1. Exit with success

This PR is technically breaking change, so I'm cool with introducing a temporary new command or put old one behind a different name.

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

Added tests with various scenarios. 

Successfully upgrading to specified version:

<img width="648" alt="screenshot 2019-02-16 at 22 22 24" src="https://user-images.githubusercontent.com/5106466/52905364-75a84f00-3239-11e9-9c3a-d3612d194cbf.png">

Failed to fetch a non-existent diff:

<img width="680" alt="screenshot 2019-02-16 at 22 22 49" src="https://user-images.githubusercontent.com/5106466/52905365-75a84f00-3239-11e9-9e92-6fd410271151.png">

No upgrade needed:

<img width="904" alt="screenshot 2019-02-16 at 22 33 27" src="https://user-images.githubusercontent.com/5106466/52905501-4abefa80-323b-11e9-9fec-2e6a44ff09a4.png">

Dependency mismatch:

<img width="988" alt="screenshot 2019-02-16 at 22 36 04" src="https://user-images.githubusercontent.com/5106466/52905502-4abefa80-323b-11e9-92db-ed0d661e493c.png">

Upgrading to older version:

<img width="556" alt="screenshot 2019-02-16 at 22 39 50" src="https://user-images.githubusercontent.com/5106466/52905533-cfaa1400-323b-11e9-9685-d45e24cf0d97.png">
2019-02-22 16:30:24 +01:00
Michał Pierzchała bd332b3add fix: setup_env script failure (#182)
* fix: setup_env script failure

* chore: adjust the message and remove unused windows script

* fix: adjust platform check and wording

* chore: remove dot for continuity with error
2019-02-22 09:16:19 +01:00
Christoph Nakazawa 0b12618bbf Merge pull request #185 from ericlewis/fix-184
Allow absolute path for templates
2019-02-21 00:49:11 +00:00
Eric Lewis 489ab232c0 allow absolute path for templates 2019-02-20 17:26:15 -05:00
Michał Pierzchała 27d4924a58 feat: refactor install to use link directly instead of spawning it (#180)
Summary:
---------

Attempt No. 2 after https://github.com/react-native-community/react-native-cli/pull/178. Turned out I passed empty array as `platforms` argument to link, while I should pass `undefined`. We could actually add `--platforms` support to `install`/`uninstall` now, what do you think?

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

Uninstalling:

<img width="677" alt="screenshot 2019-02-19 at 13 42 54" src="https://user-images.githubusercontent.com/5106466/53015940-8ed51980-344c-11e9-9f22-0406c468a10d.png">

Installing: 

<img width="668" alt="screenshot 2019-02-19 at 13 43 02" src="https://user-images.githubusercontent.com/5106466/53015941-8ed51980-344c-11e9-8556-a6350f05536f.png">
2019-02-19 13:54:36 +01:00
Mike Grabowski 760d384ae1 Publish
- @react-native-community/[email protected]
@react-native-community/[email protected]
2019-02-18 17:57:33 +01:00
Mike Grabowski ce12f21ce1 fix: unlink not working (#177) 2019-02-18 17:54:14 +01:00
Mike Grabowski cf99cd1b2c Revert "feat: better logging for install/uninstall; less spawning; fix unlinking (#174)"
This reverts commit 32cc3a2d75.
2019-02-18 17:53:33 +01:00
Michał Pierzchała 32cc3a2d75 feat: better logging for install/uninstall; less spawning; fix unlinking (#174)
Summary:
---------

- [x] use link/unlink directly from source instead of spawning
- [x] fix unlinking failing to get dependencies
- [x] improve logging

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

<img width="684" alt="screenshot 2019-02-15 at 23 40 29" src="https://user-images.githubusercontent.com/5106466/52888210-2996d500-317b-11e9-9a37-402de8f50167.png">
<img width="692" alt="screenshot 2019-02-15 at 23 40 50" src="https://user-images.githubusercontent.com/5106466/52888211-2996d500-317b-11e9-8b7e-2cdc4a4f6a94.png">
2019-02-16 16:11:12 +01:00
Michał Pierzchała b119dd2ae6 Update cli README subheadings 2019-02-16 10:00:23 +01:00
Mehdi A 9bc53ff8ca docs: document the run-ios command (#175)
document the --simulator argument for the react-native run-ios command to allow user to launch their app on a specific iOS simulator based by its official name

Regarding the #169 issue

cc @thymikee
2019-02-16 09:58:52 +01:00
Michał Pierzchała cdfd2b4bc8 docs: update repository README (#172)
Summary:
---------

Adding some more information to the main README. 
`packages/cli` still needs a proper README with all commands listed, but that's not in scope of this PR
2019-02-15 12:36:46 +01:00
Mike Grabowski 7a2ebaf275 Publish
- @react-native-community/[email protected]
 - [email protected]
@react-native-community/[email protected] [email protected]
2019-02-15 10:55:52 +01:00
Mike Grabowski 74a5cb6ea2 Publish
- @react-native-community/[email protected]
 - [email protected]
2019-02-15 10:53:06 +01:00
Mike Grabowski 17b73b3e32 fix: printing error and unknown command messages when unnecessary (#171)
Summary:
---------

The logic for printing an unknown command was always a hack and the one for printing a help when no command provided never worked.

I did a research and found out there's a recommended (Commander way) of doing this.

It also fixes a regression I've noticed in https://github.com/react-native-community/react-native-releases/issues/79#issuecomment-463933483

![](https://user-images.githubusercontent.com/5376380/52840468-f711bb80-312b-11e9-9bb3-65b9676e3132.png)

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

Run w/o command, run with wrong command.
2019-02-15 10:46:47 +01:00
Dulmandakh 9390ad889f fix: exclude debug folder from findManifest command (#170)
* exclude debug folder from findManifest command

* fix formatting

* fix lint
2019-02-15 10:14:32 +01:00
Michał Pierzchała 0dfad55724 fix: update react-native-cli README (#166)
Summary:
---------

Current README of `react-native-cli` is outdated and totally not user friendly. We already have a contributing guide on how to run it locally, so there's no point in keeping this one. I took this opportunity to write a proper README.

cc @kelset
2019-02-14 14:40:07 +01:00
Michał Pierzchała 3a3028d4f3 Publish
- @react-native-community/[email protected]
@react-native-community/[email protected]
2019-02-14 08:40:13 +01:00
Michał Pierzchała 251e34a7b3 v1.2.1 2019-02-14 08:32:22 +01:00
Michał Pierzchała 79bb170db5 chore: add *.log to gitignore 2019-02-14 08:06:17 +01:00
Michael Diarmid 28d4de9733 fear: export getDefaultConfig (#167) 2019-02-14 06:55:15 +01:00
Michael Diarmid c50e64b8ec fix: return full file path for InitializeCore incl. extension (#165)
* require.resolve `InitializeCore` 

Ensure `InitializeCore` path is the full path with extension.

* linting
2019-02-14 06:54:51 +01:00
Mike Grabowski dee16f3b73 fix: improve passing global flags to the CLI (#162)
* fix: use absolute path in init

* fix: Improve CLI logic

* chore: make the flags appear in the output

* chore: use else-if
2019-02-13 16:00:01 +01:00
Mike Grabowski 2d185c72ef Publish
- @react-native-community/[email protected]
 - [email protected]
@react-native-community/[email protected] [email protected]
2019-02-13 15:00:56 +01:00
Mike Grabowski 83d6c78cda chore: Update Yarn lock 2019-02-13 15:00:27 +01:00
Mike Grabowski 5ed021eb0b Temporarily remove commit lint 2019-02-13 14:59:45 +01:00
ifsnow b3c20b9351 Fix: problem on run-android with deviceId (#137)
* fix: problem on run-android with deviceId

* fix: change the logic to find the appropriate apk file

* fix: adding logging message

* fix: added command default value
2019-02-12 15:11:02 +01:00
Kacper Wiszczuk 7b77b36ddb fix: make prettier happy (#161) 2019-02-12 10:53:26 +01:00
Connor Love 6178e05d93 fix: ignore non-nativetargets during ios linking (#123)
* fix: ignore non-nativetargets during ios linking

fixes issue #57

* refactor: reuse variable and reorder array methods

Makes use of the single variable nativeTargetSection and puts filter before map when filtering out non-native targets.
2019-02-11 17:09:37 +01:00
Lucas Bento fb62f9b27d feat: show help when no arguments are provided (#160)
* feat: show help when no arguments are provided

* fix: add unknown command info back

* chore: visual adjustments
2019-02-11 12:20:56 +01:00
Kacper Wiszczuk 72c3dd4282 refactor: use PackageManager and improve init logging (#156)
* refactor: use PackageManager and improve init logging

* fix: review suggestions

* refactor: improve logger once again

* refactor: bold to logs status
2019-02-11 12:11:14 +01:00
Sid Ferreira fb4c39940f chore: use ESM exports where appropriate (#151)
This is an extra for #150 
Fixes exports and tweaks some tests.

The `link`, `linkAssets`, and `linkDependency` where trickier as hell, but we have all tests working.

I suggest take it easy in this review as I'm worried in a "false positive" in tests as there was a LOT of changes.

We need to improve the code coverage for changes like this have smaller chances of failing...
2019-02-07 19:16:24 +01:00
Kacper Wiszczuk d485824105 build: refactor installing packages
* build: refactor installing packages

* chore: revert version change

* fix: review fixes

* fix: review changes and install/uninstall command fixes

* fix: one more review fix
2019-02-06 17:31:47 +01:00
Kacper Wiszczuk 5fa631d2ae refactor: disable logger in tests (#155)
* refactor: disable logger in tests

* fix: review fixes

* fix: implement review suggestion
2019-02-06 16:40:23 +01:00
Kacper Wiszczuk 6d1be39b3c docs: init command localy (#153)
Summary:
Added section in `CONTRIBUTING.md`, explaining how to run `init` command localy. This might also be helpful in potential integration testing.
2019-02-06 14:59:36 +01:00
Michał Pierzchała 9a45766463 feat(perf): use lazy module evaluation (#152)
Summary:
---------

After #150 (thanks @sidferreira and @Trancever) we're finally able to use lazy module evaluation for additional perf! 

Before:
```
0.70 real         0.64 user         0.12 sys
```
After:
```
0.19 real         0.16 user         0.03 sys
```

Which gives us roughly 0.5s (~72%) improvement in startup time. With 0.2s startup time most commands feel instant now.

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

No new tests added.
2019-02-06 09:17:33 +01:00
Sid Ferreira b2a6359a74 refactor: change require to imports (#150)
* refactor(imports): replaces most uses of require by import

* fix: fixes export and revert wrong change

* fix: fix import order

* fix: revert export change

* fix: revert global-cli/index

* fix: typo
2019-02-05 14:06:03 +01:00
Devin Canterberry b7d2c8fe23 fix: xcode 10.2 compatibility for run-ios command (#138)
parse output of simulator list provided by xcode 10.2

In Xcode 10.2, the output of `xcrun simctl list --json devices`
has changed to include a namespace within each version group.
This commit makes a backwards-compatible adjustment to account
for this change in format.

To illustrate:

Before
======

```
{
  "devices": {
    "iOS 10.0": [
      ...
    ]
  }
}
```

After
=====

```
{
  "devices": {
    "com.apple.CoreSimulator.SimRuntime.iOS-10-0": [
      ...
    ]
  }
}
```
2019-02-04 23:12:07 +01:00
Michał Pierzchała 986fc35384 chore: remove npmlog dependency (#149) 2019-02-04 14:26:02 +01:00
Sid Ferreira 486a65a931 refactor: Unify logging (#146)
* refactor(logger): replaces all `console` uses

* refactor(logger): tweaks chalk usage

* fix: remove unused chalk

* fix: remove `chalk.yellow` and unused chalk

* fix: changes some info to error

* fix: revert Debugger changes

* fix: remove pending bold, join outputs
2019-02-04 14:22:30 +01:00
Mike Grabowski 65eff59246 build: update xcode version to 2.0.0 (#147) 2019-02-04 13:16:37 +01:00
Mike Grabowski 2a180e0231 feat: allow setting different React Native path (#144)
* feat: allow setting different React Native path

* fix: remaining flow errors

* feat: remove dep on React Native

* chore: ignore error from init

* Update packages/cli/src/cliEntry.js

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

* chore: explicitly disable eslint
2019-02-04 13:12:27 +01:00
Mike Grabowski 4ee44da8f8 fix: run-android not finding scripts to overwrite (#141)
Fixes #126 

We need to change this approach, issue tracking in #140.
2019-02-01 15:36:06 +01:00
Mike Grabowski 6526bdd834 fix: improve overall run-ios experience and get rid of CFBundleIdentifier (#139)
Fixes #107 

Summary:
---------

Bugs fixed:
- "CFBundleIdentifier" printed every time "run-ios" fails, shadowing the real cause for the problem
- "run-ios" running a previous/cached version of an app (usually when there was an error during build step that was ignored)

Changes made:
- Decided to turn Flow and ESLint and apply all the changes as I am working on it. I know the diff might be strange at first sight, but if you look closely, it's just cosmetics to satisfy various rules
- I also extracted some blocks to separate utilities for better readability
- I also removed a no longer needed check for CRNA which is deprecated (and IMO, is not needed)
- Converted few functions to "async" form for better readability
- Started capturing the "stderr" of "xcodebuild" and started relying on its error code in order to avoid going to next step when it fails
- Added a new type of error to differentiate from other errors and also be able to capture additional data. Logic and styling subject to change, encapsulated inside Logger.

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

Here's how the error messages look before/now:

While try to build a project with a wrong "schema" :

Before:
<img width="882" alt="screenshot 2019-01-31 at 18 07 43" src="https://user-images.githubusercontent.com/2464966/52071369-200a4c00-2583-11e9-8700-28766daae122.png">

After:
<img width="880" alt="screenshot 2019-01-31 at 18 05 23" src="https://user-images.githubusercontent.com/2464966/52071244-d91c5680-2582-11e9-83e7-e9e549a570cc.png">

While building a project that has a typo in "AppDelegate.m":

Before:
<img width="885" alt="screenshot 2019-01-31 at 18 08 19" src="https://user-images.githubusercontent.com/2464966/52071411-344e4900-2583-11e9-8613-96ddf6c68006.png">

After:
<img width="886" alt="screenshot 2019-01-31 at 18 06 36" src="https://user-images.githubusercontent.com/2464966/52071300-f6e9bb80-2582-11e9-9c9f-3a4b67318119.png">

You can try it out by running `run-ios` command on a broken project (typo, wrong configuration) or by passing a non-existing `schema`
2019-02-01 11:33:17 +01:00